|
|
5d0735 |
From 033f56ef82e06f35a8a9be8f1ce8a7fa1cf9a16b Mon Sep 17 00:00:00 2001
|
|
|
5d0735 |
From: Bastien Nocera <hadess@hadess.net>
|
|
|
5d0735 |
Date: Fri, 20 May 2016 15:57:12 +0200
|
|
|
5d0735 |
Subject: [PATCH] shell: Fix state of the "Party Mode" toggle item
|
|
|
5d0735 |
|
|
|
5d0735 |
The "Party Mode" menu item is a toggle menu item. If we only listen to
|
|
|
5d0735 |
the "activate" signal, we'll listen for clicks, but we won't change the
|
|
|
5d0735 |
state. So when the gear menu appears, the old state would be shown.
|
|
|
5d0735 |
|
|
|
5d0735 |
Listen to the state change instead, and update the action state.
|
|
|
5d0735 |
|
|
|
5d0735 |
http://bugzilla.gnome.org/show_bug.cgi?id=703910
|
|
|
5d0735 |
---
|
|
|
5d0735 |
shell/rb-shell.c | 5 +++--
|
|
|
5d0735 |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
5d0735 |
|
|
|
5d0735 |
diff --git a/shell/rb-shell.c b/shell/rb-shell.c
|
|
|
5d0735 |
index b69d01a..a9c34f0 100644
|
|
|
5d0735 |
--- a/shell/rb-shell.c
|
|
|
5d0735 |
+++ b/shell/rb-shell.c
|
|
|
5d0735 |
@@ -1742,7 +1742,7 @@ rb_shell_constructed (GObject *object)
|
|
|
5d0735 |
NULL,
|
|
|
5d0735 |
g_variant_new_boolean (FALSE)));
|
|
|
5d0735 |
g_action_map_add_action (G_ACTION_MAP (shell->priv->window), action);
|
|
|
5d0735 |
- g_signal_connect (action, "activate", G_CALLBACK (view_party_mode_changed_cb), shell);
|
|
|
5d0735 |
+ g_signal_connect (action, "change-state", G_CALLBACK (view_party_mode_changed_cb), shell);
|
|
|
5d0735 |
|
|
|
5d0735 |
action = G_ACTION (g_simple_action_new ("library-import", NULL));
|
|
|
5d0735 |
g_signal_connect (action, "activate", G_CALLBACK (add_music_action_cb), shell);
|
|
|
5d0735 |
@@ -2415,7 +2415,8 @@ rb_shell_set_window_title (RBShell *shell,
|
|
|
5d0735 |
static void
|
|
|
5d0735 |
view_party_mode_changed_cb (GAction *action, GVariant *parameter, RBShell *shell)
|
|
|
5d0735 |
{
|
|
|
5d0735 |
- shell->priv->party_mode = (shell->priv->party_mode == FALSE);
|
|
|
5d0735 |
+ shell->priv->party_mode = g_variant_get_boolean (parameter);
|
|
|
5d0735 |
+ g_simple_action_set_state (G_SIMPLE_ACTION (action), parameter);
|
|
|
5d0735 |
rb_shell_sync_party_mode (shell);
|
|
|
5d0735 |
}
|
|
|
5d0735 |
|
|
|
5d0735 |
--
|
|
|
5d0735 |
2.7.4
|
|
|
5d0735 |
|