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

feat: settings menu #859

Merged
merged 35 commits into from
Mar 25, 2025
Merged

Conversation

Computerdores
Copy link
Collaborator

@Computerdores Computerdores commented Mar 12, 2025

Summary

Implements a settings menu for global settings, addressing the roadmap item.

Close #647.

Currently provides the following settings:

  • language
  • open last loaded library on startup
  • autoplay
  • show filenames in grid
  • page size
  • show filepath
  • dark mode

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@CyanVoxel CyanVoxel added Type: Enhancement New feature or request Type: UI/UX User interface and/or user experience Priority: High An important issue requiring attention labels Mar 12, 2025
@CyanVoxel CyanVoxel added the Type: Refactor Code that needs to be restructured or cleaned up label Mar 12, 2025
@Computerdores Computerdores marked this pull request as ready for review March 13, 2025 16:22
@Computerdores Computerdores added the Status: Review Needed A review of this is needed label Mar 13, 2025
@Computerdores
Copy link
Collaborator Author

this is now ready for review

@CyanVoxel CyanVoxel removed the Status: Review Needed A review of this is needed label Mar 19, 2025
Copy link
Member

@CyanVoxel CyanVoxel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! I've got a couple questions I wanted to ask just so everything's square, but other than that this is approved once the remaining comments are addressed.

  1. Is the legacy .ini file intended to be used as a sort of cache file for things like the recently used libraries list now?
  2. Was the thumb_cache_size_limit setting left to remain in the .ini file since it's eventually intended to be a library setting? (This is totally fine if so)

As for general comments, I noticed that changing the page size in the settings doesn't seem to update the actual page size (even after re-searching) except for an initial change back to what seems to be the default of 500. For example if I set the size to 1,000 and restart the program, if I then change it to 10 and re-search then the page size will seem to show 500 entries per page until restarting. If this can't be fixed easily then just showing the "restart required" label can do for now.

Finally for the dark mode setting, if it's not too much I feel this would be better as a three-way option between "Light", "Dark", and "System" with the default being "System". Xarvex has been fixing up the system theme detection issues that were present across several Linux machines so there should be fewer chances of flash-banging users with dark system themes.

Thank you so much for your work on this!

Comment on lines 1825 to 1827
def open_settings_modal(self):
# TODO: Implement a proper settings panel, and don't re-create it each time it's opened.
settings_panel = SettingsPanel(self)
modal = PanelModal(
widget=settings_panel,
done_callback=lambda: self.update_language_settings(settings_panel.get_language()),
has_save=False,
)
modal.setTitle(Translations["settings.title"])
modal.setWindowTitle(Translations["settings.title"])
modal.show()

def update_language_settings(self, language: str):
Translations.change_language(language)

self.settings.setValue(SettingItems.LANGUAGE, language)
self.settings.sync()
# TODO: don't re-create each time this is opened.
SettingsPanel.build_modal(self).show()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this TODO still true now that build_modal is a classmethod? If not, SettingsPanel.build_modal(self).show could be used in place of open_settings_modal

Copy link
Collaborator Author

@Computerdores Computerdores Mar 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is indeed not a TODO anymore and for the same reason that SettingsPanel.build_modal(self).show can't be used instead of open_settings_modal. Because open_settings_modal is connected to a QSignal and replacing it would cause the show method to always be called on the same instance of the modal, therefore breaking the cancel functionality of the modal.

PS: I removed the TODO

@Computerdores
Copy link
Collaborator Author

  1. Is the legacy .ini file intended to be used as a sort of cache file for things like the recently used libraries list now?
  2. Was the thumb_cache_size_limit setting left to remain in the .ini file since it's eventually intended to be a library setting? (This is totally fine if so)

Yes and yes, what didn't belong into the global settings I just left as is.

As for general comments, I noticed that changing the page size in the settings doesn't seem to update the actual page size (even after re-searching) except for an initial change back to what seems to be the default of 500. For example if I set the size to 1,000 and restart the program, if I then change it to 10 and re-search then the page size will seem to show 500 entries per page until restarting. If this can't be fixed easily then just showing the "restart required" label can do for now.

works now.

Finally for the dark mode setting, if it's not too much I feel this would be better as a three-way option between "Light", "Dark", and "System" with the default being "System". Xarvex has been fixing up the system theme detection issues that were present across several Linux machines so there should be fewer chances of flash-banging users with dark system themes.

done.

Copy link
Member

@CyanVoxel CyanVoxel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks fantastic! Thank you so much for your work on this!

@CyanVoxel CyanVoxel merged commit adb996e into TagStudioDev:main Mar 25, 2025
5 checks passed
@CyanVoxel CyanVoxel added this to the Alpha v9.5.2 milestone Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High An important issue requiring attention Type: Enhancement New feature or request Type: Refactor Code that needs to be restructured or cleaned up Type: UI/UX User interface and/or user experience
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants