-
Notifications
You must be signed in to change notification settings - Fork 2
/
gui_main.py
229 lines (221 loc) · 12.7 KB
/
gui_main.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
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 600)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
self.tabWidget.setGeometry(QtCore.QRect(20, 10, 751, 551))
self.tabWidget.setObjectName("tabWidget")
self.tab_3 = QtWidgets.QWidget()
self.tab_3.setObjectName("tab_3")
self.label_11 = QtWidgets.QLabel(self.tab_3)
self.label_11.setGeometry(QtCore.QRect(240, 40, 261, 71))
font = QtGui.QFont()
font.setFamily("Yrsa")
font.setPointSize(32)
font.setBold(True)
font.setItalic(False)
font.setWeight(75)
self.label_11.setFont(font)
self.label_11.setAlignment(QtCore.Qt.AlignCenter)
self.label_11.setObjectName("label_11")
self.label_17 = QtWidgets.QLabel(self.tab_3)
self.label_17.setGeometry(QtCore.QRect(230, 110, 281, 31))
font = QtGui.QFont()
font.setFamily("aakar")
font.setPointSize(14)
font.setItalic(True)
self.label_17.setFont(font)
self.label_17.setAlignment(QtCore.Qt.AlignCenter)
self.label_17.setObjectName("label_17")
self.label_2 = QtWidgets.QLabel(self.tab_3)
self.label_2.setGeometry(QtCore.QRect(20, 160, 701, 341))
font = QtGui.QFont()
font.setPointSize(12)
self.label_2.setFont(font)
self.label_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
self.label_2.setWordWrap(True)
self.label_2.setObjectName("label_2")
self.tabWidget.addTab(self.tab_3, "")
self.tab = QtWidgets.QWidget()
self.tab.setObjectName("tab")
self.label_12 = QtWidgets.QLabel(self.tab)
self.label_12.setGeometry(QtCore.QRect(230, 110, 281, 31))
font = QtGui.QFont()
font.setFamily("aakar")
font.setPointSize(14)
font.setItalic(True)
self.label_12.setFont(font)
self.label_12.setAlignment(QtCore.Qt.AlignCenter)
self.label_12.setObjectName("label_12")
self.label_10 = QtWidgets.QLabel(self.tab)
self.label_10.setGeometry(QtCore.QRect(240, 40, 261, 71))
font = QtGui.QFont()
font.setFamily("Yrsa")
font.setPointSize(32)
font.setBold(True)
font.setItalic(False)
font.setWeight(75)
self.label_10.setFont(font)
self.label_10.setAlignment(QtCore.Qt.AlignCenter)
self.label_10.setObjectName("label_10")
self.pushButton_6 = QtWidgets.QPushButton(self.tab)
self.pushButton_6.setGeometry(QtCore.QRect(480, 300, 221, 61))
self.pushButton_6.setObjectName("pushButton_6")
self.line_3 = QtWidgets.QFrame(self.tab)
self.line_3.setGeometry(QtCore.QRect(400, 220, 16, 271))
self.line_3.setFrameShape(QtWidgets.QFrame.VLine)
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_3.setObjectName("line_3")
self.label_13 = QtWidgets.QLabel(self.tab)
self.label_13.setGeometry(QtCore.QRect(50, 230, 291, 31))
font = QtGui.QFont()
font.setPointSize(16)
font.setBold(True)
font.setWeight(75)
self.label_13.setFont(font)
self.label_13.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.label_13.setAlignment(QtCore.Qt.AlignCenter)
self.label_13.setObjectName("label_13")
self.label_5 = QtWidgets.QLabel(self.tab)
self.label_5.setGeometry(QtCore.QRect(40, 340, 181, 31))
self.label_5.setObjectName("label_5")
self.textEdit = QtWidgets.QTextEdit(self.tab)
self.textEdit.setGeometry(QtCore.QRect(230, 300, 161, 31))
self.textEdit.setInputMethodHints(QtCore.Qt.ImhMultiLine)
self.textEdit.setObjectName("textEdit")
self.textEdit_2 = QtWidgets.QTextEdit(self.tab)
self.textEdit_2.setGeometry(QtCore.QRect(230, 340, 161, 31))
self.textEdit_2.setObjectName("textEdit_2")
self.label_8 = QtWidgets.QLabel(self.tab)
self.label_8.setGeometry(QtCore.QRect(40, 300, 181, 31))
self.label_8.setObjectName("label_8")
self.label_6 = QtWidgets.QLabel(self.tab)
self.label_6.setGeometry(QtCore.QRect(40, 380, 181, 31))
self.label_6.setObjectName("label_6")
self.textEdit_3 = QtWidgets.QTextEdit(self.tab)
self.textEdit_3.setGeometry(QtCore.QRect(230, 380, 161, 31))
self.textEdit_3.setObjectName("textEdit_3")
self.label_16 = QtWidgets.QLabel(self.tab)
self.label_16.setGeometry(QtCore.QRect(50, 260, 291, 31))
font = QtGui.QFont()
font.setPointSize(12)
self.label_16.setFont(font)
self.label_16.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.label_16.setAlignment(QtCore.Qt.AlignCenter)
self.label_16.setObjectName("label_16")
self.tabWidget.addTab(self.tab, "")
self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2")
self.pushButton_4 = QtWidgets.QPushButton(self.tab_2)
self.pushButton_4.setGeometry(QtCore.QRect(480, 300, 221, 61))
self.pushButton_4.setObjectName("pushButton_4")
self.line_2 = QtWidgets.QFrame(self.tab_2)
self.line_2.setGeometry(QtCore.QRect(400, 220, 16, 271))
self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_2.setObjectName("line_2")
self.label_14 = QtWidgets.QLabel(self.tab_2)
self.label_14.setGeometry(QtCore.QRect(240, 40, 261, 71))
font = QtGui.QFont()
font.setFamily("Yrsa")
font.setPointSize(32)
font.setBold(True)
font.setItalic(False)
font.setWeight(75)
self.label_14.setFont(font)
self.label_14.setAlignment(QtCore.Qt.AlignCenter)
self.label_14.setObjectName("label_14")
self.label_15 = QtWidgets.QLabel(self.tab_2)
self.label_15.setGeometry(QtCore.QRect(230, 110, 281, 31))
font = QtGui.QFont()
font.setFamily("aakar")
font.setPointSize(14)
font.setItalic(True)
self.label_15.setFont(font)
self.label_15.setAlignment(QtCore.Qt.AlignCenter)
self.label_15.setObjectName("label_15")
self.label = QtWidgets.QLabel(self.tab_2)
self.label.setGeometry(QtCore.QRect(60, 240, 291, 171))
self.label.setLineWidth(1)
self.label.setMidLineWidth(0)
self.label.setScaledContents(False)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setWordWrap(True)
self.label.setObjectName("label")
self.tabWidget.addTab(self.tab_2, "")
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
self.tabWidget.setCurrentIndex(1)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label_11.setText(_translate("MainWindow", "EyeBreaker"))
self.label_17.setText(_translate("MainWindow", "\"Beause your eyes needs it\""))
self.label_2.setText(_translate("MainWindow", "In a survey by OnePoll, it was discovered that an average person spends 17 hours and 9 minutes everyday on screen, out of that around 5 hours on a computer/laptop screen time. That\'s a total of 44 years of a person\'s life that is spent watching a display. \n"
"\n"
"This is a serious issue that could lead to variety of eye diseases like Eye fatigue, Dry and irritated eyes, Loss of focus flexibility, Nearsightedness, Retinal damage. \n"
"Some of these damages to a person could be permanent, others; very costly to treat. We believe that by a simple set of regular on-screen-off-screen break patterns can help rest the eyes and recover from constant eye screen damages.\n"
"\n"
"That is why, we are introducing EyeBreaker, a simple yet an amazingly helpful tool that will notify you to take breaks at regular interval from your computer/laptop screen so that your eyes can maintain a better long-term health. \n"
"The tool uses your device\'s camera/webcam to track your face direction to determine if you are watching the screen or not. If you are not watching the screen or not present in front of the computer, then it considers it as your break period. \n"
"\n"
"Some of the customization that you can do:\n"
" - Focus Time: How much time you can focus on-screen without taking a break.\n"
" - Break Period: Number of seconds you want to take break.\n"
" - Checking Period: At what intervals should the camera check if you are on-screen or off-screen.\n"
"\n"
"Please Note: This application is developed based on open source research and surveys. No Medical Proof has been granted by usage of this application."))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "Info"))
self.label_12.setText(_translate("MainWindow", "\"Beause your eyes needs it\""))
self.label_10.setText(_translate("MainWindow", "EyeBreaker"))
self.pushButton_6.setText(_translate("MainWindow", "Run"))
self.label_13.setText(_translate("MainWindow", "Customize"))
self.label_5.setText(_translate("MainWindow", "- Break Period : "))
self.textEdit.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'.SF NS Text\'; font-size:13pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">1200</p></body></html>"))
self.textEdit.setPlaceholderText(_translate("MainWindow", "1200"))
self.textEdit_2.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'.SF NS Text\'; font-size:13pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">60</p></body></html>"))
self.textEdit_2.setPlaceholderText(_translate("MainWindow", "60"))
self.label_8.setText(_translate("MainWindow", "- Focus Time : "))
self.label_6.setText(_translate("MainWindow", "- Checking Period : "))
self.textEdit_3.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'.SF NS Text\'; font-size:13pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">45</p></body></html>"))
self.textEdit_3.setPlaceholderText(_translate("MainWindow", "45"))
self.label_16.setText(_translate("MainWindow", "(All in seconds)"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Start"))
self.pushButton_4.setText(_translate("MainWindow", "Stop"))
self.label_14.setText(_translate("MainWindow", "EyeBreaker"))
self.label_15.setText(_translate("MainWindow", "\"Beause your eyes needs it\""))
self.label.setText(_translate("MainWindow", "When you are done with your On-Screen work, you can stop EyeBreaker."))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Stop"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())