Merge branch 'dev' into blur-flat-regions

This commit is contained in:
heckflosse
2018-12-17 18:26:15 +01:00
6 changed files with 121 additions and 62 deletions

View File

@@ -908,6 +908,8 @@ MAIN_TAB_ADVANCED;Advanced
MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: <b>Alt-w</b> MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: <b>Alt-w</b>
MAIN_TAB_COLOR;Color MAIN_TAB_COLOR;Color
MAIN_TAB_COLOR_TOOLTIP;Shortcut: <b>Alt-c</b> MAIN_TAB_COLOR_TOOLTIP;Shortcut: <b>Alt-c</b>
MAIN_TAB_FAVORITES;Favorites
MAIN_TAB_FAVORITES_TOOLTIP;Shortcut: <b>Alt-u</b>
MAIN_TAB_DETAIL;Detail MAIN_TAB_DETAIL;Detail
MAIN_TAB_DETAIL_TOOLTIP;Shortcut: <b>Alt-d</b> MAIN_TAB_DETAIL_TOOLTIP;Shortcut: <b>Alt-d</b>
MAIN_TAB_DEVELOP; Batch Edit MAIN_TAB_DEVELOP; Batch Edit

View File

@@ -399,6 +399,7 @@ void Options::setDefaults()
autoSaveTpOpen = true; autoSaveTpOpen = true;
//crvOpen.clear (); //crvOpen.clear ();
parseExtensions.clear(); parseExtensions.clear();
favorites.clear();
parseExtensionsEnabled.clear(); parseExtensionsEnabled.clear();
parsedExtensions.clear(); parsedExtensions.clear();
renameUseTemplates = false; renameUseTemplates = false;
@@ -1075,6 +1076,10 @@ void Options::readFromFile(Glib::ustring fname)
} }
if (keyFile.has_group("GUI")) { if (keyFile.has_group("GUI")) {
if (keyFile.has_key("GUI", "Favorites")) {
favorites = keyFile.get_string_list("GUI", "Favorites");
}
if (keyFile.has_key("GUI", "WindowWidth")) { if (keyFile.has_key("GUI", "WindowWidth")) {
windowWidth = keyFile.get_integer("GUI", "WindowWidth"); windowWidth = keyFile.get_integer("GUI", "WindowWidth");
} }
@@ -1974,6 +1979,8 @@ void Options::saveToFile(Glib::ustring fname)
keyFile.set_string("Profiles", "CustomProfileBuilderPath", CPBPath); keyFile.set_string("Profiles", "CustomProfileBuilderPath", CPBPath);
keyFile.set_integer("Profiles", "CustomProfileBuilderKeys", CPBKeys); keyFile.set_integer("Profiles", "CustomProfileBuilderKeys", CPBKeys);
Glib::ArrayHandle<Glib::ustring> ahfavorites = favorites;
keyFile.set_string_list("GUI", "Favorites", ahfavorites);
keyFile.set_integer("GUI", "WindowWidth", windowWidth); keyFile.set_integer("GUI", "WindowWidth", windowWidth);
keyFile.set_integer("GUI", "WindowHeight", windowHeight); keyFile.set_integer("GUI", "WindowHeight", windowHeight);
keyFile.set_integer("GUI", "WindowX", windowX); keyFile.set_integer("GUI", "WindowX", windowX);

View File

@@ -375,6 +375,7 @@ public:
int fastexport_resize_height; int fastexport_resize_height;
bool fastexport_use_fast_pipeline; bool fastexport_use_fast_pipeline;
std::vector<Glib::ustring> favorites;
// Dialog settings // Dialog settings
Glib::ustring lastIccDir; Glib::ustring lastIccDir;
Glib::ustring lastDarkframeDir; Glib::ustring lastDarkframeDir;

View File

@@ -131,6 +131,9 @@ public:
this->batchMode = batchMode; this->batchMode = batchMode;
} }
virtual Glib::ustring getToolName () {
return toolName;
}
}; };
class FoldableToolPanel : public ToolPanel class FoldableToolPanel : public ToolPanel

View File

