Correct the behavior of the Goto dialog to show the line of the cursor as the default. 5_1_x

Sun, 27 Mar 2011 12:23:30 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 27 Mar 2011 12:23:30 +0200
branch
5_1_x
changeset 959
3b5ad7224945
parent 957
ff469c60f5fe
child 962
88b386d26b74

Correct the behavior of the Goto dialog to show the line of the cursor as the default.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Source/eric5.QScintilla.GotoDialog.html file | annotate | diff | comparison | revisions
QScintilla/GotoDialog.py file | annotate | diff | comparison | revisions
ViewManager/ViewManager.py file | annotate | diff | comparison | revisions
diff -r ff469c60f5fe -r 3b5ad7224945 APIs/Python3/eric5.api
--- a/APIs/Python3/eric5.api	Sat Mar 26 12:52:15 2011 +0100
+++ b/APIs/Python3/eric5.api	Sun Mar 27 12:23:30 2011 +0200
@@ -5187,7 +5187,7 @@
 eric5.QScintilla.Exporters.getExporter?4(format, editor)
 eric5.QScintilla.Exporters.getSupportedFormats?4()
 eric5.QScintilla.GotoDialog.GotoDialog.getLinenumber?4()
-eric5.QScintilla.GotoDialog.GotoDialog?1(maximum, parent, name = None, modal = False)
+eric5.QScintilla.GotoDialog.GotoDialog?1(maximum, curLine, parent, name = None, modal = False)
 eric5.QScintilla.Lexers.Lexer.Lexer.alwaysKeepTabs?4()
 eric5.QScintilla.Lexers.Lexer.Lexer.autoCompletionWordSeparators?4()
 eric5.QScintilla.Lexers.Lexer.Lexer.boxCommentStr?4()
diff -r ff469c60f5fe -r 3b5ad7224945 Documentation/Help/source.qch
Binary file Documentation/Help/source.qch has changed
diff -r ff469c60f5fe -r 3b5ad7224945 Documentation/Source/eric5.QScintilla.GotoDialog.html
--- a/Documentation/Source/eric5.QScintilla.GotoDialog.html	Sat Mar 26 12:52:15 2011 +0100
+++ b/Documentation/Source/eric5.QScintilla.GotoDialog.html	Sun Mar 27 12:23:30 2011 +0200
@@ -63,13 +63,16 @@
 </table>
 <a NAME="GotoDialog.__init__" ID="GotoDialog.__init__"></a>
 <h4>GotoDialog (Constructor)</h4>
-<b>GotoDialog</b>(<i>maximum, parent, name = None, modal = False</i>)
+<b>GotoDialog</b>(<i>maximum, curLine, parent, name = None, modal = False</i>)
 <p>
         Constructor
 </p><dl>
 <dt><i>maximum</i></dt>
 <dd>
-the maximum allowed for the spinbox (int)
+maximum allowed for the spinbox (integer)
+</dd><dt><i>curLine</i></dt>
+<dd>
+current line number (integer)
 </dd><dt><i>parent</i></dt>
 <dd>
 parent widget of this dialog (QWidget)
diff -r ff469c60f5fe -r 3b5ad7224945 QScintilla/GotoDialog.py
--- a/QScintilla/GotoDialog.py	Sat Mar 26 12:52:15 2011 +0100
+++ b/QScintilla/GotoDialog.py	Sun Mar 27 12:23:30 2011 +0200
@@ -15,11 +15,12 @@
     """
     Class implementing the Goto dialog.
     """
-    def __init__(self, maximum, parent, name = None, modal = False):
+    def __init__(self, maximum, curLine, parent, name = None, modal = False):
         """
         Constructor
         
-        @param maximum the maximum allowed for the spinbox (int)
+        @param maximum maximum allowed for the spinbox (integer)
+        @param curLine current line number (integer)
         @param parent parent widget of this dialog (QWidget)
         @param name name of this dialog (string)
         @param modal flag indicating a modal dialog (boolean)
@@ -31,6 +32,7 @@
         self.setModal(modal)
         
         self.linenumberSpinBox.setMaximum(maximum)
+        self.linenumberSpinBox.setValue(curLine)
         self.linenumberSpinBox.selectAll()
         
     def getLinenumber(self):
diff -r ff469c60f5fe -r 3b5ad7224945 ViewManager/ViewManager.py
--- a/ViewManager/ViewManager.py	Sat Mar 26 12:52:15 2011 +0100
+++ b/ViewManager/ViewManager.py	Sun Mar 27 12:23:30 2011 +0200
@@ -4087,7 +4087,9 @@
         Private method to handle the goto action.
         """
         aw = self.activeWindow()
-        dlg = GotoDialog(aw.lines(), self.ui, None, True)
+        lines = aw.lines()
+        curLine = aw.getCursorPosition()[0] + 1
+        dlg = GotoDialog(lines, curLine, self.ui, None, True)
         if dlg.exec_() == QDialog.Accepted:
             aw.gotoLine(dlg.getLinenumber())
         

eric ide

mercurial