25 ): |
25 ): |
26 """ |
26 """ |
27 Constructor |
27 Constructor |
28 |
28 |
29 @param pro reference to the project object |
29 @param pro reference to the project object |
30 @param fileTypeFilter file type filter (string) |
30 @type Project |
31 @param parent parent widget of this dialog (QWidget) |
31 @param fileTypeFilter file type filter |
32 @param name name of this dialog (string) |
32 @type str |
|
33 @param parent parent widget of this dialog |
|
34 @type QWidget |
|
35 @param name name of this dialog |
|
36 @type str |
33 @param startdir start directory for the selection dialog |
37 @param startdir start directory for the selection dialog |
|
38 @type str |
34 """ |
39 """ |
35 super().__init__(parent) |
40 super().__init__(parent) |
36 if name: |
41 if name: |
37 self.setObjectName(name) |
42 self.setObjectName(name) |
38 self.setupUi(self) |
43 self.setupUi(self) |
90 If the entered source directory is a subdirectory of the current |
95 If the entered source directory is a subdirectory of the current |
91 projects main directory, the target directory path is synchronized. |
96 projects main directory, the target directory path is synchronized. |
92 It is assumed, that the user wants to add a bunch of files to |
97 It is assumed, that the user wants to add a bunch of files to |
93 the project in place. |
98 the project in place. |
94 |
99 |
95 @param directory the text of the source directory line edit (string) |
100 @param directory the text of the source directory line edit |
|
101 @type str |
96 """ |
102 """ |
97 if directory.startswith(self.__project.getProjectPath()): |
103 if directory.startswith(self.__project.getProjectPath()): |
98 self.targetDirPicker.setText(directory) |
104 self.targetDirPicker.setText(directory) |
99 |
105 |
100 def getData(self): |
106 def getData(self): |
101 """ |
107 """ |
102 Public slot to retrieve the dialogs data. |
108 Public slot to retrieve the dialogs data. |
103 |
109 |
104 @return tuple of four values (string, string, string, boolean) giving |
110 @return tuple of four values giving the selected file type, the source |
105 the selected file type, the source and target directory and |
111 and target directory and a flag indicating a recursive add |
106 a flag indicating a recursive add |
112 @rtype tuple of (str, str, str, bool) |
107 """ |
113 """ |
108 filetype = self.filterComboBox.itemData(self.filterComboBox.currentIndex()) |
114 filetype = self.filterComboBox.itemData(self.filterComboBox.currentIndex()) |
109 return ( |
115 return ( |
110 filetype, |
116 filetype, |
111 self.sourceDirPicker.text(), |
117 self.sourceDirPicker.text(), |