From ea7aa5ab2626af27f903c4c5f20a5941603009e9 Mon Sep 17 00:00:00 2001 From: VALLONGOL Date: Fri, 11 Jul 2025 11:31:08 +0200 Subject: [PATCH] add select all and select none into export function --- radar_data_reader/gui/main_window.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/radar_data_reader/gui/main_window.py b/radar_data_reader/gui/main_window.py index 66e34ae..141526e 100644 --- a/radar_data_reader/gui/main_window.py +++ b/radar_data_reader/gui/main_window.py @@ -180,8 +180,32 @@ class MainWindow(tk.Frame): tree_scrollbar = ttk.Scrollbar(results_frame, orient="vertical", command=self.flight_timeline_tree.yview) self.flight_timeline_tree.configure(yscrollcommand=tree_scrollbar.set) tree_scrollbar.grid(row=0, column=1, sticky="ns") - self.export_segment_button = ttk.Button(results_frame, text="Export Selected Segment(s)", state=tk.DISABLED, command=self.controller.start_segment_export) - self.export_segment_button.grid(row=1, column=0, columnspan=2, pady=5) + buttons_frame = ttk.Frame(results_frame) + buttons_frame.grid(row=1, column=0, columnspan=2, sticky="ew", pady=5) + + # Pulsanti di selezione + select_all_button = ttk.Button(buttons_frame, text="Select All", command=self._select_all_segments) + select_all_button.pack(side=tk.LEFT, padx=(0, 5)) + + deselect_all_button = ttk.Button(buttons_frame, text="Select None", command=self._deselect_all_segments) + deselect_all_button.pack(side=tk.LEFT) + + # Sposta il pulsante di esportazione in questo frame per allinearlo + self.export_segment_button = ttk.Button( + buttons_frame, text="Export Selected Segment(s)", state=tk.DISABLED, + command=self.controller.start_segment_export + ) + # Lo mettiamo a destra per separarlo + self.export_segment_button.pack(side=tk.RIGHT) + + def _select_all_segments(self): + """Selects all items in the flight timeline treeview.""" + children = self.flight_timeline_tree.get_children() + self.flight_timeline_tree.selection_set(children) + + def _deselect_all_segments(self): + """Deselects all items in the flight timeline treeview.""" + self.flight_timeline_tree.selection_remove(self.flight_timeline_tree.selection()) def _create_out_processor_tab(self, parent): parent.columnconfigure(1, weight=1)