The Battle for Wesnoth  1.19.0-dev
connect.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2024
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, 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:34
addon_connect(std::string &host_name, bool allow_remove)
Constructor.
Definition: connect.cpp:33
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Definition: connect.cpp:45
bool allow_remove_
Enable the addon remove button?
Definition: connect.hpp:50
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
Definition: connect.cpp:55
virtual const std::string & window_id() const override
The ID of the window to build.
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:63