fixup! Port UI to GTK 4
This commit is contained in:
parent
d5531693f5
commit
6b6ccbd942
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue