00001 /* $Id: addon_connect.cpp 26681 2008-05-18 06:05:59Z mordante $ */ 00002 /* 00003 copyright (c) 2008 by mark de wever <koraq@xs4all.nl> 00004 part of the battle for wesnoth project http://www.wesnoth.org/ 00005 00006 this program is free software; you can redistribute it and/or modify 00007 it under the terms of the gnu general public license version 2 00008 or at your option any later version. 00009 this program is distributed in the hope that it will be useful, 00010 but without any warranty. 00011 00012 see the copying file for more details. 00013 */ 00014 00015 #include "gui/dialogs/addon_connect.hpp" 00016 00017 #include "gui/widgets/button.hpp" 00018 #include "gui/widgets/widget.hpp" 00019 #include "gui/widgets/window.hpp" 00020 #include "gui/widgets/window_builder.hpp" 00021 #include "gui/widgets/settings.hpp" 00022 #include "gui/widgets/text_box.hpp" 00023 #include "log.hpp" 00024 #include "video.hpp" 00025 00026 #define DBG_GUI LOG_STREAM_INDENT(debug, widget) 00027 #define LOG_GUI LOG_STREAM_INDENT(info, widget) 00028 #define WRN_GUI LOG_STREAM_INDENT(warn, widget) 00029 #define ERR_GUI LOG_STREAM_INDENT(err, widget) 00030 00031 namespace gui2 { 00032 00033 void taddon_connect::show(CVideo& video) 00034 { 00035 00036 gui2::init(); 00037 00038 twindow window = build(video, get_id(ADDON_CONNECT)); 00039 ttext_box* host_widget = dynamic_cast<ttext_box*>(window.find_widget("host_name", false)); 00040 if(host_widget) { 00041 host_widget->set_text(host_name_); 00042 window.keyboard_capture(host_widget); 00043 } 00044 00045 retval_ = window.show(true); 00046 00047 if(host_widget) { 00048 if(retval_ == tbutton::OK) { 00049 host_widget->save_to_history(); 00050 } 00051 host_name_= host_widget->get_text(); 00052 } 00053 } 00054 00055 00056 } // namespace gui2
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |