From: gouldtj Date: Wed, 27 Jun 2007 06:20:33 +0000 (+0000) Subject: r15379@tres: ted | 2007-05-09 19:13:37 -0700 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dffc9e5e6b6371941ce2294c00bdc4a6528680f7;p=inkscape.git r15379@tres: ted | 2007-05-09 19:13:37 -0700 Moving the dialog one step out and adding a cancel event. --- 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; }