def createMainWindow(self): ''' Creates the Main Window and bootstraps the Bloop Tree. ''' self._mainView_ = MainView.getInstance() self._mainViewController_ = MainViewController(self._mainView_) self._mainView_.createComponents() # Expand the data on the Friend Tree by default if self.getMainViewController().getFriendsTreeController() is not None: self.getMainViewController().getFriendsTreeController().buildTree() self.getMainViewController().bootstrapComponents() #We do all this at this point (and not on the MainView Controller) #since we'd like to make sure we have a controller before invoking #these methods. self._mainView_.show() self._mainView_.createMenuBar() #IconTray possibleTrayController = self._mainView_.initIconTray(self) if possibleTrayController: self.setTrayIconController(possibleTrayController) self.getMainViewController().restoreSizes() #Try to recover from unfinished uploads if any #self.hireWorker(self.getMainViewController().getUploadManagerViewController().tryRestoringUploads) #cant put this on a thread, windows claims the upload manager timer will be started from another thread self.getMainViewController().getUploadManagerViewController().tryRestoringUploads()
def initContextMenu(self): self._menu = QMenu(MainView.getInstance()) self._aboutAction = ActionManager.getInstance().getAboutDialogAction() self._menu.addAction(self._aboutAction) self.setContextMenu(self._menu)