Fixed issues caused by the signal/slot connection changes.

Sun, 09 Mar 2014 12:16:00 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 09 Mar 2014 12:16:00 +0100
changeset 3346
39f9273ebd61
parent 3345
071afe8be2a1
child 3349
2a034a7f1f54

Fixed issues caused by the signal/slot connection changes.

APIs/Python3/eric5.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/eric5.ViewManager.ViewManager.html file | annotate | diff | comparison | revisions
ViewManager/ViewManager.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Sat Mar 08 20:09:41 2014 +0100
+++ b/APIs/Python3/eric5.api	Sun Mar 09 12:16:00 2014 +0100
@@ -9135,7 +9135,7 @@
 eric5.ViewManager.ViewManager.ViewManager.newEditor?4()
 eric5.ViewManager.ViewManager.ViewManager.newEditorView?4(fn, caller, filetype="")
 eric5.ViewManager.ViewManager.ViewManager.nextSplit?4()
-eric5.ViewManager.ViewManager.ViewManager.openFiles?4(prog=None)
+eric5.ViewManager.ViewManager.ViewManager.openFiles?4(prog)
 eric5.ViewManager.ViewManager.ViewManager.openSourceFile?4(fn, lineno=-1, filetype="", selStart=0, selEnd=0, pos=0)
 eric5.ViewManager.ViewManager.ViewManager.preferencesChanged?4()
 eric5.ViewManager.ViewManager.ViewManager.prevSplit?4()
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Sat Mar 08 20:09:41 2014 +0100
+++ b/Documentation/Help/source.qhp	Sun Mar 09 12:16:00 2014 +0100
@@ -12620,6 +12620,7 @@
       <keyword name="ViewManager.__nextTask" id="ViewManager.__nextTask" ref="eric5.ViewManager.ViewManager.html#ViewManager.__nextTask" />
       <keyword name="ViewManager.__nextUncovered" id="ViewManager.__nextUncovered" ref="eric5.ViewManager.ViewManager.html#ViewManager.__nextUncovered" />
       <keyword name="ViewManager.__nextWarning" id="ViewManager.__nextWarning" ref="eric5.ViewManager.ViewManager.html#ViewManager.__nextWarning" />
+      <keyword name="ViewManager.__openFiles" id="ViewManager.__openFiles" ref="eric5.ViewManager.ViewManager.html#ViewManager.__openFiles" />
       <keyword name="ViewManager.__openSourceFile" id="ViewManager.__openSourceFile" ref="eric5.ViewManager.ViewManager.html#ViewManager.__openSourceFile" />
       <keyword name="ViewManager.__previewEditor" id="ViewManager.__previewEditor" ref="eric5.ViewManager.ViewManager.html#ViewManager.__previewEditor" />
       <keyword name="ViewManager.__previousBookmark" id="ViewManager.__previousBookmark" ref="eric5.ViewManager.ViewManager.html#ViewManager.__previousBookmark" />
@@ -12665,10 +12666,12 @@
       <keyword name="ViewManager.__toggleAllChildren" id="ViewManager.__toggleAllChildren" ref="eric5.ViewManager.ViewManager.html#ViewManager.__toggleAllChildren" />
       <keyword name="ViewManager.__toggleBookmark" id="ViewManager.__toggleBookmark" ref="eric5.ViewManager.ViewManager.html#ViewManager.__toggleBookmark" />
       <keyword name="ViewManager.__toggleCurrent" id="ViewManager.__toggleCurrent" ref="eric5.ViewManager.ViewManager.html#ViewManager.__toggleCurrent" />
+      <keyword name="ViewManager.__unhighlight" id="ViewManager.__unhighlight" ref="eric5.ViewManager.ViewManager.html#ViewManager.__unhighlight" />
       <keyword name="ViewManager.__zoom" id="ViewManager.__zoom" ref="eric5.ViewManager.ViewManager.html#ViewManager.__zoom" />
       <keyword name="ViewManager.__zoomIn" id="ViewManager.__zoomIn" ref="eric5.ViewManager.ViewManager.html#ViewManager.__zoomIn" />
       <keyword name="ViewManager.__zoomOut" id="ViewManager.__zoomOut" ref="eric5.ViewManager.ViewManager.html#ViewManager.__zoomOut" />
       <keyword name="ViewManager.__zoomReset" id="ViewManager.__zoomReset" ref="eric5.ViewManager.ViewManager.html#ViewManager.__zoomReset" />
