single slicer instance

check for other instances during startup
send message with command line arguments if found and terminate
listen for those messages and load objects from paths in messages from them
This commit is contained in:
David Kocik 2020-04-29 10:50:28 +02:00
parent 9cb5975956
commit d828a1e80b
16 changed files with 841 additions and 29 deletions
src/slic3r/GUI

View file

@ -100,6 +100,13 @@ void PreferencesDialog::build()
option = Option (def,"show_incompatible_presets");
m_optgroup_general->append_single_option_line(option);
def.label = L("Single Instance");
def.type = coBool;
def.tooltip = L("If this is enabled, when staring PrusaSlicer and another instance is running, that instance will be reactivated instead.");
def.set_default_value(new ConfigOptionBool{ app_config->has("single_instance") ? app_config->get("single_instance") == "1" : false });
option = Option(def, "single_instance");
m_optgroup_general->append_single_option_line(option);
#if __APPLE__
def.label = L("Use Retina resolution for the 3D scene");
def.type = coBool;
@ -177,6 +184,8 @@ void PreferencesDialog::accept()
app_config->set(it->first, it->second);
}
app_config->save();
EndModal(wxID_OK);
// Nothify the UI to update itself from the ini file.