Horizon
pool_settings_box.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include <set>
4 #include <mutex>
5 #include "util/uuid.hpp"
6 #include "common/common.hpp"
7 #include "nlohmann/json.hpp"
8 #include "pool/pool_info.hpp"
9 #include "util/changeable.hpp"
10 #include <git2.h>
11 
12 namespace horizon {
13 using json = nlohmann::json;
14 
15 class PoolSettingsBox : public Gtk::Box, public Changeable {
16 public:
17  PoolSettingsBox(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, class IPool &pool);
18  static PoolSettingsBox *create(class IPool &pool);
19  bool get_needs_save() const;
20  void save();
21  void pool_updated();
22  void update_pools();
23  std::string get_version_message() const;
24 
25  typedef sigc::signal<void, std::string> type_signal_open_pool;
26  type_signal_open_pool signal_open_pool()
27  {
28  return s_signal_open_pool;
29  }
30 
31  typedef sigc::signal<void> type_signal_saved;
32  type_signal_saved signal_saved()
33  {
34  return s_signal_saved;
35  }
36 
37 private:
38  IPool &pool;
39  PoolInfo pool_info;
40  Gtk::Entry *entry_name = nullptr;
41  class PoolBrowserButton *browser_button_via = nullptr;
42  class PoolBrowserButton *browser_button_frame = nullptr;
43  Gtk::Button *save_button = nullptr;
44  Gtk::ListBox *pools_available_listbox = nullptr;
45  Gtk::ListBox *pools_included_listbox = nullptr;
46  Gtk::ListBox *pools_actually_included_listbox = nullptr;
47  Gtk::Button *pool_inc_button = nullptr;
48  Gtk::Button *pool_excl_button = nullptr;
49  Gtk::Button *pool_up_button = nullptr;
50  Gtk::Button *pool_down_button = nullptr;
51  Gtk::Label *hint_label = nullptr;
52 
53  void update_actual();
54 
55  void inc_excl_pool(bool inc);
56  void pool_up_down(bool up);
57  void update_button_sensitivity();
58 
59  bool needs_save = false;
60  void set_needs_save();
61  unsigned int saved_version = 0;
62 
63  type_signal_open_pool s_signal_open_pool;
64  type_signal_saved s_signal_saved;
65 };
66 } // namespace horizon
Definition: changeable.hpp:5
Definition: ipool.hpp:14
Definition: pool_browser_button.hpp:9
Definition: pool_info.hpp:11
Definition: pool_settings_box.hpp:15
a class to store JSON values
Definition: json.hpp:177
basic_json<> json
default JSON class
Definition: json_fwd.hpp:62