summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/contextmenu.cpp35
-rw-r--r--src/ui/contextmenu.h2
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp12
-rw-r--r--src/ui/dialog/inkscape-preferences.h1
4 files changed, 35 insertions, 15 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("'");
diff --git a/src/ui/contextmenu.h b/src/ui/contextmenu.h
index faae6358f..465767604 100644
--- a/src/ui/contextmenu.h
+++ b/src/ui/contextmenu.h
@@ -165,7 +165,7 @@ class ContextMenu : public Gtk::Menu
/**
* auxiliary function that loads the external image editor name from the settings.
*/
- Glib::ustring getImageEditorName();
+ Glib::ustring getImageEditorName(bool is_svg = false);
/**
* callback, is executed on clicking the "Embed Image" menu entry
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 18b38c68d..f0ac55736 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -1533,16 +1533,18 @@ void InkscapePreferences::initPageBitmaps()
{
/* Note: /options/bitmapoversample removed with Cairo renderer */
_page_bitmaps.add_group_header( _("Edit"));
- _misc_bitmap_autoreload.init(_("Automatically reload bitmaps"), "/options/bitmapautoreload/value", true);
+ _misc_bitmap_autoreload.init(_("Automatically reload images"), "/options/bitmapautoreload/value", true);
_page_bitmaps.add_line( false, "", _misc_bitmap_autoreload, "",
_("Automatically reload linked images when file is changed on disk"));
_misc_bitmap_editor.init("/options/bitmapeditor/value", true);
_page_bitmaps.add_line( false, _("_Bitmap editor:"), _misc_bitmap_editor, "", "", true);
+ _misc_svg_editor.init("/options/svgeditor/value", true);
+ _page_bitmaps.add_line( false, _("_SVG editor:"), _misc_svg_editor, "", "", true);
_page_bitmaps.add_group_header( _("Export"));
_importexport_export_res.init("/dialogs/export/defaultxdpi/value", 0.0, 6000.0, 1.0, 1.0, Inkscape::Util::Quantity::convert(1, "in", "px"), true, false);
_page_bitmaps.add_line( false, _("Default export _resolution:"), _importexport_export_res, _("dpi"),
- _("Default bitmap resolution (in dots per inch) in the Export dialog"), false);
+ _("Default image resolution (in dots per inch) in the Export dialog"), false);
_page_bitmaps.add_group_header( _("Create"));
_bitmap_copy_res.init("/options/createbitmap/resolution", 1.0, 6000.0, 1.0, 1.0, Inkscape::Util::Quantity::convert(1, "in", "px"), true, false);
_page_bitmaps.add_line( false, _("Resolution for Create Bitmap _Copy:"), _bitmap_copy_res, _("dpi"),
@@ -1564,13 +1566,13 @@ void InkscapePreferences::initPageBitmaps()
Glib::ustring labels[] = {_("None (auto)"), _("Smooth (optimizeQuality)"), _("Blocky (optimizeSpeed)") };
Glib::ustring values[] = {"auto", "optimizeQuality", "optimizeSpeed"};
_bitmap_scale.init("/dialogs/import/scale", labels, values, G_N_ELEMENTS(values), "scale");
- _page_bitmaps.add_line( false, _("Bitmap scale (image-rendering):"), _bitmap_scale, "", "", false);
+ _page_bitmaps.add_line( false, _("Image scale (image-rendering):"), _bitmap_scale, "", "", false);
}
/* Note: /dialogs/import/quality removed use of in r12542 */
_importexport_import_res.init("/dialogs/import/defaultxdpi/value", 0.0, 6000.0, 1.0, 1.0, Inkscape::Util::Quantity::convert(1, "in", "px"), true, false);
_page_bitmaps.add_line( false, _("Default _import resolution:"), _importexport_import_res, _("dpi"),
- _("Default bitmap resolution (in dots per inch) for bitmap and SVG import"), false);
+ _("Default import resolution (in dots per inch) for bitmap and SVG import"), false);
_importexport_import_res_override.init(_("Override file resolution"), "/dialogs/import/forcexdpi", false);
_page_bitmaps.add_line( false, "", _importexport_import_res_override, "",
_("Use default bitmap resolution in favor of information from file"));
@@ -1580,7 +1582,7 @@ void InkscapePreferences::initPageBitmaps()
_rendering_image_outline.init( _("Images in Outline Mode"), "/options/rendering/imageinoutlinemode", false);
_page_bitmaps.add_line(false, "", _rendering_image_outline, "", _("When active will render images while in outline mode instead of a red box with an x. This is useful for manual tracing."));
- this->AddPage(_page_bitmaps, _("Bitmaps"), PREFS_PAGE_BITMAPS);
+ this->AddPage(_page_bitmaps, _("Imported Images"), PREFS_PAGE_BITMAPS);
}
void InkscapePreferences::initKeyboardShortcuts(Gtk::TreeModel::iterator iter_ui)
diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h
index 782e96a82..80df5ed65 100644
--- a/src/ui/dialog/inkscape-preferences.h
+++ b/src/ui/dialog/inkscape-preferences.h
@@ -375,6 +375,7 @@ protected:
// Bitmaps
UI::Widget::PrefCombo _misc_overs_bitmap;
UI::Widget::PrefEntryFileButtonHBox _misc_bitmap_editor;
+ UI::Widget::PrefEntryFileButtonHBox _misc_svg_editor;
UI::Widget::PrefCheckButton _misc_bitmap_autoreload;
UI::Widget::PrefSpinButton _bitmap_copy_res;
UI::Widget::PrefCheckButton _bitmap_ask;