Commit Graph

10691 Commits

Author SHA1 Message Date
Philipp Wolfer
0cf178cd5d PICARD-2879: macOS: Extend all paths in filebrowser with /Volumes/
This ensures that selected starting directory gets resolved correctly,
as the filebrowser only supports paths under /Volumes/, not directly under
/. On saving drop the /Volumes/ prefix for paths on the root volume.
2024-04-30 11:37:41 +02:00
Philipp Wolfer
52656c7cb5 Merge pull request #2438 from zas/cleanup_defaults
Cleanup defaults
2024-04-30 07:36:21 +02:00
Laurent Monin
fbab1f1884 Add tests for picard.util.macos functions
Suggested by phw
2024-04-29 17:44:12 +02:00
Laurent Monin
fbb3a1f8cd Add a note about Qt6 installed from pip and libxcb errors 2024-04-29 16:48:59 +02:00
Laurent Monin
79776a3b9a Move code from consts.defaults to picard.util.cdrom, introduce get_default_cdrom_drives() 2024-04-29 11:45:25 +02:00
Laurent Monin
da8367c5a2 Move macos-specific functions to new picard.util.macos 2024-04-29 11:41:32 +02:00
Laurent Monin
4af62cc88b Merge pull request #2437 from phw/avoid-double-crash-dialog
PICARD-2869: Avoid double crash dialog
2024-04-29 09:29:24 +02:00
Laurent Monin
ed67ef6e56 Merge pull request #2436 from zas/handle_failed_option_page
Better handling of exceptions while loading option pages
2024-04-29 09:23:55 +02:00
Philipp Wolfer
9393da348c PICARD-2869: Run register_excepthook early
Don't separately catch exceptions around main but rely on the new excepthook.

This prevents the crash dialog to be shown twice for exceptions which
are catched by the exception handler already.
2024-04-29 08:22:11 +02:00
Laurent Monin
b10efe3c73 No need to check profile_page here, the button leading here will be disabled 2024-04-28 23:46:15 +02:00
Laurent Monin
26c566573a Do not try to check profiles page if the current page isn't loaded 2024-04-28 23:45:25 +02:00
Laurent Monin
a20b71df1a Split show_attached_profiles_dialog() in smaller bits 2024-04-28 23:44:41 +02:00
Laurent Monin
c482b2e122 Do not create a OptionsDialog.profile_page property, use get_page() instead 2024-04-28 23:04:51 +02:00
Laurent Monin
0411483d1c OptionsDialog.maintenance_page is used nowhere, use a local variable instead 2024-04-28 23:00:53 +02:00
Laurent Monin
99a059e53d Minor change in try/except, add debug output if restoring expanded state fails 2024-04-28 19:40:25 +02:00
Laurent Monin
25964df99a Use a tuple instead of a generator
Suggested by phw
2024-04-28 19:26:31 +02:00
Laurent Monin
14c145dda4 Reduce code redundancy a bit as switch_page calls set_profiles_button_and_highlight
- ensure signal is connected before setting the current item
- ensure profiles stuff is ready before setting current item
2024-04-28 19:17:49 +02:00
Laurent Monin
07e6efac00 Use pagename for ... page's names
page was referring either to a page object or its name
2024-04-28 18:59:26 +02:00
Laurent Monin
499fe18cfb Use existing method get_page() 2024-04-28 18:50:21 +02:00
Laurent Monin
7152db11cb Rename page_to_item to pagename_to_item
That's clearer, as we use `page` for `OptionsPage`, but also for `OptionsPage.NAME`.
This dict clearly converts a page's name to an item.
2024-04-28 18:48:20 +02:00
Laurent Monin
dd91bddd3b add_pages(): drop unused variables foo & bar
- create a generator
- use sorted() key property to define order
2024-04-28 18:43:07 +02:00
Laurent Monin
b80f4d698e Replace OptionsPage error property with clearer initialized property
- drop tooltip, as error is clear displayed in the page anyway
- technically those exceptions happen during `__init__()` not `load()`, so that's less ambiguous
2024-04-28 18:32:43 +02:00
Dimlbur
ff2f899c7e Translated using Weblate (Russian)
Currently translated at 56.9% (676 of 1188 strings)

Co-authored-by: Dimlbur <Dimlbur@users.noreply.translations.metabrainz.org>
Translate-URL: https://translations.metabrainz.org/projects/picard/3/app/ru/
Translation: Picard/App
2024-04-28 11:42:31 +00:00
salo.rock
28e65f404d Translated using Weblate (Italian)
Currently translated at 100.0% (1188 of 1188 strings)

