Sun, 27 Mar 2011 12:22:31 +0200
Correct the behavior of the Goto dialog to show the line of the cursor as the default.
--- a/APIs/Python3/eric5.api Sat Mar 26 12:51:13 2011 +0100 +++ b/APIs/Python3/eric5.api Sun Mar 27 12:22:31 2011 +0200 @@ -5226,7 +5226,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()
--- a/Documentation/Source/eric5.QScintilla.GotoDialog.html Sat Mar 26 12:51:13 2011 +0100 +++ b/Documentation/Source/eric5.QScintilla.GotoDialog.html Sun Mar 27 12:22:31 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)
--- a/QScintilla/GotoDialog.py Sat Mar 26 12:51:13 2011 +0100 +++ b/QScintilla/GotoDialog.py Sun Mar 27 12:22:31 2011 +0200 @@ -16,11 +16,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) @@ -32,6 +33,7 @@ self.setModal(modal) self.linenumberSpinBox.setMaximum(maximum) + self.linenumberSpinBox.setValue(curLine) self.linenumberSpinBox.selectAll() def getLinenumber(self):
--- a/ViewManager/ViewManager.py Sat Mar 26 12:51:13 2011 +0100 +++ b/ViewManager/ViewManager.py Sun Mar 27 12:22:31 2011 +0200 @@ -4089,7 +4089,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())