summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f5fe60f)
raw | patch | inline | side by side (parent: f5fe60f)
author | Jon A. Cruz <jon@joncruz.org> | |
Thu, 18 Mar 2010 01:21:55 +0000 (18:21 -0700) | ||
committer | Jon A. Cruz <jon@joncruz.org> | |
Thu, 18 Mar 2010 01:21:55 +0000 (18:21 -0700) |
src/extension/internal/gdkpixbuf-input.cpp | patch | blob | history | |
src/interface.cpp | patch | blob | history | |
src/ui/clipboard.cpp | patch | blob | history |
diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp
index 3f78b3f36f78904e15342b1ec4e3d21f28564aac..a1295406c09c00a470e356a620bb3f5308c80f1d 100644 (file)
SPDocument *
GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri)
{
- bool embed = !mod->get_param_bool("link");
+ bool embed = (strcmp(mod->get_param_optiongroup("link"), "embed") == 0);
+
SPDocument *doc = NULL;
GdkPixbuf *pb = Inkscape::IO::pixbuf_new_from_file( uri, NULL );
static std::set<Glib::ustring> lossy = create_lossy_set();
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>" N_("%s GDK pixbuf Input") "</name>\n"
"<id>org.inkscape.input.gdkpixbuf.%s</id>\n"
- "<param name=\"link\" gui-text=\""
- N_("Link to image? (Leave unchecked to embed)")
- "\" type=\"boolean\">false</param>"
+ "<param name='link' type='optiongroup' appearance='full' _gui-text='" N_("Link or embed image:") "' >\n"
+ "<_option value='embed'>" N_("embed") "</_option>\n"
+ "<_option value='link'>" N_("link") "</_option>\n"
+ "</param>\n"
+ "<_param name='help' type='description'>" N_("Embed results in stand-alone, larger SVG files. Link references a file outside this SVG document and all files must be moved together.") "</_param>\n"
"<input>\n"
"<extension>.%s</extension>\n"
"<mimetype>%s</mimetype>\n"
diff --git a/src/interface.cpp b/src/interface.cpp
index cb021db18132c14c9812c4c2de3ece980e7588b1..1a6da5635d5ae2fbbc70bc19fc2bd419ef73c36e 100644 (file)
--- a/src/interface.cpp
+++ b/src/interface.cpp
++i;
}
Inkscape::Extension::Extension *ext = *i;
- bool save = ext->get_param_bool("link");
- ext->set_param_bool("link", false);
+ bool save = (strcmp(ext->get_param_optiongroup("link"), "embed") == 0);
+ ext->set_param_optiongroup("link", "embed");
ext->set_gui(false);
gchar *filename = g_build_filename( g_get_tmp_dir(), "inkscape-dnd-import", NULL );
file_import(doc, filename, ext);
g_free(filename);
- ext->set_param_bool("link", save);
+ ext->set_param_optiongroup("link", save ? "embed" : "link");
ext->set_gui(true);
sp_document_done( doc , SP_VERB_NONE,
_("Drop bitmap image"));
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index db509da2e2cc9efc85c9bae7c2393f8c97c2ff7a..649f5408a2b561815748e102bcb2f8cd47f738ca 100644 (file)
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
Glib::RefPtr<Gdk::Pixbuf> img = _clipboard->wait_for_image();
if (!img) return false;
+ // TODO unify with interface.cpp's sp_ui_drag_data_received()
// AARGH stupid
Inkscape::Extension::DB::InputList o;
Inkscape::Extension::db.get_input_list(o);
++i;
}
Inkscape::Extension::Extension *png = *i;
- bool save = png->get_param_bool("link");
- png->set_param_bool("link", false);
+ bool save = (strcmp(png->get_param_optiongroup("link"), "embed") == 0);
+ png->set_param_optiongroup("link", "embed");
png->set_gui(false);
gchar *filename = g_build_filename( g_get_tmp_dir(), "inkscape-clipboard-import", NULL );
file_import(doc, filename, png);
g_free(filename);
- png->set_param_bool("link", save);
+ png->set_param_optiongroup("link", save ? "embed" : "link");
png->set_gui(true);
return true;