146 if itm is None: |
146 if itm is None: |
147 itm = self.currentItem() |
147 itm = self.currentItem() |
148 if itm is None: |
148 if itm is None: |
149 return |
149 return |
150 |
150 |
151 filename = itm.data(Qt.UserRole).toString() |
151 filename = itm.data(Qt.UserRole) |
152 if filename: |
152 if filename: |
153 self.multiProject.openProject(filename) |
153 self.multiProject.openProject(filename) |
154 |
154 |
155 ############################################################################ |
155 ############################################################################ |
156 ## Private methods below |
156 ## Private methods below |
176 if project['master']: |
176 if project['master']: |
177 itm.setIcon(UI.PixmapCache.getIcon("masterProject.png")) |
177 itm.setIcon(UI.PixmapCache.getIcon("masterProject.png")) |
178 else: |
178 else: |
179 itm.setIcon(UI.PixmapCache.getIcon("empty.png")) |
179 itm.setIcon(UI.PixmapCache.getIcon("empty.png")) |
180 itm.setToolTip(project['file']) |
180 itm.setToolTip(project['file']) |
181 itm.setData(Qt.UserRole, QVariant(project['file'])) |
181 itm.setData(Qt.UserRole, project['file']) |
182 |
182 |
183 def __findProjectItem(self, project): |
183 def __findProjectItem(self, project): |
184 """ |
184 """ |
185 Private method to search a specific project item. |
185 Private method to search a specific project item. |
186 |
186 |
201 """ |
201 """ |
202 Private method to handle the Remove context menu entry. |
202 Private method to handle the Remove context menu entry. |
203 """ |
203 """ |
204 itm = self.currentItem() |
204 itm = self.currentItem() |
205 if itm is not None: |
205 if itm is not None: |
206 filename = itm.data(Qt.UserRole).toString() |
206 filename = itm.data(Qt.UserRole) |
207 if filename: |
207 if filename: |
208 self.multiProject.removeProject(filename) |
208 self.multiProject.removeProject(filename) |
209 |
209 |
210 def __showProjectProperties(self): |
210 def __showProjectProperties(self): |
211 """ |
211 """ |
212 Private method to show the data of a project entry. |
212 Private method to show the data of a project entry. |
213 """ |
213 """ |
214 itm = self.currentItem() |
214 itm = self.currentItem() |
215 if itm is not None: |
215 if itm is not None: |
216 filename = itm.data(Qt.UserRole).toString() |
216 filename = itm.data(Qt.UserRole) |
217 if filename: |
217 if filename: |
218 project = self.multiProject.getProject(filename) |
218 project = self.multiProject.getProject(filename) |
219 if project is not None: |
219 if project is not None: |
220 dlg = AddProjectDialog(self, project = project) |
220 dlg = AddProjectDialog(self, project = project) |
221 if dlg.exec_() == QDialog.Accepted: |
221 if dlg.exec_() == QDialog.Accepted: |