src/eric7/Plugins/VcsPlugins/vcsMercurial/HgRemoveSubrepositoriesDialog.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9653
e67609152c5e
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
15 15
16 class HgRemoveSubrepositoriesDialog(QDialog, Ui_HgRemoveSubrepositoriesDialog): 16 class HgRemoveSubrepositoriesDialog(QDialog, Ui_HgRemoveSubrepositoriesDialog):
17 """ 17 """
18 Class implementing a dialog to remove sub-repositories. 18 Class implementing a dialog to remove sub-repositories.
19 """ 19 """
20
20 def __init__(self, subrepositories, parent=None): 21 def __init__(self, subrepositories, parent=None):
21 """ 22 """
22 Constructor 23 Constructor
23 24
24 @param subrepositories list of sub-repository entries (list of strings) 25 @param subrepositories list of sub-repository entries (list of strings)
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.subrepositories.addItems(subrepositories) 31 self.subrepositories.addItems(subrepositories)
31 self.__removed = [] 32 self.__removed = []
32 33
33 @pyqtSlot() 34 @pyqtSlot()
34 def on_subrepositories_itemSelectionChanged(self): 35 def on_subrepositories_itemSelectionChanged(self):
35 """ 36 """
36 Private slot handling the selection of entries. 37 Private slot handling the selection of entries.
37 """ 38 """
38 self.removeButton.setEnabled( 39 self.removeButton.setEnabled(len(self.subrepositories.selectedItems()) > 0)
39 len(self.subrepositories.selectedItems()) > 0) 40
40
41 @pyqtSlot() 41 @pyqtSlot()
42 def on_removeButton_clicked(self): 42 def on_removeButton_clicked(self):
43 """ 43 """
44 Private slot handling the removal of the selected entries. 44 Private slot handling the removal of the selected entries.
45 """ 45 """
46 for itm in self.subrepositories.selectedItems(): 46 for itm in self.subrepositories.selectedItems():
47 self.__removed.append(itm.text()) 47 self.__removed.append(itm.text())
48 row = self.subrepositories.row(itm) 48 row = self.subrepositories.row(itm)
49 self.subrepositories.takeItem(row) 49 self.subrepositories.takeItem(row)
50 del itm 50 del itm
51 51
52 def getData(self): 52 def getData(self):
53 """ 53 """
54 Public method to retrieve the data. 54 Public method to retrieve the data.
55 55
56 @return tuple giving the remaining sub-repositories, the removed ones 56 @return tuple giving the remaining sub-repositories, the removed ones
57 and a flag indicating to delete the removed ones from disc (list 57 and a flag indicating to delete the removed ones from disc (list
58 of strings, list of strings, boolean) 58 of strings, list of strings, boolean)
59 """ 59 """
60 return ( 60 return (
61 [self.subrepositories.item(row).text() 61 [
62 for row in range(self.subrepositories.count())], 62 self.subrepositories.item(row).text()
63 for row in range(self.subrepositories.count())
64 ],
63 self.__removed, 65 self.__removed,
64 self.deleteCheckBox.isChecked() 66 self.deleteCheckBox.isChecked(),
65 ) 67 )

eric ide

mercurial