[totem] properties: Use set_accels_for_action()



commit 010ebb24965134ca3f8c40fc173d0e6451f56f2e
Author: Bastien Nocera <hadess hadess net>
Date:   Fri May 30 18:03:25 2014 +0200

    properties: Use set_accels_for_action()
    
    Instead of add_accelerator() and remove_accelerator().

 src/plugins/properties/totem-movie-properties.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/plugins/properties/totem-movie-properties.c b/src/plugins/properties/totem-movie-properties.c
index c5bb421..8503e04 100644
--- a/src/plugins/properties/totem-movie-properties.c
+++ b/src/plugins/properties/totem-movie-properties.c
@@ -248,6 +248,7 @@ impl_activate (PeasActivatable *plugin)
        GtkWindow *parent;
        GMenu *menu;
        GMenuItem *item;
+       const char * const accels[] = { "<Primary>p", NULL };
 
        pi = TOTEM_MOVIE_PROPERTIES_PLUGIN (plugin);
        totem = g_object_get_data (G_OBJECT (plugin), "object");
@@ -276,10 +277,9 @@ impl_activate (PeasActivatable *plugin)
        g_signal_connect (G_OBJECT (pi->priv->props_action), "activate",
                          G_CALLBACK (properties_action_cb), pi);
        g_action_map_add_action (G_ACTION_MAP (totem), G_ACTION (pi->priv->props_action));
-       gtk_application_add_accelerator (GTK_APPLICATION (totem),
-                                        "<Primary>p",
-                                        "app.properties",
-                                        NULL);
+       gtk_application_set_accels_for_action (GTK_APPLICATION (totem),
+                                              "app.properties",
+                                              accels);
        /* FIXME: Handle GDK_KEY_View */
 
        /* Install the menu */
@@ -312,6 +312,7 @@ impl_deactivate (PeasActivatable *plugin)
 {
        TotemMoviePropertiesPlugin *pi;
        TotemObject *totem;
+       const char const *accels[] = { NULL };
 
        pi = TOTEM_MOVIE_PROPERTIES_PLUGIN (plugin);
        totem = g_object_get_data (G_OBJECT (plugin), "object");
@@ -328,8 +329,8 @@ impl_deactivate (PeasActivatable *plugin)
                                              plugin);
        pi->priv->handler_id_stream_length = 0;
 
-       gtk_application_remove_accelerator (GTK_APPLICATION (totem),
-                                           "app.properties",
-                                           NULL);
+       gtk_application_set_accels_for_action (GTK_APPLICATION (totem),
+                                              "app.properties",
+                                              accels);
        totem_object_empty_menu_section (totem, "properties-placeholder");
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]