241 |
241 |
242 self.__menu.addAction( |
242 self.__menu.addAction( |
243 EricPixmapCache.getIcon("exit"), self.tr("Quit"), ericApp().quit |
243 EricPixmapCache.getIcon("exit"), self.tr("Quit"), ericApp().quit |
244 ) |
244 ) |
245 |
245 |
|
246 self.setContextMenu(self.__menu) |
|
247 |
246 def __loadRecentProjects(self): |
248 def __loadRecentProjects(self): |
247 """ |
249 """ |
248 Private method to load the recently opened project filenames. |
250 Private method to load the recently opened project filenames. |
249 """ |
251 """ |
250 rp = self.rsettings.value(Globals.recentNameProject) |
252 rp = self.rsettings.value(Globals.recentNameProject) |
293 Private slot to show the context menu. |
295 Private slot to show the context menu. |
294 """ |
296 """ |
295 self.menuRecentProjectsAct.setEnabled(len(self.recentProjects) > 0) |
297 self.menuRecentProjectsAct.setEnabled(len(self.recentProjects) > 0) |
296 self.menuRecentMultiProjectsAct.setEnabled(len(self.recentMultiProjects) > 0) |
298 self.menuRecentMultiProjectsAct.setEnabled(len(self.recentMultiProjects) > 0) |
297 self.menuRecentFilesAct.setEnabled(len(self.recentFiles) > 0) |
299 self.menuRecentFilesAct.setEnabled(len(self.recentFiles) > 0) |
298 |
|
299 pos = QCursor.pos() |
|
300 x = pos.x() - self.__menu.sizeHint().width() |
|
301 pos.setX(x > 0 and x or 0) |
|
302 y = pos.y() - self.__menu.sizeHint().height() |
|
303 pos.setY(y > 0 and y or 0) |
|
304 self.__menu.popup(pos) |
|
305 |
300 |
306 def __startProc(self, applName, *applArgs): |
301 def __startProc(self, applName, *applArgs): |
307 """ |
302 """ |
308 Private method to start an eric application. |
303 Private method to start an eric application. |
309 |
304 |