gui: Put a separator line before list of windows in Windows menus.
[pspp-builds.git] / src / ui / gui / psppire-window.c
index d3137ff2234d0d036329596a0c8ad0746d72dcd7..cf610f6f640a6dd4a701d55bfaedaf3372efa01c 100644 (file)
@@ -243,7 +243,8 @@ psppire_window_class_init (PsppireWindowClass *class)
     g_param_spec_string ("filename",
                       "File name",
                       "The name of the file associated with this window, if any",
-                        "Untitled",
+                        /* TRANSLATORS: This will form a filename.  Please avoid whitespace. */
+                        _("Untitled"),
                         G_PARAM_CONSTRUCT | G_PARAM_READWRITE);
 
   g_unichar_to_utf8 (0x2014, mdash);
@@ -303,9 +304,20 @@ menu_activate (GtkMenuItem *mi, gpointer data)
 static void
 insert_menuitem_into_menu (PsppireWindow *window, gpointer key)
 {
-  gchar *filename = g_filename_display_name (key);
-  GtkWidget *item = gtk_check_menu_item_new_with_label (filename);
+  gchar *filename;
+  GtkWidget *item;
 
+  /* Add a separator before adding the first real item.  If we add a separator
+     at any other time, sometimes GtkUIManager removes it. */
+  if (g_hash_table_size (window->menuitem_table) == 0)
+    {
+      GtkWidget *separator = gtk_separator_menu_item_new ();
+      gtk_widget_show (separator);
+      gtk_menu_shell_append (window->menu, separator);
+    }
+
+  filename = g_filename_display_name (key);
+  item = gtk_check_menu_item_new_with_label (filename);
   g_free (filename);
 
   g_signal_connect (item, "toggled", G_CALLBACK (menu_toggled), NULL);
@@ -465,7 +477,7 @@ psppire_window_query_save (PsppireWindow *se)
                            GTK_DIALOG_MODAL,
                            GTK_MESSAGE_WARNING,
                            GTK_BUTTONS_NONE,
-                           _("Save the changes to \"%s\" before closing?"),
+                           _("Save the changes to `%s' before closing?"),
                            fn);
   g_free (fn);