Commit Graph

8 Commits (51d87f5309e84523560307ba3d501e7eedea50b2)

Author SHA1 Message Date
bmaltais 51d87f5309
feat: Remember last used folder for file dialogs (#3290)
* feat: Remember last used folder for file dialogs

This commit introduces a feature to remember the last used folder for various file and folder dialogs within the GUI.

Key changes:

- Modified `KohyaSSGUIConfig` (`kohya_gui/class_gui_config.py`) to store and retrieve a `last_used_folder` value in the `config.toml` file.
- Updated file/folder dialog utility functions in `kohya_gui/common_gui.py` (e.g., `get_folder_path`, `get_file_path`, `get_saveasfilename_path`) to:
    - Accept the `KohyaSSGUIConfig` instance.
    - Use the stored `last_used_folder` as the initial directory for dialogs.
    - Update `last_used_folder` after a successful selection.
- Updated various GUI modules (`class_folders.py`, `wd14_caption_gui.py`, and other captioning utilities) to pass the `KohyaSSGUIConfig` instance to these dialog functions.

This enhancement improves your experience by defaulting file dialogs to the most recently accessed relevant directory, streamlining the workflow for you when you frequently work with specific folders.

* Fix typo

* Fix typos

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-06-16 07:39:29 -04:00
bmaltais 4c5f4dfd27 update file read and write to utf-8 2024-04-19 10:50:43 -04:00
bmaltais e6a8dec98d
Implement use_shell as parameter (#2297) 2024-04-15 20:26:09 -04:00
bmaltais 49f76343b5 Format with black 2024-04-03 18:32:25 -04:00
bmaltais 8bf7d327ac Add support for --config parameter to kohya_gui.py 2024-04-03 17:44:11 -04:00
bmaltais 173e2fbfae Update config 2024-03-17 19:45:55 -04:00
bmaltais 4f59a28259 Update config code 2024-03-17 11:52:56 -04:00
bmaltais 5878bd6139 Move config for gui to seperate class
Add support for more config paths
2024-03-17 11:08:54 -04:00