5 #include "util/uuid.hpp"
6 #include "common/common.hpp"
7 #include "nlohmann/json.hpp"
9 #include "util/status_dispatcher.hpp"
10 #include "util/item_set.hpp"
12 #include "util/autofree_ptr.hpp"
22 void merge_item(ObjectType ty,
const UUID &uu);
23 void merge_3d_model(
const std::string &filename);
24 void handle_refresh_prs();
25 bool prs_refreshed_once =
false;
32 class ListColumns :
public Gtk::TreeModelColumnRecord {
36 Gtk::TreeModelColumnRecord::add(name);
37 Gtk::TreeModelColumnRecord::add(type);
38 Gtk::TreeModelColumnRecord::add(uuid);
39 Gtk::TreeModelColumnRecord::add(filename);
41 Gtk::TreeModelColumn<Glib::ustring> name;
42 Gtk::TreeModelColumn<ObjectType> type;
43 Gtk::TreeModelColumn<UUID> uuid;
44 Gtk::TreeModelColumn<std::string> filename;
46 ListColumns list_columns;
48 Glib::RefPtr<Gtk::ListStore> item_store;
49 Gtk::TreeView *merge_items_view =
nullptr;
50 Gtk::Label *merge_items_placeholder_label =
nullptr;
51 Gtk::Label *pr_body_placeholder_label =
nullptr;
52 Gtk::Button *upgrade_button =
nullptr;
53 Gtk::Button *create_pr_button =
nullptr;
54 Gtk::Button *refresh_prs_button =
nullptr;
55 Gtk::Revealer *upgrade_revealer =
nullptr;
56 Gtk::Label *upgrade_label =
nullptr;
57 Gtk::Spinner *upgrade_spinner =
nullptr;
58 Gtk::Label *gh_repo_link_label =
nullptr;
59 Gtk::Label *gh_signed_in_label =
nullptr;
60 Gtk::Button *merge_items_clear_button =
nullptr;
61 Gtk::Button *merge_items_remove_button =
nullptr;
62 Gtk::Entry *pr_title_entry =
nullptr;
63 Gtk::TextView *pr_body_textview =
nullptr;
64 Gtk::ListBox *pull_requests_listbox =
nullptr;
65 Gtk::Spinner *pr_spinner =
nullptr;
67 Gtk::Button *login_button =
nullptr;
68 Gtk::Button *logout_button =
nullptr;
69 Gtk::CheckButton *show_only_my_prs_cb =
nullptr;
70 Gtk::Button *pr_update_button =
nullptr;
71 Gtk::Button *pr_update_cancel_button =
nullptr;
74 void handle_remote_upgrade();
75 void handle_create_pr();
76 void handle_update_pr();
77 void update_body_placeholder_label();
80 void remote_upgrade_thread();
81 void create_pr_thread();
82 void update_pr_thread();
83 void update_prepare_pr_thread();
85 void refresh_prs_thread();
87 void checkout_master(git_repository *repo);
88 std::string get_token_filename()
const;
90 void set_pr_update_mode(
unsigned int pr,
const std::string branch_name);
92 static int pr_diff_file_cb_c(
const git_diff_delta *delta,
float progress,
void *pl);
93 void pr_diff_file_cb(
const git_diff_delta *delta);
95 Glib::Dispatcher git_thread_dispatcher;
97 enum class GitThreadMode { UPGRADE, PULL_REQUEST, PULL_REQUEST_UPDATE, LOGIN, PULL_REQUEST_UPDATE_PREPARE };
98 GitThreadMode git_thread_mode = GitThreadMode::UPGRADE;
99 bool git_thread_busy =
false;
100 std::string git_thread_status;
101 bool git_thread_error =
false;
103 std::mutex git_thread_mutex;
105 std::string gh_owner;
109 std::set<std::string> models_merge;
110 void update_items_merge();
111 ItemSet get_referenced(ObjectType ty,
const UUID &uu);
112 bool exists_in_pool(
class Pool &pool, ObjectType ty,
const UUID &uu);
113 git_oid items_to_tree(git_repository *repo);
114 void push_branch(git_remote *remote,
const std::string &branch_name);
117 void update_my_prs();
119 std::string gh_username;
120 std::string gh_token;
122 std::string pr_title;
125 unsigned int pr_update_nr = 0;
126 std::string pr_update_branch;
128 bool logged_in_once =
false;
129 std::atomic<bool> login_succeeded =
true;
Definition: github_client.hpp:7
Definition: pool_notebook.hpp:20
Definition: pool_remote_box.hpp:17
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:23
Definition: status_dispatcher.hpp:8
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: autofree_ptr.hpp:5
a class to store JSON values
Definition: json.hpp:166
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61