def do_activate(self): """If there's no window, create one and present it (show it to user). If there's a window, just present it. Also add the log handler and the notifier to the application""" # We only allow a single window and raise any existing ones if not self.window: # Windows are associated with the application # when the last one is closed the application shuts down self.window = AppWindow(self.sidebar, self.terminal, self.console_log, self.statusbar, application=self, title="Faraday") self.window.set_icon(self.icon) self.window.present() self.loghandler = GUIHandler() model.guiapi.setMainApp(self) addHandler(self.loghandler) self.loghandler.registerGUIOutput(self.window) notifier = model.log.getNotifier() notifier.widget = self.window model.guiapi.notification_center.registerWidget(self.window)
def __init__(self, model_controller, plugin_manager, workspace_manager): FaradayUi.__init__(self, model_controller, plugin_manager, workspace_manager) qt.QApplication.__init__(self, []) self._shell_envs = dict() model.guiapi.setMainApp(self) self._main_window = MainWindow(CONF.getAppname(), self, self.getModelController(), self.getPluginManager()) self.setMainWidget(self.getMainWindow()) notifier = model.log.getNotifier() notifier.widget = self._main_window model.guiapi.notification_center.registerWidget(self._main_window) self.loghandler = GUIHandler() addHandler(self.loghandler) self._splash_screen = qt.QSplashScreen( qt.QPixmap(os.path.join(CONF.getImagePath(), "splash2.png")), qt.Qt.WStyle_StaysOnTop)
def __init__(self, model_controller, plugin_manager, workspace_manager): FaradayUi.__init__(self, model_controller, plugin_manager, workspace_manager) qt.QApplication.__init__(self, []) self._shell_envs = dict() model.guiapi.setMainApp(self) self._main_window = MainWindow(CONF.getAppname(), self, self.getModelController(), self.getPluginManager()) self.setMainWidget(self.getMainWindow()) notifier = model.log.getNotifier() notifier.widget = self._main_window model.guiapi.notification_center.registerWidget(self._main_window) self.loghandler = GUIHandler() addHandler(self.loghandler) self._splash_screen = qt.QSplashScreen( qt.QPixmap(os.path.join(CONF.getImagePath(), "splash2.png")), qt.Qt.WStyle_StaysOnTop) self.startSplashScreen()
def do_activate(self): """If there's no window, create one and present it (show it to user). If there's a window, just present it. Also add the log handler and the notifier to the application""" # We only allow a single window and raise any existing ones if not self.window: # Windows are associated with the application # when the last one is closed the application shuts down self.window = AppWindow(self.sidebar, self.ws_sidebar, self.hosts_sidebar, self.terminal, self.console_log, self.statusbar, application=self, title="Faraday " + str(CONF.getVersion())) self.window.set_icon(self.icon) self.window.present() self.loghandler = GUIHandler() model.guiapi.setMainApp(self) addHandler(self.loghandler) self.loghandler.registerGUIOutput(self.window) notifier = model.log.getNotifier() notifier.widget = self.window model.guiapi.notification_center.registerWidget(self.window) if not CouchDbManager.testCouch(CONF.getCouchURI()): self.lost_db_connection( handle_connection_lost=self.handle_connection_lost, connect_to_a_different_couch=self.force_change_couch_url)
def do_activate(self): """If there's no window, create one and present it (show it to user). If there's a window, just present it. Also add the log handler and the notifier to the application""" # We only allow a single window and raise any existing ones if not self.window: # Windows are associated with the application # when the last one is closed the application shuts down self.window = AppWindow(self.sidebar, self.ws_sidebar, self.hosts_sidebar, self.terminal, self.console_log, self.statusbar, application=self, title="Faraday " + str(CONF.getVersion())) self.window.set_icon(self.icon) self.window.present() self.loghandler = GUIHandler() model.guiapi.setMainApp(self) addHandler(self.loghandler) self.loghandler.registerGUIOutput(self.window) notifier = model.log.getNotifier() notifier.widget = self.window model.guiapi.notification_center.registerWidget(self.window) if self.serverIO.server_info() is None: should_login = self.lost_db_connection( handle_connection_lost=self.handle_connection_lost, connect_to_a_different_couch=self.force_change_couch_url) if not should_login: return if not is_authenticated(CONF.getServerURI(), CONF.getDBSessionCookies()): loginDialog = ForceLoginDialog(self.window, self.exit_faraday_without_confirm) loginDialog.run(3, CONF.getServerURI(), self.window) self.reload_workspaces() workspace_argument_set = self.open_workspace_from_args() if not workspace_argument_set: self.open_last_workspace()