summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2011-06-08 18:23:27 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2011-06-08 18:23:27 +0000
commitcff58b6bd80f0fb13ab65daea0d92eafd5213ff2 (patch)
tree4f1fa71c613e6a03cd0f290a1f4ea549083d1572
parentFix const on new icon. (diff)
downloadinkscape-cff58b6bd80f0fb13ab65daea0d92eafd5213ff2.tar.gz
inkscape-cff58b6bd80f0fb13ab65daea0d92eafd5213ff2.zip
Save a copy dialog now opens in current directory if this option is set for save as... dialog. (there is also the possibility to manually change the preferences file to change this option independently from save as... dialog)
Fixed bugs: - https://launchpad.net/bugs/791098 (bzr r10263)
-rw-r--r--src/extension/system.cpp10
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp2
2 files changed, 9 insertions, 3 deletions
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index aa5731985..b3b64ca7d 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -590,10 +590,11 @@ Glib::ustring
get_file_save_path (SPDocument *doc, FileSaveMethod method) {
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
Glib::ustring path;
+ bool use_current_dir = true;
switch (method) {
case FILE_SAVE_METHOD_SAVE_AS:
{
- bool use_current_dir = prefs->getBool("/dialogs/save_as/use_current_dir", true);
+ use_current_dir = prefs->getBool("/dialogs/save_as/use_current_dir", true);
if (doc->getURI() && use_current_dir) {
path = Glib::path_get_dirname(doc->getURI());
} else {
@@ -605,7 +606,12 @@ get_file_save_path (SPDocument *doc, FileSaveMethod method) {
path = prefs->getString("/dialogs/save_as/path");
break;
case FILE_SAVE_METHOD_SAVE_COPY:
- path = prefs->getString("/dialogs/save_copy/path");
+ use_current_dir = prefs->getBool("/dialogs/save_copy/use_current_dir", prefs->getBool("/dialogs/save_as/use_current_dir", true));
+ if (doc->getURI() && use_current_dir) {
+ path = Glib::path_get_dirname(doc->getURI());
+ } else {
+ path = prefs->getString("/dialogs/save_copy/path");
+ }
break;
case FILE_SAVE_METHOD_INKSCAPE_SVG:
if (doc->getURI()) {
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index ad3553b86..447e50831 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -1203,7 +1203,7 @@ void InkscapePreferences::initPageSave()
{
_save_use_current_dir.init( _("Use current directory for \"Save As ...\""), "/dialogs/save_as/use_current_dir", true);
_page_save.add_line( false, "", _save_use_current_dir, "",
- _("When this option is on, the \"Save as...\" dialog will always open in the directory where the currently open document is; when it's off, it will open in the directory where you last saved a file using that dialog"), true);
+ _("When this option is on, the \"Save as...\" and \"Save a Copy\" dialogs will always open in the directory where the currently open document is; when it's off, each will open in the directory where you last saved a file using it"), true);
// Autosave options