-
Notifications
You must be signed in to change notification settings - Fork 2
/
main_ui.py
334 lines (324 loc) · 18.8 KB
/
main_ui.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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'untitled.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
def clickable(widget):
class Filter(QtCore.QObject):
clicked = QtCore.pyqtSignal()
def eventFilter(self, obj, event):
if obj == widget:
if event.type() == QtCore.QEvent.MouseButtonRelease:
if obj.rect().contains(event.pos()):
self.clicked.emit()
# The developer can opt for .emit(obj) to get the object within the slot.
return True
return False
filter = Filter(widget)
widget.installEventFilter(filter)
return filter.clicked
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1620, 900)
MainWindow.setMinimumSize(QtCore.QSize(1620, 900))
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
self.verticalLayout.setObjectName("verticalLayout")
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
self.tabWidget.setObjectName("tabWidget")
self.tab = QtWidgets.QWidget()
self.tab.setMouseTracking(False)
self.tab.setObjectName("tab")
self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.tab)
self.verticalLayout_8.setObjectName("verticalLayout_8")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.time_header = QtWidgets.QLabel(self.tab)
self.time_header.setObjectName("time_header")
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.time_header.setFont(font)
self.verticalLayout_2.addWidget(self.time_header, 0, QtCore.Qt.AlignHCenter)
self.time_label = QtWidgets.QLabel(self.tab)
self.time_label.setObjectName("time_label")
font = QtGui.QFont()
font.setPointSize(15)
self.time_label.setFont(font)
self.verticalLayout_2.addWidget(self.time_label, 0, QtCore.Qt.AlignHCenter)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
self.gridLayout.setContentsMargins(0, -1, 0, -1)
self.gridLayout.setObjectName("gridLayout")
self.verticalLayout_4 = QtWidgets.QVBoxLayout()
self.verticalLayout_4.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
self.verticalLayout_4.setContentsMargins(0, -1, -1, -1)
self.verticalLayout_4.setSpacing(8)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.setTimer = QtWidgets.QPushButton(self.tab)
self.setTimer.setMaximumSize(QtCore.QSize(80, 80))
self.setTimer.setObjectName("setTimer")
self.setTimer.setFixedSize(120, 70)
self.verticalLayout_4.addWidget(self.setTimer, 0, QtCore.Qt.AlignHCenter)
self.timeEdit = QtWidgets.QTimeEdit(self.tab)
self.timeEdit.setMaximumSize(QtCore.QSize(80, 40))
self.timeEdit.setObjectName("timeEdit")
self.verticalLayout_4.addWidget(self.timeEdit, 0, QtCore.Qt.AlignHCenter)
self.gridLayout.addLayout(self.verticalLayout_4, 0, 3, 1, 1)
self.extratimerButton = QtWidgets.QPushButton(self.tab)
self.extratimerButton.setObjectName("extratimerButton")
self.gridLayout.addWidget(self.extratimerButton, 1, 2, 1, 1, QtCore.Qt.AlignHCenter)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 0, 0, 1, 1)
self.startTimer = QtWidgets.QPushButton(self.tab)
self.startTimer.setMinimumSize(QtCore.QSize(0, 50))
self.startTimer.setMaximumSize(QtCore.QSize(80, 80))
self.startTimer.setLayoutDirection(QtCore.Qt.LeftToRight)
self.startTimer.setObjectName("startTimer")
self.startTimer.setFixedSize(120, 100)
self.gridLayout.addWidget(self.startTimer, 0, 1, 1, 1, QtCore.Qt.AlignHCenter)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem1, 0, 4, 1, 1)
self.stopTimer = QtWidgets.QPushButton(self.tab)
self.stopTimer.setMinimumSize(QtCore.QSize(0, 50))
self.stopTimer.setMaximumSize(QtCore.QSize(80, 80))
self.stopTimer.setObjectName("stopTimer")
self.stopTimer.setFixedSize(120, 100)
self.gridLayout.addWidget(self.stopTimer, 0, 2, 1, 1, QtCore.Qt.AlignHCenter)
self.verticalLayout_2.addLayout(self.gridLayout)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.verticalLayout_2.addItem(spacerItem2)
self.score_header = QtWidgets.QLabel(self.tab)
self.score_header.setMaximumSize(QtCore.QSize(16777215, 30))
self.score_header.setObjectName("score_header")
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.score_header.setFont(font)
self.verticalLayout_2.addWidget(self.score_header, 0, QtCore.Qt.AlignHCenter)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.teamname_left = QtWidgets.QLabel(self.tab)
self.teamname_left.setObjectName("teamname_left")
self.teamname_left.setWordWrap(True)
font = QtGui.QFont()
font.setPointSize(15)
self.teamname_left.setFont(font)
self.horizontalLayout_2.addWidget(self.teamname_left, 0, QtCore.Qt.AlignHCenter)
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.add10_left = QtWidgets.QPushButton(self.tab)
self.add10_left.setObjectName("add10_left")
self.add10_left.setFixedSize(100, 80)
self.verticalLayout_3.addWidget(self.add10_left)
self.resetscore_left = QtWidgets.QPushButton(self.tab)
self.resetscore_left.setObjectName("resetscore_left")
self.resetscore_left.setFixedSize(100, 80)
self.verticalLayout_3.addWidget(self.resetscore_left)
self.sub10_left = QtWidgets.QPushButton(self.tab)
self.sub10_left.setObjectName("sub10_left")
self.sub10_left.setFixedSize(100, 80)
self.verticalLayout_3.addWidget(self.sub10_left)
self.horizontalLayout_2.addLayout(self.verticalLayout_3)
self.score_left = QtWidgets.QLabel(self.tab)
self.score_left.setObjectName("score_left")
self.score_left.setFixedSize(250, 300)
self.score_left.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter)
self.horizontalLayout_2.addWidget(self.score_left, 0, QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter)
font = QtGui.QFont()
font.setPointSize(60)
self.score_left.setFont(font)
self.point = QtWidgets.QLabel(self.tab)
self.point.setObjectName("point")
self.point.setFixedSize(40, 80)
font = QtGui.QFont()
font.setPointSize(20)
self.point.setFont(font)
self.horizontalLayout_2.addWidget(self.point, 0, QtCore.Qt.AlignHCenter)
self.score_right = QtWidgets.QLabel(self.tab)
self.score_right.setObjectName("score_right")
self.score_right.setFixedSize(250, 300)
self.score_right.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter)
font = QtGui.QFont()
font.setPointSize(60)
self.score_right.setFont(font)
self.horizontalLayout_2.addWidget(self.score_right, 0, QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter)
self.verticalLayout_5 = QtWidgets.QVBoxLayout()
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.add10_right = QtWidgets.QPushButton(self.tab)
self.add10_right.setObjectName("add10_right")
self.add10_right.setFixedSize(100, 80)
self.verticalLayout_5.addWidget(self.add10_right)
self.resetscore_right = QtWidgets.QPushButton(self.tab)
self.resetscore_right.setObjectName("resetscore_right")
self.resetscore_right.setFixedSize(100, 80)
self.verticalLayout_5.addWidget(self.resetscore_right)
self.sub10_right = QtWidgets.QPushButton(self.tab)
self.sub10_right.setObjectName("sub10_right")
self.sub10_right.setFixedSize(100, 80)
self.verticalLayout_5.addWidget(self.sub10_right)
self.horizontalLayout_2.addLayout(self.verticalLayout_5)
self.teamname_right = QtWidgets.QLabel(self.tab)
self.teamname_right.setObjectName("teamname_right")
self.teamname_right.setWordWrap(True)
font = QtGui.QFont()
font.setPointSize(15)
self.teamname_left.setFont(font)
self.horizontalLayout_2.addWidget(self.teamname_right, 0, QtCore.Qt.AlignHCenter)
self.verticalLayout_2.addLayout(self.horizontalLayout_2)
self.oss_label = QtWidgets.QLabel(self.tab)
self.oss_label.setMaximumSize(QtCore.QSize(16777215, 20))
self.oss_label.setObjectName("oss_label")
font = QtGui.QFont()
font.setPointSize(15)
self.oss_label.setFont(font)
self.verticalLayout_2.addWidget(self.oss_label, 0, QtCore.Qt.AlignHCenter)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem3)
self.snitchcatch_left = QtWidgets.QPushButton(self.tab)
self.snitchcatch_left.setObjectName("snitchcatch_left")
self.horizontalLayout_3.addWidget(self.snitchcatch_left)
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem4)
self.snitchcatch_right = QtWidgets.QPushButton(self.tab)
self.snitchcatch_right.setObjectName("snitchcatch_right")
self.horizontalLayout_3.addWidget(self.snitchcatch_right)
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem5)
self.verticalLayout_2.addLayout(self.horizontalLayout_3)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem6)
self.settingsButton = QtWidgets.QPushButton(self.tab)
self.settingsButton.setObjectName("settingsButton")
self.horizontalLayout_4.addWidget(self.settingsButton)
self.timekeeperButton = QtWidgets.QPushButton(self.tab)
self.timekeeperButton.setObjectName("timekeeperButton")
self.horizontalLayout_4.addWidget(self.timekeeperButton)
self.penaltyButton = QtWidgets.QPushButton(self.tab)
self.penaltyButton.setObjectName("penaltyButton")
self.horizontalLayout_4.addWidget(self.penaltyButton)
self.swapButton = QtWidgets.QPushButton(self.tab)
self.swapButton.setObjectName("swapButton")
self.horizontalLayout_4.addWidget(self.swapButton)
self.closeButton = QtWidgets.QPushButton(self.tab)
self.closeButton.setObjectName("closeButton")
self.horizontalLayout_4.addWidget(self.closeButton)
spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem7)
self.verticalLayout_2.addLayout(self.horizontalLayout_4)
self.new_penalty_label = QtWidgets.QLabel(self.tab)
self.new_penalty_label.setMaximumSize(QtCore.QSize(16777215, 20))
self.new_penalty_label.setObjectName("new_penalty_label")
font = QtGui.QFont()
font.setPointSize(15)
self.new_penalty_label.setFont(font)
self.verticalLayout_2.addWidget(self.new_penalty_label, 0, QtCore.Qt.AlignHCenter)
self.verticalLayout_8.addLayout(self.verticalLayout_2)
self.tabWidget.addTab(self.tab, "")
self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2")
self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.tab_2)
self.verticalLayout_7.setObjectName("verticalLayout_7")
self.verticalLayout_9 = QtWidgets.QVBoxLayout()
self.verticalLayout_9.setObjectName("verticalLayout_9")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem8)
self.scorecrawlButton = QtWidgets.QPushButton(self.tab_2)
self.scorecrawlButton.setObjectName("scorecrawlButton")
self.horizontalLayout.addWidget(self.scorecrawlButton)
self.readGameIDs = QtWidgets.QPushButton(self.tab_2)
self.readGameIDs.setObjectName("readGameIDs")
self.horizontalLayout.addWidget(self.readGameIDs)
spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem9)
self.verticalLayout_9.addLayout(self.horizontalLayout)
self.verticalLayout_7.addLayout(self.verticalLayout_9)
self.scrollArea = QtWidgets.QScrollArea(self.tab_2)
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName("scrollArea")
self.scrollAreaWidgetContents_2 = QtWidgets.QWidget()
self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 645, 440))
self.scrollAreaWidgetContents_2.setObjectName("scrollAreaWidgetContents_2")
self.verticalLayout_10 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents_2)
self.verticalLayout_10.setObjectName("verticalLayout_10")
self.verticalLayout_10.setAlignment(QtCore.Qt.AlignTop)
self.scrollArea.setWidget(self.scrollAreaWidgetContents_2)
self.verticalLayout_7.addWidget(self.scrollArea)
self.tabWidget.addTab(self.tab_2, "")
self.verticalLayout.addWidget(self.tabWidget)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1012, 26))
self.menubar.setObjectName("menubar")
#MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
#MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
self.add10_left.clicked.connect(lambda x: MainWindow.add_left(10))
self.sub10_left.clicked.connect(lambda x: MainWindow.add_left(-10))
self.add10_right.clicked.connect(lambda x: MainWindow.add_right(10))
self.sub10_right.clicked.connect(lambda x: MainWindow.add_right(-10))
self.startTimer.clicked.connect(MainWindow.start_timer)
self.stopTimer.clicked.connect(MainWindow.stop_timer)
self.setTimer.clicked.connect(MainWindow.set_timer)
self.resetscore_left.clicked.connect(MainWindow.reset_left)
self.resetscore_right.clicked.connect(MainWindow.reset_right)
self.closeButton.clicked.connect(MainWindow.closeQSB)
self.timekeeperButton.clicked.connect(MainWindow.timekeeper_start)
self.settingsButton.clicked.connect(MainWindow.settings_start)
self.penaltyButton.clicked.connect(MainWindow.open_penalty)
self.swapButton.clicked.connect(MainWindow.swap_scores)
self.snitchcatch_left.clicked.connect(MainWindow.snitch_catch_left)
self.snitchcatch_right.clicked.connect(MainWindow.snitch_catch_right)
self.extratimerButton.clicked.connect(MainWindow.add_timer)
self.scorecrawlButton.clicked.connect(MainWindow.scorecrawl_start)
self.readGameIDs.clicked.connect(MainWindow.read_gameids_sc)
clickable(self.oss_label).connect(MainWindow.delete_oss)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.time_header.setText(_translate("MainWindow", "Game Time"))
self.time_label.setText(_translate("MainWindow", "00:00"))
self.setTimer.setText(_translate("MainWindow", "Set"))
self.extratimerButton.setText(_translate("MainWindow", "Get extra timer"))
self.startTimer.setText(_translate("MainWindow", "Start"))
self.stopTimer.setText(_translate("MainWindow", "Stop"))
self.timeEdit.setDisplayFormat(_translate("main", "mm:ss"))
self.score_header.setText(_translate("MainWindow", "Scores"))
self.teamname_left.setText(_translate("MainWindow", "Team A"))
self.add10_left.setText(_translate("MainWindow", "+10"))
self.resetscore_left.setText(_translate("MainWindow", "reset"))
self.sub10_left.setText(_translate("MainWindow", "-10"))
self.score_left.setText(_translate("MainWindow", "Score Left"))
self.point.setText(_translate("MainWindow", ":"))
self.score_right.setText(_translate("MainWindow", "Score Right"))
self.add10_right.setText(_translate("MainWindow", "+10"))
self.resetscore_right.setText(_translate("MainWindow", "reset"))
self.sub10_right.setText(_translate("MainWindow", "-10"))
self.teamname_right.setText(_translate("MainWindow", "Team B"))
self.snitchcatch_left.setText(_translate("MainWindow", "Catch"))
self.snitchcatch_right.setText(_translate("MainWindow", "Catch"))
self.settingsButton.setText(_translate("MainWindow", "Settings"))
self.timekeeperButton.setText(_translate("MainWindow", "Start Timekeeper"))
self.penaltyButton.setText(_translate("MainWindow", "Set Penalty"))
self.swapButton.setText(_translate("MainWindow", "Swap Scores"))
self.closeButton.setText(_translate("MainWindow", "Close"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Main Window"))
self.scorecrawlButton.setText(_translate("MainWindow", "Start Score Crawl"))
self.readGameIDs.setText(_translate("MainWindow", "Read GameIDs"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Score Crawl"))