Logo Search packages:      
Sourcecode: viridian version File versions  Download package

def AmpacheTools::AmpacheGUI::AmpacheGUI::albums_cursor_changed (   self,
  widget,
  data = None 
)
The function that runs when the user clicks an album.

Definition at line 2021 of file AmpacheGUI.py.

                                                        :
            """The function that runs when the user clicks an album."""
            cursor = widget.get_cursor()
            model  = widget.get_model()
            row    = cursor[0]
            
            album_name = model[row][0]
            album_id   = model[row][1]
            
            try:
                  if self.album_id == album_id and self.album_name == album_name:
                        return True # don't refresh if the user reclicks the album
            except:
                  pass

            self.continue_load_songs = False
            
            self.album_name = album_name
            self.album_id   = album_id

            song_list_store = self.song_list_store
            song_list_store.clear()
            
            if album_id == -1: # all albums
                  self.continue_load_songs = True
                  list = []
                  for album in model:
                        list.append(album[1])
                  for album_id in list:
                        if album_id != -1:
                              if self.continue_load_songs == False:
                                    return False
                              if self.__add_songs_to_list_store(album_id):
                                    self.update_statusbar(_("Fetching Album id: ") + str(album_id))
                  self.update_statusbar(album_name.replace('<b>', '').replace('</b>', '') + " - " + self.artist_name.replace('<b>', '').replace('</b>', ''))
            else: # single album
                  if self.__add_songs_to_list_store(album_id):
                        self.update_statusbar(album_name + " - " + self.artist_name.replace('<b>', '').replace('</b>', ''))
                        

Generated by  Doxygen 1.6.0   Back to index