summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2010-03-18 01:21:55 +0000
committerJon A. Cruz <jon@joncruz.org>2010-03-18 01:21:55 +0000
commitfae67e1661842bd514929aa41ce21528ae56c571 (patch)
tree5244778438528c6d367937602fec42f3a3d5074e /src
parentAdded wrappers for the "optiongroup" type that correspond to existing "float"... (diff)
downloadinkscape-fae67e1661842bd514929aa41ce21528ae56c571.tar.gz
inkscape-fae67e1661842bd514929aa41ce21528ae56c571.zip
Changed the embed/link dialog to use radio buttons instead of a checkbox to make the link/embed effect clearer.
(bzr r9202)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/gdkpixbuf-input.cpp11
-rw-r--r--src/interface.cpp6
-rw-r--r--src/ui/clipboard.cpp7
3 files changed, 14 insertions, 10 deletions
diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp
index 3f78b3f36..a1295406c 100644
--- a/src/extension/internal/gdkpixbuf-input.cpp
+++ b/src/extension/internal/gdkpixbuf-input.cpp
@@ -30,7 +30,8 @@ static std::set<Glib::ustring> create_lossy_set()
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();
@@ -147,9 +148,11 @@ GdkpixbufInput::init(void)
"<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 cb021db18..1a6da5635 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -1465,8 +1465,8 @@ sp_ui_drag_data_received(GtkWidget *widget,
++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 );
@@ -1474,7 +1474,7 @@ sp_ui_drag_data_received(GtkWidget *widget,
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 db509da2e..649f5408a 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -874,6 +874,7 @@ bool ClipboardManagerImpl::_pasteImage()
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);
@@ -882,8 +883,8 @@ bool ClipboardManagerImpl::_pasteImage()
++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 );
@@ -891,7 +892,7 @@ bool ClipboardManagerImpl::_pasteImage()
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;