Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable setappimage if winebincode != AppImage #56

Merged
merged 6 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ __pycache__/
dist/
build/
env/
.env/
venv/
.venv/
.idea/
13 changes: 8 additions & 5 deletions LogosLinuxInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,14 @@ def parse_args(args, parser):
config.ACTION = control.restore
elif args.set_appimage:
config.APPIMAGE_FILE_PATH = args.set_appimage[0]
if not utils.file_exists(config.APPIMAGE_FILE_PATH):
raise argparse.ArgumentTypeError(f"Invalid file path: '{config.APPIMAGE_FILE_PATH}'. File does not exist.")
if not utils.check_appimage(config.APPIMAGE_FILE_PATH):
raise argparse.ArgumentTypeError(f"{config.APPIMAGE_FILE_PATH} is not an AppImage.")
config.ACTION = utils.set_appimage_symlink
if config.WINEBIN_CODE == "AppImage":
if not utils.file_exists(config.APPIMAGE_FILE_PATH):
raise argparse.ArgumentTypeError(f"Invalid file path: '{config.APPIMAGE_FILE_PATH}'. File does not exist.")
if not utils.check_appimage(config.APPIMAGE_FILE_PATH):
raise argparse.ArgumentTypeError(f"{config.APPIMAGE_FILE_PATH} is not an AppImage.")
config.ACTION = utils.set_appimage_symlink
else:
msg.logos_error("The command you requested is disabled. The configured install was not created using an AppImage.")
elif args.get_winetricks:
config.ACTION = control.get_winetricks
elif args.run_winetricks:
Expand Down
33 changes: 33 additions & 0 deletions gui.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from tkinter import Toplevel
from tkinter import BooleanVar
from tkinter import font
from tkinter import IntVar
Expand Down Expand Up @@ -239,3 +240,35 @@ def __init__(self, root, *args, **kwargs):
s3.grid(column=0, row=12, columnspan=3, sticky='we', pady=2)
self.message_label.grid(column=0, row=13, columnspan=3, sticky='we', pady=2)
self.progress.grid(column=0, row=14, columnspan=3, sticky='we', pady=2)


class ToolTip:
def __init__(self, widget, text):
self.widget = widget
self.text = text
self.tooltip_visible = False
self.tooltip_window = None

self.widget.bind("<Enter>", self.show_tooltip)
self.widget.bind("<Leave>", self.hide_tooltip)

def show_tooltip(self, event=None):
if not self.tooltip_visible:
x, y, _, _ = self.widget.bbox("insert")
x += self.widget.winfo_rootx() + self.widget.winfo_width() // 2 - 200
y += self.widget.winfo_rooty() - 25

self.tooltip_window = Toplevel(self.widget)
self.tooltip_window.wm_overrideredirect(True)
self.tooltip_window.wm_geometry(f"+{x}+{y}")

label = Label(self.tooltip_window, text=self.text, justify="left", background="#eeeeee",
relief="solid", padding=4, borderwidth=1, foreground="#000000", wraplength=80)
label.pack(ipadx=1)

self.tooltip_visible = True

def hide_tooltip(self, event=None):
if self.tooltip_visible:
self.tooltip_window.destroy()
self.tooltip_visible = False
9 changes: 7 additions & 2 deletions gui_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def on_okay_released(self, evt=None):
config.SKIP_FONTS = self.gui.skip_fonts if self.gui.skip_fonts == 1 else 0
config.SKIP_DEPENDENCIES = self.gui.skip_dependencies if self.gui.skip_dependencies == 1 else 0
if config.LOGOS_ICON_URL is None:
config.LOGOS_ICON_URL = f"https://raw.githubusercontent.com/ferion11/LogosLinuxInstaller/master/img/{config.FLPRODUCTi}-128-icon.png"
config.LOGOS_ICON_URL = f"https://raw.githubusercontent.com/FaithLife-Community/LogosLinuxInstaller/master/img/{config.FLPRODUCTi}-128-icon.png"
if config.LOGOS_ICON_FILENAME is None:
config.LOGOS_ICON_FILENAME = os.path.basename(config.LOGOS_ICON_URL)

Expand Down Expand Up @@ -465,9 +465,13 @@ def __init__(self, root, *args, **kwargs):
self.gui.logging_button.state(['disabled'])

self.gui.config_button.config(command=control.edit_config)
self.gui.deps_button.config(command=self.install_deps)
self.gui.backup_button.config(command=self.run_backup)
self.gui.restore_button.config(command=self.run_restore)
self.gui.deps_button.config(command=self.install_deps)
self.gui.appimage_button.config(command=self.set_appimage)
if config.WINEBIN_CODE != "AppImage":
self.gui.appimage_button.state(['disabled'])
gui.ToolTip(self.gui.appimage_button, "This button is disabled. The configured install was not created using an AppImage.")
self.gui.get_winetricks_button.config(command=self.get_winetricks)
self.gui.run_winetricks_button.config(command=self.launch_winetricks)
self.update_run_winetricks_button()
Expand Down Expand Up @@ -495,6 +499,7 @@ def __init__(self, root, *args, **kwargs):
self.gui.progress.state(['!disabled'])
self.gui.progress.start()


def run_installer(self, evt=None):
# self.root.control_win.destroy()
classname = "LogosLinuxInstaller"
Expand Down
Loading