-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBotMailGUI.py
More file actions
78 lines (56 loc) · 2.09 KB
/
Copy pathBotMailGUI.py
File metadata and controls
78 lines (56 loc) · 2.09 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# BotMailGUI.py
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.screenmanager import ScreenManager
from kivy.uix.screenmanager import NoTransition, SlideTransition
from Models.Language import Language
from Models.EnvironmentVariable import *
from Controllers.LanguageWindow_Controller import LanguageWindow_Controller
from Controllers.MainWindow_Controller import MainWindow_Controller
from Constants import LANGUAGES
class BotMailGUI(App):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.controllers = {}
def build(self):
# Configuration fenêtre
Window.minimum_width = 800
Window.minimum_height = 600
self.language = Language()
# Initialisation contrôleurs avec construction des vues.
self.languageScreenController = LanguageWindow_Controller(
{
"language": self.language,
},
screen_name = "language_selection"
)
self.mainScreenController = MainWindow_Controller(
{
"language": self.language,
},
screen_name = "main"
)
sm = ScreenManager()
sm.add_widget(self.languageScreenController.view)
sm.add_widget(self.mainScreenController.view)
sm.transition = NoTransition()
if not get_variable("LANGUAGE") in LANGUAGES :
# Afficher la première page par défaut
sm.current = "language_selection"
else:
sm.current = "main"
sm.transition = SlideTransition()
# # Mise en plein écran
# if self.os_name.lower().startswith('win'):
# self.state('zoomed')
# else:
# self.attributes('-zoomed', True)
return sm
# def on_start(self):
# if not self.environmentVariable_Model.get_variable("LANGUAGE") in LANGUAGES :
# # Afficher la première page par défaut
# self.root.current = "language"
# else:
# self.root.current = "main"
if __name__ == "__main__":
BotMailGUI().run()