Skip to content

Commit

Permalink
Add deprecation check for stacked_widget change
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Oct 16, 2016
1 parent c21a648 commit 0ce1bc6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gui/widgets/stacked_widget.cpp
Expand Up @@ -227,10 +227,14 @@ tstacked_widget_definition::tresolution::tresolution(const config& cfg)
namespace implementation
{

tbuilder_stacked_widget::tbuilder_stacked_widget(const config& cfg)
: tbuilder_control(cfg), stack()
tbuilder_stacked_widget::tbuilder_stacked_widget(const config& real_cfg)
: tbuilder_control(real_cfg), stack()
{
VALIDATE(cfg.has_child("layer"), _("No stack defined."));
const config& cfg = real_cfg.has_child("stack") ? real_cfg.child("stack") : real_cfg;
if(&cfg != &real_cfg) {
lg::wml_error() << "Stacked widgets no longer require a [stack] tag. Instead, place [layer] tags directly in the widget definition.\n";
}
VALIDATE(cfg.has_child("layer"), _("No stack layers defined."));
for(const auto & layer : cfg.child_range("layer"))
{
stack.push_back(std::make_shared<tbuilder_grid>(layer));
Expand Down

0 comments on commit 0ce1bc6

Please sign in to comment.