summaryrefslogtreecommitdiffstats
path: root/src/extension/system.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-04-23 22:18:35 +0000
committerJon A. Cruz <jon@joncruz.org>2011-04-23 22:18:35 +0000
commitfb8198311fa62b09e3fdad9546e92420825ebcd2 (patch)
treeb73fca62ab74bc229051698a979aa57f1bd92a4c /src/extension/system.cpp
parentTranslations. French translation update. (diff)
downloadinkscape-fb8198311fa62b09e3fdad9546e92420825ebcd2.tar.gz
inkscape-fb8198311fa62b09e3fdad9546e92420825ebcd2.zip
Fixed warning to use GUI when appropriate.
(bzr r10191)
Diffstat (limited to 'src/extension/system.cpp')
-rw-r--r--src/extension/system.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index cf58f2733..aa5731985 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -35,6 +35,8 @@
#include "implementation/xslt.h"
#include "xml/rebase-hrefs.h"
#include "io/sys.h"
+#include "inkscape.h"
+
/* #include "implementation/plugin.h" */
namespace Inkscape {
@@ -64,8 +66,7 @@ static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementatio
*
* Lastly, the open function is called in the module itself.
*/
-SPDocument *
-open(Extension *key, gchar const *filename)
+SPDocument *open(Extension *key, gchar const *filename)
{
Input *imod = NULL;
if (key == NULL) {
@@ -93,8 +94,9 @@ open(Extension *key, gchar const *filename)
throw Input::open_failed();
}
- if (!imod->prefs(filename))
+ if (!imod->prefs(filename)) {
return NULL;
+ }
SPDocument *doc = imod->open(filename);
if (!doc) {
@@ -102,11 +104,11 @@ open(Extension *key, gchar const *filename)
}
if (last_chance_svg) {
- /* We can't call sp_ui_error_dialog because we may be
- running from the console, in which case calling sp_ui
- routines will cause a segfault. See bug 1000350 - bryce */
- // sp_ui_error_dialog(_("Format autodetect failed. The file is being opened as SVG."));
- g_warning(_("Format autodetect failed. The file is being opened as SVG."));
+ if ( inkscape_use_gui() ) {
+ sp_ui_error_dialog(_("Format autodetect failed. The file is being opened as SVG."));
+ } else {
+ g_warning(_("Format autodetect failed. The file is being opened as SVG."));
+ }
}
/* This kinda overkill as most of these are already set, but I want