diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 370ab33d68..cecb8f4acd 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -1518,11 +1518,11 @@ PageDownloader::PageDownloader(ConfigWizard* parent) )); } -#ifdef __linux__ +#if defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) append_text(wxString::Format(_L( "On Linux systems the process of registration also creates desktop integration files for this version of application." ))); -#endif +#endif //(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) box_allow_downloads->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent& event) { this->m_downloader->allow(event.IsChecked()); }); @@ -1582,7 +1582,7 @@ bool DownloaderUtils::Worker::perform_register(const std::string& path_override/ #elif __APPLE__ // Apple registers for custom url in info.plist thus it has to be already registered since build. // The url will always trigger opening of prusaslicer and we have to check that user has allowed it. (GUI_App::MacOpenURL is the triggered method) -#else +#elif defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) // the performation should be called later during desktop integration perform_registration_linux = true; #endif @@ -1600,7 +1600,7 @@ void DownloaderUtils::Worker::deregister() key_full = key_string; #elif __APPLE__ // TODO -#else +#elif defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) BOOST_LOG_TRIVIAL(debug) << "DesktopIntegrationDialog::undo_downloader_registration"; DesktopIntegrationDialog::undo_downloader_registration(); perform_registration_linux = false; @@ -3063,14 +3063,14 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese if ((check_unsaved_preset_changes = install_bundles.size() > 0)) header = _L_PLURAL("A new vendor was installed and one of its printers will be activated", "New vendors were installed and one of theirs printers will be activated", install_bundles.size()); -#ifdef __linux__ +#if defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) // Desktop integration on Linux BOOST_LOG_TRIVIAL(debug) << "ConfigWizard::priv::apply_config integrate_desktop" << page_welcome->integrate_desktop() << " perform_registration_linux " << page_downloader->m_downloader->get_perform_registration_linux(); if (page_welcome->integrate_desktop()) DesktopIntegrationDialog::perform_desktop_integration(); if (page_downloader->m_downloader->get_perform_registration_linux()) DesktopIntegrationDialog::perform_downloader_desktop_integration(); -#endif +#endif //(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) // Decide whether to create snapshot based on run_reason and the reset profile checkbox bool snapshot = true; diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 4ade379083..7ed36aee3e 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -3175,10 +3175,10 @@ void GUI_App::show_downloader_registration_dialog() if (msg.ShowModal() == wxID_YES) { auto downloader_worker = new DownloaderUtils::Worker(nullptr); downloader_worker->perform_register(app_config->get("url_downloader_dest")); -#ifdef __linux__ +#if defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) if (downloader_worker->get_perform_registration_linux()) DesktopIntegrationDialog::perform_downloader_desktop_integration(); -#endif // __linux__ +#endif //(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) } else { app_config->set("downloader_url_registered", "0"); } diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index 37e3422c59..979ac11d30 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -1,11 +1,11 @@ -///|/ Copyright (c) Prusa Research 2018 - 2023 Oleksandra Iushchenko @YuSanka, David Kocík @kocikdav, Vojtěch Bubník @bubnikv, Pavel Mikuš @Godrak, Enrico Turri @enricoturri1966, Lukáš Matěna @lukasmatena, Vojtěch Král @vojtechkral -///|/ -///|/ ported from lib/Slic3r/GUI/Preferences.pm: -///|/ Copyright (c) Prusa Research 2016 - 2018 Vojtěch Bubník @bubnikv -///|/ Copyright (c) Slic3r 2013 - 2014 Alessandro Ranellucci @alranel -///|/ -///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher -///|/ +///|/ Copyright (c) Prusa Research 2018 - 2023 Oleksandra Iushchenko @YuSanka, David Kocík @kocikdav, Vojtěch Bubník @bubnikv, Pavel Mikuš @Godrak, Enrico Turri @enricoturri1966, Lukáš Matěna @lukasmatena, Vojtěch Král @vojtechkral +///|/ +///|/ ported from lib/Slic3r/GUI/Preferences.pm: +///|/ Copyright (c) Prusa Research 2016 - 2018 Vojtěch Bubník @bubnikv +///|/ Copyright (c) Slic3r 2013 - 2014 Alessandro Ranellucci @alranel +///|/ +///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher +///|/ #include "Preferences.hpp" #include "OptionsGroup.hpp" #include "GUI_App.hpp" @@ -28,9 +28,9 @@ #ifdef WIN32 #include #endif // WIN32 -#ifdef __linux__ +#if defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) #include "DesktopIntegrationDialog.hpp" -#endif //__linux__ +#endif //(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) namespace Slic3r { @@ -758,10 +758,10 @@ void PreferencesDialog::accept(wxEvent&) downloader->allow(it->second == "1"); if (!downloader->on_finish()) return; -#ifdef __linux__ +#if defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) if( downloader->get_perform_registration_linux()) DesktopIntegrationDialog::perform_downloader_desktop_integration(); -#endif // __linux__ +#endif //(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION) } std::vector options_to_recreate_GUI = { "no_defaults", "tabs_as_menu", "sys_menu_enabled", "font_pt_size", "suppress_round_corners" };