[nautilus] window-menus: activate GActions when possible



commit de011cd078f540bc77dd675189a40c0e4b9e0247
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Apr 25 13:24:05 2012 -0400

    window-menus: activate GActions when possible
    
    For actions that have a corresponding GAction available, activate them
    instead of duplicating activation code.

 src/nautilus-window-menus.c |   20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)
---
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 924785b..55a70fc 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -83,12 +83,8 @@ static void
 action_connect_to_server_callback (GtkAction *action, 
 				   gpointer user_data)
 {
-	NautilusWindow *window = NAUTILUS_WINDOW (user_data);
-	GtkWidget *dialog;
-
-	dialog = nautilus_connect_server_dialog_new (window);
-
-	gtk_widget_show (dialog);
+	g_action_group_activate_action (G_ACTION_GROUP (g_application_get_default ()),
+					"connect-to-server", NULL);
 }
 
 static void
@@ -279,20 +275,16 @@ static void
 action_preferences_callback (GtkAction *action, 
 			     gpointer user_data)
 {
-	GtkWindow *window;
-
-	window = GTK_WINDOW (user_data);
-
-	nautilus_file_management_properties_dialog_show (window);
+	g_action_group_activate_action (G_ACTION_GROUP (g_application_get_default ()),
+					"preferences", NULL);
 }
 
 static void
 action_about_nautilus_callback (GtkAction *action,
 				gpointer user_data)
 {
-	NautilusWindow *window = user_data;
-
-	nautilus_window_show_about_dialog (window);
+	g_action_group_activate_action (G_ACTION_GROUP (g_application_get_default ()),
+					"about", NULL);
 }
 
 static void



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