27
27
print ("Please install the \" textual-dev\" package before running this script." )
28
28
quit ()
29
29
30
- from targets import TargetsScreen
30
+ from settings import SettingsScreen
31
31
from editor import EditorScreen
32
32
from compile import CompileScreen
33
33
@@ -40,38 +40,32 @@ class ConfigEditorApp(App):
40
40
os .chdir (ROOT_PATH )
41
41
42
42
# Set the application options
43
- option_enable_copy = True
43
+ setting_enable_copy = True
44
44
45
45
# Options to be set by the command line arguments
46
- option_target = None
47
- option_arduino_path = None
48
- option_arduino_branch = None
49
- option_idf_branch = None
50
- option_idf_commit = None
51
- option_debug_level = None
46
+ setting_target = None
47
+ setting_arduino_path = None
48
+ setting_arduino_branch = None
49
+ setting_idf_branch = None
50
+ setting_idf_commit = None
51
+ setting_debug_level = None
52
52
53
53
ENABLE_COMMAND_PALETTE = False
54
54
CSS_PATH = "style.tcss"
55
55
SCREENS = {
56
- "targets " : TargetsScreen (),
56
+ "settings " : SettingsScreen (),
57
57
"compile" : CompileScreen (),
58
58
"editor" : EditorScreen (),
59
59
}
60
60
61
- def update_targets (self , targets : str ) -> None :
62
- # Callback function to update the targets after returning from the targets screen
63
- print ("Updating targets in app, received: " + targets )
64
- if targets :
65
- self .option_target = str (targets )
66
-
67
61
def on_button_pressed (self , event : Button .Pressed ) -> None :
68
62
# Event handler called when a button is pressed
69
63
if event .button .id == "compile-button" :
70
64
print ("Compile button pressed" )
71
65
self .push_screen ("compile" )
72
66
elif event .button .id == "targets-button" :
73
67
print ("Targets button pressed" )
74
- self .push_screen ("targets" , self . update_targets )
68
+ self .push_screen ("settings" )
75
69
elif event .button .id == "options-button" :
76
70
print ("Options button pressed" )
77
71
self .push_screen ("editor" )
@@ -94,12 +88,12 @@ def on_mount(self) -> None:
94
88
self .title = "Configurator"
95
89
self .sub_title = "Main Menu"
96
90
print ("App started. Initial Options:" )
97
- print ("Target: " + str (self .option_target ))
98
- print ("Arduino Path: " + str (self .option_arduino_path ))
99
- print ("Arduino Branch: " + str (self .option_arduino_branch ))
100
- print ("IDF Branch: " + str (self .option_idf_branch ))
101
- print ("IDF Commit: " + str (self .option_idf_commit ))
102
- print ("IDF Debug Level: " + str (self .option_debug_level ))
91
+ print ("Target: " + str (self .setting_target ))
92
+ print ("Arduino Path: " + str (self .setting_arduino_path ))
93
+ print ("Arduino Branch: " + str (self .setting_arduino_branch ))
94
+ print ("IDF Branch: " + str (self .setting_idf_branch ))
95
+ print ("IDF Commit: " + str (self .setting_idf_commit ))
96
+ print ("IDF Debug Level: " + str (self .setting_debug_level ))
103
97
104
98
def arduino_default_path ():
105
99
sys_name = platform .system ()
@@ -163,12 +157,12 @@ def main() -> None:
163
157
args = parser .parse_args ()
164
158
165
159
# Set the options in the app
166
- app .option_target = args .target
167
- app .option_arduino_path = args .arduino_path
168
- app .option_arduino_branch = args .arduino_branch
169
- app .option_idf_branch = args .idf_branch
170
- app .option_idf_commit = args .idf_commit
171
- app .option_debug_level = args .debug_level
160
+ app .setting_target = args .target
161
+ app .setting_arduino_path = args .arduino_path
162
+ app .setting_arduino_branch = args .arduino_branch
163
+ app .setting_idf_branch = args .idf_branch
164
+ app .setting_idf_commit = args .idf_commit
165
+ app .setting_debug_level = args .debug_level
172
166
173
167
# Main function to run the app
174
168
app .run ()
0 commit comments