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