def hide_app(self, empty=False): """ Hide the current application in this window :param bool empty: if ``True``, do not add the default launcher application """ self.application_box.hide() if self.current_app: if self.current_app.app_name != 'launcher': self.application_actions[ self.current_app.app_name].set_visible(True) inventory_bar = getattr(self.current_app, 'inventory_bar', None) if inventory_bar: inventory_bar.hide() if self.current_app.search: self.current_app.search.save_columns() self.current_app.deactivate() if self._help_ui: self.uimanager.remove_ui(self._help_ui) self._help_ui = None self.current_widget.destroy() StopApplicationEvent.emit(self.current_app.app_name, self.current_app) self.current_app = None self._empty_message_area() for item in self.tool_items: item.destroy() self.tool_items = [] self._update_toggle_actions('launcher') if not empty: self.run_application(app_name=u'launcher')
def hide_app(self, empty=False): """ Hide the current application in this window :param bool empty: if ``True``, do not add the default launcher application """ self.application_box.hide() if self.current_app: inventory_bar = getattr(self.current_app, "inventory_bar", None) if inventory_bar: inventory_bar.hide() if self.current_app.search: self.current_app.search.save_columns() self.current_app.deactivate() if self._help_ui: self.uimanager.remove_ui(self._help_ui) self._help_ui = None self.current_widget.destroy() StopApplicationEvent.emit(self.current_app.app_name, self.current_app) self.current_app = None self._empty_message_area() for item in self.tool_items: item.destroy() self.tool_items = [] self._update_toggle_actions("launcher") if not empty: self.run_application(app_name=u"launcher")
def hide_app(self, empty=False): """ Hide the current application in this window :param bool empty: if ``True``, do not add the default launcher application """ self.application_box.hide() # Reset menus/headerbar self.main_menu.remove_all() self.search_menu.remove_all() self.new_menu.remove_all() if self.current_app: inventory_bar = getattr(self.current_app, 'inventory_bar', None) if inventory_bar: inventory_bar.hide() if self.current_app.search: self.current_app.search.save_columns() self.current_app.deactivate() # We need to remove the accels for this app, otherwise they would # still be active from other applications for spec in self._action_specs.values(): fullname, icon, label, accel = spec[:-1] if accel: self.app.set_accels_for_action(fullname, []) if self._help_section: self.help_section.remove(0) self._help_section = None self.current_widget.destroy() StopApplicationEvent.emit(self.current_app.app_name, self.current_app) self.current_app = None self._empty_message_area() if not empty: self.run_application(app_name=u'launcher')