summaryrefslogtreecommitdiffstats
path: root/src/ui/contextmenu.cpp
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2018-05-12 00:26:49 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-05-12 00:26:49 +0000
commit3b42c3d705f97584d1cf614240aa1da7ce01a94b (patch)
tree4fa75458ce1e84e35a53d62b1fd32daada22423e /src/ui/contextmenu.cpp
parentAdd Maren improvements prepare to merge (diff)
downloadinkscape-3b42c3d705f97584d1cf614240aa1da7ce01a94b.tar.gz
inkscape-3b42c3d705f97584d1cf614240aa1da7ce01a94b.zip
Fixes bugs: #1770760, #1770761, #1770763, #1770769 related to linked SVG
Diffstat (limited to 'src/ui/contextmenu.cpp')
-rw-r--r--src/ui/contextmenu.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/ui/contextmenu.cpp b/src/ui/contextmenu.cpp
index 1a5691c3f..628b0b2fd 100644
--- a/src/ui/contextmenu.cpp
+++ b/src/ui/contextmenu.cpp
@@ -719,15 +719,25 @@ void ContextMenu::ImageProperties(void)
_desktop->_dlg_mgr->showDialog("ObjectAttributes");
}
-Glib::ustring ContextMenu::getImageEditorName() {
+Glib::ustring ContextMenu::getImageEditorName(bool is_svg) {
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
Glib::ustring value;
- Glib::ustring choices = prefs->getString("/options/bitmapeditor/value");
- if (!choices.empty()) {
- value = choices;
- }
- else {
- value = "gimp";
+ if (!is_svg) {
+ Glib::ustring choices = prefs->getString("/options/bitmapeditor/value");
+ if (!choices.empty()) {
+ value = choices;
+ }
+ else {
+ value = "gimp";
+ }
+ } else {
+ Glib::ustring choices = prefs->getString("/options/svgeditor/value");
+ if (!choices.empty()) {
+ value = choices;
+ }
+ else {
+ value = "inkscape";
+ }
}
return value;
}
@@ -739,7 +749,8 @@ void ContextMenu::ImageEdit(void)
}
GError* errThing = 0;
- Glib::ustring cmdline = getImageEditorName();
+ Glib::ustring bmpeditor = getImageEditorName();
+ Glib::ustring cmdline = bmpeditor;
Glib::ustring name;
Glib::ustring fullname;
@@ -783,7 +794,13 @@ void ContextMenu::ImageEdit(void)
} else {
fullname = Glib::build_filename(Glib::get_current_dir(), name);
}
-
+ if (name.substr(name.find_last_of(".") + 1) == "SVG" ||
+ name.substr(name.find_last_of(".") + 1) == "svg" )
+ {
+ cmdline.erase(0, bmpeditor.length());
+ Glib::ustring svgeditor = getImageEditorName(true);
+ cmdline = svgeditor.append(cmdline);
+ }
cmdline.append(" '");
cmdline.append(fullname.c_str());
cmdline.append("'");