Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #define GETTEXT_DOMAIN "wesnoth-lib"
00017
00018 #include "gui/dialogs/addon_connect.hpp"
00019
00020 #include "gui/widgets/button.hpp"
00021 #include "gui/widgets/window.hpp"
00022 #include "gui/widgets/settings.hpp"
00023 #include "gui/widgets/text_box.hpp"
00024
00025 namespace gui2 {
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 REGISTER_DIALOG(addon_connect)
00046
00047 taddon_connect::taddon_connect(std::string& host_name
00048 , const bool allow_updates
00049 , const bool allow_remove)
00050 : allow_updates_(allow_updates)
00051 , allow_remove_(allow_remove)
00052 {
00053 register_text("host_name", false, host_name, true);
00054 }
00055
00056 void taddon_connect::pre_show(CVideo& , twindow& window)
00057 {
00058 find_widget<tbutton>(&window, "remove_addons", false)
00059 .set_active(allow_remove_);
00060 }
00061
00062 void taddon_connect::post_show(twindow& window)
00063 {
00064 if(get_retval() == twindow::OK) {
00065 ttext_box& host_widget =
00066 find_widget<ttext_box>(&window, "host_name", false);
00067
00068 host_widget.save_to_history();
00069 }
00070 }
00071
00072 }