mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-02-02 08:09:13 +00:00
remove obsolete Search Mode UI and related code
This commit is contained in:
@@ -46,13 +46,6 @@ class TagColor(enum.IntEnum):
|
||||
OLIVE = 37
|
||||
|
||||
|
||||
class SearchMode(enum.IntEnum):
|
||||
"""Operational modes for item searching."""
|
||||
|
||||
AND = 0
|
||||
OR = 1
|
||||
|
||||
|
||||
class ItemType(enum.Enum):
|
||||
ENTRY = 0
|
||||
COLLATION = 1
|
||||
@@ -77,7 +70,6 @@ class FilterState:
|
||||
# these should remain
|
||||
page_index: int | None = 0
|
||||
page_size: int | None = 500
|
||||
search_mode: SearchMode = SearchMode.AND # TODO this can be removed?
|
||||
|
||||
# these should be erased on update
|
||||
# whole path
|
||||
|
||||
@@ -74,14 +74,6 @@ class Ui_MainWindow(QMainWindow):
|
||||
spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||
self.horizontalLayout_3.addItem(spacerItem)
|
||||
|
||||
# Search type selector
|
||||
self.comboBox_2 = QComboBox(self.centralwidget)
|
||||
self.comboBox_2.setMinimumSize(QSize(165, 0))
|
||||
self.comboBox_2.setObjectName("comboBox_2")
|
||||
self.comboBox_2.addItem("")
|
||||
self.comboBox_2.addItem("")
|
||||
self.horizontalLayout_3.addWidget(self.comboBox_2)
|
||||
|
||||
# Thumbnail Size placeholder
|
||||
self.thumb_size_combobox = QComboBox(self.centralwidget)
|
||||
self.thumb_size_combobox.setObjectName(u"thumbSizeComboBox")
|
||||
@@ -214,9 +206,6 @@ class Ui_MainWindow(QMainWindow):
|
||||
self.searchButton.setText(
|
||||
QCoreApplication.translate("MainWindow", u"Search", None))
|
||||
|
||||
# Search type selector
|
||||
self.comboBox_2.setItemText(0, QCoreApplication.translate("MainWindow", "And (Includes All Tags)"))
|
||||
self.comboBox_2.setItemText(1, QCoreApplication.translate("MainWindow", "Or (Includes Any Tag)"))
|
||||
self.thumb_size_combobox.setCurrentText("")
|
||||
|
||||
# Thumbnail size selector
|
||||
|
||||
@@ -70,7 +70,6 @@ from src.core.library.alchemy.enums import (
|
||||
FieldTypeEnum,
|
||||
FilterState,
|
||||
ItemType,
|
||||
SearchMode,
|
||||
)
|
||||
from src.core.library.alchemy.fields import _FieldID
|
||||
from src.core.library.alchemy.library import LibraryStatus
|
||||
@@ -522,11 +521,6 @@ class QtDriver(DriverMixin, QObject):
|
||||
FilterState.from_search_query(self.main_window.searchField.text())
|
||||
)
|
||||
)
|
||||
# Search Type Selector
|
||||
search_type_selector: QComboBox = self.main_window.comboBox_2
|
||||
search_type_selector.currentIndexChanged.connect(
|
||||
lambda: self.set_search_type(SearchMode(search_type_selector.currentIndex()))
|
||||
)
|
||||
# Thumbnail Size ComboBox
|
||||
thumb_size_combobox: QComboBox = self.main_window.thumb_size_combobox
|
||||
for size in self.thumb_sizes:
|
||||
@@ -1144,14 +1138,6 @@ class QtDriver(DriverMixin, QObject):
|
||||
self.pages_count, self.filter.page_index, emit=False
|
||||
)
|
||||
|
||||
def set_search_type(self, mode: SearchMode = SearchMode.AND):
|
||||
self.filter_items(
|
||||
FilterState( # TODO TSQLANG deal with this
|
||||
search_mode=mode,
|
||||
path=self.main_window.searchField.text(),
|
||||
)
|
||||
)
|
||||
|
||||
def remove_recent_library(self, item_key: str):
|
||||
self.settings.beginGroup(SettingItems.LIBS_LIST)
|
||||
self.settings.remove(item_key)
|
||||
|
||||
Reference in New Issue
Block a user