Fixed the feedback of a changed zoom value from the editors, shell or terminal to the view manager.

Sun, 13 Jan 2013 19:11:18 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 13 Jan 2013 19:11:18 +0100
changeset 2347
a4a4d710ebe8
parent 2342
2a56a27a4021
child 2348
84756285e7af

Fixed the feedback of a changed zoom value from the editors, shell or terminal to the view manager.

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.QScintilla.QsciScintillaCompat.html file | annotate | diff | comparison | revisions
Documentation/Source/eric5.ViewManager.ViewManager.html file | annotate | diff | comparison | revisions
QScintilla/QsciScintillaCompat.py file | annotate | diff | comparison | revisions
UI/UserInterface.py file | annotate | diff | comparison | revisions
ViewManager/ViewManager.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Sun Jan 13 17:27:15 2013 +0100
+++ b/APIs/Python3/eric5.api	Sun Jan 13 19:11:18 2013 +0100
@@ -6991,6 +6991,7 @@
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.zoomIn?4(zoom=1)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.zoomOut?4(zoom=1)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.zoomTo?4(zoom)
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.zoomValueChanged?7
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat?1(parent=None)
 eric5.QScintilla.SearchReplaceWidget.SearchReplaceWidget.findNext?4()
 eric5.QScintilla.SearchReplaceWidget.SearchReplaceWidget.findPrev?4()
@@ -8558,6 +8559,7 @@
 eric5.ViewManager.ViewManager.ViewManager.textForFind?4(getCurrentWord=True)
 eric5.ViewManager.ViewManager.ViewManager.tile?4()
 eric5.ViewManager.ViewManager.ViewManager.unhighlight?4(current=False)
+eric5.ViewManager.ViewManager.ViewManager.zoomValueChanged?4(value)
 eric5.ViewManager.ViewManager.ViewManager?1()
 eric5.ViewManager.factory?4(parent, ui, dbs, pluginManager)
 eric5.compileUiFiles.compileUiDir?4(dir, recurse = False, map = None, ** compileUi_args)
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Sun Jan 13 17:27:15 2013 +0100
+++ b/Documentation/Help/source.qhp	Sun Jan 13 19:11:18 2013 +0100
@@ -11979,6 +11979,7 @@
       <keyword name="ViewManager.textForFind" id="ViewManager.textForFind" ref="eric5.ViewManager.ViewManager.html#ViewManager.textForFind" />
       <keyword name="ViewManager.tile" id="ViewManager.tile" ref="eric5.ViewManager.ViewManager.html#ViewManager.tile" />
       <keyword name="ViewManager.unhighlight" id="ViewManager.unhighlight" ref="eric5.ViewManager.ViewManager.html#ViewManager.unhighlight" />
+      <keyword name="ViewManager.zoomValueChanged" id="ViewManager.zoomValueChanged" ref="eric5.ViewManager.ViewManager.html#ViewManager.zoomValueChanged" />
       <keyword name="ViewManagerPlugins (Package)" id="ViewManagerPlugins (Package)" ref="index-eric5.Plugins.ViewManagerPlugins.html" />
       <keyword name="ViewProfileDialog" id="ViewProfileDialog" ref="eric5.Preferences.ViewProfileDialog.html#ViewProfileDialog" />
       <keyword name="ViewProfileDialog (Constructor)" id="ViewProfileDialog (Constructor)" ref="eric5.Preferences.ViewProfileDialog.html#ViewProfileDialog.__init__" />
--- a/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Sun Jan 13 17:27:15 2013 +0100
+++ b/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Sun Jan 13 19:11:18 2013 +0100
@@ -51,7 +51,13 @@
     This class implements all the functions, that were added to
     QsciScintilla incrementally. This class ensures compatibility
     to older versions of QsciScintilla.
-</p>
+</p><h3>Signals</h3>
+<dl>
+<dt>zoomValueChanged(int)</dt>
+<dd>
+emitted to signal a change of the zoom value
+</dd>
+</dl>
 <h3>Derived from</h3>
 QsciScintilla
 <h3>Class Attributes</h3>
@@ -792,7 +798,7 @@
 </p><dl>
 <dt>Returns:</dt>
 <dd>
-zoom factor (int)
+zoom factor (integer)
 </dd>
 </dl><a NAME="QsciScintillaCompat.hasIndicator" ID="QsciScintillaCompat.hasIndicator"></a>
 <h4>QsciScintillaCompat.hasIndicator</h4>
@@ -1260,7 +1266,7 @@
 </p><dl>
 <dt><i>zoom</i></dt>
 <dd>
-zoom factor increment
+zoom factor increment (integer)
 </dd>
 </dl><a NAME="QsciScintillaCompat.zoomOut" ID="QsciScintillaCompat.zoomOut"></a>
 <h4>QsciScintillaCompat.zoomOut</h4>
@@ -1270,7 +1276,7 @@
 </p><dl>
 <dt><i>zoom</i></dt>
 <dd>
-zoom factor decrement
+zoom factor decrement (integer)
 </dd>
 </dl><a NAME="QsciScintillaCompat.zoomTo" ID="QsciScintillaCompat.zoomTo"></a>
 <h4>QsciScintillaCompat.zoomTo</h4>
@@ -1280,7 +1286,7 @@
 </p><dl>
 <dt><i>zoom</i></dt>
 <dd>
-zoom factor
+zoom factor (integer)
 </dd>
 </dl>
 <div align="right"><a href="#top">Up</a></div>
