X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fpsppire.c;h=35dad91e5d49b50ba60d009e0d9d8745d4ea441d;hb=d112adc6bdbab5593d533fdc8853e80a2cb358e7;hp=737b965c116b35d5ac7c214ca465d341c00e3463;hpb=f1a02381223dd6d652c590e2a5514967b9448905;p=pspp-builds.git diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index 737b965c..35dad91e 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -27,6 +27,7 @@ #include "psppire-data-window.h" #include "psppire.h" +#include "widgets.h" #include #include @@ -44,7 +45,6 @@ #include #include -#include #include "psppire-dict.h" #include "psppire-var-store.h" #include "psppire-data-store.h" @@ -52,7 +52,7 @@ #include "message-dialog.h" #include - +#include "psppire-window-register.h" #include "psppire-output-window.h" #include @@ -60,6 +60,7 @@ #include +GtkRecentManager *the_recent_mgr = 0; PsppireDataStore *the_data_store = 0; PsppireVarStore *the_var_store = 0; @@ -95,7 +96,7 @@ initialize (struct command_line_processor *clp, int argc, char **argv) bindtextdomain (PACKAGE, locale_dir); - glade_init (); + preregister_widgets (); gsl_set_error_handler_off (); fn_init (); @@ -147,6 +148,9 @@ initialize (struct command_line_processor *clp, int argc, char **argv) journal_enable (); textdomain (PACKAGE); + + the_recent_mgr = gtk_recent_manager_get_default (); + the_data_window = psppire_data_window_new (); command_line_processor_replace_aux (clp, &post_init_argp, the_source_stream); @@ -170,6 +174,24 @@ de_initialize (void) } +static void +func (gpointer key, gpointer value, gpointer data) +{ + gboolean rv; + PsppireWindow *window = PSPPIRE_WINDOW (value); + + g_signal_emit_by_name (window, "delete-event", 0, &rv); +} + +void +psppire_quit (void) +{ + PsppireWindowRegister *reg = psppire_window_register_new (); + psppire_window_register_foreach (reg, func, NULL); + + gtk_main_quit (); +} + struct icon_info { @@ -257,8 +279,7 @@ parse_non_options (int key, char *arg, struct argp_state *state) { case ARGP_KEY_ARG: { - psppire_data_window_load_file (PSPPIRE_DATA_WINDOW (the_data_window), - arg); + psppire_window_load (PSPPIRE_WINDOW (the_data_window), arg); break; } default: