14 |
14 |
15 class GitListDialog(QDialog, Ui_GitListDialog): |
15 class GitListDialog(QDialog, Ui_GitListDialog): |
16 """ |
16 """ |
17 Class implementing a dialog to select from a list. |
17 Class implementing a dialog to select from a list. |
18 """ |
18 """ |
|
19 |
19 def __init__(self, selections, parent=None): |
20 def __init__(self, selections, parent=None): |
20 """ |
21 """ |
21 Constructor |
22 Constructor |
22 |
23 |
23 @param selections list of entries to select from (list of string) |
24 @param selections list of entries to select from (list of string) |
24 @param parent reference to the parent widget (QWidget) |
25 @param parent reference to the parent widget (QWidget) |
25 """ |
26 """ |
26 super().__init__(parent) |
27 super().__init__(parent) |
27 self.setupUi(self) |
28 self.setupUi(self) |
28 |
29 |
29 self.selectionList.addItems(selections) |
30 self.selectionList.addItems(selections) |
30 |
31 |
31 def getSelection(self): |
32 def getSelection(self): |
32 """ |
33 """ |
33 Public method to return the selected entries. |
34 Public method to return the selected entries. |
34 |
35 |
35 @return list of selected entries (list of string) |
36 @return list of selected entries (list of string) |
36 """ |
37 """ |
37 selection = [] |
38 selection = [] |
38 for itm in self.selectionList.selectedItems(): |
39 for itm in self.selectionList.selectedItems(): |
39 selection.append(itm.text()) |
40 selection.append(itm.text()) |
40 |
41 |
41 return selection |
42 return selection |