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 <git2.h>
9 
10 namespace horizon {
11 using json = nlohmann::json;
12 
13 class PoolSettingsBox : public Gtk::Box {
14 public:
15  PoolSettingsBox(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, class IPool &pool);
16  static PoolSettingsBox *create(class IPool &pool);
17  bool get_needs_save() const;
18  void save();
19  void pool_updated();
20 
21  typedef sigc::signal<void, std::string> type_signal_open_pool;
22  type_signal_open_pool signal_open_pool()
23  {
24  return s_signal_open_pool;
25  }
26 
27 private:
28  IPool &pool;
29  Gtk::Entry *entry_name = nullptr;
30  Gtk::Button *save_button = nullptr;
31  Gtk::ListBox *pools_available_listbox = nullptr;
32  Gtk::ListBox *pools_included_listbox = nullptr;
33  Gtk::ListBox *pools_actually_included_listbox = nullptr;
34  Gtk::Button *pool_inc_button = nullptr;
35  Gtk::Button *pool_excl_button = nullptr;
36  Gtk::Button *pool_up_button = nullptr;
37  Gtk::Button *pool_down_button = nullptr;
38  Gtk::Label *hint_label = nullptr;
39 
40  std::vector<UUID> pools_included;
41 
42  void update_pools();
43  void update_actual();
44 
45  void inc_excl_pool(bool inc);
46  void pool_up_down(bool up);
47 
48  bool needs_save = false;
49  void set_needs_save();
50 
51  type_signal_open_pool s_signal_open_pool;
52 };
53 } // namespace horizon
Definition: ipool.hpp:14
Definition: pool_settings_box.hpp:13
a class to store JSON values
Definition: json.hpp:170
basic_json<> json
default JSON class
Definition: json_fwd.hpp:62