The Battle for Wesnoth  1.15.2+dev
game_version_dialog.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2013 - 2018 by Iris Morelle <shadowm2006@gmail.com>
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 #include "build_info.hpp"
20 
21 #include <map>
22 
23 #include <array>
24 
25 namespace gui2
26 {
27 class listbox;
28 
29 namespace dialogs
30 {
31 
32 class game_version : public modal_dialog
33 {
34 public:
35  /**
36  * Constructor.
37  */
38  game_version();
39 
40  /**
41  * The display function.
42  *
43  * See @ref modal_dialog for more information.
44  */
46 
47 private:
48  const std::string path_wid_stem_;
49  const std::string copy_wid_stem_;
50  const std::string browse_wid_stem_;
51 
52  std::map<std::string, std::string> path_map_;
53 
54 #ifdef _WIN32
55  const std::string log_path_;
56 #endif
57 
58  typedef std::array<std::string, 4> deplist_entry;
59  std::vector<deplist_entry> deps_;
60 
61  std::vector<game_config::optional_feature> opts_;
62 
63  std::string report_;
64 
66 
67  /** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
68  virtual const std::string& window_id() const override;
69 
70  /** Inherited from modal_dialog. */
71  virtual void pre_show(window& window) override;
72 
73  //
74  // Widget event callbacks.
75  //
76 
77  /**
78  * Callback function called when switching tabs.
79  */
81 
82  /**
83  * Callback function for the dialog-wide copy-to-clipboard button.
84  */
85  void report_copy_callback();
86 
87  /**
88  * Callback function for copy-to-clipboard action buttons.
89  *
90  * @param path Filesystem path associated with the widget.
91  */
92  void copy_to_clipboard_callback(const std::string& path);
93 
94  /**
95  * Callback function for browse-directory action buttons.
96  *
97  * @param path Filesystem path associated with the widget.
98  */
99  void browse_directory_callback(const std::string& path);
100 };
101 } // namespace dialogs
102 } // namespace gui2
void report_copy_callback()
Callback function for the dialog-wide copy-to-clipboard button.
const std::string path_wid_stem_
The display function.
std::map< std::string, std::string > path_map_
std::array< std::string, 4 > deplist_entry
virtual void pre_show(window &window) override
Inherited from modal_dialog.
Generic file dialog.
Definition: field-fwd.hpp:22
void copy_to_clipboard_callback(const std::string &path)
Callback function for copy-to-clipboard action buttons.
std::vector< deplist_entry > deps_
void browse_directory_callback(const std::string &path)
Callback function for browse-directory action buttons.
virtual const std::string & window_id() const override
Inherited from modal_dialog, implemented by REGISTER_DIALOG.
std::string path
Definition: game_config.cpp:39
Various uncategorised dialogs.
std::vector< game_config::optional_feature > opts_
Abstract base class for all modal dialogs.
void tab_switch_callback(window &window)
Callback function called when switching tabs.
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:62