-
Notifications
You must be signed in to change notification settings - Fork 0
/
allRecipeIng.py
132 lines (108 loc) · 5.36 KB
/
allRecipeIng.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
from PyQt5 import QtCore, QtGui, QtWidgets
import recipeFuncs as rf
class Ui_MainWindow(object):
def setupUiAllRecipeIng(self, MainWindow):
MainWindow.resize(800, 350)
MainWindow.setStyleSheet("background-color: #123456;")
MainWindow.setWindowIcon(QtGui.QIcon('chef.png'))
self.centralwidget = QtWidgets.QWidget(MainWindow)
import addRecipeItem
self.addRecipeItemWindow = QtWidgets.QMainWindow()
self.addRecipeItemUI = addRecipeItem.Ui_MainWindow()
self.addRecipeItemUI.setupUiAddRecipeIng(self.addRecipeItemWindow)
self.addRecipeItemWindow.hide()
import removeIng
self.removeIngWindow = QtWidgets.QMainWindow()
self.removeIngUI = removeIng.Ui_MainWindow()
self.removeIngUI.setupUiRemoveRecipeIng(self.removeIngWindow)
self.removeIngWindow.hide()
import modifyIng
self.modifyIngWindow = QtWidgets.QMainWindow()
self.modifyIngUI = modifyIng.Ui_MainWindow()
self.modifyIngUI.setupUiModifyIng(self.modifyIngWindow)
self.modifyIngWindow.hide()
import browsePubIng
temp = rf.allIngPrivate
self.ingWindow = QtWidgets.QMainWindow()
self.ingUI = browsePubIng.Ui_MainWindow()
self.ingUI.setupUiBrowsePrivPub(self.ingWindow, temp)
self.ingWindow.hide()
self.frame = QtWidgets.QFrame(self.centralwidget)
self.frame.setStyleSheet("background-color: white;")
self.frame.setGeometry(QtCore.QRect(20, 20, 751, 311))
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.addRecipeIng)
self.add.setGeometry(QtCore.QRect(50, 120, 191, 61))
self.add.setStyleSheet("background-color: #6eb4e0;")
font = QtGui.QFont()
font.setFamily("Times New Roman")
font.setPointSize(10)
font.setBold(True)
self.add.setFont(font)
self.removeIng = QtWidgets.QPushButton(self.frame, clicked=self.removeRecipeIng)
self.removeIng.setGeometry(QtCore.QRect(280, 120, 191, 61))
self.removeIng.setStyleSheet("background-color: #6eb4e0;")
self.removeIng.setFont(font)
self.modifyIng = QtWidgets.QPushButton(self.frame, clicked=self.modifyRecipeIng)
self.modifyIng.setGeometry(QtCore.QRect(510, 120, 191, 61))
self.modifyIng.setStyleSheet("background-color: #6eb4e0;")
self.modifyIng.setFont(font)
self.search1 = QtWidgets.QPushButton(self.frame, clicked=self.browsePrivIng)
self.search1.setGeometry(QtCore.QRect(160, 210, 191, 61))
self.search1.setStyleSheet("background-color: #6eb4e0;")
self.search1.setFont(font)
self.search2 = QtWidgets.QPushButton(self.frame, clicked=self.browsePubIng)
self.search2.setGeometry(QtCore.QRect(390, 210, 191, 61))
self.search2.setStyleSheet("background-color: #6eb4e0;")
self.search2.setFont(font)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def addRecipeIng(self):
self.addRecipeItemUI.setupUiAddRecipeIng(self.addRecipeItemWindow)
self.addRecipeItemWindow.show()
def removeRecipeIng(self):
self.removeIngUI.setupUiRemoveRecipeIng(self.removeIngWindow)
self.removeIngWindow.show()
def modifyRecipeIng(self):
self.modifyIngUI.setupUiModifyIng(self.modifyIngWindow)
self.modifyIngWindow.show()
def browsePrivIng(self):
temp = rf.allIngPrivate
self.ingUI.setupUiBrowsePrivPub(self.ingWindow, temp)
self.ingWindow.show()
def browsePubIng(self):
temp = rf.allIngPublic
self.ingUI.setupUiBrowsePrivPub(self.ingWindow, temp)
self.ingWindow.show()
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Personal Cookbook/Recipe Library/Recipe Ingredients"))
self.add.setText(_translate("MainWindow", "Add Ingredient"))
self.removeIng.setText(_translate("MainWindow", "Remove Ingredient"))
self.modifyIng.setText(_translate("MainWindow", "Modify Ingredient"))
self.search1.setText(_translate("MainWindow", "Browse Your\nRecipe Ingredients"))
self.search2.setText(_translate("MainWindow", "Browse Community\nRecipes Ingredients"))
self.titleLabel.setText(_translate("MainWindow", "Personal and Community Recipe Ingredients"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUiAllRecipeIng(MainWindow)
MainWindow.show()
sys.exit(app.exec_())