HIGfining nautilus-cd-burner alerts



Hi everyone,

It seems that all nautilus-cd-burner alerts don't follow the
primary/secondary text suggestion from HIG. I've in mind to adjust it,
it isn't a difficult task, just:
     1. I've in mind to use the really cute eel_alert_dialog_new () as
        showed in attached diff file. Is it a private function?
     2. I don't like put the primary text in both title and Can body,
        but by now I don't think remove the title is a good idea. What
        about something like "Warning" or "Error"?
     3. For single button alerts as in attachment, do I've to use OK or
        Close button? The first one, if I'm right.

I'll open an entry on bugzilla. I home someone will help me to use some
really neat and clean labels.
diff -Naur /usr/src/GNOME/CVS/nautilus-cd-burner/nautilus-cd-burner.c nautilus-cd-burner/nautilus-cd-burner.c
--- /usr/src/GNOME/CVS/nautilus-cd-burner/nautilus-cd-burner.c	2004-05-18 19:50:20.000000000 +0200
+++ nautilus-cd-burner/nautilus-cd-burner.c	2004-05-21 10:26:01.989296912 +0200
@@ -29,6 +29,7 @@
 #include <libgnome/gnome-help.h>
 #include <libgnomeui/gnome-ui-init.h>
 #include <eel/eel-vfs-extensions.h>
+#include <eel/eel-alert-dialog.h>
 #include <gconf/gconf-client.h>
 #include <time.h>
 #include <stdio.h>
@@ -1134,13 +1135,13 @@
 	gnome_vfs_init ();
 
 	if (argc > 2) {
-		dialog = gtk_message_dialog_new (NULL,
-						 GTK_DIALOG_MODAL,
-						 GTK_MESSAGE_ERROR,
-						 GTK_BUTTONS_OK,
-						 _("Too many parameters to nautilus-cd-burner"));
-		gtk_window_set_title (GTK_WINDOW (dialog),
-				      _("Too many parameters"));
+		dialog = eel_alert_dialog_new (NULL,
+					       GTK_DIALOG_MODAL,
+					       GTK_MESSAGE_ERROR,
+					       GTK_BUTTONS_OK,
+					       _("Too many parameters"), 
+	                                       _("Too many parameters to nautilus-cd-burner"),
+					       NULL);
 		res = gtk_dialog_run (GTK_DIALOG (dialog));
 		gtk_widget_destroy (dialog);
 		return 1;
@@ -1156,14 +1157,19 @@
 
 	if (source_iso != NULL) {
 		if (!verify_iso (source_iso, &disc_name)) {
-			dialog = gtk_message_dialog_new (NULL,
-							 GTK_DIALOG_MODAL,
-							 GTK_MESSAGE_ERROR,
-							 GTK_BUTTONS_OK,
-							 _("The file '%s' is not a valid CD image."),
-							 source_iso);
-			gtk_window_set_title (GTK_WINDOW (dialog),
-					      _("Not a valid CD image"));
+			char *str;
+
+			str = g_strdup_printf (_("The file '%s' is not a valid CD image."),
+				source_iso);
+
+			dialog = eel_alert_dialog_new (NULL,
+							GTK_DIALOG_MODAL,
+							GTK_MESSAGE_ERROR,
+							GTK_BUTTONS_OK,
+							_("Not a valid CD image"),
+							str,
+							NULL);
+			g_free (str);
 			res = gtk_dialog_run (GTK_DIALOG (dialog));
 			gtk_widget_destroy (dialog);
 			return 1;
@@ -1175,15 +1181,19 @@
 		size = estimate_size ("burn:///");
 
 		if (size == 0) {
-			dialog = gtk_message_dialog_new (NULL,
-							 GTK_DIALOG_MODAL,
-							 GTK_MESSAGE_ERROR,
-							 GTK_BUTTONS_NONE,
-							 _("You need to copy the files you want to write to CD to the CD Creator window. Would you like to open it now?"));
-			gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, _("Open CD Creator"), GTK_RESPONSE_YES, NULL);
+			dialog = eel_alert_dialog_new (NULL,
+							GTK_DIALOG_MODAL,
+							GTK_MESSAGE_ERROR,
+							GTK_BUTTONS_NONE,
+							_("No files selected"),
+							_("You need to copy the files you want to write to CD to the CD Creator window. Would you like to open it now?"),
+							NULL);
+			gtk_dialog_add_button (GTK_DIALOG (dialog),
+					GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+			gtk_dialog_add_button (GTK_DIALOG (dialog),
+					_("_Open CD Creator"), GTK_RESPONSE_YES);
+
 			gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
-			gtk_window_set_title (GTK_WINDOW (dialog),
-					      _("No files selected"));
 			res = gtk_dialog_run (GTK_DIALOG (dialog));
 			gtk_widget_destroy (dialog);
 			if (res == GTK_RESPONSE_YES) {
@@ -1199,14 +1209,14 @@
 	recorders = scan_for_cdroms (TRUE, source_iso != NULL ? FALSE : TRUE);
 
 	if (recorders == NULL) {
-		dialog = gtk_message_dialog_new (NULL,
-						 GTK_DIALOG_MODAL,
-						 GTK_MESSAGE_ERROR,
-						 GTK_BUTTONS_CLOSE,
-						 _("You do not seem to have any CD recorder in your machine. Please verify your setup."));
-		gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
-		gtk_window_set_title (GTK_WINDOW (dialog),
-				      _("No CD recorder available"));
+		dialog = eel_alert_dialog_new (NULL,
+						GTK_DIALOG_MODAL,
+						GTK_MESSAGE_ERROR,
+						GTK_BUTTONS_OK,
+						_("No CD recorder available"), 
+                                                _("You do not seem to have any CD recorder in your machine. Please verify your setup."),
+						NULL);
+		gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 		gtk_dialog_run (GTK_DIALOG (dialog));
 		gtk_widget_destroy (dialog);
 		return 1;


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