Skip to content

Commit

Permalink
Fix exception when changing install path in preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkwouter committed Jan 7, 2024
1 parent 3aae19d commit f1035f7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**1.2.6**
- Fix error detection & reporting on wineprefix creation failure
- Fix changing the install path causing an exception
- Fix error detection & reporting on wineprefix creation failure (thanks to LeXofLeviafan)

**1.2.5**
- Fix filtering for installed games
Expand Down
5 changes: 3 additions & 2 deletions minigalaxy/ui/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ class Preferences(Gtk.Dialog):
button_cancel = Gtk.Template.Child()
button_save = Gtk.Template.Child()

def __init__(self, parent, config: Config):
def __init__(self, parent, config: Config, download_manager: DownloadManager):
Gtk.Dialog.__init__(self, title=_("Preferences"), parent=parent, modal=True)
self.parent = parent
self.config = config
self.download_manager = download_manager

self.__set_locale_list()
self.__set_language_list()
Expand Down Expand Up @@ -199,7 +200,7 @@ def save_pressed(self, button):
# Only change the install_dir is it was actually changed
if self.button_file_chooser.get_filename() != self.config.install_dir:
if self.__save_install_dir_choice():
DownloadManager.cancel_all_downloads()
self.download_manager.cancel_all_downloads()
self.parent.reset_library()
else:
self.parent.show_error(_("{} isn't a usable path").format(self.button_file_chooser.get_filename()))
Expand Down
3 changes: 2 additions & 1 deletion minigalaxy/ui/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(self, config: Config, api: 'Api', download_manager: DownloadManager

self.api = api
self.config = config
self.download_manager = download_manager
self.search_string = ""
self.offline = False

Expand Down Expand Up @@ -95,7 +96,7 @@ def filter_library(self, switch, _=""):

@Gtk.Template.Callback("on_menu_preferences_clicked")
def show_preferences(self, button):
preferences_window = Preferences(self, self.config)
preferences_window = Preferences(parent=self, config=self.config, download_manager=self.download_manager)
preferences_window.run()
preferences_window.destroy()

Expand Down

0 comments on commit f1035f7

Please sign in to comment.