def _on_star_toggled(self, widget, path): try: _iter = self.model.get_iter(path) except TypeError: return new_value = not self.model.get_value(_iter, 10) self.model.set_value(_iter, 10, new_value) song_item = self.model.get_value(_iter, 5) # er, will this definitely return MediaAudio obj.? grilo.toggle_favorite(song_item) # toggle favorite status in database playlists.update_static_playlist(StaticPlaylists.Favorites) # Use this flag to ignore the upcoming _on_item_activated call self.star_renderer_click = True
def _on_star_toggled(self, widget, path): try: _iter = self.model.get_iter(path) except TypeError: return new_value = not self.model.get_value(_iter, 10) self.model.set_value(_iter, 10, new_value) song_item = self.model.get_value( _iter, 5) # er, will this definitely return MediaAudio obj.? grilo.toggle_favorite(song_item) # toggle favorite status in database playlists.update_static_playlist(StaticPlaylists.Favorites) # Use this flag to ignore the upcoming _on_item_activated call self.star_renderer_click = True
def _on_star_toggled(self, widget, path): try: _iter = self.parent.model.get_iter(path) except TypeError: return try: if self.parent.model.get_value(_iter, 9) == 2: return except AttributeError: return new_value = not self.parent.model.get_value(_iter, self.star_index) self.parent.model.set_value(_iter, self.star_index, new_value) song_item = self.parent.model.get_value(_iter, 5) grilo.toggle_favorite(song_item) # toggle favorite status in database playlists.update_static_playlist(StaticPlaylists.Favorites) # Use this flag to ignore the upcoming _on_item_activated call self.star_renderer_click = True
def _on_star_toggled(self, widget, path): """Called if a star is clicked""" try: _iter = self._parent.model.get_iter(path) except TypeError: return try: if self._parent.model[_iter][9] == 2: return except AttributeError: return new_value = not self._parent.model[_iter][self._star_index] self._parent.model[_iter][self._star_index] = new_value song_item = self._parent.model[_iter][5] grilo.toggle_favorite(song_item) playlists.update_static_playlist(StaticPlaylists.Favorites) # Use this flag to ignore the upcoming _on_item_activated call self.star_renderer_click = True
def _on_star_toggled(self, widget, path): """Called if a star is clicked""" try: _iter = self._parent.model.get_iter(path) except TypeError: return try: if self._parent.model[_iter][self._star_index] == 2: return except AttributeError: return new_value = not self._parent.model[_iter][self._star_index] self._parent.model[_iter][self._star_index] = new_value song_item = self._parent.model[_iter][5] grilo.toggle_favorite(song_item) playlists.update_smart_playlist(SmartPlaylists.Favorites) # Use this flag to ignore the upcoming _on_item_activated call self.star_renderer_click = True