eric6/QScintilla/GotoDialog.py

changeset 6942
2602857055c5
parent 6645
ad476851d7e0
child 7229
53054eb5b15a
equal deleted inserted replaced
6941:f99d60d6b59b 6942:2602857055c5
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2002 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing the Goto dialog.
8 """
9
10 from __future__ import unicode_literals
11
12 from PyQt5.QtWidgets import QDialog
13
14 from .Ui_GotoDialog import Ui_GotoDialog
15
16
17 class GotoDialog(QDialog, Ui_GotoDialog):
18 """
19 Class implementing the Goto dialog.
20 """
21 def __init__(self, maximum, curLine, parent, name=None, modal=False):
22 """
23 Constructor
24
25 @param maximum maximum allowed for the spinbox (integer)
26 @param curLine current line number (integer)
27 @param parent parent widget of this dialog (QWidget)
28 @param name name of this dialog (string)
29 @param modal flag indicating a modal dialog (boolean)
30 """
31 super(GotoDialog, self).__init__(parent)
32 if name:
33 self.setObjectName(name)
34 self.setupUi(self)
35 self.setModal(modal)
36
37 self.linenumberSpinBox.setMaximum(maximum)
38 self.linenumberSpinBox.setValue(curLine)
39 self.linenumberSpinBox.selectAll()
40
41 msh = self.minimumSizeHint()
42 self.resize(max(self.width(), msh.width()), msh.height())
43
44 def getLinenumber(self):
45 """
46 Public method to retrieve the linenumber.
47
48 @return line number (int)
49 """
50 return self.linenumberSpinBox.value()

eric ide

mercurial