302 @type dict |
302 @type dict |
303 """ |
303 """ |
304 self.__projects[project['uid']] = project |
304 self.__projects[project['uid']] = project |
305 |
305 |
306 @pyqtSlot() |
306 @pyqtSlot() |
307 def addNewProject(self, startdir=None): |
307 def addNewProject(self, startdir="", category=""): |
308 """ |
308 """ |
309 Public slot used to add a new project to the multi-project. |
309 Public slot used to add a new project to the multi-project. |
310 |
310 |
311 @param startdir start directory for the selection dialog (string) |
311 @param startdir start directory for the selection dialog |
|
312 @type str |
|
313 @param category category to be preset |
|
314 @type str |
312 """ |
315 """ |
313 from .AddProjectDialog import AddProjectDialog |
316 from .AddProjectDialog import AddProjectDialog |
314 if not startdir: |
317 if not startdir: |
315 startdir = self.ppath |
318 startdir = self.ppath |
316 if not startdir: |
319 if not startdir: |
317 startdir = Preferences.getMultiProject("Workspace") |
320 startdir = Preferences.getMultiProject("Workspace") |
318 dlg = AddProjectDialog(self.ui, startdir=startdir, |
321 dlg = AddProjectDialog(self.ui, startdir=startdir, |
319 categories=self.categories) |
322 categories=self.categories, category=category) |
320 if dlg.exec_() == QDialog.Accepted: |
323 if dlg.exec_() == QDialog.Accepted: |
321 name, filename, isMaster, description, category, uid = \ |
324 name, filename, isMaster, description, category, uid = \ |
322 dlg.getData() |
325 dlg.getData() |
323 |
326 |
324 # step 1: check, if project was already added |
327 # step 1: check, if project was already added |