Skip to content

Commit 9b1b7ca

Browse files
committed
feat(param editor): Simplify the parameter editor UI in simple mode
1 parent 9b98ae0 commit 9b1b7ca

File tree

2 files changed

+35
-26
lines changed

2 files changed

+35
-26
lines changed

ardupilot_methodic_configurator/frontend_tkinter_parameter_editor.py

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def __init__(self, current_file: str, flight_controller: FlightController, local
150150
self.tempcal_imu_progress_window: ProgressWindow
151151
self.file_upload_progress_window: ProgressWindow
152152
self.last_time_asked_to_save: float = 0
153+
self.gui_complexity = ProgramSettings.get_setting("gui_complexity")
153154

154155
self.root.title(
155156
_("Amilcar Lucas's - ArduPilot methodic configurator ") + __version__ + _(" - Parameter file editor and uploader")
@@ -178,7 +179,8 @@ def __init__(self, current_file: str, flight_controller: FlightController, local
178179
self.stage_progress_bar = StageProgressBar(
179180
self.main_frame, self.local_filesystem.configuration_phases, last_step_nr
180181
)
181-
self.stage_progress_bar.pack(side=tk.TOP, fill="x", expand=False, pady=(2, 2), padx=(4, 4))
182+
if self.gui_complexity != "simple":
183+
self.stage_progress_bar.pack(side=tk.TOP, fill="x", expand=False, pady=(2, 2), padx=(4, 4))
182184

183185
# Create a DocumentationFrame object for the Documentation Content
184186
self.documentation_frame = DocumentationFrame(self.main_frame, self.local_filesystem, self.current_file)
@@ -206,15 +208,18 @@ def __create_conf_widgets(self, version: str) -> None:
206208
directory_selection_frame = VehicleDirectorySelectionWidgets(
207209
self, config_subframe, self.local_filesystem, self.local_filesystem.vehicle_dir, destroy_parent_on_open=False
208210
)
209-
directory_selection_frame.container_frame.pack(side=tk.LEFT, fill="x", expand=False, padx=(4, 6))
211+
if self.gui_complexity != "simple":
212+
directory_selection_frame.container_frame.pack(side=tk.LEFT, fill="x", expand=False, padx=(4, 6))
210213

211214
# Create a new frame inside the config_subframe for the intermediate parameter file selection label and combobox
212215
file_selection_frame = ttk.Frame(config_subframe)
213-
file_selection_frame.pack(side=tk.LEFT, fill="x", expand=False, padx=(6, 6))
216+
if self.gui_complexity != "simple":
217+
file_selection_frame.pack(side=tk.LEFT, fill="x", expand=False, padx=(6, 6))
214218

215219
# Create a label for the Combobox
216220
file_selection_label = ttk.Label(file_selection_frame, text=_("Current intermediate parameter file:"))
217-
file_selection_label.pack(side=tk.TOP, anchor=tk.NW) # Add the label to the top of the file_selection_frame
221+
if self.gui_complexity != "simple":
222+
file_selection_label.pack(side=tk.TOP, anchor=tk.NW) # Add the label to the top of the file_selection_frame
218223

219224
# Create Combobox for intermediate parameter file selection
220225
self.file_selection_combobox = AutoResizeCombobox(
@@ -232,7 +237,8 @@ def __create_conf_widgets(self, version: str) -> None:
232237
style="readonly.TCombobox",
233238
)
234239
self.file_selection_combobox.bind("<<ComboboxSelected>>", self.on_param_file_combobox_change)
235-
self.file_selection_combobox.pack(side=tk.TOP, anchor=tk.NW, pady=(4, 0))
240+
if self.gui_complexity != "simple": # only display the combobox when not simple
241+
self.file_selection_combobox.pack(side=tk.TOP, anchor=tk.NW, pady=(4, 0))
236242

237243
font_family, _font_size = get_widget_font_family_and_size(file_selection_label)
238244
self.legend_frame(config_subframe, font_family)
@@ -307,11 +313,12 @@ def __create_parameter_area_widgets(self) -> None:
307313
variable=self.show_only_differences,
308314
command=self.on_show_only_changed_checkbox_change,
309315
)
310-
only_changed_checkbox.pack(side=tk.TOP, anchor=tk.NW)
311-
show_tooltip(
312-
only_changed_checkbox,
313-
_("Toggle to show only parameters that will change if/when uploaded to the flight controller"),
314-
)
316+
if self.gui_complexity != "simple":
317+
only_changed_checkbox.pack(side=tk.TOP, anchor=tk.NW)
318+
show_tooltip(
319+
only_changed_checkbox,
320+
_("Toggle to show only parameters that will change if/when uploaded to the flight controller"),
321+
)
315322

316323
annotate_params_checkbox = ttk.Checkbutton(
317324
checkboxes_frame,
@@ -322,14 +329,15 @@ def __create_parameter_area_widgets(self) -> None:
322329
"annotate_docs_into_param_files", self.annotate_params_into_files.get()
323330
),
324331
)
325-
annotate_params_checkbox.pack(side=tk.TOP, anchor=tk.NW)
326-
show_tooltip(
327-
annotate_params_checkbox,
328-
_(
329-
"Annotate ArduPilot parameter documentation metadata into the intermediate parameter files\n"
330-
"The files will be bigger, but all the existing parameter documentation will be included inside"
331-
),
332-
)
332+
if self.gui_complexity != "simple":
333+
annotate_params_checkbox.pack(side=tk.TOP, anchor=tk.NW)
334+
show_tooltip(
335+
annotate_params_checkbox,
336+
_(
337+
"Annotate ArduPilot parameter documentation metadata into the intermediate parameter files\n"
338+
"The files will be bigger, but all the existing parameter documentation will be included inside"
339+
),
340+
)
333341

334342
# Create upload button
335343
upload_selected_button = ttk.Button(

ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_documentation_frame.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,15 @@ def _create_bottom_row(self, documentation_grid: ttk.Frame, row: int) -> None:
9191
variable=self.auto_open_var,
9292
command=lambda: ProgramSettings.set_setting("auto_open_doc_in_browser", self.auto_open_var.get()),
9393
)
94-
show_tooltip(
95-
auto_open_checkbox,
96-
_(
97-
"Automatically open all the above documentation links in a browser\n"
98-
"whenever the current intermediate parameter file changes"
99-
),
100-
)
101-
auto_open_checkbox.pack(side=tk.LEFT, expand=False)
94+
if ProgramSettings.get_setting("gui_complexity") != "simple":
95+
show_tooltip(
96+
auto_open_checkbox,
97+
_(
98+
"Automatically open all the above documentation links in a browser\n"
99+
"whenever the current intermediate parameter file changes"
100+
),
101+
)
102+
auto_open_checkbox.pack(side=tk.LEFT, expand=False)
102103

103104
def update_why_why_now_tooltip(self, current_file: str) -> None:
104105
why_tooltip_text = self.local_filesystem.get_seq_tooltip_text(current_file, "why")

0 commit comments

Comments
 (0)