+      <keyword name="ViewManager.__zoomTo" id="ViewManager.__zoomTo" ref="eric5.ViewManager.ViewManager.html#ViewManager.__zoomTo" />
       <keyword name="ViewManager._addView" id="ViewManager._addView" ref="eric5.ViewManager.ViewManager.html#ViewManager._addView" />
       <keyword name="ViewManager._checkActions" id="ViewManager._checkActions" ref="eric5.ViewManager.ViewManager.html#ViewManager._checkActions" />
       <keyword name="ViewManager._getOpenFileFilter" id="ViewManager._getOpenFileFilter" ref="eric5.ViewManager.ViewManager.html#ViewManager._getOpenFileFilter" />
--- a/Documentation/Source/eric5.ViewManager.ViewManager.html	Sat Mar 08 20:09:41 2014 +0100
+++ b/Documentation/Source/eric5.ViewManager.ViewManager.html	Sun Mar 09 12:16:00 2014 +0100
@@ -474,6 +474,9 @@
 <td><a href="#ViewManager.__nextWarning">__nextWarning</a></td>
 <td>Private method to handle the next warning action.</td>
 </tr><tr>
+<td><a href="#ViewManager.__openFiles">__openFiles</a></td>
+<td>Private slot to open some files.</td>
+</tr><tr>
 <td><a href="#ViewManager.__openSourceFile">__openSourceFile</a></td>
 <td>Private method to open a file from the list of recently opened files.</td>
 </tr><tr>
@@ -609,6 +612,9 @@
 <td><a href="#ViewManager.__toggleCurrent">__toggleCurrent</a></td>
 <td>Private method to handle the toggle current fold action.</td>
 </tr><tr>
+<td><a href="#ViewManager.__unhighlight">__unhighlight</a></td>
+<td>Privat slot to switch of all highlights.</td>
+</tr><tr>
 <td><a href="#ViewManager.__zoom">__zoom</a></td>
 <td>Private method to handle the zoom action.</td>
 </tr><tr>
@@ -621,6 +627,9 @@
 <td><a href="#ViewManager.__zoomReset">__zoomReset</a></td>
 <td>Private method to reset the zoom factor.</td>
 </tr><tr>
