From 95de1e1b3b93f2fae7d92c78af1e5c7f46103325 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 16 Mar 2013 22:19:40 -0400 Subject: [PATCH] Preferences/Batch processing options: all to 'Add' and all to 'Set' (issue 1785) --- rtdata/languages/default | 4 ++++ rtgui/preferences.cc | 46 +++++++++++++++++++++++++++++++++++++++- rtgui/preferences.h | 5 +++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 7adf44d50..2507d2911 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -671,6 +671,10 @@ PREFERENCES_APPLNEXTSTARTUP;restart required PREFERENCES_AUTOMONPROFILE;Use operating system's main monitor color profile PREFERENCES_BATCH_PROCESSING;Batch Processing PREFERENCES_BEHAVIOR;Behavior +PREFERENCES_BEHADDALL;All to 'Add' +PREFERENCES_BEHADDALLHINT;Set all parameters to the Add mode.\nAdjustments of parameters in the batch tool panel will be deltas to the stored values +PREFERENCES_BEHSETALL;All to 'Set' +PREFERENCES_BEHSETALLHINT;Set all parameters to the Set mode.\nAdjustments of parameters in the batch tool panel will be absolute, the actual values will be displayed PREFERENCES_BLACKBODY;Tungsten PREFERENCES_BLINKCLIPPED;Blink clipped areas PREFERENCES_CACHECLEARALL;Clear All diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index d7a108585..b5bfe6ea7 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -111,8 +111,10 @@ Gtk::Widget* Preferences::getBatchProcPanel () { behscrollw->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); behscrollw->set_border_width(8); behscrollw->set_size_request(-1, 60); + Gtk::VBox* vbbeh = Gtk::manage( new Gtk::VBox () ); + vbbeh->pack_start (*behscrollw, Gtk::PACK_EXPAND_WIDGET); Gtk::Frame* behFrame = Gtk::manage (new Gtk::Frame (M("PREFERENCES_BEHAVIOR"))); - behFrame->add (*behscrollw); + behFrame->add (*vbbeh); //mvbpp->pack_start (*behFrame); mvbpp->pack_start (*behFrame, Gtk::PACK_EXPAND_WIDGET, 4); Gtk::TreeView* behTreeView = Gtk::manage (new Gtk::TreeView ()); @@ -273,6 +275,20 @@ Gtk::Widget* Preferences::getBatchProcPanel () { behTreeView->expand_all (); + behAddAll = Gtk::manage( new Gtk::Button (M("PREFERENCES_BEHADDALL")) ); + behSetAll = Gtk::manage( new Gtk::Button (M("PREFERENCES_BEHSETALL")) ); + behAddAll->set_tooltip_markup (M("PREFERENCES_BEHADDALLHINT")); + behSetAll->set_tooltip_markup (M("PREFERENCES_BEHSETALLHINT")); + + behAddAll->signal_clicked().connect( sigc::mem_fun(*this, &Preferences::behAddAllPressed) ); + behSetAll->signal_clicked().connect( sigc::mem_fun(*this, &Preferences::behSetAllPressed) ); + + Gtk::HBox* buttonpanel1 = Gtk::manage (new Gtk::HBox ()); + //buttonpanel1->set_spacing(8); + buttonpanel1->pack_end (*behSetAll, Gtk::PACK_SHRINK, 4); + buttonpanel1->pack_end (*behAddAll, Gtk::PACK_SHRINK, 4); + vbbeh->pack_start (*buttonpanel1, Gtk::PACK_SHRINK, 4); + chOverwriteOutputFile = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_OVERWRITEOUTPUTFILE")) ); mvbpp->pack_start(*chOverwriteOutputFile, Gtk::PACK_SHRINK, 4); @@ -1584,3 +1600,31 @@ bool Preferences::splashClosed(GdkEventAny* event) { splash = NULL; return true; } + +void Preferences::behAddAllPressed () { + + if (moptions.baBehav.size() == ADDSET_PARAM_NUM) { + for (size_t i=0; ichildren().begin(); sections!=behModel->children().end(); sections++) + for (Gtk::TreeIter adjs=sections->children().begin(); adjs!=sections->children().end(); adjs++) + if (adjs->get_value (behavColumns.addsetid) == i) { + adjs->set_value (behavColumns.badd, true); + adjs->set_value (behavColumns.bset, false); + break; + } + } +} + +void Preferences::behSetAllPressed () { + + if (moptions.baBehav.size() == ADDSET_PARAM_NUM) { + for (size_t i=0; ichildren().begin(); sections!=behModel->children().end(); sections++) + for (Gtk::TreeIter adjs=sections->children().begin(); adjs!=sections->children().end(); adjs++) + if (adjs->get_value (behavColumns.addsetid) == i) { + adjs->set_value (behavColumns.badd, false); + adjs->set_value (behavColumns.bset, true); + break; + } + } +} diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 1a4c383cb..b363d2056 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -119,6 +119,8 @@ class Preferences : public Gtk::Dialog { Gtk::CheckButton* ckbmenuGroupProfileOperations; Gtk::CheckButton* ckbmenuGroupExtProg; + Gtk::Button* behAddAll; + Gtk::Button* behSetAll; Gtk::CheckButton* chOverwriteOutputFile; Gtk::CheckButton* saveParamsFile; @@ -202,6 +204,9 @@ class Preferences : public Gtk::Dialog { void behAddRadioToggled (const Glib::ustring& path); void behSetRadioToggled (const Glib::ustring& path); + void behAddAllPressed (); + void behSetAllPressed (); + // void selectICCProfileDir (); // void selectMonitorProfile (); };