@@ -28,9 +28,10 @@
using namespace rtengine::procparams; using namespace rtengine::procparams;
ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChanged (false), editDataProvider (nullptr) ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChanged (false), editDataProvider (nullptr), favoritePanelSW(nullptr)
{ {
favoritePanel = Gtk::manage (new ToolVBox ());
exposurePanel = Gtk::manage (new ToolVBox ()); exposurePanel = Gtk::manage (new ToolVBox ());
detailsPanel = Gtk::manage (new ToolVBox ()); detailsPanel = Gtk::manage (new ToolVBox ());
colorPanel = Gtk::manage (new ToolVBox ()); colorPanel = Gtk::manage (new ToolVBox ());
@@ -100,58 +101,67 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
// Valeurs par dfaut: // Valeurs par dfaut:
// Best -> low ISO // Best -> low ISO
// Medium -> High ISO // Medium -> High ISO
favorites.resize(options.favorites.size(), nullptr);
addPanel (colorPanel, whitebalance); addfavoritePanel (colorPanel, whitebalance);
addPanel (exposurePanel, toneCurve); addfavoritePanel (exposurePanel, toneCurve);
addPanel (colorPanel, vibrance); addfavoritePanel (colorPanel, vibrance);
addPanel (colorPanel, chmixer); addfavoritePanel (colorPanel, chmixer);
addPanel (colorPanel, blackwhite); addfavoritePanel (colorPanel, blackwhite);
addPanel (exposurePanel, shadowshighlights); addfavoritePanel (exposurePanel, shadowshighlights);
addPanel (detailsPanel, sharpening); addfavoritePanel (detailsPanel, sharpening);
addPanel (detailsPanel, localContrast); addfavoritePanel (detailsPanel, localContrast);
addPanel (detailsPanel, sharpenEdge); addfavoritePanel (detailsPanel, sharpenEdge);
addPanel (detailsPanel, sharpenMicro); addfavoritePanel (detailsPanel, sharpenMicro);
addPanel (colorPanel, hsvequalizer); addfavoritePanel (colorPanel, hsvequalizer);
addPanel (colorPanel, filmSimulation); addfavoritePanel (colorPanel, filmSimulation);
addPanel (colorPanel, softlight); addfavoritePanel (colorPanel, softlight);
addPanel (colorPanel, rgbcurves); addfavoritePanel (colorPanel, rgbcurves);
addPanel (colorPanel, colortoning); addfavoritePanel (colorPanel, colortoning);
addPanel (exposurePanel, epd); addfavoritePanel (exposurePanel, epd);
addPanel (exposurePanel, fattal); addfavoritePanel (exposurePanel, fattal);
addPanel (advancedPanel, retinex); addfavoritePanel (advancedPanel, retinex);
addPanel (exposurePanel, pcvignette); addfavoritePanel (exposurePanel, pcvignette);
addPanel (exposurePanel, gradient); addfavoritePanel (exposurePanel, gradient);
addPanel (exposurePanel, lcurve); addfavoritePanel (exposurePanel, lcurve);
addPanel (advancedPanel, colorappearance); addfavoritePanel (advancedPanel, colorappearance);
addPanel (detailsPanel, impulsedenoise); addfavoritePanel (detailsPanel, impulsedenoise);
addPanel (detailsPanel, dirpyrdenoise); addfavoritePanel (detailsPanel, dirpyrdenoise);
addPanel (detailsPanel, defringe); addfavoritePanel (detailsPanel, defringe);
addPanel (detailsPanel, dirpyrequalizer); addfavoritePanel (detailsPanel, dirpyrequalizer);
addPanel (detailsPanel, dehaze); addfavoritePanel (detailsPanel, dehaze);
addPanel (advancedPanel, wavelet); addfavoritePanel (advancedPanel, wavelet);
addPanel (transformPanel, crop); addfavoritePanel (transformPanel, crop);
addPanel (transformPanel, resize); addfavoritePanel (transformPanel, resize);
addPanel (resize->getPackBox(), prsharpening, 2); addPanel (resize->getPackBox(), prsharpening, 2);
addPanel (transformPanel, lensgeom); addfavoritePanel (transformPanel, lensgeom);
addPanel (lensgeom->getPackBox(), rotate, 2); addfavoritePanel (lensgeom->getPackBox(), rotate, 2);
addPanel (lensgeom->getPackBox(), perspective, 2); addfavoritePanel (lensgeom->getPackBox(), perspective, 2);
addPanel (lensgeom->getPackBox(), lensProf, 2); addfavoritePanel (lensgeom->getPackBox(), lensProf, 2);
addPanel (lensgeom->getPackBox(), distortion, 2); addfavoritePanel (lensgeom->getPackBox(), distortion, 2);
addPanel (lensgeom->getPackBox(), cacorrection, 2); addfavoritePanel (lensgeom->getPackBox(), cacorrection, 2);
addPanel (lensgeom->getPackBox(), vignetting, 2); addfavoritePanel (lensgeom->getPackBox(), vignetting, 2);
addPanel (colorPanel, icm); addfavoritePanel (colorPanel, icm);
addPanel (rawPanel, sensorbayer); addfavoritePanel (rawPanel, sensorbayer);
addPanel (sensorbayer->getPackBox(), bayerprocess, 2); addfavoritePanel (sensorbayer->getPackBox(), bayerprocess, 2);
addPanel (sensorbayer->getPackBox(), bayerrawexposure, 2); addfavoritePanel (sensorbayer->getPackBox(), bayerrawexposure, 2);
addPanel (sensorbayer->getPackBox(), bayerpreprocess, 2); addfavoritePanel (sensorbayer->getPackBox(), bayerpreprocess, 2);
addPanel (sensorbayer->getPackBox(), rawcacorrection, 2); addfavoritePanel (sensorbayer->getPackBox(), rawcacorrection, 2);
addPanel (rawPanel, sensorxtrans); addfavoritePanel (rawPanel, sensorxtrans);
addPanel (sensorxtrans->getPackBox(), xtransprocess, 2); addfavoritePanel (sensorxtrans->getPackBox(), xtransprocess, 2);
addPanel (sensorxtrans->getPackBox(), xtransrawexposure, 2); addfavoritePanel (sensorxtrans->getPackBox(), xtransrawexposure, 2);
addPanel (rawPanel, rawexposure); addfavoritePanel (rawPanel, rawexposure);
addPanel (rawPanel, preprocess); addfavoritePanel (rawPanel, preprocess);
addPanel (rawPanel, darkframe); addfavoritePanel (rawPanel, darkframe);
addPanel (rawPanel, flatfield); addfavoritePanel (rawPanel, flatfield);
int favoriteCount = 0;
for(auto it = favorites.begin(); it != favorites.end(); ++it) {
if (*it) {
addPanel(favoritePanel, *it);
++favoriteCount;
}
}
toolPanels.push_back (coarse); toolPanels.push_back (coarse);
toolPanels.push_back(metadata); toolPanels.push_back(metadata);
@@ -159,7 +169,6 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
toolPanelNotebook = new Gtk::Notebook (); toolPanelNotebook = new Gtk::Notebook ();
toolPanelNotebook->set_name ("ToolPanelNotebook"); toolPanelNotebook->set_name ("ToolPanelNotebook");
exposurePanelSW = Gtk::manage (new MyScrolledWindow ()); exposurePanelSW = Gtk::manage (new MyScrolledWindow ());
detailsPanelSW = Gtk::manage (new MyScrolledWindow ()); detailsPanelSW = Gtk::manage (new MyScrolledWindow ());
colorPanelSW = Gtk::manage (new MyScrolledWindow ()); colorPanelSW = Gtk::manage (new MyScrolledWindow ());
@@ -169,7 +178,7 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
updateVScrollbars (options.hideTPVScrollbar); updateVScrollbars (options.hideTPVScrollbar);
// load panel endings // load panel endings
for (int i = 0; i < 6; i++) { for (int i = 0; i < 7; i++) {
vbPanelEnd[i] = Gtk::manage (new Gtk::VBox ()); vbPanelEnd[i] = Gtk::manage (new Gtk::VBox ());
imgPanelEnd[i] = Gtk::manage (new RTImage ("ornament1.png")); imgPanelEnd[i] = Gtk::manage (new RTImage ("ornament1.png"));
imgPanelEnd[i]->show (); imgPanelEnd[i]->show ();
@@ -177,30 +186,38 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
vbPanelEnd[i]->show_all(); vbPanelEnd[i]->show_all();
} }
if(favoriteCount > 0) {
favoritePanelSW = Gtk::manage(new MyScrolledWindow());
favoritePanelSW->add(*favoritePanel);
favoritePanel->pack_start(*Gtk::manage(new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
favoritePanel->pack_start(*vbPanelEnd[0], Gtk::PACK_SHRINK, 4);
}
exposurePanelSW->add (*exposurePanel); exposurePanelSW->add (*exposurePanel);
exposurePanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); exposurePanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
exposurePanel->pack_start (*vbPanelEnd[0], Gtk::PACK_SHRINK, 4); exposurePanel->pack_start (*vbPanelEnd[1], Gtk::PACK_SHRINK, 4);
detailsPanelSW->add (*detailsPanel); detailsPanelSW->add (*detailsPanel);
detailsPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); detailsPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
detailsPanel->pack_start (*vbPanelEnd[1], Gtk::PACK_SHRINK, 4); detailsPanel->pack_start (*vbPanelEnd[2], Gtk::PACK_SHRINK, 4);
colorPanelSW->add (*colorPanel); colorPanelSW->add (*colorPanel);
colorPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); colorPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
colorPanel->pack_start (*vbPanelEnd[2], Gtk::PACK_SHRINK, 4); colorPanel->pack_start (*vbPanelEnd[3], Gtk::PACK_SHRINK, 4);
advancedPanelSW->add (*advancedPanel); advancedPanelSW->add (*advancedPanel);
advancedPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); advancedPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
advancedPanel->pack_start (*vbPanelEnd[5], Gtk::PACK_SHRINK, 0); advancedPanel->pack_start (*vbPanelEnd[6], Gtk::PACK_SHRINK, 0);
transformPanelSW->add (*transformPanel); transformPanelSW->add (*transformPanel);
transformPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); transformPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
transformPanel->pack_start (*vbPanelEnd[3], Gtk::PACK_SHRINK, 4); transformPanel->pack_start (*vbPanelEnd[4], Gtk::PACK_SHRINK, 4);
rawPanelSW->add (*rawPanel); rawPanelSW->add (*rawPanel);
rawPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); rawPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
rawPanel->pack_start (*vbPanelEnd[4], Gtk::PACK_SHRINK, 0); rawPanel->pack_start (*vbPanelEnd[5], Gtk::PACK_SHRINK, 0);
toiF = Gtk::manage (new TextOrIcon ("wb-sun.png", M ("MAIN_TAB_FAVORITES"), M ("MAIN_TAB_FAVORITES_TOOLTIP")));
toiE = Gtk::manage (new TextOrIcon ("exposure.png", M ("MAIN_TAB_EXPOSURE"), M ("MAIN_TAB_EXPOSURE_TOOLTIP"))); toiE = Gtk::manage (new TextOrIcon ("exposure.png", M ("MAIN_TAB_EXPOSURE"), M ("MAIN_TAB_EXPOSURE_TOOLTIP")));
toiD = Gtk::manage (new TextOrIcon ("detail.png", M ("MAIN_TAB_DETAIL"), M ("MAIN_TAB_DETAIL_TOOLTIP"))); toiD = Gtk::manage (new TextOrIcon ("detail.png", M ("MAIN_TAB_DETAIL"), M ("MAIN_TAB_DETAIL_TOOLTIP")));
toiC = Gtk::manage (new TextOrIcon ("color-circles.png", M ("MAIN_TAB_COLOR"), M ("MAIN_TAB_COLOR_TOOLTIP"))); toiC = Gtk::manage (new TextOrIcon ("color-circles.png", M ("MAIN_TAB_COLOR"), M ("MAIN_TAB_COLOR_TOOLTIP")));
@@ -209,6 +226,9 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
toiR = Gtk::manage (new TextOrIcon ("bayer.png", M ("MAIN_TAB_RAW"), M ("MAIN_TAB_RAW_TOOLTIP"))); toiR = Gtk::manage (new TextOrIcon ("bayer.png", M ("MAIN_TAB_RAW"), M ("MAIN_TAB_RAW_TOOLTIP")));
toiM = Gtk::manage (new TextOrIcon ("metadata.png", M ("MAIN_TAB_METADATA"), M ("MAIN_TAB_METADATA_TOOLTIP"))); toiM = Gtk::manage (new TextOrIcon ("metadata.png", M ("MAIN_TAB_METADATA"), M ("MAIN_TAB_METADATA_TOOLTIP")));
if (favoritePanelSW) {
toolPanelNotebook->append_page (*favoritePanelSW, *toiF);
}
toolPanelNotebook->append_page (*exposurePanelSW, *toiE); toolPanelNotebook->append_page (*exposurePanelSW, *toiE);
toolPanelNotebook->append_page (*detailsPanelSW, *toiD); toolPanelNotebook->append_page (*detailsPanelSW, *toiD);
toolPanelNotebook->append_page (*colorPanelSW, *toiC); toolPanelNotebook->append_page (*colorPanelSW, *toiC);
@@ -251,6 +271,18 @@ void ToolPanelCoordinator::addPanel (Gtk::Box* where, FoldableToolPanel* panel,
toolPanels.push_back (panel); toolPanels.push_back (panel);
} }
void ToolPanelCoordinator::addfavoritePanel (Gtk::Box* where, FoldableToolPanel* panel, int level)
{
auto name = panel->getToolName();
auto it = std::find(options.favorites.begin(), options.favorites.end(), name);
if (it != options.favorites.end()) {
int index = std::distance(options.favorites.begin(), it);
favorites[index] = panel;
} else {
addPanel(where, panel, level);
}
}
ToolPanelCoordinator::~ToolPanelCoordinator () ToolPanelCoordinator::~ToolPanelCoordinator ()
{ {
idle_register.destroy(); idle_register.destroy();
@@ -856,6 +888,12 @@ bool ToolPanelCoordinator::handleShortcutKey (GdkEventKey* event)
if (alt) { if (alt) {
switch (event->keyval) { switch (event->keyval) {
case GDK_KEY_u:
if (favoritePanelSW) {
toolPanelNotebook->set_current_page (toolPanelNotebook->page_num (*favoritePanelSW));
}
return true;
case GDK_KEY_e: case GDK_KEY_e:
toolPanelNotebook->set_current_page (toolPanelNotebook->page_num (*exposurePanelSW)); toolPanelNotebook->set_current_page (toolPanelNotebook->page_num (*exposurePanelSW));
return true; return true;
@@ -893,6 +931,9 @@ void ToolPanelCoordinator::updateVScrollbars (bool hide)
{ {
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
Gtk::PolicyType policy = hide ? Gtk::POLICY_NEVER : Gtk::POLICY_AUTOMATIC; Gtk::PolicyType policy = hide ? Gtk::POLICY_NEVER : Gtk::POLICY_AUTOMATIC;
if (favoritePanelSW) {
favoritePanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
}
exposurePanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy); exposurePanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
detailsPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy); detailsPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
colorPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy); colorPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);

View File

@@ -158,6 +158,8 @@ protected:
rtengine::StagedImageProcessor* ipc; rtengine::StagedImageProcessor* ipc;
std::vector<ToolPanel*> toolPanels; std::vector<ToolPanel*> toolPanels;
std::vector<FoldableToolPanel*> favorites;
ToolVBox* favoritePanel;
ToolVBox* exposurePanel; ToolVBox* exposurePanel;
ToolVBox* detailsPanel; ToolVBox* detailsPanel;
ToolVBox* colorPanel; ToolVBox* colorPanel;
@@ -166,6 +168,7 @@ protected:
ToolVBox* advancedPanel; ToolVBox* advancedPanel;
ToolBar* toolBar; ToolBar* toolBar;
TextOrIcon* toiF;
TextOrIcon* toiE; TextOrIcon* toiE;
TextOrIcon* toiD; TextOrIcon* toiD;
TextOrIcon* toiC; TextOrIcon* toiC;
@@ -174,9 +177,10 @@ protected:
TextOrIcon* toiM; TextOrIcon* toiM;
TextOrIcon* toiW; TextOrIcon* toiW;
Gtk::Image* imgPanelEnd[6]; Gtk::Image* imgPanelEnd[7];
Gtk::VBox* vbPanelEnd[6]; Gtk::VBox* vbPanelEnd[7];
Gtk::ScrolledWindow* favoritePanelSW;
Gtk::ScrolledWindow* exposurePanelSW; Gtk::ScrolledWindow* exposurePanelSW;
Gtk::ScrolledWindow* detailsPanelSW; Gtk::ScrolledWindow* detailsPanelSW;
Gtk::ScrolledWindow* colorPanelSW; Gtk::ScrolledWindow* colorPanelSW;
@@ -191,6 +195,7 @@ protected:
void addPanel (Gtk::Box* where, FoldableToolPanel* panel, int level = 1); void addPanel (Gtk::Box* where, FoldableToolPanel* panel, int level = 1);
void foldThemAll (GdkEventButton* event); void foldThemAll (GdkEventButton* event);
void updateVScrollbars (bool hide); void updateVScrollbars (bool hide);
void addfavoritePanel (Gtk::Box* where, FoldableToolPanel* panel, int level = 1);
private: private:
EditDataProvider *editDataProvider; EditDataProvider *editDataProvider;