2 #include "common/common.hpp"
3 #include "nlohmann/json_fwd.hpp"
4 #include "pool/pool.hpp"
5 #include "util/uuid.hpp"
9 #include "pool_cache_status.hpp"
10 #include "util/item_set.hpp"
15 class PoolCacheWindow :
public Gtk::Window {
17 PoolCacheWindow(BaseObjectType *cobject,
const Glib::RefPtr<Gtk::Builder> &x,
const std::string &cache_path,
18 const std::string &pool_path,
class PoolProjectManagerAppWindow *aw);
19 static PoolCacheWindow *create(Gtk::Window *p,
const std::string &cache_path,
const std::string &pool_path,
20 class PoolProjectManagerAppWindow *aw);
22 void refresh_list(
const class PoolCacheStatus &status);
23 void select_items(
const ItemSet &items);
26 void selection_changed();
27 void update_from_pool();
30 std::string cache_path;
31 std::string base_path;
34 class PoolProjectManagerAppWindow *appwin;
36 Gtk::TreeView *pool_item_view =
nullptr;
37 Gtk::Stack *stack =
nullptr;
38 Gtk::TextView *delta_text_view =
nullptr;
39 Gtk::Button *update_from_pool_button =
nullptr;
40 Gtk::Label *status_label =
nullptr;
42 class TreeColumns :
public Gtk::TreeModelColumnRecord {
46 Gtk::TreeModelColumnRecord::add(name);
47 Gtk::TreeModelColumnRecord::add(type);
48 Gtk::TreeModelColumnRecord::add(uuid);
49 Gtk::TreeModelColumnRecord::add(state);
50 Gtk::TreeModelColumnRecord::add(delta);
51 Gtk::TreeModelColumnRecord::add(filename_cached);
53 Gtk::TreeModelColumn<Glib::ustring> name;
54 Gtk::TreeModelColumn<std::string> filename_cached;
55 Gtk::TreeModelColumn<ObjectType> type;
56 Gtk::TreeModelColumn<UUID> uuid;
57 Gtk::TreeModelColumn<PoolCacheStatus::Item::State> state;
58 Gtk::TreeModelColumn<json> delta;
60 TreeColumns tree_columns;
62 Glib::RefPtr<Gtk::ListStore> item_store;