Shell, ShellWindow, LogViewer: fixed the layouts, an ambigous shortcut and added a missing method.

Sat, 30 Jun 2018 16:58:20 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 30 Jun 2018 16:58:20 +0200
changeset 6387
a168b5f26a14
parent 6386
91dc4fa9bc9c
child 6389
cf4d99cf660f

Shell, ShellWindow, LogViewer: fixed the layouts, an ambigous shortcut and added a missing method.

APIs/Python3/eric6.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric6.QScintilla.ShellWindow.html file | annotate | diff | comparison | revisions
QScintilla/Shell.py file | annotate | diff | comparison | revisions
QScintilla/ShellWindow.py file | annotate | diff | comparison | revisions
UI/LogView.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric6.api	Sat Jun 30 15:51:40 2018 +0200
+++ b/APIs/Python3/eric6.api	Sat Jun 30 16:58:20 2018 +0200
@@ -9169,6 +9169,7 @@
 eric6.QScintilla.ShellWindow.ShellWindow.closeEvent?4(event)
 eric6.QScintilla.ShellWindow.ShellWindow.getAPIsManager?4()
 eric6.QScintilla.ShellWindow.ShellWindow.quit?4()
+eric6.QScintilla.ShellWindow.ShellWindow.showFind?4(txt="")
 eric6.QScintilla.ShellWindow.ShellWindow?1(parent=None, name=None)
 eric6.QScintilla.SortOptionsDialog.SortOptionsDialog.getData?4()
 eric6.QScintilla.SortOptionsDialog.SortOptionsDialog?1(parent=None)
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Sat Jun 30 15:51:40 2018 +0200
+++ b/Documentation/Help/source.qhp	Sat Jun 30 16:58:20 2018 +0200
@@ -14294,6 +14294,7 @@
       <keyword name="ShellWindow.closeEvent" id="ShellWindow.closeEvent" ref="eric6.QScintilla.ShellWindow.html#ShellWindow.closeEvent" />
       <keyword name="ShellWindow.getAPIsManager" id="ShellWindow.getAPIsManager" ref="eric6.QScintilla.ShellWindow.html#ShellWindow.getAPIsManager" />
       <keyword name="ShellWindow.quit" id="ShellWindow.quit" ref="eric6.QScintilla.ShellWindow.html#ShellWindow.quit" />
+      <keyword name="ShellWindow.showFind" id="ShellWindow.showFind" ref="eric6.QScintilla.ShellWindow.html#ShellWindow.showFind" />
       <keyword name="Shelve" id="Shelve" ref="eric6.Plugins.VcsPlugins.vcsMercurial.ShelveExtension.shelve.html#Shelve" />
       <keyword name="Shelve (Constructor)" id="Shelve (Constructor)" ref="eric6.Plugins.VcsPlugins.vcsMercurial.ShelveExtension.shelve.html#Shelve.__init__" />
       <keyword name="Shelve.__hgGetShelveNamesList" id="Shelve.__hgGetShelveNamesList" ref="eric6.Plugins.VcsPlugins.vcsMercurial.ShelveExtension.shelve.html#Shelve.__hgGetShelveNamesList" />
--- a/Documentation/Source/eric6.QScintilla.ShellWindow.html	Sat Jun 30 15:51:40 2018 +0200
+++ b/Documentation/Source/eric6.QScintilla.ShellWindow.html	Sat Jun 30 16:58:20 2018 +0200
@@ -158,6 +158,9 @@
 </tr><tr>
 <td><a href="#ShellWindow.quit">quit</a></td>
 <td>Public method to quit the application.</td>
+</tr><tr>
+<td><a href="#ShellWindow.showFind">showFind</a></td>
+<td>Public method to display the search widget.</td>
 </tr>
 </table>
 <h3>Static Methods</h3>
@@ -395,7 +398,17 @@
 <b>quit</b>(<i></i>)
 <p>
         Public method to quit the application.
-</p>
+</p><a NAME="ShellWindow.showFind" ID="ShellWindow.showFind"></a>
+<h4>ShellWindow.showFind</h4>
+<b>showFind</b>(<i>txt=""</i>)
+<p>
+        Public method to display the search widget.
+</p><dl>
+<dt><i>txt</i> (str)</dt>
+<dd>
+text to be shown in the combo
+</dd>
+</dl>
 <div align="right"><a href="#top">Up</a></div>
 <hr />
 </body></html>
\ No newline at end of file
--- a/QScintilla/Shell.py	Sat Jun 30 15:51:40 2018 +0200
+++ b/QScintilla/Shell.py	Sat Jun 30 16:58:20 2018 +0200
@@ -20,7 +20,7 @@
 from PyQt5.QtCore import pyqtSignal, QFileInfo, Qt, QEvent
 from PyQt5.QtGui import QClipboard, QPalette, QFont
 from PyQt5.QtWidgets import QDialog, QInputDialog, QApplication, QMenu, \
-    QWidget, QHBoxLayout, QVBoxLayout, QShortcut
+    QWidget, QHBoxLayout, QVBoxLayout, QShortcut, QSizePolicy
 from PyQt5.Qsci import QsciScintilla
 
 from E5Gui.E5Application import e5App
@@ -56,6 +56,8 @@
         
         from UI.SearchWidget import SearchWidget
         self.__searchWidget = SearchWidget(self.__shell, self, horizontal)
+        self.__searchWidget.setSizePolicy(QSizePolicy.Fixed,
+                                          QSizePolicy.Preferred)
         self.__searchWidget.hide()
         
         if horizontal:
@@ -2048,15 +2050,16 @@
             self.addActions(self.vm.editorActGrp.actions())
             self.addActions(self.vm.copyActGrp.actions())
             self.addActions(self.vm.viewActGrp.actions())
-            self.__searchShortcut = QShortcut(
-                self.vm.searchAct.shortcut(), self,
-                self.__find, self.__find)
-            self.__searchNextShortcut = QShortcut(
-                self.vm.searchNextAct.shortcut(), self,
-                self.__searchNext, self.__searchNext)
-            self.__searchPrevShortcut = QShortcut(
-                self.vm.searchPrevAct.shortcut(), self,
-                self.__searchPrev, self.__searchPrev)
+            if not self.__windowed:
+                self.__searchShortcut = QShortcut(
+                    self.vm.searchAct.shortcut(), self,
+                    self.__find, self.__find)
+                self.__searchNextShortcut = QShortcut(
+                    self.vm.searchNextAct.shortcut(), self,
+                    self.__searchNext, self.__searchNext)
+                self.__searchPrevShortcut = QShortcut(
+                    self.vm.searchPrevAct.shortcut(), self,
+                    self.__searchPrev, self.__searchPrev)
         
         try:
             self.vm.editActGrp.setEnabled(False)
@@ -2066,9 +2069,10 @@
             self.vm.searchActGrp.setEnabled(False)
         except AttributeError:
             pass
-        self.__searchShortcut.setEnabled(True)
-        self.__searchNextShortcut.setEnabled(True)
-        self.__searchPrevShortcut.setEnabled(True)
+        if not self.__windowed:
+            self.__searchShortcut.setEnabled(True)
+            self.__searchNextShortcut.setEnabled(True)
+            self.__searchPrevShortcut.setEnabled(True)
         self.setCaretWidth(self.caretWidth)
         self.setCursorFlashTime(QApplication.cursorFlashTime())
         
@@ -2084,9 +2088,10 @@
             self.vm.editorActGrp.setEnabled(False)
         except AttributeError:
             pass
-        self.__searchShortcut.setEnabled(False)
-        self.__searchNextShortcut.setEnabled(False)
-        self.__searchPrevShortcut.setEnabled(False)
+        if not self.__windowed:
+            self.__searchShortcut.setEnabled(False)
+            self.__searchNextShortcut.setEnabled(False)
+            self.__searchPrevShortcut.setEnabled(False)
         self.setCaretWidth(0)
         super(Shell, self).focusOutEvent(event)
         
@@ -2138,7 +2143,7 @@
         """
         self.__lastSearch = (txt, caseSensitive, wholeWord)
         ok = self.findFirst(
-            txt, False, caseSensitive, wholeWord, False, forward=True)
+            txt, False, caseSensitive, wholeWord, True, forward=True)
         self.searchStringFound.emit(ok)
     
     def __searchPrev(self):
@@ -2164,7 +2169,7 @@
         else:
             line, index = -1, -1
         ok = self.findFirst(
-            txt, False, caseSensitive, wholeWord, False,
+            txt, False, caseSensitive, wholeWord, True,
             forward=False, line=line, index=index)
         self.searchStringFound.emit(ok)
     
--- a/QScintilla/ShellWindow.py	Sat Jun 30 15:51:40 2018 +0200
+++ b/QScintilla/ShellWindow.py	Sat Jun 30 16:58:20 2018 +0200
@@ -960,6 +960,15 @@
         Private method to display the search widget.
         """
         txt = self.__shell.selectedText()
+        self.showFind(txt)
+    
+    def showFind(self, txt=""):
+        """
+        Public method to display the search widget.
+        
+        @param txt text to be shown in the combo
+        @type str
+        """
         self.__searchWidget.showFind(txt)
     
     def activeWindow(self):
--- a/UI/LogView.py	Sat Jun 30 15:51:40 2018 +0200
+++ b/UI/LogView.py	Sat Jun 30 16:58:20 2018 +0200
@@ -12,7 +12,7 @@
 from PyQt5.QtCore import Qt, pyqtSignal
 from PyQt5.QtGui import QBrush, QTextCursor, QTextDocument
 from PyQt5.QtWidgets import QTextEdit, QApplication, QMenu, QWidget, \
-    QHBoxLayout
+    QHBoxLayout, QSizePolicy
 
 from E5Gui.E5Application import e5App
 
@@ -41,6 +41,8 @@
         self.__logViewer = LogViewerEdit(self)
         from .SearchWidget import SearchWidget
         self.__searchWidget = SearchWidget(self.__logViewer, self)
+        self.__searchWidget.setSizePolicy(QSizePolicy.Fixed,
+                                          QSizePolicy.Preferred)
         self.__searchWidget.hide()
         
         self.__layout = QHBoxLayout(self)

eric ide

mercurial