def on_search_clicked(self, button): """ Callback of the search button """ #disable the button, so that no multiple queries are launched while #still one is active self.lock() filter = Filter(FilterType.ADVANCED_FILTER) filter.initialize_from_stored_filter_settings() guicontroller = GuiController() guicontroller.executeMasterServerQuery(filter, self.parent)
def on_search_buddies_clicked(self, widget): """ Callback of the search buddies button """ self.lock() fm = FileManager() #create a filter object filter = Filter(FilterType.BUDDY_FILTER, self.parenttab) filter.playerlist = fm.get_buddies() self.parenttab.set_all_buddies_to_offline() gc = GuiController() gc.executeMasterServerQuery(filter, self.parenttab)
def on_search_clicked(self, widget): """ Callback for the search button - triggers the execution of the master server query """ #disable the button, so that no multiple queries are launched while #still one is active self.lock() #update the filter dict of the filemanager self.save_filter() filter = Filter(FilterType.BASIC_FILTER) filter.initialize_from_stored_filter_settings() guicontroller = GuiController() guicontroller.executeMasterServerQuery(filter, self.parent)
def on_search_player_clicked(self, widget): """ Callback of the player search button """ self.search_button.set_sensitive(False) self.playersearchbutton.set_sensitive(False) name2search = self.playersearch_entry.get_text() searchname_list = [] searchname_list.append(name2search) #create the filter object filter = Filter(FilterType.BUDDY_FILTER) filter.playerlist = searchname_list self.parenttab.set_all_buddies_to_offline() gc = GuiController() gc.executeMasterServerQuery(filter, self.parenttab)
def load_buddies(self, tab, execute): """ Loads the buddylist and append the values to the treeview on the passed tab @param tab - the tab requesting the buddylist @execute - boolean value. If True immediately start a buddy search after loading the buddylist """ Log.log.debug('[GuiController] load_buddies called...') fm = FileManager() buddylist = fm.get_buddies() for name in buddylist: gobject.idle_add(tab.append_buddy_to_list, name) if execute: tab.filter.lock() #create a filter object filter = Filter(FilterType.BUDDY_FILTER, tab) filter.playerlist = fm.get_buddies() tab.set_all_buddies_to_offline() self.executeMasterServerQuery(filter, tab)