25 def __init__(self, files, parent=None, name=None): |
25 def __init__(self, files, parent=None, name=None): |
26 """ |
26 """ |
27 Constructor |
27 Constructor |
28 |
28 |
29 @param files list of files, that have been found for addition |
29 @param files list of files, that have been found for addition |
30 (list of strings) |
30 @type list of str |
31 @param parent parent widget of this dialog (QWidget) |
31 @param parent parent widget of this dialog |
32 @param name name of this dialog (string) |
32 @type QWidget |
|
33 @param name name of this dialog |
|
34 @type str |
33 """ |
35 """ |
34 super().__init__(parent) |
36 super().__init__(parent) |
35 if name: |
37 if name: |
36 self.setObjectName(name) |
38 self.setObjectName(name) |
37 self.setupUi(self) |
39 self.setupUi(self) |
50 |
52 |
51 def on_buttonBox_clicked(self, button): |
53 def on_buttonBox_clicked(self, button): |
52 """ |
54 """ |
53 Private slot called by a button of the button box clicked. |
55 Private slot called by a button of the button box clicked. |
54 |
56 |
55 @param button button that was clicked (QAbstractButton) |
57 @param button button that was clicked |
|
58 @type QAbstractButton |
56 """ |
59 """ |
57 if button == self.addAllButton: |
60 if button == self.addAllButton: |
58 self.on_addAllButton_clicked() |
61 self.on_addAllButton_clicked() |
59 elif button == self.addSelectedButton: |
62 elif button == self.addSelectedButton: |
60 self.on_addSelectedButton_clicked() |
63 self.on_addSelectedButton_clicked() |
79 |
82 |
80 def getSelection(self): |
83 def getSelection(self): |
81 """ |
84 """ |
82 Public method to return the selected items. |
85 Public method to return the selected items. |
83 |
86 |
84 @return list of selected files (list of strings) |
87 @return list of selected files |
|
88 @rtype list of str |
85 """ |
89 """ |
86 list_ = [] |
90 list_ = [] |
87 for itm in self.fileList.selectedItems(): |
91 for itm in self.fileList.selectedItems(): |
88 list_.append(itm.text()) |
92 list_.append(itm.text()) |
89 return list_ |
93 return list_ |