all msg_window with MassageDialog replaced

This commit is contained in:
2025-06-23 07:44:16 +02:00
parent 794dda346a
commit 54b62fd5d5
2 changed files with 19 additions and 70 deletions

View File

@ -9,6 +9,11 @@ My standard System: Linux Mint 22 Cinnamon
- Tunnel in tk.canvas for modern look - Tunnel in tk.canvas for modern look
- Replace Download Button with Lx Tools installer - Replace Download Button with Lx Tools installer
### Added
23-06-2025
- all msg_window with MassageDialog replaced
### Added ### Added
14-06-2025 14-06-2025

View File

@ -636,21 +636,15 @@ class FrameWidgets(ttk.Frame):
data_import, key_name = Tunnel.parse_files_to_dictionary(filepath=filepath) data_import, key_name = Tunnel.parse_files_to_dictionary(filepath=filepath)
if CryptoUtil.find_key(f"{data_import[key_name]["PrivateKey"]}="): if CryptoUtil.find_key(f"{data_import[key_name]["PrivateKey"]}="):
LxTools.msg_window( MessageDialog("error", Msg.STR["tl_exist"], title=Msg.STR["imp_err"])
AppConfig.IMAGE_PATHS["icon_error"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["imp_err"],
Msg.STR["tl_exist"],
)
elif not CryptoUtil.is_valid_base64( elif not CryptoUtil.is_valid_base64(
f"{data_import[key_name]["PrivateKey"]}=" f"{data_import[key_name]["PrivateKey"]}="
): # 2. Second check: Is it valid Base64? ): # 2. Second check: Is it valid Base64?
LxTools.msg_window( MessageDialog(
AppConfig.IMAGE_PATHS["icon_error"], "error",
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["imp_err"],
Msg.STR["invalid_base64"], Msg.STR["invalid_base64"],
title=Msg.STR["imp_err"],
) )
else: else:
filepath = Path(filepath) filepath = Path(filepath)
@ -743,12 +737,7 @@ class FrameWidgets(ttk.Frame):
print(f">> {import_file.stem} << autostart is disabled by default") print(f">> {import_file.stem} << autostart is disabled by default")
except UnboundLocalError: except UnboundLocalError:
LxTools.msg_window( MessageDialog("error", Msg.STR["no_valid_file"], title=Msg.STR["imp_err"])
AppConfig.IMAGE_PATHS["icon_error"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["imp_err"],
Msg.STR["no_valid_file"],
)
except (IsADirectoryError, TypeError, FileNotFoundError): except (IsADirectoryError, TypeError, FileNotFoundError):
print("File import: abort by user...") print("File import: abort by user...")
except EOFError as e: except EOFError as e:
@ -811,21 +800,11 @@ class FrameWidgets(ttk.Frame):
if self.l_box.size() != 0: if self.l_box.size() != 0:
LxTools.msg_window( MessageDialog("info", Msg.STR["sel_list"], title=Msg.STR["sel_tl"])
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["sel_tl"],
Msg.STR["sel_list"],
)
else: else:
LxTools.msg_window( MessageDialog("info", Msg.STR["tl_first"], title=Msg.STR["sel_tl"])
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["sel_tl"],
Msg.STR["tl_first"],
)
def enable_check_box(self, _) -> None: def enable_check_box(self, _) -> None:
""" """
@ -908,41 +887,21 @@ class FrameWidgets(ttk.Frame):
if len(self.lb_rename.get()) > 12: if len(self.lb_rename.get()) > 12:
LxTools.msg_window( MessageDialog("info", Msg.STR["sign_len"], title=Msg.STR["ren_err"])
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["ren_err"],
Msg.STR["sign_len"],
)
elif len(self.lb_rename.get()) == 0: elif len(self.lb_rename.get()) == 0:
LxTools.msg_window( MessageDialog("info", Msg.STR["zero_signs"], title=Msg.STR["ren_err"])
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["ren_err"],
Msg.STR["zero_signs"],
)
elif any(ch in special_characters for ch in self.lb_rename.get()): elif any(ch in special_characters for ch in self.lb_rename.get()):
LxTools.msg_window( MessageDialog("info", Msg.STR["false_signs"], title=Msg.STR["ren_err"])
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["ren_err"],
Msg.STR["false_signs"],
)
elif self.lb_rename.get() in [ elif self.lb_rename.get() in [
file.stem for file in AppConfig.CONFIG_DIR.glob("*.dat") file.stem for file in AppConfig.CONFIG_DIR.glob("*.dat")
]: ]:
LxTools.msg_window( MessageDialog("info", Msg.STR["is_in_use"], title=Msg.STR["ren_err"])
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["ren_err"],
Msg.STR["is_in_use"],
)
else: else:
@ -984,12 +943,7 @@ class FrameWidgets(ttk.Frame):
except IndexError: except IndexError:
LxTools.msg_window( MessageDialog("info", Msg.STR["sel_list"], title=Msg.STR["ren_err"])
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["ren_err"],
Msg.STR["sel_list"],
)
except EOFError as e: except EOFError as e:
logging.error(e, exc_info=True) logging.error(e, exc_info=True)
@ -1062,21 +1016,11 @@ class FrameWidgets(ttk.Frame):
if self.l_box.size() != 0: if self.l_box.size() != 0:
LxTools.msg_window( MessageDialog("info", Msg.STR["sel_list"], title=Msg.STR["sel_tl"])
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["sel_tl"],
Msg.STR["sel_list"],
)
else: else:
LxTools.msg_window( MessageDialog("info", Msg.STR["tl_first"], title=Msg.STR["sel_tl"])
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["sel_tl"],
Msg.STR["tl_first"],
)
def handle_connection_state(self, action: str, tunnel_name: str = None) -> None: def handle_connection_state(self, action: str, tunnel_name: str = None) -> None:
""" """