+<td><a href="#ViewManager.__zoomTo">__zoomTo</a></td>
+<td>Private slot to zoom to a given value.</td>
+</tr><tr>
 <td><a href="#ViewManager._addView">_addView</a></td>
 <td>Protected method to add a view (i.e.</td>
 </tr><tr>
@@ -928,7 +937,7 @@
 <td>Public method to tile the managed windows.</td>
 </tr><tr>
 <td><a href="#ViewManager.unhighlight">unhighlight</a></td>
-<td>Public method to switch off all highlights.</td>
+<td>Public method to switch off all highlights or the highlight of the current editor.</td>
 </tr><tr>
 <td><a href="#ViewManager.zoomValueChanged">zoomValueChanged</a></td>
 <td>Public slot to handle changes of the zoom value.</td>
@@ -1490,6 +1499,11 @@
 <b>__nextWarning</b>(<i></i>)
 <p>
         Private method to handle the next warning action.
+</p><a NAME="ViewManager.__openFiles" ID="ViewManager.__openFiles"></a>
+<h4>ViewManager.__openFiles</h4>
+<b>__openFiles</b>(<i></i>)
+<p>
+        Private slot to open some files.
 </p><a NAME="ViewManager.__openSourceFile" ID="ViewManager.__openSourceFile"></a>
 <h4>ViewManager.__openSourceFile</h4>
 <b>__openSourceFile</b>(<i>act</i>)
@@ -1795,17 +1809,17 @@
 <b>__toggleCurrent</b>(<i></i>)
 <p>
         Private method to handle the toggle current fold action.
+</p><a NAME="ViewManager.__unhighlight" ID="ViewManager.__unhighlight"></a>
+<h4>ViewManager.__unhighlight</h4>
+<b>__unhighlight</b>(<i></i>)
+<p>
+        Privat slot to switch of all highlights.
 </p><a NAME="ViewManager.__zoom" ID="ViewManager.__zoom"></a>
 <h4>ViewManager.__zoom</h4>
-<b>__zoom</b>(<i>value=None</i>)
+<b>__zoom</b>(<i></i>)
 <p>
         Private method to handle the zoom action.
-</p><dl>
-<dt><i>value=</i></dt>
-<dd>
-zoom value to be set (integer)
-</dd>
-</dl><a NAME="ViewManager.__zoomIn" ID="ViewManager.__zoomIn"></a>
+</p><a NAME="ViewManager.__zoomIn" ID="ViewManager.__zoomIn"></a>
 <h4>ViewManager.__zoomIn</h4>
 <b>__zoomIn</b>(<i></i>)
 <p>
@@ -1820,7 +1834,17 @@
 <b>__zoomReset</b>(<i></i>)
 <p>
         Private method to reset the zoom factor.
-</p><a NAME="ViewManager._addView" ID="ViewManager._addView"></a>
+</p><a NAME="ViewManager.__zoomTo" ID="ViewManager.__zoomTo"></a>
+<h4>ViewManager.__zoomTo</h4>
+<b>__zoomTo</b>(<i>value</i>)
+<p>
+        Private slot to zoom to a given value.
+</p><dl>
+<dt><i>value</i></dt>
+<dd>
+zoom value to be set (integer)
+</dd>
+</dl><a NAME="ViewManager._addView" ID="ViewManager._addView"></a>
 <h4>ViewManager._addView</h4>
 <b>_addView</b>(<i>win, fn=None, noName=""</i>)
 <p>
@@ -2624,7 +2648,7 @@
         Public slot used to move to the next split.
 </p><a NAME="ViewManager.openFiles" ID="ViewManager.openFiles"></a>
 <h4>ViewManager.openFiles</h4>
-<b>openFiles</b>(<i>prog=None</i>)
+<b>openFiles</b>(<i>prog</i>)
 <p>
         Public slot to open some files.
 </p><dl>
@@ -3046,7 +3070,8 @@
 <h4>ViewManager.unhighlight</h4>
 <b>unhighlight</b>(<i>current=False</i>)
 <p>
-        Public method to switch off all highlights.
+        Public method to switch off all highlights or the highlight of
+        the current editor.
 </p><dl>
 <dt><i>current</i></dt>
 <dd>
--- a/ViewManager/ViewManager.py	Sat Mar 08 20:09:41 2014 +0100
+++ b/ViewManager/ViewManager.py	Sun Mar 09 12:16:00 2014 +0100
@@ -9,7 +9,7 @@
 
 import os
 
-from PyQt4.QtCore import pyqtSlot, pyqtSignal, QSignalMapper, QTimer, \
+from PyQt4.QtCore import pyqtSignal, QSignalMapper, QTimer, \
     QFileInfo, QRegExp, QObject, Qt
 from PyQt4.QtGui import QColor, QKeySequence, QLineEdit, QToolBar, \
     QWidgetAction, QDialog, QApplication, QMenu, QPalette, QComboBox, QPixmap
@@ -264,7 +264,7 @@
         self.sbLang = sbLanguage
         self.sbEol = sbEol
         self.sbZoom = sbZoom
-        self.sbZoom.valueChanged.connect(self.__zoom)
+        self.sbZoom.valueChanged.connect(self.__zoomTo)
         self.__setSbFile(zoom=0)
         
         self.sbLang.clicked.connect(self.__showLanguagesMenu)
@@ -593,7 +593,7 @@
             """<p>You will be asked for the name of a file to be opened"""
             """ in an editor window.</p>"""
         ))
-        self.openAct.triggered.connect(self.openFiles)
+        self.openAct.triggered.connect(self.__openFiles)
         self.fileActions.append(self.openAct)
         
         self.closeActGrp = createActionGroup(self)
@@ -3368,7 +3368,7 @@
             """<b>Remove all highlights</b>"""
             """<p>Remove the highlights of all editors.</p>"""
         ))
