RefactoringRope/AddParameterDialog.py

branch
eric7
changeset 389
4f53795beff0
parent 374
958f34e97952
child 411
8cccb49bba7b
equal deleted inserted replaced
388:cb044ec27c24 389:4f53795beff0
15 15
16 class AddParameterDialog(QDialog, Ui_AddParameterDialog): 16 class AddParameterDialog(QDialog, Ui_AddParameterDialog):
17 """ 17 """
18 Class implementing the Add New Parameter dialog. 18 Class implementing the Add New Parameter dialog.
19 """ 19 """
20
20 def __init__(self, parent=None): 21 def __init__(self, parent=None):
21 """ 22 """
22 Constructor 23 Constructor
23 24
24 @param parent reference to the parent widget 25 @param parent reference to the parent widget
25 @type QWidget 26 @type QWidget
26 """ 27 """
27 QDialog.__init__(self, parent) 28 QDialog.__init__(self, parent)
28 self.setupUi(self) 29 self.setupUi(self)
29 30
30 self.__okButton = self.buttonBox.button( 31 self.__okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok)
31 QDialogButtonBox.StandardButton.Ok)
32 self.__okButton.setEnabled(False) 32 self.__okButton.setEnabled(False)
33 33
34 msh = self.minimumSizeHint() 34 msh = self.minimumSizeHint()
35 self.resize(max(self.width(), msh.width()), msh.height()) 35 self.resize(max(self.width(), msh.width()), msh.height())
36 36
37 @pyqtSlot(str) 37 @pyqtSlot(str)
38 def on_nameEdit_textChanged(self, txt): 38 def on_nameEdit_textChanged(self, txt):
39 """ 39 """
40 Private slot called, when the name entry is changed. 40 Private slot called, when the name entry is changed.
41 41
42 @param txt text of the entry 42 @param txt text of the entry
43 @type str 43 @type str
44 """ 44 """
45 self.__okButton.setEnabled(txt != "") 45 self.__okButton.setEnabled(txt != "")
46 46
47 def getData(self): 47 def getData(self):
48 """ 48 """
49 Public method to extract the data entered into the dialog. 49 Public method to extract the data entered into the dialog.
50 50
51 @return tuple containing name, default and value 51 @return tuple containing name, default and value
52 @rtype tuple of (str, str, str) 52 @rtype tuple of (str, str, str)
53 """ 53 """
54 return (self.nameEdit.text(), 54 return (self.nameEdit.text(), self.defaultEdit.text(), self.valueEdit.text())
55 self.defaultEdit.text(),
56 self.valueEdit.text())

eric ide

mercurial