-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
116 lines (82 loc) · 3.27 KB
/
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
import tkinter as tk
from Base import top
from Base.bottom import Bottom
from threading import Thread
from ActivityIndicator.Activity_Indicator import ImageLabel
class Splash(tk.Toplevel):
def __init__(self, parent):
tk.Toplevel.__init__(self, parent)
self.title("Splash")
self['bg'] = 'black'
lbl = ImageLabel(self)
lbl['bd'] = 0
lbl['bg'] = 'black'
lbl.grid(row=0, column=0, sticky=tk.N + tk.S + tk.W + tk.E)
self.logo = tk.PhotoImage(file=r'images\loading.png', height=150, width=360)
self.labelLogo = tk.Label(self, image=self.logo, bd=0, bg='black')
self.labelLogo.grid(row=1, column=0, sticky=tk.N + tk.S + tk.W + tk.E)
self.grid_columnconfigure(0, weight=1)
self.state('zoomed')
self.overrideredirect(True)
lbl.load('ActivityIndicator/Activity.gif')
class Container(tk.Frame):
def __init__(self, master, *args, **kwargs):
tk.Frame.__init__(self, master, bg='#000000', *args, **kwargs)
self.top = top.Top(self)
self.bottom = Bottom(self)
from Base.listOfPage import bottomInstance
bottomInstance.append(self.bottom)
self.top.grid(row=0, column=0, sticky=tk.N + tk.S + tk.W + tk.E)
self.bottom.grid(row=1, column=0, sticky=tk.N + tk.S + tk.W + tk.E)
self.grid_rowconfigure(0, weight=8)
self.grid_rowconfigure(1, weight=2)
self.grid_columnconfigure(0, weight=1)
class Root(tk.Tk):
def __init__(self, data, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
self.counter = False
self.bind("<F11>", self.toggle_fullscreen)
self.bind("<Escape>", self.end_fullscreen)
def TK_player():
self.withdraw()
self.title('Amplify')
# self.title['bg']='black'
app_icon = tk.PhotoImage(file=r"images\app_64.png")
self.iconphoto(False, app_icon)
container = Container(self)
container.grid(row=0, column=0, sticky=tk.N + tk.S + tk.W + tk.E)
self.grid_columnconfigure(0, weight=1)
self.grid_rowconfigure(0, weight=1)
self.state('zoomed')
def Splash_Screen():
splash = Splash(self)
def myfun():
splash.destroy()
self.deiconify()
splash.after(30000, myfun)
# time.sleep(15000)
self.tk_player = Thread(target=TK_player)
self.tk_player.start()
self.splash = Thread(target=Splash_Screen)
self.splash.start()
def toggle_fullscreen(self, event=None):
self.counter = not self.counter # Just toggling the boolean
self.attributes("-fullscreen", self.counter)
return "break"
def end_fullscreen(self, event=None):
self.counter = False
self.attributes("-fullscreen", False)
return "break"
if __name__ == '__main__':
from Database.Database import get_user
from os import path
if path.exists('user'):
f = open('user', 'r')
doc = get_user(f.readline())
f.close()
root = Root(data=doc)
root.mainloop()
else:
from Pages.UserAuthentication.AuthBase import AuthBase
login = AuthBase()
login.mainloop()