The Battle for Wesnoth  1.15.12+dev
connect.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2018 by Mark de Wever <koraq@xs4all.nl>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
18 
19 namespace gui2::dialogs
20 {
21 
22 /**
23  * @ingroup GUIWindowDefinitionWML
24  *
25  * This shows the dialog for managing addons and connecting to the addon server.
26  * Key |Type |Mandatory|Description
27  * ------------------|----------|---------|-----------
28  * hostname | text_box |yes |This text contains the name of the server to connect to.
29  * show_help | @ref gui::button |yes |Thus button shows the in-game help about add-ons management when triggered.
30  * free to choose (2)| button |no |This button closes the dialog to display a dialog for removing installed add-ons.
31  */
33 {
34 public:
35  /**
36  * Constructor.
37  *
38  * @param host_name The parameter's usage is:
39  * - Input: The initial value for the host_name.
40  * - Output :The final value of the host_name if
41  * the dialog returns retval::OK or 3
42  * undefined otherwise.
43  * @param allow_remove Sets @ref allow_remove_.
44  */
45  addon_connect(std::string& host_name,
46  const bool allow_remove);
47 
48 private:
49  /** Enable the addon remove button? */
51 
52  void help_button_callback();
53 
54  virtual const std::string& window_id() const override;
55 
56  virtual void pre_show(window& window) override;
57 
58  virtual void post_show(window& window) override;
59 };
60 
61 } // namespace dialogs
This shows the dialog for managing addons and connecting to the addon server.
Definition: connect.hpp:32
virtual const std::string & window_id() const override
The id of the window to build.
bool allow_remove_
Enable the addon remove button?
Definition: connect.hpp:50
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Definition: connect.cpp:46
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
Definition: connect.cpp:56
addon_connect(std::string &host_name, const bool allow_remove)
Constructor.
Definition: connect.cpp:33
Abstract base class for all modal dialogs.
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition: window.hpp:64