diff --git a/dzgui/const/update.py b/dzgui/const/update.py new file mode 100644 index 0000000..0487e2c --- /dev/null +++ b/dzgui/const/update.py @@ -0,0 +1,13 @@ +""" +This file is intended to be patched by package maintainers +repackaging DZGUI for use in different distributions. + +If DZGUI is going to be installed globally via a package manager +or other means and will reside in an immutable location, or needs to be +explicitly bound to a certain version, set the flag below to False. + +This will disable the ability for the application to self-manage and +will suppress the "Updates available" button in the gutter. +""" + +ALLOW_UPDATES = True diff --git a/dzgui/data/CHANGELOG.md b/dzgui/data/CHANGELOG.md index ca32a3c..90af44b 100644 --- a/dzgui/data/CHANGELOG.md +++ b/dzgui/data/CHANGELOG.md @@ -65,7 +65,6 @@ ## Unreleased - Load offline mods - Choose to jump into splash screen instead of server -- Setup wizard - Local documentation - Raw debug command in context menu diff --git a/dzgui/views/components/right_panel.py b/dzgui/views/components/right_panel.py index 660b959..aad0d09 100644 --- a/dzgui/views/components/right_panel.py +++ b/dzgui/views/components/right_panel.py @@ -17,6 +17,7 @@ from dzgui.const.constants import ( TMP_PATH, TMP_TARBALL, ) +from dzgui.const.update import ALLOW_UPDATES from dzgui.const.enum import ServerTab from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager from dzgui.strings import dialogs @@ -94,7 +95,7 @@ class RightPanel(Gtk.Box): valign=Gtk.Align.END, spacing=10, ) - if update is not None: + if ALLOW_UPDATES and update is not None: self.update_button.set_halign(Gtk.Align.END) self.gutter_box.add(self.update_button) self.update_button.connect(