add on manual exclude view on delete methode self._apply_changes() for directly remove in file and add cancel button

This commit is contained in:
2025-09-13 01:55:20 +02:00
parent d5e08853a5
commit aa604efc86

View File

@@ -85,9 +85,16 @@ class AdvancedSettingsFrame(ttk.Frame):
self.manual_excludes_listbox.pack(
fill=tk.BOTH, expand=True, padx=5, pady=5)
manual_exclude_buttons_frame = ttk.Frame(self.manual_excludes_frame)
manual_exclude_buttons_frame.pack(pady=5)
delete_button = ttk.Button(
self.manual_excludes_frame, text=Msg.STR["delete"], command=self._delete_manual_exclude)
delete_button.pack(pady=5)
manual_exclude_buttons_frame, text=Msg.STR["delete"], command=self._delete_manual_exclude)
delete_button.pack(side=tk.LEFT, padx=5, pady=5)
cancel_button = ttk.Button(
manual_exclude_buttons_frame, text=Msg.STR["cancel"], command=self._cancel_changes)
cancel_button.pack(side=tk.LEFT, padx=5, pady=5)
self.animation_settings_frame = ttk.LabelFrame(
view_container, text=Msg.STR["animation_settings_title"], padding=10)
@@ -181,12 +188,12 @@ class AdvancedSettingsFrame(ttk.Frame):
self.keyfile_settings_frame.columnconfigure(1, weight=1)
button_frame = ttk.Frame(self)
button_frame.pack(pady=10)
self.bottom_button_frame = ttk.Frame(self)
self.bottom_button_frame.pack(pady=10)
ttk.Button(button_frame, text=Msg.STR["apply"], command=self._apply_changes).pack(
ttk.Button(self.bottom_button_frame, text=Msg.STR["apply"], command=self._apply_changes).pack(
side=tk.LEFT, padx=5)
ttk.Button(button_frame, text=Msg.STR["cancel"], command=self._cancel_changes).pack(
ttk.Button(self.bottom_button_frame, text=Msg.STR["cancel"], command=self._cancel_changes).pack(
side=tk.LEFT, padx=5)
self.tree_frame.pack(fill=tk.BOTH, expand=True)
@@ -302,6 +309,12 @@ class AdvancedSettingsFrame(ttk.Frame):
self.animation_settings_frame.pack_forget()
self.backup_defaults_frame.pack_forget()
# Show/hide the main action buttons based on the view
if index == 1: # Manual Excludes view
self.bottom_button_frame.pack_forget()
else:
self.bottom_button_frame.pack(pady=10)
if index == 0:
self.tree_frame.pack(fill=tk.BOTH, expand=True)
self.info_label.config(text=Msg.STR["advanced_settings_warning"])
@@ -341,6 +354,7 @@ class AdvancedSettingsFrame(ttk.Frame):
selected_indices = self.manual_excludes_listbox.curselection()
for i in reversed(selected_indices):
self.manual_excludes_listbox.delete(i)
self._apply_changes()
def _reset_animation_settings(self):
self.config_manager.remove_setting("backup_animation_type")