def on_search_entry_activated(self, widget): self.set_status(self.STATUS_SEARCHING) # clear existing search self.model.clear() # get type of search iter = self.search_combobox.get_active_iter() search_type = self.search_combobox.get_model().get_value(iter, 0) iter = self.orderby_type_combobox.get_active_iter() orderby = self.orderby_type_combobox.get_model().get_value(iter, 0) iter = self.orderby_direction_combobox.get_active_iter() direction = self.orderby_direction_combobox.get_model().get_value(iter, 0) orderby += "_" + direction numresults = self.numresults_spinbutton.get_value_as_int() search_term = self.search_textentry.get_text() # save search term settings.set_option('plugin/jamendo/searchterms', search_term) if search_type == 'artist': resultthread = jamapi.get_artist_list(search_term, orderby, numresults, self.response_callback) resultthread.start() if search_type == 'album': resultthread = jamapi.get_album_list(search_term, orderby, numresults, self.response_callback) resultthread.start() if search_type == 'genre_tags': resultthread = jamapi.get_artist_list_by_genre(search_term, orderby, numresults, self.response_callback) resultthread.start() if search_type == 'track': resultthread = jamapi.get_track_list(search_term, orderby, numresults, self.response_callback) resultthread.start()
def on_search_entry_activated(self, widget): self.set_status(self.STATUS_SEARCHING) #clear existing search self.model.clear() #get type of search iter = self.search_combobox.get_active_iter() search_type = self.search_combobox.get_model().get_value(iter, 0) iter = self.orderby_type_combobox.get_active_iter() orderby = self.orderby_type_combobox.get_model().get_value(iter, 0) iter = self.orderby_direction_combobox.get_active_iter() direction = self.orderby_direction_combobox.get_model().get_value(iter, 0) orderby += "_" + direction numresults = self.numresults_spinbutton.get_value_as_int() search_term = self.search_textentry.get_text() #save search term settings.set_option('plugin/jamendo/searchterms', search_term) results = None if search_type == 'artist': resultthread = jamapi.get_artist_list(search_term, orderby, numresults, self.response_callback) resultthread.start(); if search_type == 'album': resultthread = jamapi.get_album_list(search_term, orderby, numresults, self.response_callback) resultthread.start() if search_type == 'genre_tags': resultthread = jamapi.get_artist_list_by_genre(search_term, orderby, numresults, self.response_callback) resultthread.start() if search_type == 'track': resultthread = jamapi.get_track_list(search_term, orderby, numresults, self.response_callback) resultthread.start()