add new modul MessageDialog and replace old message dialog

This commit is contained in:
2025-06-14 22:55:47 +02:00
parent ffb9a5ba5f
commit c2552696e4
5 changed files with 411 additions and 105 deletions

@@ -6,6 +6,7 @@ from pathlib import Path
import subprocess
import shutil
from shared_libs.common_tools import LxTools
from shared_libs.message import MessageDialog
class GiteaUpdate:
@@ -72,29 +73,18 @@ class GiteaUpdate:
if result == 0:
shutil.chown(f"{Path.home()}/{res}.zip", 1000, 1000)
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_download"],
Msg.STR["title"],
Msg.STR["ok_message"],
)
MessageDialog("info", text=Msg.STR["ok_message"])
else:
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_error"],
AppConfig.IMAGE_PATHS["icon_download_error"],
Msg.STR["error_title"],
Msg.STR["error_massage"],
MessageDialog(
"error", text=Msg.STR["error_message"], title=Msg.STR["error_title"]
)
except subprocess.CalledProcessError:
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_error"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["error_title"],
Msg.STR["error_no_internet"],
MessageDialog(
"error", text=Msg.STR["error_no_internet"], title=Msg.STR["error_title"]
)