-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathyear_window.py
257 lines (250 loc) · 13.4 KB
/
year_window.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
#Copyright (C) 2017 Nihal Rao I, Sanjan S Poojari, Shishir Upadhya
from PyQt5 import QtCore, QtGui, QtWidgets
import lightstyle
class Ui_year_window(object):
def setupUi(self, year_window):
year_window.setObjectName("year_window")
year_window.resize(630, 260)
year_window.setStyleSheet(lightstyle.css)
year_window.setWindowIcon(QtGui.QIcon('icons/favicon.ico'))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(year_window.sizePolicy().hasHeightForWidth())
year_window.setSizePolicy(sizePolicy)
year_window.setMinimumSize(QtCore.QSize(630, 260))
year_window.setMaximumSize(QtCore.QSize(630, 260))
self.gridLayoutWidget = QtWidgets.QWidget(year_window)
self.gridLayoutWidget.setGeometry(QtCore.QRect(0, 0, 631, 261))
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
self.gridLayout.setContentsMargins(7, 0, 7, 6)
self.gridLayout.setObjectName("gridLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
self.label.setSizePolicy(sizePolicy)
self.label.setMinimumSize(QtCore.QSize(0, 35))
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(12)
self.label.setFont(font)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
self.gridLayout_2 = QtWidgets.QGridLayout()
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_6 = QtWidgets.QLabel(self.gridLayoutWidget)
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
self.label_6.setFont(font)
self.label_6.setObjectName("label_6")
self.gridLayout_2.addWidget(self.label_6, 2, 4, 1, 1)
self.label_4 = QtWidgets.QLabel(self.gridLayoutWidget)
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
self.label_4.setFont(font)
self.label_4.setObjectName("label_4")
self.gridLayout_2.addWidget(self.label_4, 2, 0, 1, 1)
self.endYear_dateedit = QtWidgets.QDateEdit(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.endYear_dateedit.sizePolicy().hasHeightForWidth())
self.endYear_dateedit.setSizePolicy(sizePolicy)
self.endYear_dateedit.setMinimumSize(QtCore.QSize(0, 30))
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
self.endYear_dateedit.setFont(font)
self.endYear_dateedit.setObjectName("endYear_dateedit")
self.gridLayout_2.addWidget(self.endYear_dateedit, 3, 4, 1, 1)
self.endMonth_combobox = QtWidgets.QComboBox(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.endMonth_combobox.sizePolicy().hasHeightForWidth())
self.endMonth_combobox.setSizePolicy(sizePolicy)
self.endMonth_combobox.setMinimumSize(QtCore.QSize(147, 30))
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
self.endMonth_combobox.setFont(font)
self.endMonth_combobox.setObjectName("endMonth_combobox")
self.gridLayout_2.addWidget(self.endMonth_combobox, 3, 3, 1, 1)
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem, 4, 0, 1, 1)
self.label_7 = QtWidgets.QLabel(self.gridLayoutWidget)
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
self.label_7.setFont(font)
self.label_7.setObjectName("label_7")
self.gridLayout_2.addWidget(self.label_7, 2, 1, 1, 1)
self.startMonth_combobox = QtWidgets.QComboBox(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.startMonth_combobox.sizePolicy().hasHeightForWidth())
self.startMonth_combobox.setSizePolicy(sizePolicy)
self.startMonth_combobox.setMinimumSize(QtCore.QSize(147, 30))
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
self.startMonth_combobox.setFont(font)
self.startMonth_combobox.setObjectName("startMonth_combobox")
self.gridLayout_2.addWidget(self.startMonth_combobox, 3, 0, 1, 1)
self.label_5 = QtWidgets.QLabel(self.gridLayoutWidget)
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
self.label_5.setFont(font)
self.label_5.setObjectName("label_5")
self.gridLayout_2.addWidget(self.label_5, 2, 3, 1, 1)
self.label_3 = QtWidgets.QLabel(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
self.label_3.setSizePolicy(sizePolicy)
self.label_3.setMinimumSize(QtCore.QSize(0, 35))
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
font.setBold(True)
font.setWeight(75)
self.label_3.setFont(font)
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setObjectName("label_3")
self.gridLayout_2.addWidget(self.label_3, 1, 3, 1, 2)
self.startYear_dateedit = QtWidgets.QDateEdit(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.startYear_dateedit.sizePolicy().hasHeightForWidth())
self.startYear_dateedit.setSizePolicy(sizePolicy)
self.startYear_dateedit.setMinimumSize(QtCore.QSize(147, 30))
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
self.startYear_dateedit.setFont(font)
self.startYear_dateedit.setObjectName("startYear_dateedit")
self.gridLayout_2.addWidget(self.startYear_dateedit, 3, 1, 1, 1)
self.line = QtWidgets.QFrame(self.gridLayoutWidget)
self.line.setFrameShape(QtWidgets.QFrame.VLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.gridLayout_2.addWidget(self.line, 0, 2, 5, 1)
self.label_2 = QtWidgets.QLabel(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
self.label_2.setSizePolicy(sizePolicy)
self.label_2.setMinimumSize(QtCore.QSize(147, 35))
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
font.setBold(True)
font.setWeight(75)
self.label_2.setFont(font)
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
self.label_2.setObjectName("label_2")
self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 2)
self.label_8 = QtWidgets.QLabel(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_8.sizePolicy().hasHeightForWidth())
self.label_8.setSizePolicy(sizePolicy)
self.label_8.setMinimumSize(QtCore.QSize(0, 0))
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
self.label_8.setFont(font)
self.label_8.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.label_8.setObjectName("label_8")
self.gridLayout_2.addWidget(self.label_8, 5, 0, 1, 1)
self.dept_combobox = QtWidgets.QComboBox(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.dept_combobox.sizePolicy().hasHeightForWidth())
self.dept_combobox.setSizePolicy(sizePolicy)
self.dept_combobox.setMinimumSize(QtCore.QSize(300, 30))
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(10)
self.dept_combobox.setFont(font)
self.dept_combobox.setObjectName("dept_combobox")
self.gridLayout_2.addWidget(self.dept_combobox, 6, 0, 1, 3)
self.gridLayout.addLayout(self.gridLayout_2, 1, 0, 1, 1)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem1)
self.skipBtn = QtWidgets.QPushButton(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.skipBtn.sizePolicy().hasHeightForWidth())
self.skipBtn.setSizePolicy(sizePolicy)
self.skipBtn.setMinimumSize(QtCore.QSize(100, 30))
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(11)
self.skipBtn.setFont(font)
self.skipBtn.setObjectName("skipBtn")
self.horizontalLayout_2.addWidget(self.skipBtn)
self.continueBtn = QtWidgets.QPushButton(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.continueBtn.sizePolicy().hasHeightForWidth())
self.continueBtn.setSizePolicy(sizePolicy)
self.continueBtn.setMinimumSize(QtCore.QSize(100, 30))
font = QtGui.QFont()
font.setFamily("Century Gothic")
font.setPointSize(11)
self.continueBtn.setFont(font)
self.continueBtn.setObjectName("continueBtn")
self.horizontalLayout_2.addWidget(self.continueBtn)
self.gridLayout.addLayout(self.horizontalLayout_2, 2, 0, 1, 1)
self.retranslateUi(year_window)
QtCore.QMetaObject.connectSlotsByName(year_window)
year_window.setTabOrder(self.startMonth_combobox, self.startYear_dateedit)
year_window.setTabOrder(self.startYear_dateedit, self.endMonth_combobox)
year_window.setTabOrder(self.endMonth_combobox, self.endYear_dateedit)
year_window.setTabOrder(self.endYear_dateedit, self.dept_combobox)
year_window.setTabOrder(self.dept_combobox, self.skipBtn)
year_window.setTabOrder(self.skipBtn, self.continueBtn)
def retranslateUi(self, year_window):
_translate = QtCore.QCoreApplication.translate
year_window.setWindowTitle(_translate("year_window", "TimeTable Generator"))
self.label.setText(_translate("year_window", "Set Academic Year & Department"))
self.label_6.setText(_translate("year_window", "Year:"))
self.label_4.setText(_translate("year_window", "Month:"))
self.endYear_dateedit.setDisplayFormat(_translate("year_window", "yyyy"))
self.label_7.setText(_translate("year_window", "Year:"))
self.label_5.setText(_translate("year_window", "Month:"))
self.label_3.setText(_translate("year_window", "End Date:"))
self.startYear_dateedit.setDisplayFormat(_translate("year_window", "yyyy"))
self.label_2.setText(_translate("year_window", "Start Date:"))
self.label_8.setText(_translate("year_window", "Department: "))
self.skipBtn.setText(_translate("year_window", "Skip"))
self.continueBtn.setText(_translate("year_window", "Continue"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
year_window = QtWidgets.QDialog()
ui = Ui_year_window()
ui.setupUi(year_window)
year_window.show()
sys.exit(app.exec_())