Plugins/VcsPlugins/vcsPySvn/SvnCommitDialog.py

changeset 1888
03f59d88a62d
parent 1509
c0b5e693b0eb
child 2302
f29e9405c851
equal deleted inserted replaced
1886:732f94385668 1888:03f59d88a62d
25 @signal rejected() emitted, if the dialog was rejected 25 @signal rejected() emitted, if the dialog was rejected
26 """ 26 """
27 accepted = pyqtSignal() 27 accepted = pyqtSignal()
28 rejected = pyqtSignal() 28 rejected = pyqtSignal()
29 29
30 def __init__(self, parent=None): 30 def __init__(self, changelists, parent=None):
31 """ 31 """
32 Constructor 32 Constructor
33 33
34 @param changelists list of available change lists (list of strings)
34 @param parent parent widget (QWidget) 35 @param parent parent widget (QWidget)
35 """ 36 """
36 super().__init__(parent, Qt.WindowFlags(Qt.Window)) 37 super().__init__(parent, Qt.WindowFlags(Qt.Window))
37 self.setupUi(self) 38 self.setupUi(self)
38 39
39 if pysvn.svn_version < (1, 5, 0) or pysvn.version < (1, 6, 0): 40 if pysvn.svn_version < (1, 5, 0) or pysvn.version < (1, 6, 0):
40 self.changeListsGroup.hide() 41 self.changeListsGroup.hide()
42 else:
43 self.changeLists.addItems(sorted(changelists))
41 44
42 def showEvent(self, evt): 45 def showEvent(self, evt):
43 """ 46 """
44 Public method called when the dialog is about to be shown. 47 Public method called when the dialog is about to be shown.
45 48
76 """ 79 """
77 Public method to check, if the user entered some changelists. 80 Public method to check, if the user entered some changelists.
78 81
79 @return flag indicating availability of changelists (boolean) 82 @return flag indicating availability of changelists (boolean)
80 """ 83 """
81 listsTxt = self.changeListsEdit.text() 84 return len(self.changeLists.selectedItems()) > 0
82 lists = listsTxt.split(';')
83 slists = [l.strip() for l in lists if l.strip() != ""]
84 return len(slists) > 0
85 85
86 def changelistsData(self): 86 def changelistsData(self):
87 """ 87 """
88 Public method to retrieve the changelists data. 88 Public method to retrieve the changelists data.
89 89
90 @return tuple containing the changelists (list of strings) and a flag 90 @return tuple containing the changelists (list of strings) and a flag
91 indicating to keep changelists (boolean) 91 indicating to keep changelists (boolean)
92 """ 92 """
93 listsTxt = self.changeListsEdit.text() 93 slists = [l.text().strip() for l in self.changeLists.selectedItems()
94 lists = listsTxt.split(';') 94 if l.text().strip() != ""]
95 slists = [l.strip() for l in lists if l.strip() != ""]
96 95
97 if len(slists) == 0: 96 if len(slists) == 0:
98 return [], False 97 return [], False
99 98
100 return slists, self.keepChangeListsCheckBox.isChecked() 99 return slists, self.keepChangeListsCheckBox.isChecked()

eric ide

mercurial