Set the window title when opening a file on the command line
[pspp-builds.git] / src / ui / gui / psppire-syntax-window.c
index 766134b2678132abc7eea0425e9a18e62bfe9ea1..37bfd35cabe3b086ae6f43edc18763e7a4f0b1c0 100644 (file)
@@ -75,8 +75,6 @@ psppire_syntax_window_finalize (GObject *object)
 {
   GObjectClass *class = G_OBJECT_GET_CLASS (object);
 
-  PsppireSyntaxWindow *window = PSPPIRE_SYNTAX_WINDOW (object);
-
   GObjectClass *parent_class = g_type_class_peek_parent (class);
 
   if (G_OBJECT_CLASS (parent_class)->finalize)
@@ -108,10 +106,12 @@ psppire_syntax_window_base_finalize (PsppireSyntaxWindowClass *class,
 
 
 static void
-editor_execute_syntax (const PsppireSyntaxWindow *se, GtkTextIter start,
-               GtkTextIter stop)
+editor_execute_syntax (const PsppireSyntaxWindow *sw, GtkTextIter start,
+                      GtkTextIter stop)
 {
-  execute_syntax (create_syntax_editor_source (se->buffer, start, stop));
+  PsppireWindow *win = PSPPIRE_WINDOW (sw);
+  const gchar *name = psppire_window_get_filename (win);
+  execute_syntax (create_syntax_editor_source (sw->buffer, start, stop, name));
 }
 
 
@@ -519,11 +519,12 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window)
                    G_CALLBACK (open_syntax_window),
                    window);
 
-
+#if 0
   g_signal_connect (get_widget_assert (xml,"file_new_data"),
                    "activate",
                    G_CALLBACK (create_data_window),
                    window);
+#endif
 
   g_signal_connect (get_widget_assert (xml,"help_about"),
                    "activate",
@@ -575,8 +576,7 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window)
                    "activate",
                    G_CALLBACK (psppire_window_minimise_all), NULL);
 
-  PSPPIRE_WINDOW (window)->menu = GTK_MENU (get_widget_assert (xml,"windows_menu"));
-  g_object_ref (PSPPIRE_WINDOW (window)->menu);
+  PSPPIRE_WINDOW (window)->menu = GTK_MENU_SHELL (get_widget_assert (xml,"windows_menu"));
 
   g_object_unref (xml);