mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-07-18 19:46:19 +02:00
feat: add setting to open edit window when creating tags
This commit is contained in:
@@ -30,7 +30,6 @@ class TagSuggestBox(SuggestBox[Tag]):
|
||||
super().__init__(driver, view=view or SuggestBoxView())
|
||||
self._driver = driver
|
||||
self._lib = self._driver.lib
|
||||
self._edit_on_create = self._driver.settings.edit_tag_on_create
|
||||
|
||||
@override
|
||||
def on_item_create(self) -> None:
|
||||
@@ -43,7 +42,7 @@ class TagSuggestBox(SuggestBox[Tag]):
|
||||
"""
|
||||
query: str = self._layout.search_field.text()
|
||||
|
||||
if self._edit_on_create:
|
||||
if self._driver.settings.edit_tag_on_create:
|
||||
panel: BuildTagPanel = BuildTagPanel(self._lib)
|
||||
modal: PanelModal = PanelModal(
|
||||
panel, Translations["tag.new"], Translations["tag.new"], is_savable=True
|
||||
|
||||
@@ -74,10 +74,10 @@ class GlobalSettings(BaseModel):
|
||||
infinite_scroll: bool = Field(default=True)
|
||||
show_filepath: ShowFilepathOption = Field(default=ShowFilepathOption.DEFAULT)
|
||||
tag_click_action: TagClickActionOption = Field(default=TagClickActionOption.DEFAULT)
|
||||
edit_tag_on_create: bool = Field(default=False)
|
||||
theme: Theme = Field(default=Theme.SYSTEM)
|
||||
splash: Splash = Field(default=Splash.DEFAULT)
|
||||
windows_start_command: bool = Field(default=False)
|
||||
edit_tag_on_create: bool = Field(default=False)
|
||||
|
||||
date_format: str = Field(default="%x")
|
||||
hour_format: bool = Field(default=True)
|
||||
|
||||
@@ -216,6 +216,13 @@ class SettingsPanel(PanelWidget):
|
||||
Translations["settings.tag_click_action.label"], self.tag_click_action_combobox
|
||||
)
|
||||
|
||||
# Open Edit Window When Creating Tag
|
||||
self.edit_tag_on_create_checkbox = QCheckBox()
|
||||
self.edit_tag_on_create_checkbox.setChecked(self.driver.settings.edit_tag_on_create)
|
||||
form_layout.addRow(
|
||||
Translations["settings.edit_tag_on_create"], self.edit_tag_on_create_checkbox
|
||||
)
|
||||
|
||||
# TODO: Implement Library Settings
|
||||
def __build_library_settings(self): # pyright: ignore[reportUnusedFunction]
|
||||
form_layout = QFormLayout(self.library_settings_container)
|
||||
@@ -366,6 +373,7 @@ class SettingsPanel(PanelWidget):
|
||||
"show_filepath": self.filepath_combobox.currentData(),
|
||||
"theme": self.theme_combobox.currentData(),
|
||||
"tag_click_action": self.tag_click_action_combobox.currentData(),
|
||||
"edit_tag_on_create": self.edit_tag_on_create_checkbox.isChecked(),
|
||||
"date_format": self.dateformat_combobox.currentData(),
|
||||
"hour_format": self.hourformat_checkbox.isChecked(),
|
||||
"zero_padding": self.zeropadding_checkbox.isChecked(),
|
||||
@@ -388,6 +396,7 @@ class SettingsPanel(PanelWidget):
|
||||
driver.settings.show_filepath = settings["show_filepath"]
|
||||
driver.settings.theme = settings["theme"]
|
||||
driver.settings.tag_click_action = settings["tag_click_action"]
|
||||
driver.settings.edit_tag_on_create = settings["edit_tag_on_create"]
|
||||
driver.settings.date_format = settings["date_format"]
|
||||
driver.settings.hour_format = settings["hour_format"]
|
||||
driver.settings.zero_padding = settings["zero_padding"]
|
||||
|
||||
@@ -316,6 +316,7 @@
|
||||
"settings.dateformat.international": "International",
|
||||
"settings.dateformat.label": "Date Format",
|
||||
"settings.dateformat.system": "System",
|
||||
"settings.edit_tag_on_create": "Edit Tag After Creation",
|
||||
"settings.filepath.label": "Filepath Visibility",
|
||||
"settings.filepath.option.full": "Show Full Paths",
|
||||
"settings.filepath.option.name": "Show Filenames Only",
|
||||
|
||||
Reference in New Issue
Block a user