single instance check

processing paths with whitespaces
unified lock for all systems - wxInstanceChecker
checking a messaging only for same binaries
This commit is contained in:
David Kocik 2020-05-14 12:15:02 +02:00
parent ad1c6c29f4
commit 65a37ffaa1
10 changed files with 282 additions and 200 deletions
src/slic3r/GUI

View file

@ -323,6 +323,12 @@ void GUI_App::init_app_config()
}
}
void GUI_App::init_single_instance_checker(const std::string &name, const std::string &path)
{
BOOST_LOG_TRIVIAL(debug) << "init wx instance checker " << name << " "<< path;
m_single_instance_checker = std::make_unique<wxSingleInstanceChecker>(boost::nowide::widen(name), boost::nowide::widen(path));
}
bool GUI_App::OnInit()
{
try {
@ -451,6 +457,10 @@ bool GUI_App::on_init_inner()
preset_updater->slic3r_update_notify();
preset_updater->sync(preset_bundle);
});
#ifdef _WIN32
//sets window property to mainframe so other instances can indentify it
OtherInstanceMessageHandler::init_windows_properties(mainframe, m_instance_hash_int);
#endif //WIN32
}
});