summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dffc9e5)
raw | patch | inline | side by side (parent: dffc9e5)
author | gouldtj <gouldtj@users.sourceforge.net> | |
Wed, 27 Jun 2007 06:20:42 +0000 (06:20 +0000) | ||
committer | gouldtj <gouldtj@users.sourceforge.net> | |
Wed, 27 Jun 2007 06:20:42 +0000 (06:20 +0000) |
Can now hit the cancel key and have it mean something.
src/extension/effect.cpp | patch | blob | history | |
src/extension/effect.h | patch | blob | history |
index 658861de795a0a5365d129eb629bdbb6acf90be7..f33ff5154d2d6230867e9952e22293b787303098 100644 (file)
--- a/src/extension/effect.cpp
+++ b/src/extension/effect.cpp
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_CANCEL,
true); // modal
+ working.signal_response().connect(sigc::mem_fun(this, &Effect::workingCanceled));
g_free(dlgmessage);
+ _canceled = false;
working.show();
set_last_effect(this);
imp->effect(this, doc);
- sp_document_done(doc->doc(), SP_VERB_NONE, _(this->get_name()));
+ if (!_canceled) {
+ sp_document_done(doc->doc(), SP_VERB_NONE, _(this->get_name()));
+ } else {
+ sp_document_cancel(doc->doc());
+ }
working.hide();
return;
}
+/** \internal
+ \brief A function used by the working dialog to recieve the cancel
+ button press
+ \param resp The key that was pressed (should always be cancel)
+
+ This function recieves the key event and marks the effect as being
+ canceled. It calls the function in the implementation that would
+ cancel the implementation.
+*/
+void
+Effect::workingCanceled (const int resp) {
+ if (resp == Gtk::RESPONSE_CANCEL) {
+ std::cout << "Canceling Effect" << std::endl;
+ _canceled = true;
+ imp->cancelProcessing();
+ }
+ return;
+}
+
+/** \brief Sets which effect was called last
+ \param in_effect The effect that has been called
+
+ This function sets the static variable \c _last_effect and it
+ ensures that the last effect verb is sensitive.
+
+ If the \c in_effect variable is \c NULL then the last effect
+ verb is made insesitive.
+*/
void
Effect::set_last_effect (Effect * in_effect)
{
diff --git a/src/extension/effect.h b/src/extension/effect.h
index b6fc80aa5c00ff63fdcaaf53ec62c1e00a505615..53d31cf0620feffb4b7effaf367326201350ac47 100644 (file)
--- a/src/extension/effect.h
+++ b/src/extension/effect.h
#include <config.h>
#include <glibmm/i18n.h>
+#include <gtkmm/dialog.h>
#include <gtk/gtkdialog.h>
#include "verbs.h"
private:
static gchar * remove_ (gchar * instr);
+
+ bool _canceled;
+ void workingCanceled (const int resp);
};
} } /* namespace Inkscape, Extension */