5 #include "util/uuid.hpp"
6 #include "common/common.hpp"
7 #include "nlohmann/json.hpp"
21 bool refreshed_once =
false;
26 Gtk::Button *refresh_button =
nullptr;
27 Gtk::Label *info_label =
nullptr;
28 Gtk::TreeView *diff_treeview =
nullptr;
29 Gtk::TreeView *status_treeview =
nullptr;
30 Gtk::CheckButton *diff_show_deleted_checkbutton =
nullptr;
31 Gtk::CheckButton *diff_show_modified_checkbutton =
nullptr;
32 Gtk::Box *diff_box =
nullptr;
33 Gtk::Button *add_with_deps_button =
nullptr;
35 void make_treeview(Gtk::TreeView *treeview);
37 class TreeColumns :
public Gtk::TreeModelColumnRecord {
41 Gtk::TreeModelColumnRecord::add(name);
42 Gtk::TreeModelColumnRecord::add(type);
43 Gtk::TreeModelColumnRecord::add(uuid);
45 Gtk::TreeModelColumnRecord::add(status);
46 Gtk::TreeModelColumnRecord::add(status_flags);
47 Gtk::TreeModelColumnRecord::add(path);
49 Gtk::TreeModelColumn<Glib::ustring> name;
50 Gtk::TreeModelColumn<ObjectType> type;
51 Gtk::TreeModelColumn<UUID> uuid;
53 Gtk::TreeModelColumn<git_delta_t> status;
54 Gtk::TreeModelColumn<unsigned int> status_flags;
55 Gtk::TreeModelColumn<std::string> path;
57 TreeColumns list_columns;
59 Glib::RefPtr<Gtk::ListStore> diff_store;
60 Glib::RefPtr<Gtk::TreeModelFilter> diff_store_filtered;
61 Glib::RefPtr<Gtk::TreeModelSort> diff_store_sorted;
63 Glib::RefPtr<Gtk::ListStore> status_store;
64 Glib::RefPtr<Gtk::TreeModelSort> status_store_sorted;
65 void install_sort(Glib::RefPtr<Gtk::TreeSortable> store);
67 static int diff_file_cb_c(
const git_diff_delta *delta,
float progress,
void *pl);
68 static int status_cb_c(
const char *path,
unsigned int status_flags,
void *payload);
69 void status_cb(
const char *path,
unsigned int status_flags);
70 void diff_file_cb(
const git_diff_delta *delta);
72 void update_store_from_db_prepare();
73 void update_store_from_db(Glib::RefPtr<Gtk::ListStore> store);
74 void handle_add_with_deps();