Horizon
pool-prj-mgr-app.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include "util/uuid.hpp"
4 #include "nlohmann/json_fwd.hpp"
5 #include <map>
6 #include <set>
7 #include <zmq.hpp>
8 #include <glibmm/datetime.h>
9 #ifdef G_OS_WIN32
10 #undef ERROR
11 #undef DELETE
12 #undef DUPLICATE
13 #endif
14 #include "preferences/preferences.hpp"
15 
16 namespace horizon {
17 using json = nlohmann::json;
18 
19 class PoolProjectManagerApplication : public Gtk::Application {
20 protected:
22 
23 public:
24  static Glib::RefPtr<PoolProjectManagerApplication> create();
25  std::string get_config_filename();
26  const std::string &get_ep_broadcast() const;
27  void send_json(int pid, const json &j);
28  zmq::context_t zctx;
29 
30  std::map<std::string, Glib::DateTime> recent_items;
31 
32  std::deque<UUID> part_favorites;
33 
34  void close_appwindows(std::set<Gtk::Window *> wins);
35  Preferences &get_preferences();
36 
37 protected:
38  // Override default signal handlers:
39  void on_activate() override;
40  void on_startup() override;
41  void on_shutdown();
42  void on_open(const Gio::Application::type_vec_files &files, const Glib::ustring &hint) override;
43 
44  std::string sock_broadcast_ep;
45 
46 
47 private:
48  class PoolProjectManagerAppWindow *create_appwindow();
49  void on_hide_window(Gtk::Window *window);
50  void on_action_quit();
51  void on_action_new_window();
52  void on_action_preferences();
53  void load_from_config(const std::string &config_filename);
54  Preferences preferences;
55  class PreferencesWindow *preferences_window = nullptr;
56 
57 
58 public:
59  zmq::socket_t sock_broadcast;
60 };
61 } // namespace horizon
a class to store JSON values
Definition: json.hpp:161
Definition: preferences_window.hpp:7
Definition: pool-prj-mgr-app.hpp:19
Definition: block.cpp:9
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61
Definition: preferences.hpp:57
Definition: pool-prj-mgr-app_win.hpp:17