def __key_press(self, songlist, event, librarian, player): if qltk.is_accel(event, "<Primary>Return", "<Primary>KP_Enter"): self.__enqueue(self.get_selected_songs()) return True elif qltk.is_accel(event, "<Primary>F"): self.emit('start-interactive-search') return True elif qltk.is_accel(event, "<Primary>Delete"): songs = self.get_selected_songs() if songs: trash_songs(self, songs, librarian) return True elif qltk.is_accel(event, "<alt>Return"): songs = self.get_selected_songs() if songs: window = SongProperties(librarian, songs, parent=self) window.show() return True elif qltk.is_accel(event, "<Primary>I"): songs = self.get_selected_songs() if songs: window = Information(librarian, songs, self) window.show() return True elif qltk.is_accel(event, "space", "KP_Space") and player is not None: player.paused = not player.paused return True return False
def __key_press(self, songlist, event, librarian): rating_accels = [ "<Primary>%d" % i for i in range( min(10, config.RATINGS.number + 1))] if (qltk.is_accel(event, *rating_accels) and config.getboolean("browsers", "rating_hotkeys")): rating = int(chr(event.keyval)) * config.RATINGS.precision self.__set_rating(rating, self.get_selected_songs(), librarian) return True elif qltk.is_accel(event, "<Primary>Return", "<Primary>KP_Enter"): self.__enqueue(self.get_selected_songs()) return True elif qltk.is_accel(event, "<Primary>F"): self.emit('start-interactive-search') return True elif qltk.is_accel(event, "<Primary>Delete"): songs = self.get_selected_songs() if songs: trash_songs(self, songs, librarian) return True elif qltk.is_accel(event, "<alt>Return"): songs = self.get_selected_songs() if songs: window = SongProperties(librarian, songs, parent=self) window.show() return True elif qltk.is_accel(event, "<Primary>I"): songs = self.get_selected_songs() if songs: window = Information(librarian, songs, self) window.show() return True return False
def trash_cb(item): parent = get_menu_item_top_parent(item) trash_songs(parent, songs, librarian)