-
Notifications
You must be signed in to change notification settings - Fork 0
/
reportbutton.py
50 lines (36 loc) · 1.24 KB
/
reportbutton.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
""" reportbutton.py - Copyright Ricky sutanto """
from PyQt5.uic import loadUi
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QDialog)
import resource
import dbconn
import logging
import mainpage
logging.basicConfig(level=logging.ERROR)
LOGGER = logging.getLogger("reportbutton")
class reportButton(QDialog):
def __init__(self, userdata):
super(reportButton, self).__init__()
self.userData = userdata
def _show(self):
loadUi("reportbut.ui", self)
mainpage.mainWindow.reportMenu = 0
self.butReport.clicked.connect(self.handleReportClick)
self.butBackup.clicked.connect(self.handleBackupClick)
self.butProduction.clicked.connect(self.handleProductionClick)
def keyPressEvent(self, event):
if event.key() == Qt.Key_Escape:
self.close()
elif event.key() == Qt.Key_Return:
event.accept()
def closewin(self):
self.close()
def handleReportClick(self):
mainpage.mainWindow.reportMenu = 1
self.closewin()
def handleBackupClick(self):
mainpage.mainWindow.reportMenu = 2
self.closewin()
def handleProductionClick(self):
mainpage.mainWindow.reportMenu = 3
self.closewin()