From: John Darrington Date: Thu, 1 Jan 2009 11:05:26 +0000 (+0900) Subject: Set the window title when opening a file on the command line X-Git-Tag: v0.7.3~296^2~12 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76160320343cb402ed54024f8ea258e548c0b0c5;p=pspp-builds.git Set the window title when opening a file on the command line --- diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index 21226ea5..16e8a8a0 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -1005,14 +1005,6 @@ on_switch_sheet (GtkNotebook *notebook, -void -create_data_window (void) -{ - GtkWidget *w = psppire_data_window_new (); - gtk_widget_show (w); -} - - static void psppire_data_window_init (PsppireDataWindow *de) { diff --git a/src/ui/gui/psppire-data-window.h b/src/ui/gui/psppire-data-window.h index 13d59a0c..77687dc9 100644 --- a/src/ui/gui/psppire-data-window.h +++ b/src/ui/gui/psppire-data-window.h @@ -114,8 +114,6 @@ struct _PsppireDataWindowClass GType psppire_data_window_get_type (void); GtkWidget* psppire_data_window_new (void); -void create_data_window (void); - G_END_DECLS diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index 073537bd..37bfd35c 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -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", diff --git a/src/ui/gui/psppire-window.c b/src/ui/gui/psppire-window.c index c1333769..78eda412 100644 --- a/src/ui/gui/psppire-window.c +++ b/src/ui/gui/psppire-window.c @@ -325,14 +325,12 @@ remove_menuitem (PsppireWindowRegister *reg, const gchar *key, gpointer data) PsppireWindow *window = PSPPIRE_WINDOW (data); GtkWidget *item ; - if ( !GTK_WIDGET_REALIZED (window)) - return; - item = g_hash_table_lookup (window->menuitem_table, key); g_hash_table_remove (window->menuitem_table, key); - gtk_container_remove (GTK_CONTAINER (window->menu), item); + if (GTK_IS_CONTAINER (window->menu)) + gtk_container_remove (GTK_CONTAINER (window->menu), item); } static void diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index e50ce2f0..62117a01 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -69,6 +69,7 @@ static void create_icon_factory (void); struct source_stream *the_source_stream ; struct dataset * the_dataset = NULL; +static GtkWidget *the_data_window; static void replace_casereader (struct casereader *s) @@ -118,8 +119,6 @@ initialize (struct command_line_processor *clp, int argc, char **argv) the_data_store = psppire_data_store_new (dictionary); replace_casereader (NULL); - - create_icon_factory (); outp_configure_driver_line ( @@ -136,14 +135,16 @@ initialize (struct command_line_processor *clp, int argc, char **argv) /* Ignore alarm clock signals */ signal (SIGALRM, SIG_IGN); + the_data_window = psppire_data_window_new (); + command_line_processor_replace_aux (clp, &post_init_argp, the_source_stream); command_line_processor_replace_aux (clp, &non_option_argp, the_source_stream); command_line_processor_parse (clp, argc, argv); - create_data_window (); - execute_syntax (create_syntax_string_source ("")); + + gtk_widget_show (the_data_window); } @@ -281,6 +282,9 @@ parse_non_options (int key, char *arg, struct argp_state *state) ERRMODE_CONTINUE); ds_destroy (&syntax); + + psppire_window_set_filename (the_data_window, arg); + break; } default: