Tech ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER - Disable association to 3mf and stl files if the application is run on Windows 8 or later
This commit is contained in:
parent
e6750a524f
commit
39cefdad89
5 changed files with 7865 additions and 7817 deletions
|
@ -81,6 +81,8 @@
|
||||||
#define ENABLE_USED_FILAMENT_POST_PROCESS (1 && ENABLE_2_5_0_ALPHA1)
|
#define ENABLE_USED_FILAMENT_POST_PROCESS (1 && ENABLE_2_5_0_ALPHA1)
|
||||||
// Enable gizmo grabbers to share common models
|
// Enable gizmo grabbers to share common models
|
||||||
#define ENABLE_GIZMO_GRABBER_REFACTOR (1 && ENABLE_2_5_0_ALPHA1)
|
#define ENABLE_GIZMO_GRABBER_REFACTOR (1 && ENABLE_2_5_0_ALPHA1)
|
||||||
|
// Disable association to 3mf and stl files if the application is run on Windows 8 or later
|
||||||
|
#define ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER (1 && ENABLE_2_5_0_ALPHA1)
|
||||||
|
|
||||||
|
|
||||||
#endif // _prusaslicer_technologies_h_
|
#endif // _prusaslicer_technologies_h_
|
||||||
|
|
|
@ -1934,6 +1934,9 @@ void ConfigWizard::priv::load_pages()
|
||||||
index->add_page(page_update);
|
index->add_page(page_update);
|
||||||
index->add_page(page_reload_from_disk);
|
index->add_page(page_reload_from_disk);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
if (page_files_association != nullptr)
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
index->add_page(page_files_association);
|
index->add_page(page_files_association);
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
index->add_page(page_mode);
|
index->add_page(page_mode);
|
||||||
|
@ -2747,6 +2750,9 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
|
||||||
app_config->set("export_sources_full_pathnames", page_reload_from_disk->full_pathnames ? "1" : "0");
|
app_config->set("export_sources_full_pathnames", page_reload_from_disk->full_pathnames ? "1" : "0");
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
if (page_files_association != nullptr) {
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
app_config->set("associate_3mf", page_files_association->associate_3mf() ? "1" : "0");
|
app_config->set("associate_3mf", page_files_association->associate_3mf() ? "1" : "0");
|
||||||
app_config->set("associate_stl", page_files_association->associate_stl() ? "1" : "0");
|
app_config->set("associate_stl", page_files_association->associate_stl() ? "1" : "0");
|
||||||
// app_config->set("associate_gcode", page_files_association->associate_gcode() ? "1" : "0");
|
// app_config->set("associate_gcode", page_files_association->associate_gcode() ? "1" : "0");
|
||||||
|
@ -2761,6 +2767,14 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
|
||||||
// if (page_files_association->associate_gcode())
|
// if (page_files_association->associate_gcode())
|
||||||
// wxGetApp().associate_gcode_files();
|
// wxGetApp().associate_gcode_files();
|
||||||
// }
|
// }
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
app_config->set("associate_3mf", "0");
|
||||||
|
app_config->set("associate_stl", "0");
|
||||||
|
// app_config->set("associate_gcode", "0");
|
||||||
|
}
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
|
@ -2921,6 +2935,10 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
|
||||||
p->add_page(p->page_update = new PageUpdate(this));
|
p->add_page(p->page_update = new PageUpdate(this));
|
||||||
p->add_page(p->page_reload_from_disk = new PageReloadFromDisk(this));
|
p->add_page(p->page_reload_from_disk = new PageReloadFromDisk(this));
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
// file association is not possible anymore starting with Win 8
|
||||||
|
if (wxPlatformInfo::Get().GetOSMajorVersion() < 8)
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
p->add_page(p->page_files_association = new PageFilesAssociation(this));
|
p->add_page(p->page_files_association = new PageFilesAssociation(this));
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
p->add_page(p->page_mode = new PageMode(this));
|
p->add_page(p->page_mode = new PageMode(this));
|
||||||
|
|
|
@ -1203,10 +1203,17 @@ bool GUI_App::on_init_inner()
|
||||||
|
|
||||||
if (is_editor()) {
|
if (is_editor()) {
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
// file association is not possible anymore starting with Win 8
|
||||||
|
if (wxPlatformInfo::Get().GetOSMajorVersion() < 8) {
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
if (app_config->get("associate_3mf") == "1")
|
if (app_config->get("associate_3mf") == "1")
|
||||||
associate_3mf_files();
|
associate_3mf_files();
|
||||||
if (app_config->get("associate_stl") == "1")
|
if (app_config->get("associate_stl") == "1")
|
||||||
associate_stl_files();
|
associate_stl_files();
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
}
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
#endif // __WXMSW__
|
#endif // __WXMSW__
|
||||||
|
|
||||||
preset_updater = new PresetUpdater();
|
preset_updater = new PresetUpdater();
|
||||||
|
@ -1244,8 +1251,15 @@ bool GUI_App::on_init_inner()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
// file association is not possible anymore starting with Win 8
|
||||||
|
if (wxPlatformInfo::Get().GetOSMajorVersion() < 8) {
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
if (app_config->get("associate_gcode") == "1")
|
if (app_config->get("associate_gcode") == "1")
|
||||||
associate_gcode_files();
|
associate_gcode_files();
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
}
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
#endif // __WXMSW__
|
#endif // __WXMSW__
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2418,6 +2432,10 @@ void GUI_App::open_preferences(const std::string& highlight_option /*= std::stri
|
||||||
this->plater_->refresh_print();
|
this->plater_->refresh_print();
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
// file association is not possible anymore starting with Win 8
|
||||||
|
if (wxPlatformInfo::Get().GetOSMajorVersion() < 8) {
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
if (is_editor()) {
|
if (is_editor()) {
|
||||||
if (app_config->get("associate_3mf") == "1")
|
if (app_config->get("associate_3mf") == "1")
|
||||||
associate_3mf_files();
|
associate_3mf_files();
|
||||||
|
@ -2428,6 +2446,9 @@ void GUI_App::open_preferences(const std::string& highlight_option /*= std::stri
|
||||||
if (app_config->get("associate_gcode") == "1")
|
if (app_config->get("associate_gcode") == "1")
|
||||||
associate_gcode_files();
|
associate_gcode_files();
|
||||||
}
|
}
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
}
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
if (mainframe->preferences_dialog->settings_layout_changed()) {
|
if (mainframe->preferences_dialog->settings_layout_changed()) {
|
||||||
|
|
|
@ -230,6 +230,10 @@ void PreferencesDialog::build()
|
||||||
app_config->get("export_sources_full_pathnames") == "1");
|
app_config->get("export_sources_full_pathnames") == "1");
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
// file association is not possible anymore starting with Win 8
|
||||||
|
if (wxPlatformInfo::Get().GetOSMajorVersion() < 8) {
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
// Please keep in sync with ConfigWizard
|
// Please keep in sync with ConfigWizard
|
||||||
append_bool_option(m_optgroup_general, "associate_3mf",
|
append_bool_option(m_optgroup_general, "associate_3mf",
|
||||||
L("Associate .3mf files to PrusaSlicer"),
|
L("Associate .3mf files to PrusaSlicer"),
|
||||||
|
@ -240,6 +244,9 @@ void PreferencesDialog::build()
|
||||||
L("Associate .stl files to PrusaSlicer"),
|
L("Associate .stl files to PrusaSlicer"),
|
||||||
L("If enabled, sets PrusaSlicer as default application to open .stl files."),
|
L("If enabled, sets PrusaSlicer as default application to open .stl files."),
|
||||||
app_config->get("associate_stl") == "1");
|
app_config->get("associate_stl") == "1");
|
||||||
|
#if ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
|
}
|
||||||
|
#endif // ENABLE_REMOVE_ASSOCIATION_TO_FILE_FOR_WINDOWS_8_AND_LATER
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
m_optgroup_general->append_separator();
|
m_optgroup_general->append_separator();
|
||||||
|
|
Loading…
Reference in a new issue