gtk+ r22415 - in trunk: . gtk



Author: davidz
Date: Fri Feb 27 21:03:47 2009
New Revision: 22415
URL: http://svn.gnome.org/viewvc/gtk+?rev=22415&view=rev

Log:
2009-02-27  David Zeuthen  <davidz redhat com>

	Bug 573383 â GtkMountOperation fixes for ask_password()

	* gtk/gtkmountoperation.c (gtk_mount_operation_ask_password):
	Split the message from GMountOperation into primary/secondary like
	we also do in gtk_mount_operation_ask_question()



Modified:
   trunk/ChangeLog
   trunk/gtk/gtkmountoperation.c

Modified: trunk/gtk/gtkmountoperation.c
==============================================================================
--- trunk/gtk/gtkmountoperation.c	(original)
+++ trunk/gtk/gtkmountoperation.c	Fri Feb 27 21:03:47 2009
@@ -434,6 +434,7 @@
   GtkWidget *message_label;
   gboolean   can_anonymous;
   guint      rows;
+  const gchar *secondary;
 
   operation = GTK_MOUNT_OPERATION (mount_op);
   priv = operation->priv;
@@ -482,11 +483,33 @@
   main_vbox = gtk_vbox_new (FALSE, 18);
   gtk_box_pack_start (GTK_BOX (hbox), main_vbox, TRUE, TRUE, 0);
 
-  message_label = gtk_label_new (message);
-  gtk_misc_set_alignment (GTK_MISC (message_label), 0.0, 0.5);
-  gtk_label_set_line_wrap (GTK_LABEL (message_label), TRUE);
-  gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (message_label),
-                      FALSE, FALSE, 0);
+  secondary = strstr (message, "\n");
+  if (secondary != NULL)
+    {
+      gchar *s;
+      gchar *primary;
+
+      primary = g_strndup (message, secondary - message + 1);
+      s = g_strdup_printf ("<big><b>%s</b></big>%s", primary, secondary);
+
+      message_label = gtk_label_new (NULL);
+      gtk_label_set_markup (GTK_LABEL (message_label), s);
+      gtk_misc_set_alignment (GTK_MISC (message_label), 0.0, 0.5);
+      gtk_label_set_line_wrap (GTK_LABEL (message_label), TRUE);
+      gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (message_label),
+                          FALSE, TRUE, 0);
+
+      g_free (s);
+      g_free (primary);
+    }
+  else
+    {
+      message_label = gtk_label_new (message);
+      gtk_misc_set_alignment (GTK_MISC (message_label), 0.0, 0.5);
+      gtk_label_set_line_wrap (GTK_LABEL (message_label), TRUE);
+      gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (message_label),
+                          FALSE, FALSE, 0);
+    }
 
   vbox = gtk_vbox_new (FALSE, 6);
   gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);



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