?next? is now ?next song? implemented

This commit is contained in:
coderkun 2012-07-23 13:54:34 +02:00
commit 262e99beb9
2 changed files with 9 additions and 12 deletions

11
mcg.py
View file

@ -97,10 +97,10 @@ class MCGClient:
self._add_action(self._playpause) self._add_action(self._playpause)
def next(self): def next_song(self):
"""Plays the next album in the current order """Plays the next album in the current order
""" """
self._add_action(self._next) self._add_action(self._next_song)
def connect_signal(self, signal, callback): def connect_signal(self, signal, callback):
@ -251,13 +251,10 @@ class MCGClient:
self._client.play() self._client.play()
def _next(self): def _next_song(self):
"""Action: Performs the real next command. """Action: Performs the real next command.
""" """
song = self._client.currentsong() self._client.next()
if song:
current_album = MCGAlbum(song['artist'], song['album'], song['date'], os.path.dirname(song['file']))
# TODO _next()
def _idle(self, modules): def _idle(self, modules):

View file

@ -40,7 +40,7 @@ class MCGGtk(Gtk.Window):
self._toolbar.connect_signal(Toolbar.SIGNAL_CONNECT, self.toolbar_connect_cb) self._toolbar.connect_signal(Toolbar.SIGNAL_CONNECT, self.toolbar_connect_cb)
self._toolbar.connect_signal(Toolbar.SIGNAL_UPDATE, self.toolbar_update_cb) self._toolbar.connect_signal(Toolbar.SIGNAL_UPDATE, self.toolbar_update_cb)
self._toolbar.connect_signal(Toolbar.SIGNAL_PLAYPAUSE, self.toolbar_playpause_cb) self._toolbar.connect_signal(Toolbar.SIGNAL_PLAYPAUSE, self.toolbar_playpause_cb)
self._toolbar.connect_signal(Toolbar.SIGNAL_NEXT, self.toolbar_next_cb) self._toolbar.connect_signal(Toolbar.SIGNAL_NEXT_SONG, self.toolbar_next_song_cb)
self._toolbar.connect_signal(Toolbar.SIGNAL_FILTER, self.toolbar_filter_cb) self._toolbar.connect_signal(Toolbar.SIGNAL_FILTER, self.toolbar_filter_cb)
self._toolbar.connect_signal(Toolbar.SIGNAL_GRID_SIZE_TEMP, self.toolbar_grid_size_temp_cb) self._toolbar.connect_signal(Toolbar.SIGNAL_GRID_SIZE_TEMP, self.toolbar_grid_size_temp_cb)
self._toolbar.connect_signal(Toolbar.SIGNAL_GRID_SIZE, self.toolbar_grid_size_cb) self._toolbar.connect_signal(Toolbar.SIGNAL_GRID_SIZE, self.toolbar_grid_size_cb)
@ -99,8 +99,8 @@ class MCGGtk(Gtk.Window):
self._mcg.playpause() self._mcg.playpause()
def toolbar_next_cb(self): def toolbar_next_song_cb(self):
self._mcg.next() self._mcg.next_song()
def toolbar_filter_cb(self, filter_string): def toolbar_filter_cb(self, filter_string):
@ -223,7 +223,7 @@ class Toolbar(Gtk.Toolbar):
SIGNAL_CONNECT = 'connect' SIGNAL_CONNECT = 'connect'
SIGNAL_UPDATE = 'update' SIGNAL_UPDATE = 'update'
SIGNAL_PLAYPAUSE = 'playpause' SIGNAL_PLAYPAUSE = 'playpause'
SIGNAL_NEXT = 'next' SIGNAL_NEXT_SONG = 'next-song'
SIGNAL_FILTER = 'filter' SIGNAL_FILTER = 'filter'
SIGNAL_GRID_SIZE_TEMP = 'grid-size-temp' SIGNAL_GRID_SIZE_TEMP = 'grid-size-temp'
SIGNAL_GRID_SIZE = 'grid-size' SIGNAL_GRID_SIZE = 'grid-size'
@ -271,7 +271,7 @@ class Toolbar(Gtk.Toolbar):
self._connection_button.connect('clicked', self._callback_with_function, self.SIGNAL_CONNECT) self._connection_button.connect('clicked', self._callback_with_function, self.SIGNAL_CONNECT)
self._update_button.connect('clicked', self._callback_with_function, self.SIGNAL_UPDATE) self._update_button.connect('clicked', self._callback_with_function, self.SIGNAL_UPDATE)
self._playpause_button.connect('clicked', self._callback_with_function, self.SIGNAL_PLAYPAUSE) self._playpause_button.connect('clicked', self._callback_with_function, self.SIGNAL_PLAYPAUSE)
self._next_button.connect('clicked', self._callback_with_function, self.SIGNAL_NEXT) self._next_button.connect('clicked', self._callback_with_function, self.SIGNAL_NEXT_SONG)
self._filter_entry.connect('changed', self._callback_with_function, self.SIGNAL_FILTER, self._filter_entry.get_text) self._filter_entry.connect('changed', self._callback_with_function, self.SIGNAL_FILTER, self._filter_entry.get_text)
self._grid_size_scale.connect('change-value', self.grid_size_temp_cb) self._grid_size_scale.connect('change-value', self.grid_size_temp_cb)
self._grid_size_scale.connect('button-release-event', self.grid_size_cb) self._grid_size_scale.connect('button-release-event', self.grid_size_cb)