Solving issue 1690: "ver 4.09.50 unable to save processing profiles". There is now 2 new shortcut places when loading/saving a profile, and 1 new place when "saving as.." an image in the dialog box.

This commit is contained in:
natureh 510
2013-02-04 00:36:56 +01:00
parent 3e04306a93
commit 0c7475c4df
6 changed files with 28 additions and 5 deletions

View File

@@ -392,7 +392,6 @@ void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) {
openThm->increaseRef ();
fname=openThm->getFileName();
//saveAsDialog->setInitialFileName (removeExtension (Glib::path_get_basename (fname)));
lastSaveAsFileName = removeExtension (Glib::path_get_basename (fname));
previewHandler = new PreviewHandler ();
@@ -420,7 +419,7 @@ void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) {
// initialize profile
Glib::ustring defProf = openThm->getType()==FT_Raw ? options.defProfRaw : options.defProfImg;
profilep->initProfile (defProf, ldprof);
profilep->setInitialFileName (Glib::path_get_basename (fname) + paramFileExtension);
profilep->setInitialFileName (fname);
openThm->addThumbnailListener (this);
info_toggled ();
@@ -1064,6 +1063,7 @@ void EditorPanel::saveAsPressed () {
saveAsDialog->set_default_size (options.saveAsDialogWidth, options.saveAsDialogHeight);
saveAsDialog->setInitialFileName (lastSaveAsFileName);
saveAsDialog->setImagePath (fname);
do {
int result = saveAsDialog->run ();

View File

@@ -157,6 +157,8 @@ void Options::updatePaths() {
lastProfilingReferenceDir = preferredPath;
if (lastVibranceCurvesDir.empty() || !safe_file_test (lastVibranceCurvesDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastVibranceCurvesDir, Glib::FILE_TEST_IS_DIR))
lastVibranceCurvesDir = preferredPath;
if (loadSaveProfilePath.empty() || !safe_file_test (loadSaveProfilePath, Glib::FILE_TEST_EXISTS) || !safe_file_test (loadSaveProfilePath, Glib::FILE_TEST_IS_DIR))
loadSaveProfilePath = preferredPath;
}
Glib::ustring Options::getPreferredProfilePath() {

View File

@@ -40,7 +40,7 @@ void ProfilePanel::cleanup () {
delete partialProfileDlg;
}
ProfilePanel::ProfilePanel (bool readOnly) : lastFilename("") {
ProfilePanel::ProfilePanel (bool readOnly) : lastFilename(""), imagePath("") {
tpc = NULL;
@@ -128,6 +128,11 @@ void ProfilePanel::save_clicked (GdkEventButton* event) {
FileChooserLastFolderPersister persister( &dialog, options.loadSaveProfilePath );
dialog.set_current_name (lastFilename);
//Add the user's default (or global if multiuser=false) profile path to the Shortcut list
dialog.add_shortcut_folder(options.getPreferredProfilePath());
//Add the image's path to the Shortcut list
dialog.add_shortcut_folder(imagePath);
//Add response buttons the the dialog:
dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL);
dialog.add_button(Gtk::StockID("gtk-save"), Gtk::RESPONSE_OK);
@@ -245,6 +250,11 @@ void ProfilePanel::load_clicked (GdkEventButton* event) {
Gtk::FileChooserDialog dialog(M("PROFILEPANEL_LOADDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN);
FileChooserLastFolderPersister persister( &dialog, options.loadSaveProfilePath );
//Add the user's default (or global if multiuser=false) profile path to the Shortcut list
dialog.add_shortcut_folder(options.getPreferredProfilePath());
//Add the image's path to the Shortcut list
dialog.add_shortcut_folder(imagePath);
//Add response buttons the the dialog:
dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL);
dialog.add_button(Gtk::StockID("gtk-open"), Gtk::RESPONSE_OK);
@@ -480,5 +490,8 @@ void ProfilePanel::initProfile (const Glib::ustring& profname, ProcParams* lastS
}
}
void ProfilePanel::setInitialFileName (const Glib::ustring& filename) {
lastFilename = Glib::path_get_basename(filename) + paramFileExtension;
imagePath = Glib::path_get_dirname(filename);
}

View File

@@ -32,6 +32,7 @@ class ProfilePanel : public Gtk::VBox, public PParamsChangeListener {
private:
Glib::ustring lastFilename;
Glib::ustring imagePath;
protected:
@@ -63,7 +64,7 @@ class ProfilePanel : public Gtk::VBox, public PParamsChangeListener {
static void cleanup ();
void initProfile (const Glib::ustring& profname, rtengine::procparams::ProcParams* lastSaved);
void setInitialFileName (const Glib::ustring& filename) {lastFilename = filename;}
void setInitialFileName (const Glib::ustring& filename);
// PParamsChangeListener interface
void procParamsChanged (rtengine::procparams::ProcParams* params, rtengine::ProcEvent ev, Glib::ustring descr, ParamsEdited* paramsEdited=NULL);

View File

@@ -219,3 +219,9 @@ void SaveAsDialog::setInitialFileName (Glib::ustring fname) {
fchooser->set_current_name(fname);
}
void SaveAsDialog::setImagePath (Glib::ustring ipath) {
//Add the image's path to the Shortcut list
fchooser->add_shortcut_folder(Glib::path_get_dirname(ipath));
}

View File

@@ -52,6 +52,7 @@ class SaveAsDialog : public Gtk::Dialog, public FormatChangeListener {
int getSaveMethodNum ();
void setInitialFileName (Glib::ustring iname);
void setImagePath (Glib::ustring ipath);
void okPressed ();
void cancelPressed ();