merge with dev

This commit is contained in:
Desmis
2017-08-20 07:34:22 +02:00
36 changed files with 675 additions and 294 deletions

View File

@@ -217,7 +217,7 @@ CurveEditor::CurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEd
curveType->set_tooltip_text(M("CURVEEDITOR_TYPE"));
// TODO: Does this signal have to be blocked when on curve type change ?
curveType->signal_toggled().connect ( sigc::mem_fun(*this, &CurveEditor::curveTypeToggled) );
typeconn = curveType->signal_changed().connect (sigc::mem_fun(*this, &CurveEditor::typeSelectionChanged) );
typeconn = curveType->signal_item_selected().connect (sigc::mem_fun(*this, &CurveEditor::typeSelectionChanged) );
}
void CurveEditor::setCurve (const std::vector<double>& p)

View File

@@ -194,7 +194,7 @@ void CurveEditorGroup::curveListComplete()
*/
void CurveEditorGroup::typeSelectionChanged (CurveEditor* ce, int n)
{
// Same type : do nothing
// Same curve and same type : do nothing
if (ce == displayedCurve && n == (int)ce->selected) {
return;
}

View File

@@ -262,8 +262,30 @@ RTWindow *create_rt_window()
#endif
Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create(THEMEREGEXSTR, Glib::RegexCompileFlags::REGEX_CASELESS);
Glib::ustring filename = Glib::build_filename(argv0, "themes", options.theme + ".css");
if (!regex->match(options.theme + ".css") || !Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) {
Glib::ustring filename;
Glib::MatchInfo mInfo;
bool match = regex->match(options.theme + ".css", mInfo);
if (match) {
// save old theme (name + version)
Glib::ustring initialTheme(options.theme);
// update version
auto pos = options.theme.find("-GTK3-");
Glib::ustring themeRootName(options.theme.substr(0, pos));
if (GTK_MINOR_VERSION < 20) {
options.theme = themeRootName + "-GTK3-_19";
} else {
options.theme = themeRootName + "-GTK3-20_";
}
// check if this version exist
if (!Glib::file_test(Glib::build_filename(argv0, "themes", options.theme + ".css"), Glib::FILE_TEST_EXISTS)) {
// set back old theme version if the actual one doesn't exist yet
options.theme = initialTheme;
}
}
filename = Glib::build_filename(argv0, "themes", options.theme + ".css");
if (!match || !Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) {
options.theme = "RawTherapee-GTK";
// We're not testing GTK_MAJOR_VERSION == 3 here, since this branch requires Gtk3 only
if (GTK_MINOR_VERSION < 20) {

View File

@@ -100,9 +100,12 @@ bool PopUpCommon::addEntry (const Glib::ustring& fileName, const Glib::ustring&
void PopUpCommon::entrySelected (int i)
{
// Emit a a signal if the selected item has changed
// Emit a signal if the selected item has changed
if (setSelected (i))
message (selected);
messageChanged (selected);
// Emit a signal in all case (i.e. propagate the signal_activate event)
messageItemSelected (selected);
}
void PopUpCommon::setItemSensitivity (int index, bool isSensitive) {

View File

@@ -42,7 +42,9 @@ class PopUpCommon
public:
typedef sigc::signal<void, int> type_signal_changed;
typedef sigc::signal<void, int> type_signal_item_selected;
type_signal_changed signal_changed();
type_signal_item_selected signal_item_selected();
Gtk::Grid* buttonGroup; // this is the widget to be packed
PopUpCommon (Gtk::Button* button, const Glib::ustring& label = "");
@@ -57,7 +59,8 @@ public:
void setItemSensitivity (int i, bool isSensitive);
private:
type_signal_changed message;
type_signal_changed messageChanged;
type_signal_item_selected messageItemSelected;
std::vector<Glib::ustring> imageFilenames;
std::vector<const RTImage*> images;
@@ -78,7 +81,12 @@ protected:
inline PopUpCommon::type_signal_changed PopUpCommon::signal_changed ()
{
return message;
return messageChanged;
}
inline PopUpCommon::type_signal_item_selected PopUpCommon::signal_item_selected ()
{
return messageItemSelected;
}
inline int PopUpCommon::getEntryCount () const