/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2004, 2005, 2006, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation
+ Copyright (C) 2004, 2005, 2006, 2009, 2010, 2011, 2012, 2013, 2014, 2016 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
break;
case 14:
{
- if (is->file)
+ if (is->filename_arg != -1)
{
+#ifndef G_OS_WIN32
+ const char *file = (*is->argv)[is->filename_arg];
const gchar *local_encoding = NULL;
g_get_charset (&local_encoding);
-
- struct file_handle *fh = fh_create_file (NULL, is->file, local_encoding, fh_default_properties ());
+#else
+ char **as = g_win32_get_command_line ();
+ const char *file = as[is->filename_arg];
+ const gchar *local_encoding = "UTF-8";
+#endif
+
+ struct file_handle *fh = fh_create_file (NULL,
+ file,
+ local_encoding,
+ fh_default_properties ());
+
const char *filename = fh_get_file_name (fh);
int retval = any_reader_detect (fh, NULL);
i18n_done ();
}
-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 ();
}