src/eric7/QScintilla/GotoDialog.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9653
e67609152c5e
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
14 14
15 class GotoDialog(QDialog, Ui_GotoDialog): 15 class GotoDialog(QDialog, Ui_GotoDialog):
16 """ 16 """
17 Class implementing the Goto dialog. 17 Class implementing the Goto dialog.
18 """ 18 """
19
19 def __init__(self, maximum, curLine, parent, name=None, modal=False): 20 def __init__(self, maximum, curLine, parent, name=None, modal=False):
20 """ 21 """
21 Constructor 22 Constructor
22 23
23 @param maximum maximum allowed for the spinbox (integer) 24 @param maximum maximum allowed for the spinbox (integer)
24 @param curLine current line number (integer) 25 @param curLine current line number (integer)
25 @param parent parent widget of this dialog (QWidget) 26 @param parent parent widget of this dialog (QWidget)
26 @param name name of this dialog (string) 27 @param name name of this dialog (string)
27 @param modal flag indicating a modal dialog (boolean) 28 @param modal flag indicating a modal dialog (boolean)
29 super().__init__(parent) 30 super().__init__(parent)
30 if name: 31 if name:
31 self.setObjectName(name) 32 self.setObjectName(name)
32 self.setupUi(self) 33 self.setupUi(self)
33 self.setModal(modal) 34 self.setModal(modal)
34 35
35 self.linenumberSpinBox.setMaximum(maximum) 36 self.linenumberSpinBox.setMaximum(maximum)
36 self.linenumberSpinBox.setValue(curLine) 37 self.linenumberSpinBox.setValue(curLine)
37 self.linenumberSpinBox.selectAll() 38 self.linenumberSpinBox.selectAll()
38 39
39 self.buttonBox.button( 40 self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setDefault(True)
40 QDialogButtonBox.StandardButton.Ok).setDefault(True) 41
41
42 msh = self.minimumSizeHint() 42 msh = self.minimumSizeHint()
43 self.resize(max(self.width(), msh.width()), msh.height()) 43 self.resize(max(self.width(), msh.width()), msh.height())
44 44
45 def getLinenumber(self): 45 def getLinenumber(self):
46 """ 46 """
47 Public method to retrieve the linenumber. 47 Public method to retrieve the linenumber.
48 48
49 @return line number (int) 49 @return line number (int)
50 """ 50 """
51 return self.linenumberSpinBox.value() 51 return self.linenumberSpinBox.value()

eric ide

mercurial