-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.py
175 lines (166 loc) · 10 KB
/
interface.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
# © Designed and Developed by Mehmet Güdük.
# © Licensed with GPL-3.0 License, Author is Mehmet Güdük.
# The visual and design part of the application is here.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(320, 250)
MainWindow.setMinimumSize(QtCore.QSize(320, 250))
MainWindow.setMaximumSize(QtCore.QSize(320, 250))
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/newPrefix/logo.ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)
MainWindow.setStyleSheet("")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayoutWidget = QtWidgets.QWidget(self.centralwidget)
self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 10, 301, 221))
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
self.gridLayout_2 = QtWidgets.QGridLayout(self.gridLayoutWidget)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setHorizontalSpacing(10)
self.gridLayout_2.setVerticalSpacing(2)
self.gridLayout_2.setObjectName("gridLayout_2")
self.lbl_DATE = QtWidgets.QLabel(self.gridLayoutWidget)
self.lbl_DATE.setMinimumSize(QtCore.QSize(40, 20))
self.lbl_DATE.setMaximumSize(QtCore.QSize(40, 20))
self.lbl_DATE.setFrameShape(QtWidgets.QFrame.NoFrame)
self.lbl_DATE.setAlignment(QtCore.Qt.AlignCenter)
self.lbl_DATE.setObjectName("lbl_DATE")
self.gridLayout_2.addWidget(self.lbl_DATE, 3, 0, 1, 1)
self.timeEdit_DATE = QtWidgets.QTimeEdit(self.gridLayoutWidget)
self.timeEdit_DATE.setMinimumSize(QtCore.QSize(0, 0))
self.timeEdit_DATE.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
self.timeEdit_DATE.setAlignment(QtCore.Qt.AlignCenter)
self.timeEdit_DATE.setCorrectionMode(QtWidgets.QAbstractSpinBox.CorrectToPreviousValue)
self.timeEdit_DATE.setKeyboardTracking(True)
self.timeEdit_DATE.setCalendarPopup(False)
self.timeEdit_DATE.setCurrentSectionIndex(0)
self.timeEdit_DATE.setObjectName("timeEdit_DATE")
self.gridLayout_2.addWidget(self.timeEdit_DATE, 4, 1, 1, 1)
self.btn_cancel = QtWidgets.QPushButton(self.gridLayoutWidget)
self.btn_cancel.setObjectName("btn_cancel")
self.gridLayout_2.addWidget(self.btn_cancel, 7, 0, 1, 5)
self.lbl_SECOND = QtWidgets.QLabel(self.gridLayoutWidget)
self.lbl_SECOND.setMinimumSize(QtCore.QSize(40, 20))
self.lbl_SECOND.setMaximumSize(QtCore.QSize(40, 20))
self.lbl_SECOND.setAlignment(QtCore.Qt.AlignCenter)
self.lbl_SECOND.setObjectName("lbl_SECOND")
self.gridLayout_2.addWidget(self.lbl_SECOND, 5, 3, 1, 1)
self.lbl_TIME = QtWidgets.QLabel(self.gridLayoutWidget)
self.lbl_TIME.setMinimumSize(QtCore.QSize(40, 20))
self.lbl_TIME.setMaximumSize(QtCore.QSize(40, 20))
self.lbl_TIME.setFrameShape(QtWidgets.QFrame.NoFrame)
self.lbl_TIME.setAlignment(QtCore.Qt.AlignCenter)
self.lbl_TIME.setObjectName("lbl_TIME")
self.gridLayout_2.addWidget(self.lbl_TIME, 4, 0, 1, 1)
self.spinBox_SECOND = QtWidgets.QSpinBox(self.gridLayoutWidget)
self.spinBox_SECOND.setMinimumSize(QtCore.QSize(90, 20))
self.spinBox_SECOND.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
self.spinBox_SECOND.setMaximum(999999)
self.spinBox_SECOND.setObjectName("spinBox_SECOND")
self.gridLayout_2.addWidget(self.spinBox_SECOND, 5, 4, 1, 1)
self.dateTimeEdit_DATE = QtWidgets.QDateTimeEdit(self.gridLayoutWidget)
self.dateTimeEdit_DATE.setMinimumSize(QtCore.QSize(0, 0))
self.dateTimeEdit_DATE.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
self.dateTimeEdit_DATE.setAlignment(QtCore.Qt.AlignCenter)
self.dateTimeEdit_DATE.setCalendarPopup(True)
self.dateTimeEdit_DATE.setObjectName("dateTimeEdit_DATE")
self.gridLayout_2.addWidget(self.dateTimeEdit_DATE, 3, 1, 1, 1)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_2.addItem(spacerItem, 5, 0, 1, 2)
self.btn_start_STOPWATCH = QtWidgets.QPushButton(self.gridLayoutWidget)
self.btn_start_STOPWATCH.setObjectName("btn_start_STOPWATCH")
self.gridLayout_2.addWidget(self.btn_start_STOPWATCH, 6, 3, 1, 2)
self.line = QtWidgets.QFrame(self.gridLayoutWidget)
self.line.setMinimumSize(QtCore.QSize(0, 0))
self.line.setFrameShape(QtWidgets.QFrame.VLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.gridLayout_2.addWidget(self.line, 3, 2, 4, 1)
self.lbl_HOUR = QtWidgets.QLabel(self.gridLayoutWidget)
self.lbl_HOUR.setMinimumSize(QtCore.QSize(40, 20))
self.lbl_HOUR.setMaximumSize(QtCore.QSize(40, 20))
self.lbl_HOUR.setAlignment(QtCore.Qt.AlignCenter)
self.lbl_HOUR.setObjectName("lbl_HOUR")
self.gridLayout_2.addWidget(self.lbl_HOUR, 3, 3, 1, 1)
self.lbl_MINUTE = QtWidgets.QLabel(self.gridLayoutWidget)
self.lbl_MINUTE.setMinimumSize(QtCore.QSize(40, 20))
self.lbl_MINUTE.setMaximumSize(QtCore.QSize(40, 20))
self.lbl_MINUTE.setAlignment(QtCore.Qt.AlignCenter)
self.lbl_MINUTE.setObjectName("lbl_MINUTE")
self.gridLayout_2.addWidget(self.lbl_MINUTE, 4, 3, 1, 1)
self.spinBox_MINUTE = QtWidgets.QSpinBox(self.gridLayoutWidget)
self.spinBox_MINUTE.setMinimumSize(QtCore.QSize(90, 20))
self.spinBox_MINUTE.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
self.spinBox_MINUTE.setMaximum(999999)
self.spinBox_MINUTE.setObjectName("spinBox_MINUTE")
self.gridLayout_2.addWidget(self.spinBox_MINUTE, 4, 4, 1, 1)
self.spinBox_HOUR = QtWidgets.QSpinBox(self.gridLayoutWidget)
self.spinBox_HOUR.setMinimumSize(QtCore.QSize(90, 20))
self.spinBox_HOUR.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
self.spinBox_HOUR.setMaximum(999999)
self.spinBox_HOUR.setObjectName("spinBox_HOUR")
self.gridLayout_2.addWidget(self.spinBox_HOUR, 3, 4, 1, 1)
self.btn_start_DATETIME = QtWidgets.QPushButton(self.gridLayoutWidget)
self.btn_start_DATETIME.setObjectName("btn_start_DATETIME")
self.gridLayout_2.addWidget(self.btn_start_DATETIME, 6, 0, 1, 2)
self.progressBar = QtWidgets.QProgressBar(self.gridLayoutWidget)
font = QtGui.QFont()
font.setPointSize(8)
font.setBold(False)
font.setItalic(False)
font.setUnderline(False)
font.setWeight(50)
font.setStrikeOut(False)
font.setKerning(True)
self.progressBar.setFont(font)
self.progressBar.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
self.progressBar.setProperty("value", 0)
self.progressBar.setAlignment(QtCore.Qt.AlignCenter)
self.progressBar.setTextVisible(True)
self.progressBar.setInvertedAppearance(False)
self.progressBar.setObjectName("progressBar")
self.gridLayout_2.addWidget(self.progressBar, 1, 0, 1, 5)
self.comboBox = QtWidgets.QComboBox(self.gridLayoutWidget)
self.comboBox.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
self.comboBox.setLayoutDirection(QtCore.Qt.LeftToRight)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.gridLayout_2.addWidget(self.comboBox, 2, 0, 1, 5)
self.lbl_TIMER = QtWidgets.QLabel(self.centralwidget)
self.lbl_TIMER.setGeometry(QtCore.QRect(0, 0, 321, 20))
self.lbl_TIMER.setAlignment(QtCore.Qt.AlignCenter)
self.lbl_TIMER.setObjectName("lbl_TIMER")
self.lbl_copyright = QtWidgets.QLabel(self.centralwidget)
self.lbl_copyright.setGeometry(QtCore.QRect(0, 230, 321, 20))
self.lbl_copyright.setStyleSheet("color: rgb(0, 0, 0);")
self.lbl_copyright.setAlignment(QtCore.Qt.AlignCenter)
self.lbl_copyright.setObjectName("lbl_copyright")
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
self.comboBox.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Shutdown Timer"))
self.lbl_DATE.setText(_translate("MainWindow", "Date"))
self.btn_cancel.setText(_translate("MainWindow", "Cancel"))
self.lbl_SECOND.setText(_translate("MainWindow", "Second"))
self.lbl_TIME.setText(_translate("MainWindow", "Time"))
self.dateTimeEdit_DATE.setDisplayFormat(_translate("MainWindow", "dd/MM/yyyy"))
self.btn_start_STOPWATCH.setText(_translate("MainWindow", "Start"))
self.lbl_HOUR.setText(_translate("MainWindow", "Hour"))
self.lbl_MINUTE.setText(_translate("MainWindow", "Minute"))
self.btn_start_DATETIME.setText(_translate("MainWindow", "Start"))
self.comboBox.setItemText(0, _translate("MainWindow", "Shutdown"))
self.comboBox.setItemText(1, _translate("MainWindow", "Restart"))
self.comboBox.setItemText(2, _translate("MainWindow", "Log off"))
self.comboBox.setItemText(3, _translate("MainWindow", "Hibernate"))
self.lbl_TIMER.setText(_translate("MainWindow", "TextLabel"))
self.lbl_copyright.setText(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:7pt; color:#000000;\">© Designed and Developed by </span><a href=\"https://github.com/mehmetguduk\"><span style=\" font-size:7pt; text-decoration: underline; color:#0000ff;\">Mehmet Güdük</span></a></p></body></html>"))
import icon