Make some minor changes and update test coverage
This commit is contained in:
@@ -2526,12 +2526,14 @@ class GuiDocEditSearch(QFrame):
|
||||
# Slots
|
||||
##
|
||||
|
||||
@pyqtSlot()
|
||||
def _doClose(self):
|
||||
"""Hide the search/replace bar.
|
||||
"""
|
||||
self.closeSearch()
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
def _doSearch(self):
|
||||
"""Call the search action function for the document editor.
|
||||
"""
|
||||
@@ -2542,12 +2544,14 @@ class GuiDocEditSearch(QFrame):
|
||||
self.docEditor.findNext()
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
def _doReplace(self):
|
||||
"""Call the replace action function for the document editor.
|
||||
"""
|
||||
self.docEditor.replaceNext()
|
||||
return
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def _doToggleReplace(self, theState):
|
||||
"""Toggle the show/hide of the replace box.
|
||||
"""
|
||||
@@ -2562,36 +2566,42 @@ class GuiDocEditSearch(QFrame):
|
||||
self.docEditor.updateDocMargins()
|
||||
return
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def _doToggleCase(self, theState):
|
||||
"""Enable/disable case sensitive mode.
|
||||
"""
|
||||
self.isCaseSense = theState
|
||||
return
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def _doToggleWord(self, theState):
|
||||
"""Enable/disable whole word search mode.
|
||||
"""
|
||||
self.isWholeWord = theState
|
||||
return
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def _doToggleRegEx(self, theState):
|
||||
"""Enable/disable regular expression search mode.
|
||||
"""
|
||||
self.isRegEx = theState
|
||||
return
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def _doToggleLoop(self, theState):
|
||||
"""Enable/disable looping the search.
|
||||
"""
|
||||
self.doLoop = theState
|
||||
return
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def _doToggleProject(self, theState):
|
||||
"""Enable/disable continuing search in next project file.
|
||||
"""
|
||||
self.doNextFile = theState
|
||||
return
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def _doToggleMatchCap(self, theState):
|
||||
"""Enable/disable preserving capitalisation when replacing.
|
||||
"""
|
||||
@@ -2804,18 +2814,21 @@ class GuiDocEditHeader(QWidget):
|
||||
# Slots
|
||||
##
|
||||
|
||||
@pyqtSlot()
|
||||
def _editDocument(self):
|
||||
"""Open the edit item dialog from the main GUI.
|
||||
"""
|
||||
self.mainGui.editItemLabel(self._docHandle)
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
def _searchDocument(self):
|
||||
"""Toggle the visibility of the search box.
|
||||
"""
|
||||
self.docEditor.toggleSearch()
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
def _closeDocument(self):
|
||||
"""Trigger the close editor on the main window.
|
||||
"""
|
||||
@@ -2826,6 +2839,7 @@ class GuiDocEditHeader(QWidget):
|
||||
self.minmaxButton.setVisible(False)
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
def _minmaxDocument(self):
|
||||
"""Switch on or off Focus Mode.
|
||||
"""
|
||||
|
||||
@@ -889,12 +889,14 @@ class GuiDocViewHeader(QWidget):
|
||||
# Slots
|
||||
##
|
||||
|
||||
@pyqtSlot()
|
||||
def _closeDocument(self):
|
||||
"""Trigger the close editor/viewer on the main window.
|
||||
"""
|
||||
self.mainGui.closeDocViewer()
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
def _refreshDocument(self):
|
||||
"""Reload the content of the document.
|
||||
"""
|
||||
@@ -1124,6 +1126,7 @@ class GuiDocViewFooter(QWidget):
|
||||
# Slots
|
||||
##
|
||||
|
||||
@pyqtSlot()
|
||||
def _doShowHide(self):
|
||||
"""Toggle the expand/collapse of the panel.
|
||||
"""
|
||||
@@ -1131,6 +1134,7 @@ class GuiDocViewFooter(QWidget):
|
||||
self.viewMeta.setVisible(not isVisible)
|
||||
return
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def _doToggleSticky(self, theState):
|
||||
"""Toggle the sticky flag for the reference panel.
|
||||
"""
|
||||
@@ -1140,6 +1144,7 @@ class GuiDocViewFooter(QWidget):
|
||||
self.viewMeta.refreshReferences(self.docViewer.docHandle())
|
||||
return
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def _doToggleComments(self, theState):
|
||||
"""Toggle the view comment button and reload the document.
|
||||
"""
|
||||
@@ -1147,6 +1152,7 @@ class GuiDocViewFooter(QWidget):
|
||||
self.docViewer.reloadText()
|
||||
return
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def _doToggleSynopsis(self, theState):
|
||||
"""Toggle the view synopsis button and reload the document.
|
||||
"""
|
||||
|
||||
@@ -246,12 +246,9 @@ class GuiTheme:
|
||||
# Icons
|
||||
self.iconCache.loadTheme(self.themeIcons)
|
||||
|
||||
# Apply Styles
|
||||
qApp.setPalette(self._guiPalette)
|
||||
|
||||
# Update Dependant Colours
|
||||
backCol = qApp.palette().window().color()
|
||||
textCol = qApp.palette().windowText().color()
|
||||
backCol = self._guiPalette.window().color()
|
||||
textCol = self._guiPalette.windowText().color()
|
||||
|
||||
backLCol = backCol.lightnessF()
|
||||
textLCol = textCol.lightnessF()
|
||||
@@ -263,6 +260,9 @@ class GuiTheme:
|
||||
|
||||
self.helpText = [int(255*helpLCol)]*3
|
||||
|
||||
# Apply Styles
|
||||
qApp.setPalette(self._guiPalette)
|
||||
|
||||
return True
|
||||
|
||||
def loadSyntax(self):
|
||||
|
||||
Reference in New Issue
Block a user