From 1b2001d45ea6ee99490d4b1c374b1a03d73bbc86 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 1 Nov 2015 13:03:27 +0300 Subject: Add strong typed bool enum on the fly. --- src/gui/widgets/setupitem.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/gui/widgets/setupitem.cpp') diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index 94e6231f9..be26265c3 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -728,7 +728,7 @@ SetupItemSlider::SetupItemSlider(const std::string &restrict text, const double max, const double step, const int width, - const bool onTheFly, + const OnTheFly onTheFly, const MainConfig mainConfig) : SetupItem(text, description, keyName, parent, eventName, mainConfig), mHorizont(nullptr), @@ -754,7 +754,7 @@ SetupItemSlider::SetupItemSlider(const std::string &restrict text, const double step, const std::string &restrict def, const int width, - const bool onTheFly, + const OnTheFly onTheFly, const MainConfig mainConfig) : SetupItem(text, description, keyName, parent, eventName, def, mainConfig), mHorizont(nullptr), @@ -823,7 +823,7 @@ void SetupItemSlider::toWidget() void SetupItemSlider::action(const ActionEvent &event A_UNUSED) { fromWidget(); - if (mOnTheFly) + if (mOnTheFly == OnTheFly_true) save(); } @@ -846,7 +846,7 @@ SetupItemSlider2::SetupItemSlider2(const std::string &restrict text, const int max, const int step, SetupItemNames *restrict const values, - const bool onTheFly, + const OnTheFly onTheFly, const MainConfig mainConfig, const bool doNotAlign) : SetupItem(text, description, keyName, parent, eventName, mainConfig), @@ -877,7 +877,7 @@ SetupItemSlider2::SetupItemSlider2(const std::string &restrict text, const int step, SetupItemNames *restrict const values, const std::string &restrict def, - const bool onTheFly, + const OnTheFly onTheFly, const MainConfig mainConfig, const bool doNotAlign) : SetupItem(text, description, keyName, parent, eventName, def, mainConfig), @@ -987,7 +987,7 @@ void SetupItemSlider2::action(const ActionEvent &event A_UNUSED) { fromWidget(); updateLabel(); - if (mOnTheFly) + if (mOnTheFly == OnTheFly_true) save(); } @@ -1033,7 +1033,7 @@ SetupItemSliderList::SetupItemSliderList(const std::string &restrict text, const std::string &restrict eventName, ListModel *restrict const model, const int width, - const bool onTheFly, + const OnTheFly onTheFly, const MainConfig mainConfig) : SetupItem(text, description, keyName, parent, eventName, mainConfig), mHorizont(nullptr), @@ -1055,7 +1055,7 @@ SetupItemSliderList::SetupItemSliderList(const std::string &restrict text, ListModel *restrict const model, const std::string &restrict def, const int width, - const bool onTheFly, + const OnTheFly onTheFly, const MainConfig mainConfig) : SetupItem(text, description, keyName, parent, eventName, def, mainConfig), mHorizont(nullptr), @@ -1120,7 +1120,7 @@ void SetupItemSliderList::toWidget() void SetupItemSliderList::action(const ActionEvent &event A_UNUSED) { fromWidget(); - if (mOnTheFly) + if (mOnTheFly == OnTheFly_true) save(); } @@ -1139,7 +1139,8 @@ SetupItemSound::SetupItemSound(const std::string &restrict text, SetupTabScroll *restrict const parent, const std::string &restrict eventName, ListModel *restrict const model, - const int width, const bool onTheFly, + const int width, + const OnTheFly onTheFly, const MainConfig mainConfig) : SetupItemSliderList(text, description, keyName, parent, eventName, model, width, onTheFly, mainConfig), @@ -1179,7 +1180,7 @@ SetupItemSliderInt::SetupItemSliderInt(const std::string &restrict text, ListModel *restrict const model, const int min, const int width, - const bool onTheFly, + const OnTheFly onTheFly, const MainConfig mainConfig) : SetupItemSliderList(text, description, keyName, parent, eventName, model, width, onTheFly, mainConfig), -- cgit v1.2.3-70-g09d2