[gnumeric] Stf: set proper error when we fail due to lack of GUI.



commit 266730917c293bf6749dcc93c1b648ea982354e4
Author: Morten Welinder <terra gnome org>
Date:   Sun Mar 10 13:21:09 2013 -0400

    Stf: set proper error when we fail due to lack of GUI.

 ChangeLog |    4 +++-
 src/stf.c |    5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5cecece..5f12bc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2013-03-10  Morten Welinder  <terra gnome org>
 
-       * src/ssconvert.c (convert): Fix error handling.  Part of #695529.
+       * src/stf.c (stf_read_workbook): Set error when we fail due to
+       lack of GUI.
+       * src/ssconvert.c (convert): Fix error handling.  Fixes #695529.
 
 2013-03-09  Morten Welinder <terra gnome org>
 
diff --git a/src/stf.c b/src/stf.c
index 171b936..9222cbb 100644
--- a/src/stf.c
+++ b/src/stf.c
@@ -229,9 +229,10 @@ stf_read_workbook (G_GNUC_UNUSED GOFileOpener const *fo,  gchar const *enc,
        size_t data_len;
        WorkbookView *wbv = WORKBOOK_VIEW (view);
 
-       /* FIXME : how to do this cleanly ? */
-       if (!IS_WBC_GTK (context->impl))
+       if (!IS_WBC_GTK (context->impl)) {
+               go_io_error_string (context, _("This importer can only be used with a GUI."));
                return;
+       }
 
        name = g_path_get_basename (gsf_input_name (input));
        nameutf8 = g_filename_to_utf8 (name, -1, NULL, NULL, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]