def on_tab_change(self, notebook, page, page_num): """ Callback method handling tab changes. @param notebook - the notebook instance @param page - notebookpage @param page_num - number of the current page """ #load favorites and recent servers directly if switched to #these tabs gc = GuiController() if 1 == page_num: #favorites #gc.loadFavorites(self.favoritestab) gc.executeFavoritesLoading(self.favoritestab) self.favoritestab.filter.lock() if 2 == page_num: #recent server #gc.loadRecentServer(self.recenttab) gc.executeRecentServersLoading(self.recenttab) self.recenttab.filter.lock() if 3 == page_num: #buddies tab fm = FileManager() config = fm.getConfiguration() execute = fm.value_as_boolean(config[cfgkey.OPT_BUDDYSEARCH]) if self.first_switch and execute: gc.execute_buddies_loading(self.buddiestab, execute=True) else: gc.execute_buddies_loading(self.buddiestab) self.first_switch = False
def on_refresh_clicked(self, widget): """ Callback for the refresh button """ self.refresh_button.set_sensitive(False) guicontroller = GuiController() guicontroller.executeRecentServersLoading(self.parent)