Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 41cd5be874 | |||
| 6b6ccbd942 |
3 changed files with 20 additions and 96 deletions
|
|
@ -1,75 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<interface>
|
|
||||||
<menu id="app-menu">
|
|
||||||
<section>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">win.connect</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Connect</attribute>
|
|
||||||
<attribute name="accel"><Primary>c</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">win.play</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Play</attribute>
|
|
||||||
<attribute name="accel"><Primary>p</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">win.clear-playlist</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Clear Playlist</attribute>
|
|
||||||
<attribute name="accel"><Primary>r</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">win.toggle-fullscreen</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Toggle Fullscreen</attribute>
|
|
||||||
<attribute name="accel">F11</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">win.search-library</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Search Library</attribute>
|
|
||||||
<attribute name="accel"><Primary>f</attribute>
|
|
||||||
</item>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">win.panel</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Connection</attribute>
|
|
||||||
<attribute name="target">0</attribute>
|
|
||||||
<attribute name="accel"><Primary>KP_1</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">win.panel</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Cover</attribute>
|
|
||||||
<attribute name="target">1</attribute>
|
|
||||||
<attribute name="accel"><Primary>KP_2</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">win.panel</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Playlist</attribute>
|
|
||||||
<attribute name="target">2</attribute>
|
|
||||||
<attribute name="accel"><Primary>KP_3</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">win.panel</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Library</attribute>
|
|
||||||
<attribute name="target">3</attribute>
|
|
||||||
<attribute name="accel"><Primary>KP_4</attribute>
|
|
||||||
</item>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">win.show-help-overlay</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Keyboard Shortcuts</attribute>
|
|
||||||
<attribute name="accel"><Primary>k</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">app.info</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Info</attribute>
|
|
||||||
<attribute name="accel"><Primary>i</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="action">app.quit</attribute>
|
|
||||||
<attribute name="label" translatable="yes">Quit</attribute>
|
|
||||||
<attribute name="accel"><Primary>q</attribute>
|
|
||||||
</item>
|
|
||||||
</section>
|
|
||||||
</menu>
|
|
||||||
</interface>
|
|
||||||
|
|
@ -29,8 +29,15 @@ class Application(Gtk.Application):
|
||||||
self.set_accels_for_action('window.close', ['<primary>q'])
|
self.set_accels_for_action('window.close', ['<primary>q'])
|
||||||
self.set_accels_for_action('win.show-help-overlay', ['<primary>k'])
|
self.set_accels_for_action('win.show-help-overlay', ['<primary>k'])
|
||||||
self.set_accels_for_action('app.info', ['<primary>i'])
|
self.set_accels_for_action('app.info', ['<primary>i'])
|
||||||
#self.create_action('about', self.on_about_action)
|
self.set_accels_for_action('win.connect', ['<primary>c'])
|
||||||
#self.create_action('preferences', self.on_preferences_action)
|
self.set_accels_for_action('win.play', ['<primary>p'])
|
||||||
|
self.set_accels_for_action('win.clear-playlist', ['<primary>r'])
|
||||||
|
self.set_accels_for_action('win.toggle-fullscreen', ['F11'])
|
||||||
|
self.set_accels_for_action('win.search-library', ['<primary>f'])
|
||||||
|
self.set_accels_for_action('win.panel("0")', ['<primary>KP_1'])
|
||||||
|
self.set_accels_for_action('win.panel("1")', ['<primary>KP_2'])
|
||||||
|
self.set_accels_for_action('win.panel("2")', ['<primary>KP_3'])
|
||||||
|
self.set_accels_for_action('win.panel("3")', ['<primary>KP_4'])
|
||||||
|
|
||||||
|
|
||||||
def do_startup(self):
|
def do_startup(self):
|
||||||
|
|
@ -40,7 +47,6 @@ class Application(Gtk.Application):
|
||||||
self._set_default_settings()
|
self._set_default_settings()
|
||||||
self._load_css()
|
self._load_css()
|
||||||
self._setup_actions()
|
self._setup_actions()
|
||||||
self._load_appmenu()
|
|
||||||
self._setup_adw()
|
self._setup_adw()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -102,14 +108,6 @@ class Application(Gtk.Application):
|
||||||
self.add_action(action)
|
self.add_action(action)
|
||||||
|
|
||||||
|
|
||||||
def _load_appmenu(self):
|
|
||||||
builder = Gtk.Builder()
|
|
||||||
# FIXME Handle menu
|
|
||||||
#builder.set_translation_domain(Application.DOMAIN)
|
|
||||||
#builder.add_from_resource(self._get_resource_path('ui/gtk.menu.ui'))
|
|
||||||
#self.set_app_menu(builder.get_object('app-menu'))
|
|
||||||
|
|
||||||
|
|
||||||
def _get_resource_path(self, path):
|
def _get_resource_path(self, path):
|
||||||
return "/{}/{}".format(Application.ID.replace('.', '/'), path)
|
return "/{}/{}".format(Application.ID.replace('.', '/'), path)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -616,16 +616,17 @@ class Client(Base):
|
||||||
|
|
||||||
def _queue_album(self, album):
|
def _queue_album(self, album):
|
||||||
track_ids = []
|
track_ids = []
|
||||||
self._logger.info("add album %s", album)
|
if album in self._albums:
|
||||||
for track in album.get_tracks():
|
self._logger.info("add album %s", album)
|
||||||
self._logger.info("addid: %r", track.get_file())
|
for track in self._albums[album].get_tracks():
|
||||||
track_id = None
|
self._logger.info("addid: %r", track.get_file())
|
||||||
track_id_response = self._parse_dict(self._call('addid', track.get_file()))
|
track_id = None
|
||||||
if 'id' in track_id_response:
|
track_id_response = self._parse_dict(self._call('addid', track.get_file()))
|
||||||
track_id = track_id_response['id']
|
if 'id' in track_id_response:
|
||||||
self._logger.debug("track id: %r", track_id)
|
track_id = track_id_response['id']
|
||||||
if track_id is not None:
|
self._logger.debug("track id: %r", track_id)
|
||||||
track_ids.append(track_id)
|
if track_id is not None:
|
||||||
|
track_ids.append(track_id)
|
||||||
return track_ids
|
return track_ids
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue