-
Notifications
You must be signed in to change notification settings - Fork 0
/
personalPantry.py
117 lines (96 loc) · 4.69 KB
/
personalPantry.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUiPantry(self, MainWindow):
MainWindow.resize(800, 350)
MainWindow.setStyleSheet("background-color: #123456;")
MainWindow.setWindowIcon(QtGui.QIcon('chef.png'))
self.centralwidget = QtWidgets.QWidget(MainWindow)
import addPantry
self.addPantryWindow = QtWidgets.QMainWindow()
self.addPantryUI = addPantry.Ui_MainWindow()
self.addPantryUI.setupUiAddPantry(self.addPantryWindow)
self.addPantryWindow.hide()
import removePantry
self.removePantryWindow = QtWidgets.QMainWindow()
self.removePantryUI = removePantry.Ui_MainWindow()
self.removePantryUI.setupUiRemovePantry(self.removePantryWindow)
self.removePantryWindow.hide()
import browsePantry
self.browsePantryWindow = QtWidgets.QMainWindow()
self.browsePantryUI = browsePantry.Ui_MainWindow()
self.browsePantryUI.setupUiBrowsePantry(self.browsePantryWindow)
self.browsePantryWindow.hide()
import modifyPantry
self.modifyPantryWindow = QtWidgets.QMainWindow()
self.modifyPantryUI = modifyPantry.Ui_MainWindow()
self.modifyPantryUI.setupUiModifyPantry(self.modifyPantryWindow)
self.modifyPantryWindow.hide()
self.frame = QtWidgets.QFrame(self.centralwidget)
self.frame.setGeometry(QtCore.QRect(20, 20, 751, 311))
self.frame.setStyleSheet("background-color: white;")
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.titleLabel = QtWidgets.QLabel(self.frame)
self.titleLabel.setGeometry(QtCore.QRect(30, 20, 691, 61))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(18)
font.setBold(True)
self.titleLabel.setFont(font)
self.titleLabel.setAlignment(QtCore.Qt.AlignCenter)
self.line = QtWidgets.QFrame(self.frame)
self.line.setGeometry(QtCore.QRect(30, 80, 691, 16))
self.line.setFrameShape(QtWidgets.QFrame.HLine)
self.line.setFrameShadow(QtWidgets.QFrame.Plain)
self.line.setLineWidth(5)
self.add = QtWidgets.QPushButton(self.frame, clicked=self.addPantry)
self.add.setGeometry(QtCore.QRect(80, 110, 251, 71))
self.add.setStyleSheet("background-color: #6eb4e0;")
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(12)
font.setBold(True)
self.add.setFont(font)
self.remove = QtWidgets.QPushButton(self.frame, clicked=self.remove)
self.remove.setGeometry(QtCore.QRect(420, 110, 251, 71))
self.remove.setStyleSheet("background-color: #6eb4e0;")
self.remove.setFont(font)
self.modify = QtWidgets.QPushButton(self.frame, clicked=self.modify)
self.modify.setGeometry(QtCore.QRect(80, 210, 251, 71))
self.modify.setStyleSheet("background-color: #6eb4e0;")
self.modify.setFont(font)
self.browse = QtWidgets.QPushButton(self.frame, clicked=self.browse)
self.browse.setGeometry(QtCore.QRect(420, 210, 251, 71))
self.browse.setStyleSheet("background-color: #6eb4e0;")
self.browse.setFont(font)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def addPantry(self):
self.addPantryUI.setupUiAddPantry(self.addPantryWindow)
self.addPantryWindow.show()
def remove(self):
self.removePantryUI.setupUiRemovePantry(self.removePantryWindow)
self.removePantryWindow.show()
def modify(self):
self.modifyPantryUI.setupUiModifyPantry(self.modifyPantryWindow)
self.modifyPantryWindow.show()
def browse(self):
self.browsePantryUI.setupUiBrowsePantry(self.browsePantryWindow)
self.browsePantryWindow.show()
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Personal Cookbook/Personal Pantry"))
self.titleLabel.setText(_translate("MainWindow", "Personal Pantry"))
self.add.setText(_translate("MainWindow", "Add Ingredient"))
self.remove.setText(_translate("MainWindow", "Remove Ingredient"))
self.modify.setText(_translate("MainWindow", "Modify Ingredient"))
self.browse.setText(_translate("MainWindow", "Browse Pantry"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUiPantry(MainWindow)
MainWindow.show()
sys.exit(app.exec_())