def start(self, options): """ Run the application by showing the welcome dialog. :type options: Namespace """ self.welcome = Welcome(self) self.welcome.show() if options.open and isdir(options.open): self.sgnCreateSession.emit(expandPath(options.open))
def onSessionClosed(self): """ Quit Eddy. """ ## SAVE SESSION STATE session = self.sender() if session: session.save() self.sessions.remove(session) ## CLEANUP POSSIBLE LEFTOVERS self.sessions = DistinctList(filter(None, self.sessions)) ## SWITCH TO AN ACTIVE WINDOW OR WELCOME PANEL if self.sessions: session = self.sessions[-1] session.show() else: self.welcome = Welcome(self) self.welcome.show()
def start(self): """ Run the application by showing the welcome dialog. """ # CONFIGURE THE WORKSPACE #settings = QtCore.QSettings() #workspace = expandPath(settings.value('workspace/home', WORKSPACE, str)) ''' if not isdir(workspace): window = WorkspaceDialog() if window.exec_() == WorkspaceDialog.Rejected: raise SystemExit ''' # PROCESS COMMAND LINE ARGUMENTS args = self.options.positionalArguments() if self.openFilePath: args.append(self.openFilePath) self.openFilePath = None # SHOW WELCOME DIALOG self.welcome = Welcome(self) self.welcome.show() # PROCESS ADDITIONAL COMMAND LINE OPTIONS if self.options.isSet(CommandLineParser.OPEN): value = self.options.value(CommandLineParser.OPEN) if value: project = os.path.join(workspace, value) if project and isdir(os.path.join(workspace, project)): self.sgnCreateSession.emit(project) else: LOGGER.warning('Unable to open project: %s', project) # POSITIONAL ARGUMENTS elif args: fname = expandPath(args[0]) if fexists(fname): #project = os.path.dirname(fname) project = fname self.sgnCreateSession.emit(project) else: LOGGER.warning('Unable to open file: %s', fname) # COMPLETE STARTUP self.started = True