Merge with 572a875474cb7c02682801dc30daab16a0d3c20b

This commit is contained in:
natureh 510
2013-01-27 01:09:04 +01:00
parent f3e0647a32
commit ee33ca0b7d
25 changed files with 808 additions and 575 deletions

View File

@@ -185,12 +185,12 @@ Adjuster::~Adjuster () {
if (automatic) delete automatic;
}
void Adjuster::addAutoButton () {
void Adjuster::addAutoButton (Glib::ustring tooltip) {
if (!automatic) {
automatic = new Gtk::CheckButton ();
//automatic->add (*Gtk::manage (new RTImage ("processing.png")));
automatic->set_border_width (0);
automatic->set_tooltip_text (M("GENERAL_AUTO"));
automatic->set_tooltip_markup(tooltip.length() ? Glib::ustring::compose("<b>%1</b>\n\n%2", M("GENERAL_AUTO"), tooltip) : M("GENERAL_AUTO"));
autoChange = automatic->signal_toggled().connect( sigc::mem_fun(*this, &Adjuster::autoToggled) );
hbox->pack_end (*automatic, Gtk::PACK_SHRINK, 0);

View File

@@ -80,7 +80,7 @@ class Adjuster : public Gtk::VBox {
virtual ~Adjuster ();
// Add an "Automatic" checkbox next to the reset button.
void addAutoButton();
void addAutoButton(Glib::ustring tooltip="");
// Remove the "Automatic" checkbox next to the reset button.
void delAutoButton();
// Send back the value of og the Auto checkbox

View File

@@ -57,7 +57,7 @@ ColorAppearance::ColorAppearance () : Gtk::VBox(), FoldableToolPanel(this) {
degree = Gtk::manage (new Adjuster (M("TP_COLORAPP_CIECAT_DEGREE"), 0., 100., 1., 100.));
if (degree->delay < 1000) degree->delay = 1000;
degree->throwOnButtonRelease();
degree->addAutoButton();
degree->addAutoButton(M("TP_COLORAPP_DEGREE_AUTO_TOOLTIP"));
degree->set_tooltip_markup (M("TP_COLORAPP_DEGREE_TOOLTIP"));
p1VBox->pack_start (*degree);
@@ -78,7 +78,7 @@ ColorAppearance::ColorAppearance () : Gtk::VBox(), FoldableToolPanel(this) {
wbmHBox->pack_start (*wbmodel);
p1VBox->pack_start (*wbmHBox);
adapscen = Gtk::manage (new Adjuster (M("TP_COLORAPP_ADAPTSCENE"), 1, 4000., 1., 2000.));
adapscen = Gtk::manage (new Adjuster (M("TP_COLORAPP_ADAPTSCENE"), 0.1, 4000., 0.1, 2000.));
if (adapscen->delay < 1000) adapscen->delay = 1000;
adapscen->throwOnButtonRelease();
adapscen->set_tooltip_markup (M("TP_COLORAPP_ADAPTSCENE_TOOLTIP"));
@@ -830,6 +830,27 @@ void ColorAppearance::setDefaults (const ProcParams* defParams, const ParamsEdit
}
}
int autoCamChangedUI (void* data) {
(static_cast<ColorAppearance*>(data))->autoCamComputed_ ();
return 0;
}
void ColorAppearance::autoCamChanged (double ccam)
{
nextCcam = ccam;
g_idle_add (autoCamChangedUI, this);
// Glib::signal_idle().connect (sigc::mem_fun(*this, &ColorAppearance::autoCamComputed_));
}
bool ColorAppearance::autoCamComputed_ () {
disableListener ();
// degree->setEnabled (true);
degree->setValue (nextCcam);
enableListener ();
return false;
}
void ColorAppearance::colorForValue (double valX, double valY, int callerId, ColorCaller *caller) {
@@ -891,6 +912,7 @@ void ColorAppearance::adjusterAutoToggled (Adjuster* a, bool newval) {
}
if (listener && (multiImage||enabled->get_active()) ) {
if(a==degree) {
if (degree->getAutoInconsistent())
listener->panelChanged (EvCATAutoDegree, M("GENERAL_UNCHANGED"));
@@ -926,7 +948,8 @@ void ColorAppearance::enabledChanged () {
toneCurveMode->set_sensitive (true);
}
else
listener->panelChanged (EvCATEnabled, M("GENERAL_DISABLED"));
{listener->panelChanged (EvCATEnabled, M("GENERAL_DISABLED"));
}
}
}

View File

@@ -28,7 +28,7 @@
#include "guiutils.h"
#include "colorprovider.h"
class ColorAppearance : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel, public CurveListener, public ColorProvider {
class ColorAppearance : public Gtk::VBox, public AdjusterListener, public FoldableToolPanel, public rtengine::AutoCamListener, public CurveListener, public ColorProvider {
protected:
Glib::RefPtr<Gtk::Tooltip> bgTTips;
@@ -76,7 +76,7 @@ class ColorAppearance : public Gtk::VBox, public AdjusterListener, public Foldab
DiagonalCurveEditor* shape;
DiagonalCurveEditor* shape2;
DiagonalCurveEditor* shape3;
double nextCcam;
bool lastEnabled;
bool lastAutoDegree;
sigc::connection enaConn;
@@ -109,6 +109,8 @@ class ColorAppearance : public Gtk::VBox, public AdjusterListener, public Foldab
void datacie_toggled ();
void tonecie_toggled ();
// void sharpcie_toggled ();
void autoCamChanged (double ccam);
bool autoCamComputed_ ();
void curveChanged (CurveEditor* ce);
void curveMode1Changed ();

View File

@@ -102,6 +102,8 @@ bool MultiLangMgr::isOSLanguageDetectSupported() {
#else
return false;
#endif
#elif __linux__ || __APPLE__
return true;
#else
return false;
#endif
@@ -114,7 +116,6 @@ Glib::ustring MultiLangMgr::getOSUserLanguage() {
if (isOSLanguageDetectSupported()) {
// TODO: Add support for other OS here
#ifdef WIN32
// When using old versions of MINGW this is not defined
#ifdef __MINGW64_VERSION_MAJOR
@@ -128,8 +129,10 @@ Glib::ustring MultiLangMgr::getOSUserLanguage() {
langName=TranslateRFC2Language(localRFC);
}
#endif
#elif __linux__ || __APPLE__
langName = TranslateRFC2Language(std::setlocale(LC_CTYPE,""));
#endif
} else printf("Automatic language detection not supported on your OS\n");
}
return langName;
}

View File

@@ -357,6 +357,8 @@ void ToolPanelCoordinator::initImage (rtengine::StagedImageProcessor* ipc_, bool
if (ipc) {
ipc->setAutoExpListener (toneCurve);
ipc->setAutoCamListener (colorappearance);
ipc->setSizeListener (crop);
ipc->setSizeListener (resize);
}