From 6b92425b46de741d4cda35027083fd988ac4e942 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 22 Mar 2013 22:22:15 +0300 Subject: Add option to accept language messages in any languge. This messages will be showed in language or general tab. --- src/gui/widgets/setupitem.cpp | 6 ++++++ src/gui/widgets/setupitem.h | 2 ++ src/gui/widgets/setuptabscroll.cpp | 7 +++++++ src/gui/widgets/setuptabscroll.h | 2 ++ 4 files changed, 17 insertions(+) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index 0e9fa993c..fbb24d2b6 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -180,6 +180,12 @@ void SetupItem::fixFirstItemSize(gcn::Widget *const widget) widget->setWidth(maxSize); } +void SetupItem::rereadValue() +{ + load(); + toWidget(); +} + SetupItemCheckBox::SetupItemCheckBox(std::string text, std::string description, std::string keyName, SetupTabScroll *const parent, diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h index f660500a8..d91f0ac2e 100644 --- a/src/gui/widgets/setupitem.h +++ b/src/gui/widgets/setupitem.h @@ -107,6 +107,8 @@ class SetupItem : public gcn::ActionListener, void fixFirstItemSize(gcn::Widget *const widget); + void rereadValue(); + protected: std::string mText; diff --git a/src/gui/widgets/setuptabscroll.cpp b/src/gui/widgets/setuptabscroll.cpp index 89077dd8c..ec8f36eba 100644 --- a/src/gui/widgets/setuptabscroll.cpp +++ b/src/gui/widgets/setuptabscroll.cpp @@ -124,3 +124,10 @@ void SetupTabScroll::widgetResized(const gcn::Event &event A_UNUSED) mScroll->setWidth(getWidth() - 12); mScroll->setHeight(getHeight() - 12 - 12); } + +void SetupTabScroll::reread(const std::string &name) +{ + SetupItem *const item = mItems[name + "Event"]; + if (item) + item->rereadValue(); +} diff --git a/src/gui/widgets/setuptabscroll.h b/src/gui/widgets/setuptabscroll.h index e90ce28c2..2417bd400 100644 --- a/src/gui/widgets/setuptabscroll.h +++ b/src/gui/widgets/setuptabscroll.h @@ -62,6 +62,8 @@ class SetupTabScroll : public SetupTab void widgetResized(const gcn::Event &event) override; + void reread(const std::string &name); + protected: VertContainer *mContainer; ScrollArea *mScroll; -- cgit v1.2.3-70-g09d2