Horizon
Loading...
Searching...
No Matches
pool_merge_box.hpp
1#pragma once
2#include <gtkmm.h>
3#include "common/common.hpp"
4#include "util/uuid.hpp"
5#include "nlohmann/json.hpp"
6#include "pool_status_provider.hpp"
7
8namespace horizon {
9using json = nlohmann::json;
10
11class PoolMergeBox2 : public Gtk::Box {
12public:
13 PoolMergeBox2(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, PoolStatusProviderPoolManager &prv);
15
16
17private:
18 Gtk::TreeView *pool_item_view = nullptr;
19 Gtk::Stack *stack = nullptr;
20 Gtk::TextView *delta_text_view = nullptr;
21 Gtk::CheckButton *cb_update_layer_help = nullptr;
22 Gtk::CheckButton *cb_update_tables = nullptr;
23 Gtk::Menu context_menu;
24 Gtk::Button *button_update = nullptr;
25
27 void update_from_prv();
28 void selection_changed();
29
30 enum class MenuOP { CHECK, UNCHECK, TOGGLE };
31 void append_context_menu_item(const std::string &name, MenuOP op);
32
33 void action_toggled(const Glib::ustring &path);
34
35 class TreeColumns : public Gtk::TreeModelColumnRecord {
36 public:
37 TreeColumns()
38 {
39 Gtk::TreeModelColumnRecord::add(name);
40 Gtk::TreeModelColumnRecord::add(type);
41 Gtk::TreeModelColumnRecord::add(uuid);
42 Gtk::TreeModelColumnRecord::add(delta);
43 Gtk::TreeModelColumnRecord::add(filename_local);
44 Gtk::TreeModelColumnRecord::add(filename_remote);
45 Gtk::TreeModelColumnRecord::add(merge);
46 Gtk::TreeModelColumnRecord::add(state);
47 }
48 Gtk::TreeModelColumn<Glib::ustring> name;
49 Gtk::TreeModelColumn<std::string> filename_local;
50 Gtk::TreeModelColumn<std::string> filename_remote;
51 Gtk::TreeModelColumn<ObjectType> type;
52 Gtk::TreeModelColumn<UUID> uuid;
53 Gtk::TreeModelColumn<json> delta;
54 Gtk::TreeModelColumn<bool> merge;
55 Gtk::TreeModelColumn<PoolStatusPoolManager::ItemInfo::ItemState> state;
56 };
57 TreeColumns list_columns;
58
59 Glib::RefPtr<Gtk::ListStore> item_store;
60};
61} // namespace horizon
Definition pool_merge_box.hpp:11
Definition pool_status_provider.hpp:92
a class to store JSON values
Definition json.hpp:177
basic_json<> json
default JSON class
Definition json_fwd.hpp:62