示例#1
0
 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
示例#2
0
    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
示例#3
0
 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
示例#4
0
 def trash_cb(item):
     parent = get_menu_item_top_parent(item)
     trash_songs(parent, songs, librarian)
示例#5
0
 def trash_cb(item):
     parent = get_menu_item_top_parent(item)
     trash_songs(parent, songs, librarian)