-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtui.py
185 lines (179 loc) · 10.1 KB
/
qtui.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
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(700, 450)
MainWindow.setMinimumSize(QtCore.QSize(700, 450))
MainWindow.setMaximumSize(QtCore.QSize(700, 450))
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.horizontalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(30, 51, 651, 81))
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
self.input_layout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
self.input_layout.setSizeConstraint(
QtWidgets.QLayout.SetDefaultConstraint)
self.input_layout.setContentsMargins(0, 0, 0, 0)
self.input_layout.setSpacing(0)
self.input_layout.setObjectName("input_layout")
self.hours_field = QtWidgets.QPlainTextEdit(
self.horizontalLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(
self.hours_field.sizePolicy().hasHeightForWidth())
self.hours_field.setSizePolicy(sizePolicy)
self.hours_field.setMinimumSize(QtCore.QSize(200, 50))
self.hours_field.setMaximumSize(QtCore.QSize(50, 50))
self.hours_field.setLayoutDirection(QtCore.Qt.LeftToRight)
self.hours_field.setObjectName("hours_field")
self.input_layout.addWidget(self.hours_field)
self.minuits_field = QtWidgets.QPlainTextEdit(
self.horizontalLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
self.minuits_field.sizePolicy().hasHeightForWidth())
self.minuits_field.setSizePolicy(sizePolicy)
self.minuits_field.setMinimumSize(QtCore.QSize(200, 50))
self.minuits_field.setMaximumSize(QtCore.QSize(50, 50))
self.minuits_field.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.minuits_field.setLayoutDirection(QtCore.Qt.LeftToRight)
self.minuits_field.setObjectName("minuits_field")
self.input_layout.addWidget(self.minuits_field)
self.seconds_field = QtWidgets.QPlainTextEdit(
self.horizontalLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
self.seconds_field.sizePolicy().hasHeightForWidth())
self.seconds_field.setSizePolicy(sizePolicy)
self.seconds_field.setMinimumSize(QtCore.QSize(200, 50))
self.seconds_field.setMaximumSize(QtCore.QSize(50, 50))
self.seconds_field.setFocusPolicy(QtCore.Qt.StrongFocus)
self.seconds_field.setLayoutDirection(QtCore.Qt.LeftToRight)
self.seconds_field.setObjectName("seconds_field")
self.input_layout.addWidget(self.seconds_field)
self.mode = QtWidgets.QGroupBox(self.centralwidget)
self.mode.setGeometry(QtCore.QRect(30, 250, 151, 181))
self.mode.setObjectName("mode")
self.verticalLayoutWidget_2 = QtWidgets.QWidget(self.mode)
self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(10, 31, 131, 131))
self.verticalLayoutWidget_2.setObjectName("verticalLayoutWidget_2")
self.verticalLayout = QtWidgets.QVBoxLayout(
self.verticalLayoutWidget_2)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setObjectName("verticalLayout")
self.direct_mode = QtWidgets.QRadioButton(self.verticalLayoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
self.direct_mode.sizePolicy().hasHeightForWidth())
self.direct_mode.setSizePolicy(sizePolicy)
self.direct_mode.setMinimumSize(QtCore.QSize(50, 50))
self.direct_mode.setObjectName("direct_mode")
self.verticalLayout.addWidget(self.direct_mode)
self.manual_mode = QtWidgets.QRadioButton(self.verticalLayoutWidget_2)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
self.manual_mode.sizePolicy().hasHeightForWidth())
self.manual_mode.setSizePolicy(sizePolicy)
self.manual_mode.setMinimumSize(QtCore.QSize(50, 50))
self.manual_mode.setObjectName("manual_mode")
self.verticalLayout.addWidget(self.manual_mode)
self.timeout_box = QtWidgets.QCheckBox(self.centralwidget)
self.timeout_box.setGeometry(QtCore.QRect(240, 250, 151, 41))
self.timeout_box.setObjectName("timeout_box")
self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
self.verticalLayoutWidget.setGeometry(QtCore.QRect(30, 130, 651, 111))
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
self.button_layout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
self.button_layout.setContentsMargins(0, 0, 0, 0)
self.button_layout.setObjectName("button_layout")
self.quickes = QtWidgets.QHBoxLayout()
self.quickes.setContentsMargins(10, 10, 10, 10)
self.quickes.setObjectName("quickes")
self.mins_5 = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.mins_5.setObjectName("mins_5")
self.quickes.addWidget(self.mins_5)
self.mins_10 = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.mins_10.setObjectName("mins_10")
self.quickes.addWidget(self.mins_10)
self.mins_30 = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.mins_30.setObjectName("mins_30")
self.quickes.addWidget(self.mins_30)
self.mins_60 = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.mins_60.setObjectName("mins_60")
self.quickes.addWidget(self.mins_60)
self.button_layout.addLayout(self.quickes)
self.main_btn_layput = QtWidgets.QHBoxLayout()
self.main_btn_layput.setContentsMargins(10, 10, 10, 10)
self.main_btn_layput.setObjectName("main_btn_layput")
self.clear_btn = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.clear_btn.setObjectName("clear_btn")
self.main_btn_layput.addWidget(self.clear_btn)
self.cancel_btn = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.cancel_btn.setObjectName("cancel_btn")
self.main_btn_layput.addWidget(self.cancel_btn)
self.extend_btn = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.extend_btn.setObjectName("extend_btn")
self.main_btn_layput.addWidget(self.extend_btn)
self.submit_btn = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.submit_btn.setObjectName("submit_btn")
self.main_btn_layput.addWidget(self.submit_btn)
self.button_layout.addLayout(self.main_btn_layput)
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.centralwidget)
self.horizontalLayoutWidget_2.setGeometry(
QtCore.QRect(30, 10, 651, 41))
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
self.field_label = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
self.field_label.setContentsMargins(0, 0, 0, 0)
self.field_label.setObjectName("field_label")
self.hrs_label = QtWidgets.QLabel(self.horizontalLayoutWidget_2)
self.hrs_label.setAlignment(QtCore.Qt.AlignCenter)
self.hrs_label.setObjectName("hrs_label")
self.field_label.addWidget(self.hrs_label)
self.minutes_label = QtWidgets.QLabel(self.horizontalLayoutWidget_2)
self.minutes_label.setAlignment(QtCore.Qt.AlignCenter)
self.minutes_label.setObjectName("minutes_label")
self.field_label.addWidget(self.minutes_label)
self.seconds_label = QtWidgets.QLabel(self.horizontalLayoutWidget_2)
self.seconds_label.setAlignment(QtCore.Qt.AlignCenter)
self.seconds_label.setObjectName("seconds_label")
self.field_label.addWidget(self.seconds_label)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "ShutDownify"))
self.hours_field.setPlainText(_translate("MainWindow", "0"))
self.minuits_field.setPlainText(_translate("MainWindow", "0"))
self.seconds_field.setPlainText(_translate("MainWindow", "0"))
self.mode.setTitle(_translate("MainWindow", "Mode"))
self.direct_mode.setText(_translate("MainWindow", "Direct mode"))
self.manual_mode.setText(_translate("MainWindow", "Manual mode"))
self.timeout_box.setText(_translate(
"MainWindow", "Fast display timeout"))
self.mins_5.setText(_translate("MainWindow", "+5 mins"))
self.mins_10.setText(_translate("MainWindow", "+10 mins"))
self.mins_30.setText(_translate("MainWindow", "+30 mins"))
self.mins_60.setText(_translate("MainWindow", "+1 hr"))
self.clear_btn.setText(_translate("MainWindow", "Clear"))
self.cancel_btn.setText(_translate("MainWindow", "Cancel"))
self.extend_btn.setText(_translate("MainWindow", "Extend"))
self.submit_btn.setText(_translate("MainWindow", "Submit"))
self.hrs_label.setText(_translate("MainWindow", "Hours"))
self.minutes_label.setText(_translate("MainWindow", "Minutes"))
self.seconds_label.setText(_translate("MainWindow", "Seconds"))