def __key_press(self, songlist, event, librarian): rating_accels = [ "<ctrl>%d" % i for i in range(min(10, config.RATINGS.number + 1)) ] if qltk.is_accel(event, *rating_accels): rating = int(chr(event.keyval)) * config.RATINGS.precision self.__set_rating(rating, self.get_selected_songs(), librarian) return True elif qltk.is_accel(event, "<ctrl>Return", "<ctrl>KP_Enter"): self.__enqueue(self.get_selected_songs()) return True elif qltk.is_accel(event, "<control>F"): self.emit('start-interactive-search') 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, "<control>I"): songs = self.get_selected_songs() if songs: window = Information(librarian, songs, self) window.show() return True return False
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 = [ "<ctrl>%d" % i for i in range(min(10, config.RATINGS.number + 1))] if qltk.is_accel(event, *rating_accels): rating = int(chr(event.keyval)) * config.RATINGS.precision self.__set_rating(rating, self.get_selected_songs(), librarian) return True elif qltk.is_accel(event, "<ctrl>Return", "<ctrl>KP_Enter"): self.__enqueue(self.get_selected_songs()) return True elif qltk.is_accel(event, "<control>F"): self.emit('start-interactive-search') 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, "<control>I"): songs = self.get_selected_songs() if songs: window = Information(librarian, songs, self) window.show() return True return False
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): if event.string in ['0', '1', '2', '3', '4']: rating = min(1.0, int(event.string) * config.RATINGS.precision) self.__set_rating(rating, self.get_selected_songs(), librarian) return True elif qltk.is_accel(event, "<ctrl>Return") or \ qltk.is_accel(event, "<ctrl>KP_Enter"): self.__enqueue(self.get_selected_songs()) return True elif qltk.is_accel(event, "<control>F"): self.emit('start-interactive-search') 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, "<control>I"): songs = self.get_selected_songs() if songs: window = Information(librarian, songs, self) window.show() return True return False
def __song_properties(self, librarian): model, rows = self.get_selection().get_selected_rows() if rows: songs = [model[row][0] for row in rows] else: from quodlibet import app if app.player.song: songs = [app.player.song] else: return window = SongProperties(librarian, songs, parent=self) window.show()
def __song_properties(self, librarian): model, rows = self.get_selection().get_selected_rows() if rows: songs = [model[row][0] for row in rows] else: from quodlibet import app if app.player.song: songs = [app.player.song] else: return window = SongProperties(librarian, songs, parent=self) window.show()
def _properties(app, value=None): library = app.library player = app.player window = app.window if value: if value in library: songs = [library[value]] else: songs = library.query(value) else: songs = [player.song] songs = filter(None, songs) if songs: window = SongProperties(library, songs, parent=window) window.show()
def _properties(app, value=None): library = app.library player = app.player window = app.window if value: if value in library: songs = [library[value]] else: songs = library.query(value) else: songs = [player.song] songs = filter(None, songs) if songs: window = SongProperties(library, songs, parent=window) window.show()
def __key_pressed(self, view, event, librarian): # if ctrl+a is pressed, intercept and select the All entry instead if is_accel(event, "<Primary>a"): self.set_selected([]) return True elif is_accel(event, "<Primary>Return", "<Primary>KP_Enter"): qltk.enqueue(self.__get_selected_songs(sort=True)) return True elif is_accel(event, "<alt>Return"): songs = self.__get_selected_songs(sort=True) if songs: window = SongProperties(librarian, songs, parent=self) window.show() return True elif is_accel(event, "<Primary>I"): songs = self.__get_selected_songs(sort=True) if songs: window = Information(librarian, songs, self) window.show() return True return False
def __key_pressed(self, view, event, librarian): # if ctrl+a is pressed, intercept and select the All entry instead if is_accel(event, "<Primary>a"): self.set_selected([]) return True elif is_accel(event, "<Primary>Return", "<Primary>KP_Enter"): self.__enqueue(self.__get_selected_songs(sort=True)) return True elif is_accel(event, "<alt>Return"): songs = self.__get_selected_songs(sort=True) if songs: window = SongProperties(librarian, songs, parent=self) window.show() return True elif is_accel(event, "<Primary>I"): songs = self.__get_selected_songs(sort=True) if songs: window = Information(librarian, songs, self) window.show() return True return False
def song_properties_cb(menu_item): parent = get_menu_item_top_parent(menu_item) window = SongProperties(librarian, songs, parent) window.show()
def __properties(self, *args): song = app.player.song if song: window = SongProperties(app.librarian, [song]) window.show()
def song_properties_cb(menu_item): window = SongProperties(librarian, songs, parent) window.show()
def on_properties(*args): song = player.song window = SongProperties(app.librarian, [song]) window.show()
def __current_song_prop(self, *args): song = app.player.song if song: librarian = self.__library.librarian window = SongProperties(librarian, [song], parent=self) window.show()
def song_properties_cb(menu_item): parent = get_menu_item_top_parent(menu_item) window = SongProperties(librarian, songs, parent) window.show()
def __current_song_prop(self, *args): song = app.player.song if song: librarian = self.__library.librarian window = SongProperties(librarian, [song], parent=self) window.show()
def __properties(self, *args): song = app.player.song if song: window = SongProperties(app.librarian, [song]) window.show()
def on_properties(*args): song = player.song window = SongProperties(app.librarian, [song]) window.show()