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 PoolNotebook *nb,
16  const std::string &bp);
17  static PoolSettingsBox *create(class PoolNotebook *nb, const std::string &bp);
18  bool get_needs_save() const;
19  void save();
20  void pool_updated();
21 
22 private:
23  class PoolNotebook *notebook = nullptr;
24  std::string pool_base_path;
25  Gtk::Entry *entry_name = nullptr;
26  Gtk::Button *save_button = nullptr;
27  Gtk::ListBox *pools_available_listbox = nullptr;
28  Gtk::ListBox *pools_included_listbox = nullptr;
29  Gtk::Button *pool_inc_button = nullptr;
30  Gtk::Button *pool_excl_button = nullptr;
31  Gtk::Button *pool_up_button = nullptr;
32  Gtk::Button *pool_down_button = nullptr;
33  Gtk::Label *hint_label = nullptr;
34 
35  std::vector<UUID> pools_included;
36 
37  void update_pools();
38 
39  void inc_excl_pool(bool inc);
40 
41  bool needs_save = false;
42  void set_needs_save();
43 };
44 } // namespace horizon
horizon::PoolNotebook
Definition: pool_notebook.hpp:20
horizon::PoolSettingsBox
Definition: pool_settings_box.hpp:13
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:166
nlohmann::json
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61