[gnome-control-center/randr-set-as-default] Show a success dialog when the configuration is saved



commit c30ff27d1f0d8ea5ad17a3699ef57c027dcad9d8
Author: Federico Mena Quintero <federico novell com>
Date:   Fri Mar 19 16:44:01 2010 -0600

    Show a success dialog when the configuration is saved
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 capplets/display/xrandr-capplet.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c
index b3c0f21..1904813 100644
--- a/capplets/display/xrandr-capplet.c
+++ b/capplets/display/xrandr-capplet.c
@@ -2297,6 +2297,23 @@ apply_button_clicked_cb (GtkButton *button, gpointer data)
 }
 
 static void
+success_dialog_for_make_default (App *app)
+{
+    GtkWidget *dialog;
+
+    dialog = gtk_message_dialog_new (GTK_WINDOW (app->dialog),
+				     GTK_DIALOG_MODAL,
+				     GTK_MESSAGE_INFO,
+				     GTK_BUTTONS_OK,
+				     _("The monitor configuration has been saved"));
+    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+					      _("This configuration will be used the next time someone logs in."));
+
+    gtk_dialog_run (GTK_DIALOG (dialog));
+    gtk_widget_destroy (dialog);
+}
+
+static void
 make_default (App *app)
 {
     char *command_line;
@@ -2322,8 +2339,11 @@ make_default (App *app)
 				    dest_basename);
 
     error = NULL;
+    /* FIXME: pick up stderr and present it nicely in case of error */
     if (!g_spawn_command_line_sync (command_line, NULL, NULL, NULL, &error))
 	error_message (app, _("Could not set the default configuration for monitors"), error ? error->message : NULL);
+    else
+	success_dialog_for_make_default (app);
 
     g_free (dest_filename);
     g_free (dest_basename);



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