The Battle for Wesnoth  1.15.9+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
20 {
21 namespace dialogs
22 {
23 
24 /**
25  * @ingroup GUIWindowDefinitionWML
26  *
27  * This shows the dialog for managing addons and connecting to the addon server.
28  * Key |Type |Mandatory|Description
29  * ------------------|----------|---------|-----------
30  * hostname | text_box |yes |This text contains the name of the server to connect to.
31  * show_help | @ref gui::button |yes |Thus button shows the in-game help about add-ons management when triggered.
32  * free to choose (2)| button |no |This button closes the dialog to display a dialog for removing installed add-ons.
33  */
35 {
36 public:
37  /**
38  * Constructor.
39  *
40  * @param host_name The parameter's usage is:
41  * - Input: The initial value for the host_name.
42  * - Output :The final value of the host_name if
43  * the dialog returns retval::OK or 3
44  * undefined otherwise.
45  * @param allow_remove Sets @ref allow_remove_.
46  */
47  addon_connect(std::string& host_name,
48  const bool allow_remove);
49 
50 private:
51  /** Enable the addon remove button? */
53 
54  void help_button_callback();
55 
56  /** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
57  virtual const std::string& window_id() const override;
58 
59  /** Inherited from modal_dialog. */
60  virtual void pre_show(window& window) override;
61 
62  /** Inherited from modal_dialog. */
63  virtual void post_show(window& window) override;
64 };
65 
66 } // namespace dialogs
67 } // namespace gui2
This shows the dialog for managing addons and connecting to the addon server.
Definition: connect.hpp:34
Generic file dialog.
Definition: field-fwd.hpp:22
virtual const std::string & window_id() const override
Inherited from modal_dialog, implemented by REGISTER_DIALOG.
bool allow_remove_
Enable the addon remove button?
Definition: connect.hpp:52
virtual void pre_show(window &window) override
Inherited from modal_dialog.
Definition: connect.cpp:48
Various uncategorised dialogs.
virtual void post_show(window &window) override
Inherited from modal_dialog.
Definition: connect.cpp:58
addon_connect(std::string &host_name, const bool allow_remove)
Constructor.
Definition: connect.cpp:35
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