forked from kucukbahadir/TimeTrackingProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
62 lines (48 loc) · 1.59 KB
/
main.py
File metadata and controls
62 lines (48 loc) · 1.59 KB
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
from time import time
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QDialog, QApplication
from PyQt5.uic import loadUi
import sys
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QDialog, QApplication
from PyQt5.uic import loadUi
class LoginUI(QDialog):
def __init__(self):
super(LoginUI,self).__init__()
loadUi("./UI/login.ui",self)
# This is example of changing screen
self.loginButton.clicked.connect(self.go_main_menu)
def go_main_menu(self):
main_menu = MainMenuUI()
widget.addWidget(main_menu)
widget.setCurrentIndex(widget.currentIndex()+1)
class MainMenuUI(QDialog):
def __init__(self):
super(MainMenuUI,self).__init__()
loadUi("./UI/mainMenu.ui",self)
class PomodoroUI(QDialog):
def __init__(self):
super(PomodoroUI,self).__init__()
loadUi("./UI/pomodoro.ui",self)
class ShortBreakUI(QDialog):
def __init__(self):
super(ShortBreakUI,self).__init__()
loadUi("./UI/shortBreak.ui",self)
class LongBreakUI(QDialog):
def __init__(self):
super(LongBreakUI,self).__init__()
loadUi("./UI/longBreak.ui",self)
app = QApplication(sys.argv)
UI = LoginUI() # This line determines which screen you will load at first
# You can also try one of other screens to see them.
# UI = MainMenuUI()
# UI = PomodoroUI()
# UI = ShortBreakUI()
# UI = LongBreakUI()
widget = QtWidgets.QStackedWidget()
widget.addWidget(UI)
widget.setFixedWidth(800)
widget.setFixedHeight(600)
widget.setWindowTitle("Time Tracking App")
widget.show()
sys.exit(app.exec_())