Enhanced export functionality with error handling and updated Active method implementation for improved error management

This commit is contained in:
2025-05-24 14:53:56 +02:00
parent 79f6fc0265
commit 7f4fabe856
4 changed files with 87 additions and 95 deletions

View File

@ -177,7 +177,7 @@ class FrameWidgets(ttk.Frame):
self.about_btn.grid(column=2, columnspan=2, row=0)
self.readme = tk.Menu(self)
self.a = Tunnel.active()
self.a = Tunnel.get_active()
# Label Frame 1
self.lb_frame_btn_lbox = ttk.Frame(self)
@ -292,14 +292,7 @@ class FrameWidgets(ttk.Frame):
self.btn_exp = ttk.Button(
self.lb_frame_btn_lbox,
image=self.exp_pic,
command=lambda: Tunnel.export(
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_vpn"],
AppConfig.IMAGE_PATHS["icon_error"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["sel_tl"],
Msg.STR["tl_first"],
),
command=lambda: Tunnel.export(),
padding=0,
)
@ -713,7 +706,7 @@ class FrameWidgets(ttk.Frame):
LxTools.clean_files(AppConfig.TEMP_DIR, file=None)
AppConfig.ensure_directories()
self.str_var.set("")
self.a = Tunnel.active()
self.a = Tunnel.get_active()
self.l_box.insert(0, self.a)
self.wg_autostart.configure(state="normal")
self.l_box.selection_clear(0, tk.END)
@ -1147,7 +1140,7 @@ class FrameWidgets(ttk.Frame):
"""
Updated the display after connection changes
"""
self.a = Tunnel.active()
self.a = Tunnel.get_active()
if not hasattr(self, "str_var"):
self.str_var = tk.StringVar()
self.str_var.set(self.a)