src/eric7/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgUnshelveDataDialog.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9653
e67609152c5e
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
14 14
15 class HgUnshelveDataDialog(QDialog, Ui_HgUnshelveDataDialog): 15 class HgUnshelveDataDialog(QDialog, Ui_HgUnshelveDataDialog):
16 """ 16 """
17 Class implementing a dialog to enter the data for an unshelve operation. 17 Class implementing a dialog to enter the data for an unshelve operation.
18 """ 18 """
19
19 def __init__(self, shelveNames, shelveName="", parent=None): 20 def __init__(self, shelveNames, shelveName="", parent=None):
20 """ 21 """
21 Constructor 22 Constructor
22 23
23 @param shelveNames list of available shelves (list of string) 24 @param shelveNames list of available shelves (list of string)
24 @param shelveName name of the shelve to restore (string) 25 @param shelveName name of the shelve to restore (string)
25 @param parent reference to the parent widget (QWidget) 26 @param parent reference to the parent widget (QWidget)
26 """ 27 """
27 super().__init__(parent) 28 super().__init__(parent)
28 self.setupUi(self) 29 self.setupUi(self)
29 30
30 self.nameComboBox.addItem("") 31 self.nameComboBox.addItem("")
31 self.nameComboBox.addItems(sorted(shelveNames)) 32 self.nameComboBox.addItems(sorted(shelveNames))
32 33
33 if shelveName and shelveName in shelveNames: 34 if shelveName and shelveName in shelveNames:
34 self.nameComboBox.setCurrentIndex( 35 self.nameComboBox.setCurrentIndex(self.nameComboBox.findText(shelveName))
35 self.nameComboBox.findText(shelveName)) 36
36
37 msh = self.minimumSizeHint() 37 msh = self.minimumSizeHint()
38 self.resize(max(self.width(), msh.width()), msh.height()) 38 self.resize(max(self.width(), msh.width()), msh.height())
39 39
40 def getData(self): 40 def getData(self):
41 """ 41 """
42 Public method to get the user data. 42 Public method to get the user data.
43 43
44 @return tuple containing the name (string) and a flag indicating 44 @return tuple containing the name (string) and a flag indicating
45 to keep the shelved change (boolean) 45 to keep the shelved change (boolean)
46 """ 46 """
47 return ( 47 return (
48 self.nameComboBox.currentText().replace(" ", "_"), 48 self.nameComboBox.currentText().replace(" ", "_"),
49 self.keepCheckBox.isChecked() 49 self.keepCheckBox.isChecked(),
50 ) 50 )

eric ide

mercurial