gui/dialogs/transient_message.cpp

Go to the documentation of this file.
00001 /* $Id: transient_message.cpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2009 - 2012 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 as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY.
00012 
00013    See the COPYING file for more details.
00014 */
00015 
00016 #define GETTEXT_DOMAIN "wesnoth-lib"
00017 
00018 #include "gui/dialogs/transient_message.hpp"
00019 
00020 #include "gettext.hpp"
00021 #include "gui/widgets/settings.hpp"
00022 #include "log.hpp"
00023 
00024 namespace gui2 {
00025 
00026 REGISTER_DIALOG(transient_message)
00027 
00028 ttransient_message::ttransient_message(const std::string& title
00029         , const bool title_use_markup
00030         , const std::string& message
00031         , const bool message_use_markup
00032         , const std::string& image)
00033 {
00034     register_label("title", true, title, title_use_markup);
00035     register_label("message", true, message, message_use_markup);
00036     register_image("image", true, image);
00037 }
00038 
00039 void show_transient_message(CVideo& video
00040         , const std::string& title
00041         , const std::string& message
00042         , const std::string& image
00043         , const bool message_use_markup
00044         , const bool title_use_markup)
00045 {
00046     ttransient_message dlg(title
00047             , title_use_markup
00048             , message
00049             , message_use_markup
00050             , image);
00051 
00052     dlg.show(video);
00053 }
00054 
00055 void show_transient_error_message(CVideo& video
00056         , const std::string& message
00057         , const std::string& image
00058         , const bool message_use_markup)
00059 {
00060     LOG_STREAM(err, lg::general) << message << '\n';
00061     show_transient_message(video
00062             , _("Error")
00063             , message
00064             , image
00065             , message_use_markup);
00066 }
00067 
00068 } // namespace gui2
00069 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:02:59 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs