[Xfce4-commits] r29101 - in libxfcegui4/trunk: . libxfce4kbd-private

Jannis Pohlmann jannis at xfce.org
Tue Jan 6 00:58:32 CET 2009


Author: jannis
Date: 2009-01-05 23:58:32 +0000 (Mon, 05 Jan 2009)
New Revision: 29101

Modified:
   libxfcegui4/trunk/ChangeLog
   libxfcegui4/trunk/libxfce4kbd-private/xfce-shortcut-dialog.c
   libxfcegui4/trunk/libxfce4kbd-private/xfce-shortcuts.c
Log:
	* libxfce4kbd-private/xfce-shortcut-dialog.c,
	  libxfce4kbd-private/xfce-shortcuts.c: Review strings and improve the
	  layout of the shortcut dialog a tiny bit (the latter being slightly
	  evil since we're in feature freeze).

Modified: libxfcegui4/trunk/ChangeLog
===================================================================
--- libxfcegui4/trunk/ChangeLog	2009-01-05 23:58:28 UTC (rev 29100)
+++ libxfcegui4/trunk/ChangeLog	2009-01-05 23:58:32 UTC (rev 29101)
@@ -1,3 +1,10 @@
+2008-01-06	jannis
+
+	* libxfce4kbd-private/xfce-shortcut-dialog.c,
+	  libxfce4kbd-private/xfce-shortcuts.c: Review strings and improve the 
+	  layout of the shortcut dialog a tiny bit (the latter being slightly 
+	  evil since we're in feature freeze).
+
 2009-01-05	jannis
 
 	* libxfce4kbd-private/xfce-shortcut-dialog.c: Fix indentation in 

Modified: libxfcegui4/trunk/libxfce4kbd-private/xfce-shortcut-dialog.c
===================================================================
--- libxfcegui4/trunk/libxfce4kbd-private/xfce-shortcut-dialog.c	2009-01-05 23:58:28 UTC (rev 29100)
+++ libxfcegui4/trunk/libxfce4kbd-private/xfce-shortcut-dialog.c	2009-01-05 23:58:32 UTC (rev 29101)
@@ -238,32 +238,30 @@
                                       const gchar        *action)
 {
   GtkWidget   *button;
-  GtkWidget   *hbox;
+  GtkWidget   *table;
   GtkWidget   *label;
   const gchar *title;
-  gchar       *subtitle;
+  const gchar *action_label;
 
   if (g_utf8_collate (provider, "xfwm4") == 0)
     {
-      title = _("Enter window manager action shortcut");
-      subtitle = g_strdup_printf (_("Action: %s"), action_name);
+      title = _("Window Manager Action Shortcut");
+      action_label = _("Action:");
     }
   else if (g_utf8_collate (provider, "commands") == 0)
     {
-      title = _("Enter command shortcut");
-      subtitle = g_strdup_printf (_("Command: %s"), action_name);
+      title = _("Command Shortcut");
+      action_label = _("Command:");
     }
   else
     {
-      title = _("Enter shortcut");
-      subtitle = g_strdup_printf (_("Action: %s"), action_name);
+      title = _("Shortcut");
+      action_label = _("Action:");
     }
 
   /* Set dialog title */
   gtk_window_set_title (GTK_WINDOW (dialog), title);
   gtk_window_set_icon_name (GTK_WINDOW (dialog), "input-keyboard");
-  xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (dialog), subtitle);
-  g_free (subtitle);
 
   /* Configure dialog */
   gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
@@ -281,18 +279,31 @@
   gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_CANCEL);
   gtk_widget_show (button);
 
-  hbox = gtk_hbox_new (FALSE, 12);
-  gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
-  gtk_widget_show (hbox);
+  table = gtk_table_new (2, 2, FALSE);
+  gtk_table_set_row_spacings (GTK_TABLE (table), 6);
+  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
+  gtk_container_set_border_width (GTK_CONTAINER (table), 12);
+  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table);
+  gtk_widget_show (table);
 
+  label = gtk_label_new (action_label);
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
+  gtk_widget_show (label);
+
+  label = gtk_label_new (action_name);
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+  gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 0, 1);
+  gtk_widget_show (label);
+
   label = gtk_label_new (_("Shortcut:"));
-  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
   gtk_widget_show (label);
 
   dialog->shortcut_label = gtk_label_new (NULL);
   gtk_misc_set_alignment (GTK_MISC (dialog->shortcut_label), 0.0, 0.5);
-  gtk_box_pack_start (GTK_BOX (hbox), dialog->shortcut_label, TRUE, TRUE, 0);
+  gtk_table_attach_defaults (GTK_TABLE (table), dialog->shortcut_label, 1, 2, 1, 2);
   gtk_widget_show (dialog->shortcut_label);
 
   /* Connect to key release signal for determining the new shortcut */

Modified: libxfcegui4/trunk/libxfce4kbd-private/xfce-shortcuts.c
===================================================================
--- libxfcegui4/trunk/libxfce4kbd-private/xfce-shortcuts.c	2009-01-05 23:58:28 UTC (rev 29100)
+++ libxfcegui4/trunk/libxfce4kbd-private/xfce-shortcuts.c	2009-01-05 23:58:32 UTC (rev 29101)
@@ -50,17 +50,17 @@
 
 static XfceShortcutConflictMessage conflict_messages[] = {
   { "xfwm4", "xfwm4", 
-    N_("This shortcut is already being used by <b>another window manager action</b>. Which action do you want to use?"), 
-    N_("Use %s"), N_("Keep the other one") },
+    N_("This shortcut is already being used for another window manager action. Which action do you want to use?"), 
+    N_("Use '%s'"), N_("Keep the other one") },
   { "xfwm4", "commands",
-    N_("The shortcut is already being used for the command <b>%s</b>. Which action do you want to use?"), 
-    N_("Use %s"), N_("Keep %s") },
+    N_("This shortcut is already being used for the command '%s'. Which action do you want to use?"), 
+    N_("Use '%s'"), N_("Keep '%s'") },
   { "commands","commands",
-    N_("The shortcut is already being used for the command <b>%s</b>. Which action do you want to use?"),
-    N_("Use %s"), N_("Keep %s") },
+    N_("This shortcut is already being used for the command '%s'. Which action do you want to use?"),
+    N_("Use '%s'"), N_("Keep '%s'") },
   { "commands", "xfwm4",
-    N_("The shortcut is already being used by a <b>window manager action</b>. Which action do you want to use?"),
-    N_("Use %s"), N_("Keep the window manager action") },
+    N_("This shortcut is already being used by a window manager action. Which action do you want to use?"),
+    N_("Use '%s'"), N_("Keep the window manager action") },
   { 0, 0, NULL, NULL, NULL },
 };
 
@@ -75,13 +75,11 @@
                                gboolean     ignore_same_provider)
 {
   gchar   *title;
-  gchar   *primary_text;
   gchar   *secondary_text;
   gchar   *owner_action_name;
   gchar   *other_action_name;
   gchar   *owner_button_text;
   gchar   *other_button_text;
-  gchar   *escaped_shortcut;
   gboolean handled = FALSE;
   gint     response = GTK_RESPONSE_ACCEPT;
   gint     i;
@@ -94,10 +92,6 @@
 
   title = g_strdup_printf (_("Conflicting actions for %s"), shortcut);
 
-  escaped_shortcut = g_markup_escape_text (shortcut, -1);
-  primary_text = g_strdup_printf (_("Conflicting actions for %s"), escaped_shortcut);
-  g_free (escaped_shortcut);
-
   for (i = 0; conflict_messages[i].message != NULL; ++i)
     if (g_utf8_collate (conflict_messages[i].owner_name, owner) == 0 &&
         g_utf8_collate (conflict_messages[i].other_name, other) == 0)
@@ -111,7 +105,7 @@
         other_button_text = g_markup_printf_escaped (conflict_messages[i].other_button_text, other_action_name);
 
         response = xfce_message_dialog (NULL, title, GTK_STOCK_DIALOG_QUESTION,
-                                        primary_text, secondary_text,
+                                        title, secondary_text,
                                         XFCE_CUSTOM_BUTTON, owner_button_text, GTK_RESPONSE_ACCEPT,
                                         XFCE_CUSTOM_BUTTON, other_button_text, GTK_RESPONSE_REJECT,
                                         NULL);
@@ -129,12 +123,11 @@
   if (G_UNLIKELY (!handled))
     {
       xfce_message_dialog (NULL, title, GTK_STOCK_DIALOG_ERROR,
-                           primary_text, _("The shortcut is already being used for something else."),
+                           title, _("This shortcut is already being used for something else."),
                            GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
       response = GTK_RESPONSE_REJECT;
     }
 
-  g_free (primary_text);
   g_free (title);
 
   return response;




More information about the Xfce4-commits mailing list