mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-02-02 08:09:13 +00:00
ui: recent libraries list improvements (#881)
* ui: improve missing library message * ui: update recent library max to 10
This commit is contained in:
committed by
GitHub
parent
13afb0f664
commit
33e6bc180d
@@ -1754,7 +1754,7 @@ class QtDriver(DriverMixin, QObject):
|
||||
|
||||
def update_libs_list(self, path: Path | str):
|
||||
"""Add library to list in SettingItems.LIBS_LIST."""
|
||||
item_limit: int = 5
|
||||
item_limit: int = 10
|
||||
path = Path(path)
|
||||
|
||||
self.cached_values.beginGroup(SettingItems.LIBS_LIST)
|
||||
@@ -1858,8 +1858,18 @@ class QtDriver(DriverMixin, QObject):
|
||||
open_status: LibraryStatus | None = None
|
||||
try:
|
||||
open_status = self.lib.open_library(path)
|
||||
except ValueError as e:
|
||||
logger.warning(e)
|
||||
open_status = LibraryStatus(
|
||||
success=False,
|
||||
library_path=path,
|
||||
message=Translations["menu.file.missing_library.title"],
|
||||
msg_description=Translations.format(
|
||||
"menu.file.missing_library.message", library=library_dir_display
|
||||
),
|
||||
)
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
logger.error(e)
|
||||
open_status = LibraryStatus(
|
||||
success=False, library_path=path, message=type(e).__name__, msg_description=str(e)
|
||||
)
|
||||
|
||||
@@ -198,6 +198,8 @@
|
||||
"menu.edit": "Edit",
|
||||
"menu.file.clear_recent_libraries": "Clear Recent",
|
||||
"menu.file.close_library": "&Close Library",
|
||||
"menu.file.missing_library.message": "The location of the library \"{library}\" cannot be found.",
|
||||
"menu.file.missing_library.title": "Missing Library",
|
||||
"menu.file.new_library": "New Library",
|
||||
"menu.file.open_create_library": "&Open/Create Library",
|
||||
"menu.file.open_library": "Open Library",
|
||||
|
||||
Reference in New Issue
Block a user