mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
fixed main menu
This commit is contained in:
parent
c953bfa8b3
commit
e79b6f8d6f
25
bin/mpdevil
25
bin/mpdevil
|
@ -3416,9 +3416,9 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||||
settings_action.connect("activate", self._on_settings)
|
settings_action.connect("activate", self._on_settings)
|
||||||
self.add_action(settings_action)
|
self.add_action(settings_action)
|
||||||
|
|
||||||
stats_action=Gio.SimpleAction.new("stats", None)
|
self._stats_action=Gio.SimpleAction.new("stats", None)
|
||||||
stats_action.connect("activate", self._on_stats)
|
self._stats_action.connect("activate", self._on_stats)
|
||||||
self.add_action(stats_action)
|
self.add_action(self._stats_action)
|
||||||
|
|
||||||
self._update_action=Gio.SimpleAction.new("update", None)
|
self._update_action=Gio.SimpleAction.new("update", None)
|
||||||
self._update_action.connect("activate", self._on_update)
|
self._update_action.connect("activate", self._on_update)
|
||||||
|
@ -3449,10 +3449,13 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||||
subsection.append(_("About"), "app.about")
|
subsection.append(_("About"), "app.about")
|
||||||
subsection.append(_("Quit"), "app.quit")
|
subsection.append(_("Quit"), "app.quit")
|
||||||
|
|
||||||
|
mpd_subsection=Gio.Menu()
|
||||||
|
mpd_subsection.append(_("Update database"), "win.update")
|
||||||
|
mpd_subsection.append(_("Server stats"), "win.stats")
|
||||||
|
|
||||||
menu=Gio.Menu()
|
menu=Gio.Menu()
|
||||||
menu.append(_("Save window layout"), "win.save")
|
menu.append(_("Save window layout"), "win.save")
|
||||||
menu.append(_("Update database"), "win.update")
|
menu.append_section(None, mpd_subsection)
|
||||||
menu.append(_("Server stats"), "win.stats")
|
|
||||||
menu.append_section(None, subsection)
|
menu.append_section(None, subsection)
|
||||||
|
|
||||||
menu_button=Gtk.MenuButton(image=self._icons["open-menu-symbolic"], tooltip_text=_("Menu"))
|
menu_button=Gtk.MenuButton(image=self._icons["open-menu-symbolic"], tooltip_text=_("Menu"))
|
||||||
|
@ -3543,6 +3546,8 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||||
def _on_reconnected(self, *args):
|
def _on_reconnected(self, *args):
|
||||||
self._dbus_service.acquire_name()
|
self._dbus_service.acquire_name()
|
||||||
self._playback_control.set_sensitive(True)
|
self._playback_control.set_sensitive(True)
|
||||||
|
self._update_action.set_enabled(True)
|
||||||
|
self._stats_action.set_enabled(True)
|
||||||
|
|
||||||
def _on_disconnected(self, *args):
|
def _on_disconnected(self, *args):
|
||||||
self._dbus_service.release_name()
|
self._dbus_service.release_name()
|
||||||
|
@ -3551,6 +3556,8 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||||
self._header_bar.set_subtitle("")
|
self._header_bar.set_subtitle("")
|
||||||
self.songid_playing=None
|
self.songid_playing=None
|
||||||
self._playback_control.set_sensitive(False)
|
self._playback_control.set_sensitive(False)
|
||||||
|
self._update_action.set_enabled(False)
|
||||||
|
self._stats_action.set_enabled(False)
|
||||||
|
|
||||||
def _on_key_press_event(self, widget, event):
|
def _on_key_press_event(self, widget, event):
|
||||||
ctrl = (event.state & Gdk.ModifierType.CONTROL_MASK)
|
ctrl = (event.state & Gdk.ModifierType.CONTROL_MASK)
|
||||||
|
@ -3608,13 +3615,11 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||||
settings.destroy()
|
settings.destroy()
|
||||||
|
|
||||||
def _on_stats(self, action, param):
|
def _on_stats(self, action, param):
|
||||||
if self._client.connected():
|
stats=ServerStats(self, self._client, self._settings)
|
||||||
stats=ServerStats(self, self._client, self._settings)
|
stats.destroy()
|
||||||
stats.destroy()
|
|
||||||
|
|
||||||
def _on_update(self, action, param):
|
def _on_update(self, action, param):
|
||||||
if self._client.connected():
|
self._client.wrapped_call("update")
|
||||||
self._client.wrapped_call("update")
|
|
||||||
|
|
||||||
def _on_help(self, action, param):
|
def _on_help(self, action, param):
|
||||||
Gtk.show_uri_on_window(self, "https://github.com/SoongNoonien/mpdevil/wiki/Usage", Gdk.CURRENT_TIME)
|
Gtk.show_uri_on_window(self, "https://github.com/SoongNoonien/mpdevil/wiki/Usage", Gdk.CURRENT_TIME)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user