-        self.unhighlightAct.triggered.connect(self.unhighlight)
+        self.unhighlightAct.triggered.connect(self.__unhighlight)
         self.viewActions.append(self.unhighlightAct)
         
         self.newDocumentViewAct = E5Action(
@@ -4145,34 +4145,34 @@
     ## Methods and slots that deal with file and window handling
     ##################################################################
     
-    @pyqtSlot()
-    def openFiles(self, prog=None):
+    def __openFiles(self):
+        """
+        Private slot to open some files.
+        """
+        # set the cwd of the dialog based on the following search criteria:
+        #     1: Directory of currently active editor
+        #     2: Directory of currently active project
+        #     3: CWD
+        import QScintilla.Lexers
+        filter = self._getOpenFileFilter()
+        progs = E5FileDialog.getOpenFileNamesAndFilter(
+            self.ui,
+            QApplication.translate('ViewManager', "Open files"),
+            self._getOpenStartDir(),
+            QScintilla.Lexers.getOpenFileFiltersList(True, True),
+            filter)[0]
+        for prog in progs:
+            self.openFile(prog)
+    
+    def openFiles(self, prog):
         """
         Public slot to open some files.
         
         @param prog name of file to be opened (string)
         """
-        # Get the file name if one wasn't specified.
-        if prog is None:
-            # set the cwd of the dialog based on the following search criteria:
-            #     1: Directory of currently active editor
-            #     2: Directory of currently active project
-            #     3: CWD
-            import QScintilla.Lexers
-            filter = self._getOpenFileFilter()
-            progs = E5FileDialog.getOpenFileNamesAndFilter(
-                self.ui,
-                QApplication.translate('ViewManager', "Open files"),
-                self._getOpenStartDir(),
-                QScintilla.Lexers.getOpenFileFiltersList(True, True),
-                filter)[0]
-        else:
-            progs = [prog]
-        
-        for prog in progs:
-            prog = Utilities.normabspath(prog)
-            # Open up the new files.
-            self.openSourceFile(prog)
+        prog = Utilities.normabspath(prog)
+        # Open up the new files.
+        self.openSourceFile(prog)
 
     def checkDirty(self, editor, autosave=False):
         """
@@ -4565,10 +4565,16 @@
             pixmap = QPixmap()
         return pixmap
         
-    @pyqtSlot()
+    def __unhighlight(self):
+        """
+        Privat slot to switch of all highlights.
+        """
+        self.unhighlight()
+        
     def unhighlight(self, current=False):
         """
-        Public method to switch off all highlights.
+        Public method to switch off all highlights or the highlight of
+        the current editor.
         
         @param current flag indicating only the current editor should be
             unhighlighted (boolean)
@@ -5584,27 +5590,35 @@
                 aw.zoomTo(0)
                 self.sbZoom.setValue(aw.getZoom())
         
-    @pyqtSlot()
-    @pyqtSlot(int)
-    def __zoom(self, value=None):
+    def __zoom(self):
         """
         Private method to handle the zoom action.
-        
-        @keyparam value zoom value to be set (integer)
         """
         if QApplication.focusWidget() == e5App().getObject("Shell"):
             aw = e5App().getObject("Shell")
         else:
             aw = self.activeWindow()
         if aw:
-            if value is None:
-                from QScintilla.ZoomDialog import ZoomDialog
-                dlg = ZoomDialog(aw.getZoom(), self.ui, None, True)
-                if dlg.exec_() == QDialog.Accepted:
-                    value = dlg.getZoomSize()
+            from QScintilla.ZoomDialog import ZoomDialog
+            dlg = ZoomDialog(aw.getZoom(), self.ui, None, True)
+            if dlg.exec_() == QDialog.Accepted:
+                value = dlg.getZoomSize()
             if value is not None:
-                aw.zoomTo(value)
-                self.sbZoom.setValue(aw.getZoom())
+                self.__zoomTo(value)
+        
+    def __zoomTo(self, value):
+        """
+        Private slot to zoom to a given value.
+        
+        @param value zoom value to be set (integer)
+        """
+        if QApplication.focusWidget() == e5App().getObject("Shell"):
+            aw = e5App().getObject("Shell")
+        else:
+            aw = self.activeWindow()
+        if aw:
+            aw.zoomTo(value)
+            self.sbZoom.setValue(aw.getZoom())
         
     def zoomValueChanged(self, value):
         """

eric ide

mercurial