Refresh global search when toggling settings, if there is a search
This commit is contained in:
@@ -208,6 +208,12 @@ class GuiProjectSearch(QWidget):
|
|||||||
self.searchResult.clear()
|
self.searchResult.clear()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def refreshCurrentSearch(self) -> None:
|
||||||
|
"""Refresh the search if there is one."""
|
||||||
|
if self.searchResult.topLevelItemCount() > 0:
|
||||||
|
self._processSearch()
|
||||||
|
return
|
||||||
|
|
||||||
##
|
##
|
||||||
# Events
|
# Events
|
||||||
##
|
##
|
||||||
@@ -298,18 +304,21 @@ class GuiProjectSearch(QWidget):
|
|||||||
def _toggleCase(self, state: bool) -> None:
|
def _toggleCase(self, state: bool) -> None:
|
||||||
"""Enable/disable case sensitive mode."""
|
"""Enable/disable case sensitive mode."""
|
||||||
CONFIG.searchProjCase = state
|
CONFIG.searchProjCase = state
|
||||||
|
self.refreshCurrentSearch()
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot(bool)
|
@pyqtSlot(bool)
|
||||||
def _toggleWord(self, state: bool) -> None:
|
def _toggleWord(self, state: bool) -> None:
|
||||||
"""Enable/disable whole word search mode."""
|
"""Enable/disable whole word search mode."""
|
||||||
CONFIG.searchProjWord = state
|
CONFIG.searchProjWord = state
|
||||||
|
self.refreshCurrentSearch()
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot(bool)
|
@pyqtSlot(bool)
|
||||||
def _toggleRegEx(self, state: bool) -> None:
|
def _toggleRegEx(self, state: bool) -> None:
|
||||||
"""Enable/disable regular expression search mode."""
|
"""Enable/disable regular expression search mode."""
|
||||||
CONFIG.searchProjRegEx = state
|
CONFIG.searchProjRegEx = state
|
||||||
|
self.refreshCurrentSearch()
|
||||||
return
|
return
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class SharedData(QObject):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def saveEditor(self, tHandle: str | None = None) -> None:
|
def saveEditor(self, tHandle: str | None = None) -> None:
|
||||||
"""Save editor content, optionally a specific document."""
|
"""Save the editor content, optionally a specific document."""
|
||||||
docEditor = self.mainGui.docEditor
|
docEditor = self.mainGui.docEditor
|
||||||
if (
|
if (
|
||||||
self.hasProject and docEditor.docHandle
|
self.hasProject and docEditor.docHandle
|
||||||
|
|||||||
Reference in New Issue
Block a user