The Battle for Wesnoth  1.19.7+dev
log_settings.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2017 - 2024
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 #include "gui/widgets/group.hpp"
19 #include <map>
20 
21 namespace gui2::dialogs
22 {
23 class log_settings : public modal_dialog
24 {
25 public:
26  /** Constructor. */
27  log_settings();
28 
29  /**
30  * The display function.
31  *
32  * See @ref modal_dialog for more information.
33  */
35 
36 private:
37  void set_logger(const std::basic_string<char>& log_domain);
38 
39  std::map<std::string, group<std::string>> groups_;
40  std::vector<std::string> domain_list_, widget_id_;
41 
42  virtual const std::string& window_id() const override;
43 
44  virtual void pre_show() override;
45 
46  virtual void post_show() override;
47 
48  void filter_text_changed(const std::string& text);
49 };
50 
51 } // namespace gui2::dialogs
void set_logger(const std::basic_string< char > &log_domain)
The display function.
std::vector< std::string > domain_list_
void filter_text_changed(const std::string &text)
virtual void post_show() override
Actions to be taken after the window has been shown.
virtual const std::string & window_id() const override
The ID of the window to build.
std::map< std::string, group< std::string > > groups_
std::vector< std::string > widget_id_
virtual void pre_show() override
Actions to be taken before showing the window.
Abstract base class for all modal dialogs.
#define DEFINE_SIMPLE_DISPLAY_WRAPPER(dialog)
Adds a bare-bones static display function to a dialog class that immediately invokes the dialogs's mo...