Changed "Processing profile operations -> Custom Profile Builder" to "Reset to default profile"

The behaviour has changed slightly, so that clicking the menu item now resets
to the default processing profile specified in the preferences. If this
involves calling the custom profile builder, the behaviour is the same as
before. But this is a bit more general, in that it might also simply reapply
the static default profile, or regenerate the dynamic one (depending on the
user's settings)
This commit is contained in:
Alberto Griggio
2017-03-13 23:24:12 +01:00
parent 3660ed5f95
commit e0d9090420
5 changed files with 16 additions and 11 deletions

View File

@@ -117,7 +117,7 @@ FILEBROWSER_DELETEDLGMSG;Are you sure you want to delete the selected <b>%1</b>
FILEBROWSER_DELETEDLGMSGINCLPROC;Are you sure you want to delete the selected <b>%1</b> files <b>including</b> a queue-processed version?
FILEBROWSER_EMPTYTRASH;Empty trash
FILEBROWSER_EMPTYTRASHHINT;Permanently delete the files from trash.
FILEBROWSER_EXEC_CPB;Custom Profile Builder
FILEBROWSER_RESETDEFAULTPROFILE;Reset to default
FILEBROWSER_EXTPROGMENU;Open with
FILEBROWSER_FLATFIELD;Flat-Field
FILEBROWSER_MOVETODARKFDIR;Move to dark-frames directory

View File

@@ -340,7 +340,7 @@ FileBrowser::FileBrowser ()
p++;
submenuProfileOperations->attach (*Gtk::manage(applypartprof = new Gtk::MenuItem (M("FILEBROWSER_APPLYPROFILE_PARTIAL"))), 0, 1, p, p + 1);
p++;
submenuProfileOperations->attach (*Gtk::manage(execcustprof = new Gtk::MenuItem (M("FILEBROWSER_EXEC_CPB"))), 0, 1, p, p + 1);
submenuProfileOperations->attach (*Gtk::manage(resetdefaultprof = new Gtk::MenuItem (M("FILEBROWSER_RESETDEFAULTPROFILE"))), 0, 1, p, p + 1);
p++;
submenuProfileOperations->attach (*Gtk::manage(clearprof = new Gtk::MenuItem (M("FILEBROWSER_CLEARPROFILE"))), 0, 1, p, p + 1);
p++;
@@ -358,7 +358,7 @@ FileBrowser::FileBrowser ()
p++;
pmenu->attach (*Gtk::manage(applypartprof = new Gtk::MenuItem (M("FILEBROWSER_APPLYPROFILE_PARTIAL"))), 0, 1, p, p + 1);
p++;
pmenu->attach (*Gtk::manage(execcustprof = new Gtk::MenuItem (M("FILEBROWSER_EXEC_CPB"))), 0, 1, p, p + 1);
pmenu->attach (*Gtk::manage(resetdefaultprof = new Gtk::MenuItem (M("FILEBROWSER_RESETDEFAULTPROFILE"))), 0, 1, p, p + 1);
p++;
pmenu->attach (*Gtk::manage(clearprof = new Gtk::MenuItem (M("FILEBROWSER_CLEARPROFILE"))), 0, 1, p, p + 1);
p++;
@@ -427,7 +427,7 @@ FileBrowser::FileBrowser ()
partpasteprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), partpasteprof));
applyprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), applyprof));
applypartprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), applypartprof));
execcustprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), execcustprof));
resetdefaultprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), resetdefaultprof));
clearprof->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), clearprof));
cachemenu->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), cachemenu));
@@ -960,7 +960,7 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m)
}
queue_draw ();
} else if (m == execcustprof) {
} else if (m == resetdefaultprof) {
if (!mselected.empty() && bppcl) {
bppcl->beginBatchPParamsChange(mselected.size());
}

View File

@@ -110,7 +110,7 @@ protected:
Gtk::MenuItem* partpasteprof;
Gtk::MenuItem* applyprof;
Gtk::MenuItem* applypartprof;
Gtk::MenuItem* execcustprof;
Gtk::MenuItem* resetdefaultprof;
Gtk::MenuItem* clearprof;
Gtk::MenuItem* cachemenu;
Gtk::MenuItem* clearFromCache;

View File

@@ -198,14 +198,13 @@ const ProcParams& Thumbnail::getProcParamsU ()
* The loaded profile may be partial, but it return a complete ProcParams (i.e. without ParamsEdited)
*
* @param returnParams Ask to return a pointer to a ProcParams object if true
* @param forceCPB True if the Custom Profile Builder has to be invoked, False if the CPB has to be invoked if the profile doesn't
* exist yet. It depends on other conditions too
* @param force True if the profile has to be re-generated even if it already exists
* @param flaggingMode True if the ProcParams will be created because the file browser is being flagging an image
* (rang, to trash, color labels). This parameter is passed to the CPB.
*
* @return Return a pointer to a ProcPamas structure to be updated if returnParams is true and if everything went fine, NULL otherwise.
*/
rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool returnParams, bool forceCPB, bool flaggingMode)
rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool returnParams, bool force, bool flaggingMode)
{
static int index = 0; // Will act as unique identifier during the session
@@ -217,7 +216,7 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu
const CacheImageData* cfs = getCacheImageData();
Glib::ustring defaultPparamsPath = options.findProfilePath(defProf);
const bool create = (!hasProcParams() || forceCPB);
const bool create = (!hasProcParams() || force);
const Glib::ustring outFName =
(options.paramsLoadLocation == PLL_Input) ?
@@ -239,6 +238,12 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu
if (!err) {
loadProcParams();
}
} else if (create &&
defProf != DEFPROFILE_DYNAMIC && defProf != DEFPROFILE_INTERNAL){
const PartialProfile *p = profileStore.getProfile(defProf);
if (p && !p->pparams->save(outFName)) {
loadProcParams();
}
}
if (!options.CPBPath.empty() && !defaultPparamsPath.empty() && create && cfs && cfs->exifValid) {

View File

@@ -87,7 +87,7 @@ public:
const rtengine::procparams::ProcParams& getProcParamsU (); // Unprotected version
// Use this to create params on demand for update ; if flaggingMode=true, the procparams is created for a file being flagged (inTrash, rank, colorLabel)
rtengine::procparams::ProcParams* createProcParamsForUpdate (bool returnParams, bool forceCPB, bool flaggingMode = false);
rtengine::procparams::ProcParams* createProcParamsForUpdate (bool returnParams, bool force, bool flaggingMode = false);
void setProcParams (const rtengine::procparams::ProcParams& pp, ParamsEdited* pe = nullptr, int whoChangedIt = -1, bool updateCacheNow = true);
void clearProcParams (int whoClearedIt = -1);