- {
- g_warning ("Cannot create icon: %s", err->message);
- g_clear_error (&err);
- }
- }
-
- {
- /* Create our own "pspp-stock-reset" item, using the
- GTK_STOCK_REFRESH icon set */
-
- GtkStockItem items[] = {
- {"pspp-stock-reset", N_("_Reset"), 0, 0, PACKAGE},
- {"pspp-stock-select", N_("_Select"), 0, 0, PACKAGE}
- };
-
-
- gtk_stock_add (items, 2);
- gtk_icon_factory_add (factory, "pspp-stock-reset",
- gtk_icon_factory_lookup_default (GTK_STOCK_REFRESH)
- );
-
- gtk_icon_factory_add (factory, "pspp-stock-select",
- gtk_icon_factory_lookup_default (GTK_STOCK_INDEX)
- );
- }
-
- gtk_icon_factory_add_default (factory);
-}
-\f
-static void
-load_data_file (PsppireDataWindow *window, const char *arg)
-{
- gchar *filename = NULL;
- gchar *utf8 = NULL;
- const gchar *local_encoding = NULL;
- gsize written = -1;
- const gboolean local_is_utf8 = g_get_charset (&local_encoding);
-
- /* There seems to be no Glib function to convert from local encoding
- to filename encoding. Therefore it has to be done in two steps:
- the intermediate encoding is UTF8.
-
- Either step could fail. However, in many cases the file can still
- be loaded even if the conversion fails. So in those cases, after showing
- a warning, we simply copy the locally encoded filename to the destination
- and hope for the best.
- */
-
- if ( local_is_utf8)
- {
- utf8 = xstrdup (arg);
- }
- else
- {
- GError *err = NULL;
- utf8 = g_locale_to_utf8 (arg, -1, NULL, &written, &err);
- if ( NULL == utf8)