Skip to content

Commit d87db7d

Browse files
committed
Add UI checks
1 parent 920e3dd commit d87db7d

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

tools/config_editor/app.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def compose(self) -> ComposeResult:
8686

8787
def on_mount(self) -> None:
8888
# Event handler called when the app is mounted for the first time
89-
self.title = "Configurator"
9089
self.sub_title = "Main Menu"
9190
print("Main screen mounted.")
9291

@@ -131,6 +130,7 @@ def on_mount(self) -> None:
131130
print("IDF Branch: " + str(self.setting_idf_branch))
132131
print("IDF Commit: " + str(self.setting_idf_commit))
133132
print("IDF Debug Level: " + str(self.setting_debug_level))
133+
self.title = "Configurator"
134134
self.push_screen("main")
135135

136136
def arduino_default_path():
@@ -256,8 +256,11 @@ def main() -> None:
256256
elif args.arduino_path == arduino_default_path():
257257
print("Warning: Default Arduino path not found. Disabling copy to Arduino.")
258258
app.setting_enable_copy = False
259+
elif args.arduino_path == "/arduino-esp32": # Docker mount point
260+
print("Error: Arduino folder not mounted to /arduino-esp32 in Docker container.")
261+
exit(1)
259262
else:
260-
print("Invalid path to Arduino core: " + os.path.abspath(args.arduino_path))
263+
print("Error: Invalid path to Arduino core: " + os.path.abspath(args.arduino_path))
261264
exit(1)
262265
else:
263266
app.setting_enable_copy = False

tools/config_editor/compile.py

+10
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ def compile_libs(self) -> None:
7272

7373
label = self.query_one("#compile-title", Static)
7474
self.child_process = None
75+
76+
if not self.app.setting_target:
77+
self.print_error("No target selected")
78+
label.update("No target selected")
79+
return
7580
if self.app.setting_target == ",".join(self.app.supported_targets):
7681
target = "all targets"
7782
else:
@@ -161,3 +166,8 @@ def compose(self) -> ComposeResult:
161166
self.button_widget = Button("Back", id="compile-back-button")
162167
yield self.button_widget
163168
yield Footer()
169+
170+
def on_mount(self) -> None:
171+
# Event handler called when the screen is mounted
172+
print("Compile screen mounted")
173+
self.sub_title = "Compilation"

0 commit comments

Comments
 (0)