4 #include "util/uuid.hpp" 6 #include "nlohmann/json_fwd.hpp" 7 #include "util/editor_process.hpp" 8 #include "util/window_state_store.hpp" 9 #include "pool-prj-mgr-process.hpp" 10 #include "project/project.hpp" 11 #include "prj-mgr/prj-mgr_views.hpp" 12 #include "pool-mgr/view_create_pool.hpp" 28 void open_file_view(
const Glib::RefPtr<Gio::File> &file);
30 bool close_pool_or_project();
31 bool really_close_pool_or_project();
32 void wait_for_all_processes();
33 std::string get_filename()
const;
36 const std::vector<std::string> &env = {},
bool read_only =
false);
38 const std::vector<std::string> &args);
40 std::map<std::string, PoolProjectManagerProcess *> get_processes();
42 class Pool *pool =
nullptr;
44 typedef sigc::signal<void, std::string, int, bool> type_signal_process_exited;
45 type_signal_process_exited signal_process_exited()
47 return s_signal_process_exited;
53 bool can_close =
true;
55 std::vector<std::string> files_need_save;
60 void process_save(
const std::string &file);
61 void process_close(
const std::string &file);
62 void cleanup_pool_cache();
65 Glib::RefPtr<Gtk::Builder> builder;
66 Gtk::Stack *stack =
nullptr;
67 Gtk::Button *button_open =
nullptr;
68 Gtk::Button *button_close =
nullptr;
69 Gtk::Button *button_update =
nullptr;
70 Gtk::Button *button_download =
nullptr;
71 Gtk::Button *button_do_download =
nullptr;
72 Gtk::Button *button_cancel =
nullptr;
73 Gtk::MenuButton *button_new =
nullptr;
74 Gtk::Button *button_create =
nullptr;
75 Gtk::Button *button_save =
nullptr;
76 Gtk::Spinner *spinner_update =
nullptr;
77 Gtk::Revealer *download_revealer =
nullptr;
78 Gtk::Label *download_label =
nullptr;
79 Gtk::Spinner *download_spinner =
nullptr;
81 Gtk::Entry *download_gh_username_entry =
nullptr;
82 Gtk::Entry *download_gh_repo_entry =
nullptr;
83 Gtk::FileChooserButton *download_dest_dir_button =
nullptr;
85 Gtk::HeaderBar *header =
nullptr;
86 Gtk::ListBox *recent_pools_listbox =
nullptr;
87 Gtk::ListBox *recent_projects_listbox =
nullptr;
88 std::vector<Gtk::ListBox *> recent_listboxes;
89 Gtk::Label *label_gitversion =
nullptr;
90 Gtk::Box *pool_box =
nullptr;
93 Gtk::Label *pool_update_status_label =
nullptr;
94 Gtk::Revealer *pool_update_status_rev =
nullptr;
95 Gtk::Button *pool_update_status_close_button =
nullptr;
96 Gtk::ProgressBar *pool_update_progress =
nullptr;
98 Gtk::InfoBar *info_bar =
nullptr;
99 Gtk::Label *info_bar_label =
nullptr;
101 Gtk::MenuItem *menu_new_pool =
nullptr;
102 Gtk::MenuItem *menu_new_project =
nullptr;
104 std::unique_ptr<Project> project =
nullptr;
105 std::string project_filename;
106 bool project_needs_save =
false;
111 enum class ViewMode { OPEN, POOL, DOWNLOAD, PROJECT, CREATE_PROJECT, CREATE_POOL };
112 ViewMode view_mode = ViewMode::OPEN;
113 void set_view_mode(ViewMode mode);
115 void update_recent_items();
119 void handle_recent();
120 void handle_update();
121 void handle_download();
122 void handle_do_download();
123 void handle_new_project();
124 void handle_new_pool();
125 void handle_create();
126 void handle_cancel();
130 bool on_delete_event(GdkEventAny *ev)
override;
132 void download_thread(std::string gh_username, std::string gh_repo, std::string dest_dir);
134 Glib::Dispatcher download_dispatcher;
136 bool downloading =
false;
137 bool download_error =
false;
138 std::string download_status;
139 std::mutex download_mutex;
143 std::map<std::string, PoolProjectManagerProcess> processes;
144 std::map<int, bool> pids_need_save;
146 type_signal_process_exited s_signal_process_exited;
152 void handle_place_part(
const UUID &uu);
153 void handle_assign_part(
const UUID &uu);
155 zmq::socket_t sock_mgr;
156 std::string sock_mgr_ep;
158 sigc::connection sock_mgr_conn;
161 bool check_schema_update(
const std::string &base_path);
164 zmq::context_t &zctx;
165 void set_pool_updating(
bool v,
bool success);
166 void set_pool_update_status_text(
const std::string &txt);
167 void set_pool_update_progress(
float progress);
Definition: pool-prj-mgr-app_win.hpp:51
Definition: part_browser_window.hpp:13
a class to store JSON values
Definition: json.hpp:161
Definition: pool_notebook.hpp:18
Definition: window_state_store.hpp:20
Definition: pool_cache_window.hpp:14
Definition: view_create_pool.hpp:8
Definition: pool-prj-mgr-app.hpp:19
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:19
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61
Definition: prj-mgr_views.hpp:35
Definition: pool-prj-mgr-process.hpp:5
Definition: prj-mgr_views.hpp:9
Definition: pool-prj-mgr-app_win.hpp:17