summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2007-06-27 06:20:33 +0000
committergouldtj <gouldtj@users.sourceforge.net>2007-06-27 06:20:33 +0000
commit6094eb1ecb8b03d2c8a31026804d1df0939abcd3 (patch)
tree96dc38180ebc776c28822f68de1b3f1261321808 /src
parentr15378@tres: ted | 2007-05-09 18:59:27 -0700 (diff)
downloadinkscape-6094eb1ecb8b03d2c8a31026804d1df0939abcd3.tar.gz
inkscape-6094eb1ecb8b03d2c8a31026804d1df0939abcd3.zip
r15379@tres: ted | 2007-05-09 19:13:37 -0700
Moving the dialog one step out and adding a cancel event. (bzr r3121)
Diffstat (limited to 'src')
-rw-r--r--src/extension/effect.cpp13
-rw-r--r--src/extension/implementation/implementation.cpp5
-rw-r--r--src/extension/implementation/implementation.h1
-rw-r--r--src/extension/implementation/script.cpp12
4 files changed, 19 insertions, 12 deletions
diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp
index 10ac493b5..658861de7 100644
--- a/src/extension/effect.cpp
+++ b/src/extension/effect.cpp
@@ -15,6 +15,8 @@
#include "effect.h"
#include "ui/view/view.h"
+#include "gtkmm/messagedialog.h"
+
/* Inkscape::Extension::Effect */
namespace Inkscape {
@@ -239,11 +241,22 @@ Effect::effect (Inkscape::UI::View::View * doc)
set_state(Extension::STATE_LOADED);
if (!loaded()) return;
+ gchar * dlgmessage = g_strdup_printf(_("The effect '%s' is working on your document. Please wait."), get_name());
+ Gtk::MessageDialog working(dlgmessage,
+ false, // use markup
+ Gtk::MESSAGE_INFO,
+ Gtk::BUTTONS_CANCEL,
+ true); // modal
+ g_free(dlgmessage);
+ working.show();
+
set_last_effect(this);
imp->effect(this, doc);
sp_document_done(doc->doc(), SP_VERB_NONE, _(this->get_name()));
+ working.hide();
+
return;
}
diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp
index 42eabc3ad..d01f52cb4 100644
--- a/src/extension/implementation/implementation.cpp
+++ b/src/extension/implementation/implementation.cpp
@@ -44,6 +44,11 @@ Implementation::check(Inkscape::Extension::Extension *module) {
return TRUE;
} /* Implemenation::check */
+bool
+Implementation::cancelProcessing (void) {
+ return true;
+}
+
Gtk::Widget *
Implementation::prefs_input(Inkscape::Extension::Input *module, gchar const *filename) {
return module->autogui(NULL, NULL);
diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h
index 03ade7a16..fbe84249c 100644
--- a/src/extension/implementation/implementation.h
+++ b/src/extension/implementation/implementation.h
@@ -46,6 +46,7 @@ public:
/** Verify any dependencies. */
virtual bool check(Inkscape::Extension::Extension *module);
+ virtual bool cancelProcessing (void);
/* ----- Input functions ----- */
/** Find out information about the file. */
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index 2e0dd004e..b5e995b65 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -789,17 +789,6 @@ Script::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *do
return;
}
- gchar * dlgmessage = g_strdup_printf(_("The effect '%s' is working on your document. Please wait."), module->get_name());
-
- Gtk::MessageDialog working(dlgmessage,
- false, // use markup
- Gtk::MESSAGE_INFO,
- Gtk::BUTTONS_CANCEL,
- true); // modal
- g_free(dlgmessage);
- working.show();
-
-
gchar *tmpname;
// FIXME: process the GError instead of passing NULL
gint tempfd_in = g_file_open_tmp("ink_ext_XXXXXX", &tmpname, NULL);
@@ -890,7 +879,6 @@ Script::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *do
sp_namedview_update_layers_from_document(desktop);
}
- working.hide();
return;
}