Favourites => Favorites, #5016

This commit is contained in:
heckflosse 2018-11-23 16:48:05 +01:00
parent 0ae602bcf0
commit 43b77679d4
5 changed files with 82 additions and 80 deletions

View File

@ -900,8 +900,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_FAVOURITES;Favourites MAIN_TAB_FAVORITES;Favorites
MAIN_TAB_FAVOURITES_TOOLTIP;Shortcut: <b>Alt-u</b> 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,7 +399,7 @@ void Options::setDefaults()
autoSaveTpOpen = true; autoSaveTpOpen = true;
//crvOpen.clear (); //crvOpen.clear ();
parseExtensions.clear(); parseExtensions.clear();
favourites.clear(); favorites.clear();
parseExtensionsEnabled.clear(); parseExtensionsEnabled.clear();
parsedExtensions.clear(); parsedExtensions.clear();
renameUseTemplates = false; renameUseTemplates = false;
@ -1070,8 +1070,8 @@ void Options::readFromFile(Glib::ustring fname)
} }
if (keyFile.has_group("GUI")) { if (keyFile.has_group("GUI")) {
if (keyFile.has_key("GUI", "Favourites")) { if (keyFile.has_key("GUI", "Favorites")) {
favourites = keyFile.get_string_list("GUI", "Favourites"); favorites = keyFile.get_string_list("GUI", "Favorites");
} }
if (keyFile.has_key("GUI", "WindowWidth")) { if (keyFile.has_key("GUI", "WindowWidth")) {
@ -1972,8 +1972,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> ahfavourites = favourites; Glib::ArrayHandle<Glib::ustring> ahfavorites = favorites;
keyFile.set_string_list("GUI", "Favourites", ahfavourites); 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,7 +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> favourites; std::vector<Glib::ustring> favorites;
// Dialog settings // Dialog settings
Glib::ustring lastIccDir; Glib::ustring lastIccDir;
Glib::ustring lastDarkframeDir; Glib::ustring lastDarkframeDir;

View File

@ -31,7 +31,7 @@ using namespace rtengine::procparams;
ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChanged (false), editDataProvider (nullptr) ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChanged (false), editDataProvider (nullptr)
{ {
favouritePanel = Gtk::manage (new ToolVBox ()); 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 ());
@ -101,62 +101,64 @@ 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
favourites.resize(options.favourites.size()); favorites.resize(options.favorites.size(), nullptr);
addfavouritePanel (colorPanel, whitebalance); addfavoritePanel (colorPanel, whitebalance);
addfavouritePanel (exposurePanel, toneCurve); addfavoritePanel (exposurePanel, toneCurve);
addfavouritePanel (colorPanel, vibrance); addfavoritePanel (colorPanel, vibrance);
addfavouritePanel (colorPanel, chmixer); addfavoritePanel (colorPanel, chmixer);
addfavouritePanel (colorPanel, blackwhite); addfavoritePanel (colorPanel, blackwhite);
addfavouritePanel (exposurePanel, shadowshighlights); addfavoritePanel (exposurePanel, shadowshighlights);
addfavouritePanel (detailsPanel, sharpening); addfavoritePanel (detailsPanel, sharpening);
addfavouritePanel (detailsPanel, localContrast); addfavoritePanel (detailsPanel, localContrast);
addfavouritePanel (detailsPanel, sharpenEdge); addfavoritePanel (detailsPanel, sharpenEdge);
addfavouritePanel (detailsPanel, sharpenMicro); addfavoritePanel (detailsPanel, sharpenMicro);
addfavouritePanel (colorPanel, hsvequalizer); addfavoritePanel (colorPanel, hsvequalizer);
addfavouritePanel (colorPanel, filmSimulation); addfavoritePanel (colorPanel, filmSimulation);
addfavouritePanel (colorPanel, softlight); addfavoritePanel (colorPanel, softlight);
addfavouritePanel (colorPanel, rgbcurves); addfavoritePanel (colorPanel, rgbcurves);
addfavouritePanel (colorPanel, colortoning); addfavoritePanel (colorPanel, colortoning);
addfavouritePanel (exposurePanel, epd); addfavoritePanel (exposurePanel, epd);
addfavouritePanel (exposurePanel, fattal); addfavoritePanel (exposurePanel, fattal);
addfavouritePanel (advancedPanel, retinex); addfavoritePanel (advancedPanel, retinex);
addfavouritePanel (exposurePanel, pcvignette); addfavoritePanel (exposurePanel, pcvignette);
addfavouritePanel (exposurePanel, gradient); addfavoritePanel (exposurePanel, gradient);
addfavouritePanel (exposurePanel, lcurve); addfavoritePanel (exposurePanel, lcurve);
addfavouritePanel (advancedPanel, colorappearance); addfavoritePanel (advancedPanel, colorappearance);
addfavouritePanel (detailsPanel, impulsedenoise); addfavoritePanel (detailsPanel, impulsedenoise);
addfavouritePanel (detailsPanel, dirpyrdenoise); addfavoritePanel (detailsPanel, dirpyrdenoise);
addfavouritePanel (detailsPanel, defringe); addfavoritePanel (detailsPanel, defringe);
addfavouritePanel (detailsPanel, dirpyrequalizer); addfavoritePanel (detailsPanel, dirpyrequalizer);
addfavouritePanel (detailsPanel, dehaze); addfavoritePanel (detailsPanel, dehaze);
addfavouritePanel (advancedPanel, wavelet); addfavoritePanel (advancedPanel, wavelet);
addfavouritePanel (transformPanel, crop); addfavoritePanel (transformPanel, crop);
addfavouritePanel (transformPanel, resize); addfavoritePanel (transformPanel, resize);
addfavouritePanel (resize->getPackBox(), prsharpening, 2); addfavoritePanel (resize->getPackBox(), prsharpening, 2);
addfavouritePanel (transformPanel, lensgeom); addfavoritePanel (transformPanel, lensgeom);
addfavouritePanel (lensgeom->getPackBox(), rotate, 2); addfavoritePanel (lensgeom->getPackBox(), rotate, 2);
addfavouritePanel (lensgeom->getPackBox(), perspective, 2); addfavoritePanel (lensgeom->getPackBox(), perspective, 2);
addfavouritePanel (lensgeom->getPackBox(), lensProf, 2); addfavoritePanel (lensgeom->getPackBox(), lensProf, 2);
addfavouritePanel (lensgeom->getPackBox(), distortion, 2); addfavoritePanel (lensgeom->getPackBox(), distortion, 2);
addfavouritePanel (lensgeom->getPackBox(), cacorrection, 2); addfavoritePanel (lensgeom->getPackBox(), cacorrection, 2);
addfavouritePanel (lensgeom->getPackBox(), vignetting, 2); addfavoritePanel (lensgeom->getPackBox(), vignetting, 2);
addfavouritePanel (colorPanel, icm); addfavoritePanel (colorPanel, icm);
addfavouritePanel (rawPanel, sensorbayer); addfavoritePanel (rawPanel, sensorbayer);
addfavouritePanel (sensorbayer->getPackBox(), bayerprocess, 2); addfavoritePanel (sensorbayer->getPackBox(), bayerprocess, 2);
addfavouritePanel (sensorbayer->getPackBox(), bayerrawexposure, 2); addfavoritePanel (sensorbayer->getPackBox(), bayerrawexposure, 2);
addfavouritePanel (sensorbayer->getPackBox(), bayerpreprocess, 2); addfavoritePanel (sensorbayer->getPackBox(), bayerpreprocess, 2);
addfavouritePanel (sensorbayer->getPackBox(), rawcacorrection, 2); addfavoritePanel (sensorbayer->getPackBox(), rawcacorrection, 2);
addfavouritePanel (rawPanel, sensorxtrans); addfavoritePanel (rawPanel, sensorxtrans);
addfavouritePanel (sensorxtrans->getPackBox(), xtransprocess, 2); addfavoritePanel (sensorxtrans->getPackBox(), xtransprocess, 2);
addfavouritePanel (sensorxtrans->getPackBox(), xtransrawexposure, 2); addfavoritePanel (sensorxtrans->getPackBox(), xtransrawexposure, 2);
addfavouritePanel (rawPanel, rawexposure); addfavoritePanel (rawPanel, rawexposure);
addfavouritePanel (rawPanel, preprocess); addfavoritePanel (rawPanel, preprocess);
addfavouritePanel (rawPanel, darkframe); addfavoritePanel (rawPanel, darkframe);
addfavouritePanel (rawPanel, flatfield); addfavoritePanel (rawPanel, flatfield);
for(auto it = favourites.begin(); it != favourites.end(); ++it) { for(auto it = favorites.begin(); it != favorites.end(); ++it) {
addPanel(favouritePanel, *it); if (*it) {
addPanel(favoritePanel, *it);
}
} }
toolPanels.push_back (coarse); toolPanels.push_back (coarse);
toolPanels.push_back(metadata); toolPanels.push_back(metadata);
@ -164,7 +166,7 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
toolPanelNotebook = new Gtk::Notebook (); toolPanelNotebook = new Gtk::Notebook ();
toolPanelNotebook->set_name ("ToolPanelNotebook"); toolPanelNotebook->set_name ("ToolPanelNotebook");
favouritePanelSW = Gtk::manage (new MyScrolledWindow ()); favoritePanelSW = Gtk::manage (new MyScrolledWindow ());
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 ());
@ -182,9 +184,9 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
vbPanelEnd[i]->show_all(); vbPanelEnd[i]->show_all();
} }
favouritePanelSW->add (*favouritePanel); favoritePanelSW->add (*favoritePanel);
favouritePanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0); favoritePanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
favouritePanel->pack_start (*vbPanelEnd[0], Gtk::PACK_SHRINK, 4); 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);
@ -210,7 +212,7 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
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[5], Gtk::PACK_SHRINK, 0); rawPanel->pack_start (*vbPanelEnd[5], Gtk::PACK_SHRINK, 0);
toiF = Gtk::manage (new TextOrIcon ("wb-sun.png", M ("MAIN_TAB_FAVOURITES"), M ("MAIN_TAB_FAVOURITES_TOOLTIP"))); 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")));
@ -219,7 +221,7 @@ 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")));
toolPanelNotebook->append_page (*favouritePanelSW, *toiF); 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);
@ -262,13 +264,13 @@ void ToolPanelCoordinator::addPanel (Gtk::Box* where, FoldableToolPanel* panel,
toolPanels.push_back (panel); toolPanels.push_back (panel);
} }
void ToolPanelCoordinator::addfavouritePanel (Gtk::Box* where, FoldableToolPanel* panel, int level) void ToolPanelCoordinator::addfavoritePanel (Gtk::Box* where, FoldableToolPanel* panel, int level)
{ {
auto name = panel->getToolName(); auto name = panel->getToolName();
auto it = std::find(options.favourites.begin(), options.favourites.end(), name); auto it = std::find(options.favorites.begin(), options.favorites.end(), name);
if (it != options.favourites.end()) { if (it != options.favorites.end()) {
int index = std::distance(options.favourites.begin(), it); int index = std::distance(options.favorites.begin(), it);
favourites[index] = panel; favorites[index] = panel;
} else { } else {
addPanel(where, panel, level); addPanel(where, panel, level);
} }
@ -880,7 +882,7 @@ bool ToolPanelCoordinator::handleShortcutKey (GdkEventKey* event)
if (alt) { if (alt) {
switch (event->keyval) { switch (event->keyval) {
case GDK_KEY_u: case GDK_KEY_u:
toolPanelNotebook->set_current_page (toolPanelNotebook->page_num (*favouritePanelSW)); toolPanelNotebook->set_current_page (toolPanelNotebook->page_num (*favoritePanelSW));
return true; return true;
case GDK_KEY_e: case GDK_KEY_e:
@ -920,7 +922,7 @@ 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;
favouritePanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy); 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,8 +158,8 @@ protected:
rtengine::StagedImageProcessor* ipc; rtengine::StagedImageProcessor* ipc;
std::vector<ToolPanel*> toolPanels; std::vector<ToolPanel*> toolPanels;
std::vector<FoldableToolPanel*> favourites; std::vector<FoldableToolPanel*> favorites;
ToolVBox* favouritePanel; ToolVBox* favoritePanel;
ToolVBox* exposurePanel; ToolVBox* exposurePanel;
ToolVBox* detailsPanel; ToolVBox* detailsPanel;
ToolVBox* colorPanel; ToolVBox* colorPanel;
@ -180,7 +180,7 @@ protected:
Gtk::Image* imgPanelEnd[7]; Gtk::Image* imgPanelEnd[7];
Gtk::VBox* vbPanelEnd[7]; Gtk::VBox* vbPanelEnd[7];
Gtk::ScrolledWindow* favouritePanelSW; Gtk::ScrolledWindow* favoritePanelSW;
Gtk::ScrolledWindow* exposurePanelSW; Gtk::ScrolledWindow* exposurePanelSW;
Gtk::ScrolledWindow* detailsPanelSW; Gtk::ScrolledWindow* detailsPanelSW;
Gtk::ScrolledWindow* colorPanelSW; Gtk::ScrolledWindow* colorPanelSW;
@ -195,7 +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 addfavouritePanel (Gtk::Box* where, FoldableToolPanel* panel, int level = 1); void addfavoritePanel (Gtk::Box* where, FoldableToolPanel* panel, int level = 1);
private: private:
EditDataProvider *editDataProvider; EditDataProvider *editDataProvider;