--- a/Documentation/Source/eric5.ViewManager.ViewManager.html	Sun Jan 13 17:27:15 2013 +0100
+++ b/Documentation/Source/eric5.ViewManager.ViewManager.html	Sun Jan 13 19:11:18 2013 +0100
@@ -868,6 +868,9 @@
 </tr><tr>
 <td><a href="#ViewManager.unhighlight">unhighlight</a></td>
 <td>Public method to switch off all highlights.</td>
+</tr><tr>
+<td><a href="#ViewManager.zoomValueChanged">zoomValueChanged</a></td>
+<td>Public slot to handle changes of the zoom value.</td>
 </tr>
 </table>
 <h3>Static Methods</h3>
@@ -2843,6 +2846,16 @@
 flag indicating only the current editor should be unhighlighted
                 (boolean)
 </dd>
+</dl><a NAME="ViewManager.zoomValueChanged" ID="ViewManager.zoomValueChanged"></a>
+<h4>ViewManager.zoomValueChanged</h4>
+<b>zoomValueChanged</b>(<i>value</i>)
+<p>
+        Public slot to handle changes of the zoom value.
+</p><dl>
+<dt><i>value</i></dt>
+<dd>
+new zoom value (integer)
+</dd>
 </dl>
 <div align="right"><a href="#top">Up</a></div>
 <hr />
--- a/QScintilla/QsciScintillaCompat.py	Sun Jan 13 17:27:15 2013 +0100
+++ b/QScintilla/QsciScintillaCompat.py	Sun Jan 13 19:11:18 2013 +0100
@@ -7,7 +7,7 @@
 Module implementing a compatability interface class to QsciScintilla.
 """
 
-from PyQt4.QtCore import Qt
+from PyQt4.QtCore import pyqtSignal, Qt
 from PyQt4.QtGui import QPalette, QColor, QApplication
 from PyQt4.Qsci import QsciScintilla, \
     QSCINTILLA_VERSION as QsciQSCINTILLA_VERSION, QSCINTILLA_VERSION_STR, \
@@ -40,7 +40,11 @@
     This class implements all the functions, that were added to
     QsciScintilla incrementally. This class ensures compatibility
     to older versions of QsciScintilla.
+    
+    @signal zoomValueChanged(int) emitted to signal a change of the zoom value
     """
+    zoomValueChanged = pyqtSignal(int)
+    
     ArrowFoldStyle = QsciScintilla.BoxedTreeFoldStyle + 1
     ArrowTreeFoldStyle = ArrowFoldStyle + 1
     
@@ -304,34 +308,33 @@
         """
         Public method used to increase the zoom factor.
         
-        @param zoom zoom factor increment
+        @param zoom zoom factor increment (integer)
         """
-        self.zoom += zoom
         super().zoomIn(zoom)
     
     def zoomOut(self, zoom=1):
         """
         Public method used to decrease the zoom factor.
         
-        @param zoom zoom factor decrement
+        @param zoom zoom factor decrement (integer)
         """
-        self.zoom -= zoom
         super().zoomOut(zoom)
     
     def zoomTo(self, zoom):
         """
         Public method used to zoom to a specific zoom factor.
         
-        @param zoom zoom factor
+        @param zoom zoom factor (integer)
         """
         self.zoom = zoom
         super().zoomTo(zoom)
+        self.zoomValueChanged.emit(self.zoom)
     
     def getZoom(self):
         """
         Public method used to retrieve the current zoom factor.
         
-        @return zoom factor (int)
+        @return zoom factor (integer)
         """
         return self.zoom
     
--- a/UI/UserInterface.py	Sun Jan 13 17:27:15 2013 +0100
+++ b/UI/UserInterface.py	Sun Jan 13 19:11:18 2013 +0100
@@ -449,6 +449,10 @@
         self.viewmanager.editorChanged.connect(self.projectBrowser.handleEditorChanged)
         self.viewmanager.checkActions.connect(self.cooperation.checkEditorActions)
         
+        self.shell.zoomValueChanged.connect(self.viewmanager.zoomValueChanged)
+        
+        self.terminal.zoomValueChanged.connect(self.viewmanager.zoomValueChanged)
+        
         self.cooperation.shareEditor.connect(self.viewmanager.shareEditor)
         self.cooperation.startEdit.connect(self.viewmanager.startSharedEdit)
         self.cooperation.sendEdit.connect(self.viewmanager.sendSharedEdit)
--- a/ViewManager/ViewManager.py	Sun Jan 13 17:27:15 2013 +0100
+++ b/ViewManager/ViewManager.py	Sun Jan 13 19:11:18 2013 +0100
@@ -3732,6 +3732,8 @@
             self.__lastEditorClosed()
             self.lastEditorClosed.emit()
         
+        editor.deleteLater()
+        
         return True
         
     def closeCurrentWindow(self):
@@ -3855,6 +3857,7 @@
         editor.selectionChanged.connect(self.searchDlg.selectionChanged)
         editor.selectionChanged.connect(self.replaceDlg.selectionChanged)
         editor.lastEditPositionAvailable.connect(self.__lastEditPositionAvailable)
+        editor.zoomValueChanged.connect(self.zoomValueChanged)
         
     def newEditorView(self, fn, caller, filetype=""):
         """
@@ -5042,6 +5045,14 @@
                 aw.zoomTo(value)
                 self.sbZoom.setValue(aw.getZoom())
         
+    def zoomValueChanged(self, value):
+        """
+        Public slot to handle changes of the zoom value.
+        
+        @param value new zoom value (integer)
+        """
+        self.sbZoom.setValue(value)
+        
     def __toggleAll(self):
         """
         Private method to handle the toggle all folds action.

eric ide

mercurial