The Battle for Wesnoth  1.15.2+dev
sp_options_configure.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2018 by the Battle for Wesnoth Project https://www.wesnoth.org/
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY.
10 
11  See the COPYING file for more details.
12 */
13 
14 #define GETTEXT_DOMAIN "wesnoth-lib"
15 
17 
18 #include "gui/widgets/settings.hpp"
19 
20 namespace gui2
21 {
22 namespace dialogs
23 {
24 
25 REGISTER_DIALOG(sp_options_configure)
26 
27 sp_options_configure::sp_options_configure(ng::create_engine& create_engine, ng::configure_engine& config_engine)
28  : create_engine_(create_engine)
29  , config_engine_(config_engine)
30  , options_manager_()
31 {
32  set_restore(true);
33 }
34 
36 {
38  options_manager_->update_all_options();
39 }
40 
42 {
43  if(window.get_retval() == retval::OK) {
44  config_engine_.set_options(options_manager_->get_options_config());
45  }
46 }
47 
48 } // namespace dialogs
49 } // namespace gui2
Generic file dialog.
Definition: field-fwd.hpp:22
This file contains the settings handling of the widget library.
std::unique_ptr< mp_options_helper > options_manager_
Various uncategorised dialogs.
int get_retval()
Definition: window.hpp:370
virtual void post_show(window &window) override
Inherited from modal_dialog.
virtual void pre_show(window &window) override
Inherited from modal_dialog.
Dialog was closed with the OK button.
Definition: retval.hpp:34
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:62
void set_options(const config &cfg)