diff options
author | David Kocik <kocikdav@gmail.com> | 2020-05-14 13:15:02 +0300 |
---|---|---|
committer | David Kocik <kocikdav@gmail.com> | 2020-05-15 10:34:53 +0300 |
commit | 65a37ffaa1fb4ab1df392344db21d7dfa83724dd (patch) | |
tree | 7cfe44239aaf72ed10977b556297309d4209a52f /src/slic3r/GUI/GUI_App.hpp | |
parent | ad1c6c29f4e0a6681eb8a9bfa5fc6812ff2b89a2 (diff) |
single instance check
processing paths with whitespaces
unified lock for all systems - wxInstanceChecker
checking a messaging only for same binaries
Diffstat (limited to 'src/slic3r/GUI/GUI_App.hpp')
-rw-r--r-- | src/slic3r/GUI/GUI_App.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index 3afadf4e0..984a1241e 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -13,6 +13,7 @@ #include <wx/colour.h> #include <wx/font.h> #include <wx/string.h> +#include <wx/snglinst.h> #include <mutex> #include <stack> @@ -106,6 +107,9 @@ class GUI_App : public wxApp std::unique_ptr<PrintHostJobQueue> m_printhost_job_queue; ConfigWizard* m_wizard; // Managed by wxWindow tree std::unique_ptr <OtherInstanceMessageHandler> m_other_instance_message_handler; + std::unique_ptr <wxSingleInstanceChecker> m_single_instance_checker; + std::string m_instance_hash_string; + size_t m_instance_hash_int; public: bool OnInit() override; bool initialized() const { return m_initialized; } @@ -194,6 +198,12 @@ public: RemovableDriveManager* removable_drive_manager() { return m_removable_drive_manager.get(); } OtherInstanceMessageHandler* other_instance_message_handler() { return m_other_instance_message_handler.get(); } + wxSingleInstanceChecker* single_instance_checker() {return m_single_instance_checker.get();} + + void init_single_instance_checker(const std::string &name, const std::string &path); + void set_instance_hash (const size_t hash) { m_instance_hash_int = hash; m_instance_hash_string = std::to_string(hash); } + std::string get_instance_hash_string () { return m_instance_hash_string; } + size_t get_instance_hash_int () { return m_instance_hash_int; } ImGuiWrapper* imgui() { return m_imgui.get(); } |