Co-authored-by: salo.rock <salo.rock@users.noreply.translations.metabrainz.org>
Translate-URL: https://translations.metabrainz.org/projects/picard/3/app/it/
Translation: Picard/App
2024-04-28 11:42:31 +00:00
Laurent Monin
200028f2c7 Improve ErrorOptionsPage display 2024-04-28 13:33:10 +02:00
Laurent Monin
b387c91468 Run page.set_dialog() in the try/except block as it may be redefined
And add a parameter to pass it to `ErrorOptionsPage`.
It looks code duplication, but it isn't, as an `OptionsPage` subclass can redefine `set_dialog()`.
2024-04-28 11:43:41 +02:00
Laurent Monin
e9ef17f332 Simplify code, no need to make a special case of profile_page.save() 2024-04-28 11:29:07 +02:00
Laurent Monin
054ba32d6c Introduce generator properties to iterate initialized and loaded pages 2024-04-28 11:27:29 +02:00
Laurent Monin
25a36ee281 Disable Restore Defaults for pages that failed to load 2024-04-28 11:17:17 +02:00
Laurent Monin
d47968bce1 Do not try to use profiles if profiles option page failed to load 2024-04-28 11:07:46 +02:00
Laurent Monin
063e2cc538 Call setCurrentWidget() from switch_page(), it makes more sense 2024-04-28 11:06:06 +02:00
Laurent Monin
4346b77152 Link to Troubleshooting documentation instead of Bug Tracker
Suggested by rdswift
2024-04-28 10:37:04 +02:00
Laurent Monin
a7c172e6c1 Introduce OptionsPage.loaded and make code more resistant to page loading failures
- if the page fails during initialization `error` property is set
- if the page fails during `load()` `loaded` property is False
- test `page.loaded` before trying to use it or call methods from it
2024-04-27 22:55:26 +02:00
Laurent Monin
866c0bd7af Improve error message and add a link to bug tracker 2024-04-27 22:28:25 +02:00
Laurent Monin
b26d5608eb Avoid a possible exception if the current item is an inactive page
To replicate the issue:
- select a page
- exit Picard
- set the page ACTIVE attribute to False
- load Picard
- open Options again
2024-04-27 19:07:20 +02:00
Laurent Monin
b892157d86 Append (error) to page title and add a tooltip indicating it failed to load 2024-04-27 18:54:11 +02:00
Laurent Monin
a48d1cf356 No need to add widget to pages_stack in add_pages(), as it is done before it is called
- not sure why we had this, but removing one or the other doesn't change anything and works
2024-04-27 18:36:28 +02:00
Laurent Monin
64710d0aea Better handling of exceptions while loading option pages
- without this patch, Picard crashes, and/or the options display gets corrupted
- with this patch, a fake page is loaded instead, displaying the message, but avoiding a crash
- it will be important for pages created by plugins
2024-04-27 18:10:21 +02:00
Dimlbur
b13f2064bb Translated using Weblate (Russian)
Currently translated at 56.9% (676 of 1188 strings)

Co-authored-by: Dimlbur <Dimlbur@users.noreply.translations.metabrainz.org>
Translate-URL: https://translations.metabrainz.org/projects/picard/3/app/ru/
Translation: Picard/App
2024-04-27 10:42:27 +00:00
Laurent Monin
559f364fcc Add missing header to const/defaults.py
Copied from const/__init__.py where most entries were before
2024-04-26 22:43:01 +02:00
Laurent Monin
ce5ed9dbcf Merge pull request #2435 from zas/comment_options
Add header & comment to new options.py
2024-04-26 22:38:41 +02:00
Laurent Monin
4c6cb1db29 Rephrasing
Co-authored-by: Bob Swift <bswift@rsds.ca>
2024-04-26 21:45:11 +02:00
Laurent Monin
219aed5b21 Add header & comment to new options.py 2024-04-26 21:11:21 +02:00
Laurent Monin
64f8d47c36 Merge pull request #2433 from zas/centralize_options
Move option declarations to picard/options.py and introduce const.defaults
2024-04-26 19:27:07 +02:00
Laurent Monin
e24d4f7e8a Move remaining DEFAULT_* constants to const.defaults
Some imports are made locally to avoid circular import issues (mainly in `util` module)
2024-04-26 18:11:51 +02:00
Laurent Monin
2af3fa6fea Move ItemViews persist options to options.py 2024-04-26 17:29:00 +02:00
Laurent Monin
7902a096e2 Remove last traces of options 2024-04-26 17:13:09 +02:00
Laurent Monin
0eb5349882 Cache known option names
`profile_groups_all_settings()` is used mainly in `SettingConfigSection` getter & setter
so performance is important
2024-04-26 17:07:36 +02:00
Laurent Monin
34b046fe31 Drop class UserProfileGroups, use module level methods 2024-04-26 16:54:54 +02:00
Laurent Monin
5540f2fa0e More consistent naming 2024-04-26 16:22:08 +02:00