diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2026-07-03 17:24:41 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2026-07-03 17:24:41 +0300 |
| commit | ce6384fdc7fca88eca4fe0a0e92823b5c3dc1d57 (patch) | |
| tree | 9445ac2c50b82dafeee56b2b7bbc7fcbbbd30c6a | |
| parent | 6be0f6f60c929157e924ac8b4b635bf73badb3e3 (diff) | |
| download | fungus-launcher-ce6384fdc7fca88eca4fe0a0e92823b5c3dc1d57.tar.gz fungus-launcher-ce6384fdc7fca88eca4fe0a0e92823b5c3dc1d57.tar.xz | |
use common pick_folder() helper for game directory
| -rw-r--r-- | fungus/settings_dialog.py | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/fungus/settings_dialog.py b/fungus/settings_dialog.py index f04bb08..66cc507 100644 --- a/fungus/settings_dialog.py +++ b/fungus/settings_dialog.py @@ -18,7 +18,7 @@ from fungus.constants import ( ) from fungus.config_manager import ConfigManager from fungus.dialogs import show_warning_dialog -from fungus.utils import EntryTooltipMixin +from fungus.utils import EntryTooltipMixin, pick_folder from fungus.umu_manager import ( check_and_install_if_needed, get_installed_umu_version, @@ -483,22 +483,9 @@ class SettingsDialog(EntryTooltipMixin, Gtk.Dialog): def on_button_add_gamedir_clicked(self, widget): """Open a folder chooser and append the selected directory to the game directories list.""" - filechooser = Gtk.FileChooserNative( - title="Select a game directory", - transient_for=self, - action=Gtk.FileChooserAction.SELECT_FOLDER, - accept_label="Open", - cancel_label="Cancel", - ) - - response = filechooser.run() - - if response == Gtk.ResponseType.ACCEPT: - folder = filechooser.get_filename() - if folder and not any(row[0] == folder for row in self.liststore_game_dirs): - self.liststore_game_dirs.append([folder]) - - filechooser.destroy() + folder = pick_folder("Select a game directory", self) + if folder and not any(row[0] == folder for row in self.liststore_game_dirs): + self.liststore_game_dirs.append([folder]) def populate_combobox_with_runners(self): """Fill the Proton runner combobox with available runners.""" |
