Merge pull request 'eplace msg_window with MassageDialog vpn stop icon corrected new icons question and warning , info and error revised' (#37) from 04-06-2025_large_update into main
Reviewed-on: #37
@ -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
|
||||||
|
14-06-2025
|
||||||
|
|
||||||
|
- replace msg_window with MassageDialog
|
||||||
|
- vpn stop icon corrected
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
07-06-2025
|
07-06-2025
|
||||||
|
BIN
lx-icons/128/Lunix_Tools.png
Normal file
After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.5 KiB |
BIN
lx-icons/128/question_mark.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
lx-icons/128/warning.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 10 KiB |
BIN
lx-icons/256/Lunix_Tools.png
Normal file
After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.8 KiB |
BIN
lx-icons/256/question_mark.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
lx-icons/256/warning.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 20 KiB |
BIN
lx-icons/32/Lunix_Tools.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
lx-icons/32/question_mark.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
lx-icons/32/warning.png
Normal file
After Width: | Height: | Size: 838 B |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
lx-icons/32/wg_vpn.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
lx-icons/48/Lunix_Tools.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
lx-icons/48/question_mark.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
lx-icons/48/warning.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
lx-icons/64/Lunix_Tools.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
lx-icons/64/question_mark.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
lx-icons/64/warning.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 4.5 KiB |
@ -7,24 +7,22 @@ import shutil
|
|||||||
from subprocess import CompletedProcess, run
|
from subprocess import CompletedProcess, run
|
||||||
from shared_libs.wp_app_config import AppConfig
|
from shared_libs.wp_app_config import AppConfig
|
||||||
from shared_libs.common_tools import LxTools
|
from shared_libs.common_tools import LxTools
|
||||||
|
from shared_libs.message import MessageDialog
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--user", required=True, help="Username of the target file system")
|
parser.add_argument("--user", required=True, help="Username of the target file system")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
_ = AppConfig.setup_translations()
|
||||||
try:
|
try:
|
||||||
# Retrieve UID and GID
|
# Retrieve UID and GID
|
||||||
user_info = pwd.getpwnam(args.user)
|
user_info = pwd.getpwnam(args.user)
|
||||||
uid = user_info.pw_uid # User ID (e.g., 1000)
|
uid = user_info.pw_uid # User ID (e.g., 1000)
|
||||||
gid = user_info.pw_gid # Group ID (e.g., 1000)
|
gid = user_info.pw_gid # Group ID (e.g., 1000)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
LxTools.msg_window(
|
MessageDialog("error", _(f"User '{args.user}' not found."), title="Error decrypt")
|
||||||
AppConfig.IMAGE_PATHS["icon_error"],
|
|
||||||
AppConfig.IMAGE_PATHS["icon_error"],
|
|
||||||
"Error decrypt",
|
|
||||||
f"User '{args.user}' not found.",
|
|
||||||
exc_info=True,
|
|
||||||
)
|
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
crypted_tunnel: Path = Path(f"/home/{args.user}/.config/wire_py")
|
crypted_tunnel: Path = Path(f"/home/{args.user}/.config/wire_py")
|
||||||
@ -58,9 +56,10 @@ else:
|
|||||||
|
|
||||||
# Output from Openssl Error
|
# Output from Openssl Error
|
||||||
if process.stderr:
|
if process.stderr:
|
||||||
LxTools.msg_window(
|
MessageDialog(
|
||||||
AppConfig.IMAGE_PATHS["icon_error"],
|
"erro",
|
||||||
AppConfig.IMAGE_PATHS["icon_error"],
|
_(
|
||||||
"Error decrypt",
|
f"{process.stderr} Error by [{tunnel_path}] Code: {process.returncode}"
|
||||||
f"{process.stderr} Error by [{tunnel_path}] Code: {process.returncode}",
|
),
|
||||||
|
title="Error decrypt",
|
||||||
)
|
)
|
||||||
|
32
tunnel.py
@ -9,6 +9,7 @@ from subprocess import run, CompletedProcess
|
|||||||
import secrets
|
import secrets
|
||||||
from shared_libs.wp_app_config import AppConfig, Msg
|
from shared_libs.wp_app_config import AppConfig, Msg
|
||||||
from shared_libs.common_tools import LxTools, CryptoUtil
|
from shared_libs.common_tools import LxTools, CryptoUtil
|
||||||
|
from shared_libs.message import MessageDialog
|
||||||
|
|
||||||
# Translate
|
# Translate
|
||||||
_ = AppConfig.setup_translations()
|
_ = AppConfig.setup_translations()
|
||||||
@ -172,12 +173,8 @@ class Tunnel:
|
|||||||
CryptoUtil.decrypt(getpass.getuser())
|
CryptoUtil.decrypt(getpass.getuser())
|
||||||
if len([file.name for file in AppConfig.TEMP_DIR.glob("*.conf")]) == 0:
|
if len([file.name for file in AppConfig.TEMP_DIR.glob("*.conf")]) == 0:
|
||||||
|
|
||||||
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"],
|
|
||||||
)
|
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
wg_tar: str = f"{AppConfig.BASE_DIR}/{now_datetime}"
|
wg_tar: str = f"{AppConfig.BASE_DIR}/{now_datetime}"
|
||||||
@ -186,22 +183,20 @@ class Tunnel:
|
|||||||
with zipfile.ZipFile(f"{wg_tar}.zip", "r") as zf:
|
with zipfile.ZipFile(f"{wg_tar}.zip", "r") as zf:
|
||||||
if zf.namelist():
|
if zf.namelist():
|
||||||
|
|
||||||
LxTools.msg_window(
|
MessageDialog(
|
||||||
AppConfig.IMAGE_PATHS["icon_info"],
|
"info",
|
||||||
AppConfig.IMAGE_PATHS["icon_vpn"],
|
|
||||||
Msg.STR["exp_succ"],
|
|
||||||
Msg.STR["exp_in_home"],
|
Msg.STR["exp_in_home"],
|
||||||
|
title=Msg.STR["exp_succ"],
|
||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logging.error(
|
logging.error(
|
||||||
"There was a mistake at creating the Zip file. File is empty."
|
"There was a mistake at creating the Zip file. File is empty."
|
||||||
)
|
)
|
||||||
LxTools.msg_window(
|
MessageDialog(
|
||||||
AppConfig.IMAGE_PATHS["icon_error"],
|
"error", Msg.STR["exp_zip"], title=Msg.STR["exp_err"]
|
||||||
AppConfig.IMAGE_PATHS["icon_msg"],
|
|
||||||
Msg.STR["exp_err"],
|
|
||||||
Msg.STR["exp_zip"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
@ -217,12 +212,7 @@ class Tunnel:
|
|||||||
pass
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Export failed: {str(e)}")
|
logging.error(f"Export failed: {str(e)}")
|
||||||
LxTools.msg_window(
|
MessageDialog("error", Msg.STR["exp_try"], title=Msg.STR["exp_err"])
|
||||||
AppConfig.IMAGE_PATHS["icon_error"],
|
|
||||||
AppConfig.IMAGE_PATHS["icon_msg"],
|
|
||||||
Msg.STR["exp_err"],
|
|
||||||
Msg.STR["exp_try"],
|
|
||||||
)
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
23
wirepy.py
@ -8,11 +8,12 @@ import shutil
|
|||||||
import sys
|
import sys
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
from functools import partial
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from subprocess import CompletedProcess, run
|
from subprocess import CompletedProcess, run
|
||||||
from tkinter import TclError, filedialog, ttk
|
from tkinter import TclError, filedialog, ttk
|
||||||
from tunnel import Tunnel
|
from tunnel import Tunnel
|
||||||
|
from shared_libs.message import MessageDialog
|
||||||
from shared_libs.gitea import GiteaUpdate
|
from shared_libs.gitea import GiteaUpdate
|
||||||
from shared_libs.common_tools import (
|
from shared_libs.common_tools import (
|
||||||
LxTools,
|
LxTools,
|
||||||
@ -462,10 +463,6 @@ class FrameWidgets(ttk.Frame):
|
|||||||
"""
|
"""
|
||||||
a tk.Toplevel window
|
a tk.Toplevel window
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def link_btn() -> None:
|
|
||||||
webbrowser.open("https://git.ilunix.de/punix/Wire-Py")
|
|
||||||
|
|
||||||
msg_t = _(
|
msg_t = _(
|
||||||
"Wire-Py a simple Wireguard Gui for Linux systems.\n\n"
|
"Wire-Py a simple Wireguard Gui for Linux systems.\n\n"
|
||||||
"Wire-Py is open source software written in Python.\n\n"
|
"Wire-Py is open source software written in Python.\n\n"
|
||||||
@ -473,13 +470,17 @@ class FrameWidgets(ttk.Frame):
|
|||||||
"Use without warranty!\n"
|
"Use without warranty!\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
LxTools.msg_window(
|
MessageDialog(
|
||||||
AppConfig.IMAGE_PATHS["icon_vpn"],
|
"info",
|
||||||
AppConfig.IMAGE_PATHS["icon_vpn"],
|
|
||||||
_("Info"),
|
|
||||||
msg_t,
|
msg_t,
|
||||||
_("Go to Wire-Py git"),
|
buttons=["OK", _("Go to Wire-Py git")],
|
||||||
link_btn,
|
title=_("Info"),
|
||||||
|
commands=[
|
||||||
|
None,
|
||||||
|
partial(webbrowser.open, "https://git.ilunix.de/punix/Wire-Py"),
|
||||||
|
],
|
||||||
|
icon=AppConfig.IMAGE_PATHS["icon_vpn"],
|
||||||
|
wraplength=420,
|
||||||
)
|
)
|
||||||
|
|
||||||
def update_setting(self, update_res) -> None:
|
def update_setting(self, update_res) -> None:
|
||||||
|