Skip to content

Commit 3ebbcbf

Browse files
committed
fix: fix things that broke during merge
1 parent a30de72 commit 3ebbcbf

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

tagstudio/src/core/settings/tssettings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class TSSettings(BaseModel):
1515
open_last_loaded_on_startup: bool = Field(default=False)
1616
show_library_list: bool = Field(default=True)
1717
autoplay: bool = Field(default=False)
18+
show_filenames_in_grid: bool = Field(default=False)
1819

1920
filename: str = Field()
2021

@@ -38,7 +39,7 @@ def to_dict(self) -> dict[str, any]:
3839

3940
return d
4041

41-
def save(self, path: Path | str | None) -> None:
42+
def save(self, path: Path | str | None = None) -> None:
4243
if isinstance(path, str):
4344
path = Path(path)
4445

tagstudio/src/qt/modals/settings_modal.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,23 @@ def __init__(self, settings: tssettings):
6666
)
6767

6868
# ---
69-
self.main.addLayout(self.darkMode_Row)
69+
self.show_filenames_Label = QLabel()
70+
self.show_filenames_Value = QCheckBox()
71+
self.show_filenames_Row = QHBoxLayout()
72+
self.show_filenames_Row.addWidget(self.show_filenames_Label)
73+
self.show_filenames_Row.addWidget(self.show_filenames_Value)
74+
# TODO: use value from translations
75+
self.show_filenames_Label.setText("Show filenames in grid")
76+
self.show_filenames_Value.setChecked(self.tempSettings.show_filenames_in_grid)
77+
78+
self.show_filenames_Value.stateChanged.connect(
79+
lambda state: setattr(self.tempSettings, "show_filenames_in_grid", bool(state))
80+
)
81+
# ---
7082
self.main.addLayout(self.language_Row)
83+
self.main.addLayout(self.darkMode_Row)
7184
self.main.addLayout(self.show_library_list_Row)
85+
self.main.addLayout(self.show_filenames_Row)
7286

7387
def set_property(self, prop_name: str, value: any) -> None:
7488
setattr(self.tempSettings, prop_name, value)

tagstudio/src/qt/ts_qt.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,9 @@ def start(self) -> None:
321321

322322
open_on_start_action = QAction("Open Library on Start", self)
323323
open_on_start_action.setCheckable(True)
324-
open_on_start_action.setChecked(
325-
bool(self.settings.value(SettingItems.START_LOAD_LAST, defaultValue=True, type=bool))
326-
)
324+
open_on_start_action.setChecked(self.settings.open_last_loaded_on_startup)
327325
open_on_start_action.triggered.connect(
328-
lambda checked: self.settings.setValue(SettingItems.START_LOAD_LAST, checked)
326+
lambda checked: setattr(self.settings, "open_last_loaded_on_startup", checked)
329327
)
330328
file_menu.addAction(open_on_start_action)
331329

@@ -382,7 +380,7 @@ def start(self) -> None:
382380
check_action.triggered.connect(
383381
lambda checked: setattr(self.settings, "open_last_loaded_on_startup", checked)
384382
)
385-
window_menu.addAction(check_action)
383+
# window_menu.addAction(check_action)
386384

387385
# Tools Menu ===========================================================
388386
def create_fix_unlinked_entries_modal():
@@ -426,7 +424,7 @@ def create_dupe_files_modal():
426424
self.toggle_libs_list(checked),
427425
)
428426
)
429-
window_menu.addAction(show_libs_list_action)
427+
# window_menu.addAction(show_libs_list_action)
430428

431429
def create_folders_tags_modal():
432430
if not hasattr(self, "folders_modal"):
@@ -595,7 +593,7 @@ def close_library(self, is_shutdown: bool = False):
595593
start_time = time.time()
596594

597595
self.cache.last_library = self.lib.library_dir
598-
self.settings.sync()
596+
self.settings.save()
599597

600598
self.lib.close()
601599

@@ -915,9 +913,7 @@ def _init_thumb_grid(self):
915913
self,
916914
(self.thumb_size, self.thumb_size),
917915
grid_idx,
918-
bool(
919-
self.settings.value(SettingItems.SHOW_FILENAMES, defaultValue=True, type=bool)
920-
),
916+
bool(self.settings.show_filenames_in_grid),
921917
)
922918

923919
layout.addWidget(item_thumb)

0 commit comments

Comments
 (0)