Index: wesnoth/src/game_events.cpp
===================================================================
--- wesnoth/src/game_events.cpp	(révision 53756)
+++ wesnoth/src/game_events.cpp	(copie de travail)
@@ -2764,14 +2764,21 @@
 	unit_map::iterator speaker;
 	vconfig text_input_element;
 	bool has_text_input;
+	unsigned int auto_close_timeout_;
 	const std::vector<std::string> &options;
 
 	message_user_choice(const vconfig &c, const unit_map::iterator &s,
 		const vconfig &t, bool ht, const std::vector<std::string> &o)
 		: cfg(c), speaker(s), text_input_element(t)
 		, has_text_input(ht), options(o)
-	{}
+	{
+	}
 
+	void set_auto_close_timeout(unsigned int auto_close_timeout)
+	{
+		auto_close_timeout_ = auto_close_timeout;
+	}
+
 	virtual config query_user() const
 	{
 		std::string image = get_image(cfg, speaker);
@@ -2798,7 +2805,7 @@
 			resources::screen->video(), caption, cfg["message"],
 			image, false, has_text_input, text_input_label,
 			&text_input_content, input_max_size, options,
-			&option_chosen);
+			&option_chosen, auto_close_timeout_);
 
 		/* Since gui2::show_wml_message needs to do undrawing the
 		   chatlines can get garbled and look dirty on screen. Force a
@@ -2834,6 +2841,8 @@
 
 	bool has_input= (has_text_input || !menu_items.empty() );
 
+	int auto_close_timeout = lexical_cast_default<int> (cfg["duration"], 0);
+
 	// skip messages during quick replay
 	play_controller *controller = resources::controller;
 	if(!has_input && (
@@ -2926,6 +2935,17 @@
 
 	message_user_choice msg(cfg, speaker, text_input_element, has_text_input,
 		options);
+
+	/* Add the lifetime of the message*/
+	if(auto_close_timeout > 0)
+	{
+		msg.set_auto_close_timeout(auto_close_timeout);
+	}
+	else
+	{
+		msg.set_auto_close_timeout(0);
+	}
+
 	if (!has_input)
 	{
 		/* Always show the dialog if it has no input, whether we are
Index: wesnoth/src/gui/dialogs/wml_message.cpp
===================================================================
--- wesnoth/src/gui/dialogs/wml_message.cpp	(révision 53756)
+++ wesnoth/src/gui/dialogs/wml_message.cpp	(copie de travail)
@@ -171,7 +171,8 @@
 		, std::string* input_text
 		, const unsigned maximum_length
 		, const std::vector<std::string>& option_list
-		, int* chosen_option)
+		, int* chosen_option
+		, unsigned int auto_close_timeout)
 {
 	std::auto_ptr<twml_message_> dlg;
 	if(left_side) {
@@ -189,7 +190,7 @@
 		dlg->set_option_list(option_list, chosen_option);
 	}
 
-	dlg->show(video);
+	dlg->show(video, auto_close_timeout);
 	return dlg->get_retval();
 }
 
Index: wesnoth/src/gui/dialogs/wml_message.hpp
===================================================================
--- wesnoth/src/gui/dialogs/wml_message.hpp	(révision 53756)
+++ wesnoth/src/gui/dialogs/wml_message.hpp	(copie de travail)
@@ -102,6 +102,7 @@
 
 	/** Inherited from tdialog. */
 	void post_show(twindow& window);
+
 };
 
 /** Shows a dialog with the portrait on the left side. */
@@ -160,6 +161,8 @@
  *  @param chosen_option          Pointer to the initially chosen option.
  *                                Will be set to the chosen_option when the
  *                                dialog closes.
+ *
+ *	@param auto_close_timeout	  Duration of the message (if specified)
  */
 int show_wml_message(const bool left_side
 		, CVideo& video
@@ -172,7 +175,8 @@
 		, std::string* input_text
 	    , const unsigned maximum_length
 		, const std::vector<std::string>& option_list
-		, int* chosen_option);
+		, int* chosen_option
+		, unsigned int auto_close_timeout);
 
 
 } // namespace gui2
