def close(self): try: self.widgets = None except TypeError: pass except AttributeError: pass perspective_manager.disable_perspective("fics")
def close(self): try: self.widgets = None except TypeError: pass except AttributeError: pass perspective_manager.disable_perspective("fics")
def on_chessfile_closed(self, persp): if len(self.chessfiles) == 1: self.chessfiles.remove(self.chessfile) self.chessfile.close() perspective_manager.disable_perspective("database") elif self.chessfile.path is not None: self.chessfiles.remove(self.chessfile) self.chessfile.close()
def close(self, widget): i = self.chessfiles.index(self.chessfile) if self.chessfile.path is not None: self.notebooks["gamelist"].remove_page(i) self.notebooks["opening_tree"].remove_page(i) self.notebooks["filter"].remove_page(i) self.notebooks["preview"].remove_page(i) del self.gamelists[i] del self.filter_panels[i] del self.chessfiles[i] self.chessfile.close() if len(self.chessfiles) == 0: self.set_sensitives(False) perspective_manager.disable_perspective("database") self.emit("chessfile_closed")
def close(self, widget): i = self.chessfiles.index(self.chessfile) if self.chessfile.path is not None: self.notebooks["gamelist"].remove_page(i) self.notebooks["opening_tree"].remove_page(i) self.notebooks["filter"].remove_page(i) self.notebooks["preview"].remove_page(i) del self.gamelists[i] del self.filter_panels[i] del self.chessfiles[i] self.chessfile.close() if len(self.chessfiles) == 0: self.set_sensitives(False) perspective_manager.disable_perspective("database") self.emit("chessfile_closed")
def delGameWidget(gmwidg): """ Remove the widget from the GUI after the game has been terminated """ global dock, dockAlign log.debug("gamewidget.delGameWidget: starting %s" % repr(gmwidg)) gmwidg.closed = True gmwidg.emit("closed") called_from_preferences = False window_list = Gtk.Window.list_toplevels() for window in window_list: if window.is_active() and window == widgets["preferences"]: called_from_preferences = True break pageNum = gmwidg.getPageNumber() headbook = getheadbook() if gmwidg.notebookKey in key2gmwidg: del key2gmwidg[gmwidg.notebookKey] if gmwidg.notebookKey in key2cid: headbook.disconnect(key2cid[gmwidg.notebookKey]) del key2cid[gmwidg.notebookKey] headbook.remove_page(pageNum) for notebook in notebooks.values(): notebook.remove_page(pageNum) if headbook.get_n_pages() == 1 and conf.get("hideTabs", False): show_tabs(False) if headbook.get_n_pages() == 0: dock = None dockAlign = None if not called_from_preferences: # If the last (but not the designGW) gmwidg was closed # and we are FICS-ing, present the FICS lounge perspective_manager.disable_perspective("games") gmwidg._del()
def delGameWidget(self, gmwidg): """ Remove the widget from the GUI after the game has been terminated """ log.debug("Games.delGameWidget: starting %s" % repr(gmwidg)) gmwidg.closed = True gmwidg.emit("closed") called_from_preferences = False window_list = Gtk.Window.list_toplevels() widgets = gamewidget.getWidgets() for window in window_list: if window.is_active() and window == widgets["preferences"]: called_from_preferences = True break pageNum = gmwidg.getPageNumber() headbook = self.getheadbook() if gmwidg.notebookKey in self.key2gmwidg: del self.key2gmwidg[gmwidg.notebookKey] if gmwidg.notebookKey in self.key2cid: headbook.disconnect(self.key2cid[gmwidg.notebookKey]) del self.key2cid[gmwidg.notebookKey] headbook.remove_page(pageNum) for notebook in self.notebooks.values(): notebook.remove_page(pageNum) if headbook.get_n_pages() == 1 and conf.get("hideTabs"): self.show_tabs(False) if headbook.get_n_pages() == 0: if not called_from_preferences: # If the last (but not the designGW) gmwidg was closed # and we are FICS-ing, present the FICS lounge perspective_manager.disable_perspective("games") gmwidg._del()
def close(self, close_button): for page in list(self.page_dict.keys()): if self.page_dict[page][1] == close_button: chessfile = self.page_dict[page][0] i = self.chessfiles.index(chessfile) self.notebooks["gamelist"].remove_page(i) self.notebooks["OpeningTreePanel"].remove_page(i) self.notebooks["FilterPanel"].remove_page(i) self.notebooks["PreviewPanel"].remove_page(i) del self.gamelists[i] del self.filter_panels[i] del self.chessfiles[i] chessfile.close() del self.page_dict[page] self.headbook.remove_page(self.headbook.page_num(page)) break if len(self.chessfiles) == 0: self.set_sensitives(False) perspective_manager.disable_perspective("database") self.emit("chessfile_closed")
def close(self, close_button): for page in list(self.page_dict.keys()): if self.page_dict[page][1] == close_button: chessfile = self.page_dict[page][0] i = self.chessfiles.index(chessfile) self.notebooks["gamelist"].remove_page(i) self.notebooks["OpeningTreePanel"].remove_page(i) self.notebooks["FilterPanel"].remove_page(i) self.notebooks["PreviewPanel"].remove_page(i) del self.gamelists[i] del self.filter_panels[i] del self.chessfiles[i] chessfile.close() del self.page_dict[page] self.headbook.remove_page(self.headbook.page_num(page)) break if len(self.chessfiles) == 0: self.set_sensitives(False) perspective_manager.disable_perspective("database") self.emit("chessfile_closed")
def on_exit_clicked(button): perspective_manager.disable_perspective("learn")
def on_exit_clicked(button): perspective_manager.disable_perspective("learn")