mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-02 03:40:38 +08:00
Remove All mentions of downloads from wizard and preferences for DESKTOP_INTEGRATION = 0
cleanup - remove notification
This commit is contained in:
parent
40bc51e09d
commit
655e26b078
@ -1473,7 +1473,6 @@ PageDownloader::PageDownloader(ConfigWizard* parent)
|
|||||||
boldfont.SetWeight(wxFONTWEIGHT_BOLD);
|
boldfont.SetWeight(wxFONTWEIGHT_BOLD);
|
||||||
|
|
||||||
append_spacer(VERTICAL_SPACING);
|
append_spacer(VERTICAL_SPACING);
|
||||||
|
|
||||||
auto* box_allow_downloads = new wxCheckBox(this, wxID_ANY, _L("Allow built-in downloader"));
|
auto* box_allow_downloads = new wxCheckBox(this, wxID_ANY, _L("Allow built-in downloader"));
|
||||||
// TODO: Do we want it like this? The downloader is allowed for very first time the wizard is run.
|
// TODO: Do we want it like this? The downloader is allowed for very first time the wizard is run.
|
||||||
bool box_allow_value = (app_config->has("downloader_url_registered") ? app_config->get_bool("downloader_url_registered") : true);
|
bool box_allow_value = (app_config->has("downloader_url_registered") ? app_config->get_bool("downloader_url_registered") : true);
|
||||||
@ -2408,7 +2407,9 @@ void ConfigWizard::priv::load_pages()
|
|||||||
btn_finish->Enable(any_fff_selected || any_sla_selected || custom_printer_selected || custom_printer_in_bundle);
|
btn_finish->Enable(any_fff_selected || any_sla_selected || custom_printer_selected || custom_printer_in_bundle);
|
||||||
|
|
||||||
index->add_page(page_update);
|
index->add_page(page_update);
|
||||||
|
#if !defined(__linux__) || (defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION))
|
||||||
index->add_page(page_downloader);
|
index->add_page(page_downloader);
|
||||||
|
#endif
|
||||||
index->add_page(page_reload_from_disk);
|
index->add_page(page_reload_from_disk);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
index->add_page(page_files_association);
|
index->add_page(page_files_association);
|
||||||
@ -2775,12 +2776,12 @@ void ConfigWizard::priv::on_3rdparty_install(const VendorProfile *vendor, bool i
|
|||||||
bool ConfigWizard::priv::on_bnt_finish()
|
bool ConfigWizard::priv::on_bnt_finish()
|
||||||
{
|
{
|
||||||
wxBusyCursor wait;
|
wxBusyCursor wait;
|
||||||
|
#if !defined(__linux__) || (defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION))
|
||||||
if (!page_downloader->on_finish_downloader()) {
|
if (!page_downloader->on_finish_downloader()) {
|
||||||
index->go_to(page_downloader);
|
index->go_to(page_downloader);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* If some printers were added/deleted, but related MaterialPage wasn't activated,
|
/* If some printers were added/deleted, but related MaterialPage wasn't activated,
|
||||||
* than last changes wouldn't be updated for filaments/materials.
|
* than last changes wouldn't be updated for filaments/materials.
|
||||||
* SO, do that before check_and_install_missing_materials()
|
* SO, do that before check_and_install_missing_materials()
|
||||||
@ -3404,7 +3405,9 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
|
|||||||
|
|
||||||
|
|
||||||
p->add_page(p->page_update = new PageUpdate(this));
|
p->add_page(p->page_update = new PageUpdate(this));
|
||||||
|
#if !defined(__linux__) || (defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION))
|
||||||
p->add_page(p->page_downloader = new PageDownloader(this));
|
p->add_page(p->page_downloader = new PageDownloader(this));
|
||||||
|
#endif
|
||||||
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
|
||||||
p->add_page(p->page_files_association = new PageFilesAssociation(this));
|
p->add_page(p->page_files_association = new PageFilesAssociation(this));
|
||||||
|
@ -3158,6 +3158,9 @@ void GUI_App::show_desktop_integration_dialog()
|
|||||||
|
|
||||||
void GUI_App::show_downloader_registration_dialog()
|
void GUI_App::show_downloader_registration_dialog()
|
||||||
{
|
{
|
||||||
|
#if defined(__linux__) && !defined(SLIC3R_DESKTOP_INTEGRATION)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
InfoDialog msg(nullptr
|
InfoDialog msg(nullptr
|
||||||
, format_wxstr(_L("Welcome to %1% version %2%."), SLIC3R_APP_NAME, SLIC3R_VERSION)
|
, format_wxstr(_L("Welcome to %1% version %2%."), SLIC3R_APP_NAME, SLIC3R_VERSION)
|
||||||
, format_wxstr(_L(
|
, format_wxstr(_L(
|
||||||
@ -3169,10 +3172,10 @@ void GUI_App::show_downloader_registration_dialog()
|
|||||||
if (msg.ShowModal() == wxID_YES) {
|
if (msg.ShowModal() == wxID_YES) {
|
||||||
auto downloader_worker = new DownloaderUtils::Worker(nullptr);
|
auto downloader_worker = new DownloaderUtils::Worker(nullptr);
|
||||||
downloader_worker->perform_register(app_config->get("url_downloader_dest"));
|
downloader_worker->perform_register(app_config->get("url_downloader_dest"));
|
||||||
#if defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)
|
#if defined(__linux__)
|
||||||
if (downloader_worker->get_perform_registration_linux())
|
if (downloader_worker->get_perform_registration_linux())
|
||||||
DesktopIntegrationDialog::perform_downloader_desktop_integration();
|
DesktopIntegrationDialog::perform_downloader_desktop_integration();
|
||||||
#endif //(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)
|
#endif //(__linux__)
|
||||||
} else {
|
} else {
|
||||||
app_config->set("downloader_url_registered", "0");
|
app_config->set("downloader_url_registered", "0");
|
||||||
}
|
}
|
||||||
@ -3553,14 +3556,17 @@ void GUI_App::start_download(std::string url)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__APPLE__) || (defined(__linux__) && !defined(SLIC3R_DESKTOP_INTEGRATION))
|
// Windows register and deregister executable path to registry - cant get here when not registered
|
||||||
if (app_config && !app_config->get_bool("downloader_url_registered"))
|
// Apple registers via info.plist attached to exectable - might get here
|
||||||
{
|
// Linux registers via desktop integration file - might get here only if such file was created outside Slicer.
|
||||||
|
// Desktop integration is limited with SLIC3R_DESKTOP_INTEGRATION (cmake option).
|
||||||
|
#if defined(__APPLE__) || (defined(__linux__) && !defined(SLIC3R_DESKTOP_INTEGRATION))
|
||||||
|
if (app_config && app_config->get_bool("downloader_url_registered")) {
|
||||||
notification_manager()->push_notification(NotificationType::URLNotRegistered);
|
notification_manager()->push_notification(NotificationType::URLNotRegistered);
|
||||||
BOOST_LOG_TRIVIAL(error) << "Recieved command to open URL, but it is not allowed in app configuration. URL: " << url;
|
BOOST_LOG_TRIVIAL(error) << "Recieved command to open URL, but it is not allowed in app configuration. URL: " << url;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif //defined(__APPLE__) || (defined(__linux__) && !defined(SLIC3R_DESKTOP_INTEGRATION))
|
#endif //defined(__APPLE__) || (defined(__linux__) && !defined(SLIC3R_DESKTOP_INTEGRATION))
|
||||||
|
|
||||||
//lets always init so if the download dest folder was changed, new dest is used
|
//lets always init so if the download dest folder was changed, new dest is used
|
||||||
boost::filesystem::path dest_folder(app_config->get("url_downloader_dest"));
|
boost::filesystem::path dest_folder(app_config->get("url_downloader_dest"));
|
||||||
|
@ -126,7 +126,7 @@ enum class NotificationType
|
|||||||
ExportOngoing,
|
ExportOngoing,
|
||||||
// Progressbar of download from prusaslicer:// url
|
// Progressbar of download from prusaslicer:// url
|
||||||
URLDownload,
|
URLDownload,
|
||||||
// MacOS specific - PS comes forward even when downloader is not allowed
|
// MacOS and Linux flatpack (SLIC3R_DESKTOP_INTEGRATION = 0) specific - PS comes forward even when downloader is not allowed
|
||||||
URLNotRegistered,
|
URLNotRegistered,
|
||||||
// Config file was detected during startup, open wifi config dialog via hypertext
|
// Config file was detected during startup, open wifi config dialog via hypertext
|
||||||
WifiConfigFileDetected
|
WifiConfigFileDetected
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
#include "DesktopIntegrationDialog.hpp"
|
#include "DesktopIntegrationDialog.hpp"
|
||||||
#endif //(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)
|
#endif //(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)
|
||||||
|
|
||||||
|
#if defined(__linux__) && !defined(SLIC3R_DESKTOP_INTEGRATION)
|
||||||
|
#include "NotificationManager.hpp"
|
||||||
|
#endif //(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
static t_config_enum_names enum_names_from_keys_map(const t_config_enum_values& enum_keys_map)
|
static t_config_enum_names enum_names_from_keys_map(const t_config_enum_values& enum_keys_map)
|
||||||
@ -130,10 +134,10 @@ void PreferencesDialog::show(const std::string& highlight_opt_key /*= std::strin
|
|||||||
|
|
||||||
if (wxGetApp().is_editor()) {
|
if (wxGetApp().is_editor()) {
|
||||||
auto app_config = get_app_config();
|
auto app_config = get_app_config();
|
||||||
|
#if !defined(__linux__) || (defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION))
|
||||||
downloader->set_path_name(app_config->get("url_downloader_dest"));
|
downloader->set_path_name(app_config->get("url_downloader_dest"));
|
||||||
downloader->allow(!app_config->has("downloader_url_registered") || app_config->get_bool("downloader_url_registered"));
|
downloader->allow(!app_config->has("downloader_url_registered") || app_config->get_bool("downloader_url_registered"));
|
||||||
|
#endif
|
||||||
for (const std::string& opt_key : {"suppress_hyperlinks", "downloader_url_registered"})
|
for (const std::string& opt_key : {"suppress_hyperlinks", "downloader_url_registered"})
|
||||||
m_optgroup_other->set_value(opt_key, app_config->get_bool(opt_key));
|
m_optgroup_other->set_value(opt_key, app_config->get_bool(opt_key));
|
||||||
|
|
||||||
@ -640,15 +644,17 @@ void PreferencesDialog::build()
|
|||||||
//L("If enabled, the descriptions of configuration parameters in settings tabs wouldn't work as hyperlinks. "
|
//L("If enabled, the descriptions of configuration parameters in settings tabs wouldn't work as hyperlinks. "
|
||||||
// "If disabled, the descriptions of configuration parameters in settings tabs will work as hyperlinks."),
|
// "If disabled, the descriptions of configuration parameters in settings tabs will work as hyperlinks."),
|
||||||
app_config->get_bool("suppress_hyperlinks"));
|
app_config->get_bool("suppress_hyperlinks"));
|
||||||
|
#if !defined(__linux__) || (defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION))
|
||||||
append_bool_option(m_optgroup_other, "downloader_url_registered",
|
append_bool_option(m_optgroup_other, "downloader_url_registered",
|
||||||
L("Allow downloads from Printables.com"),
|
L("Allow downloads from Printables.com"),
|
||||||
L("If enabled, PrusaSlicer will be allowed to download from Printables.com"),
|
L("If enabled, PrusaSlicer will be allowed to download from Printables.com"),
|
||||||
app_config->get_bool("downloader_url_registered"));
|
app_config->get_bool("downloader_url_registered"));
|
||||||
|
#endif
|
||||||
|
|
||||||
activate_options_tab(m_optgroup_other);
|
activate_options_tab(m_optgroup_other);
|
||||||
|
#if !defined(__linux__) || (defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION))
|
||||||
create_downloader_path_sizer();
|
create_downloader_path_sizer();
|
||||||
|
#endif
|
||||||
create_settings_font_widget();
|
create_settings_font_widget();
|
||||||
|
|
||||||
#if ENABLE_ENVIRONMENT_MAP
|
#if ENABLE_ENVIRONMENT_MAP
|
||||||
@ -753,16 +759,18 @@ void PreferencesDialog::update_ctrls_alignment()
|
|||||||
|
|
||||||
void PreferencesDialog::accept(wxEvent&)
|
void PreferencesDialog::accept(wxEvent&)
|
||||||
{
|
{
|
||||||
|
#if !defined(__linux__) || (defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION))
|
||||||
if(wxGetApp().is_editor()) {
|
if(wxGetApp().is_editor()) {
|
||||||
if (const auto it = m_values.find("downloader_url_registered"); it != m_values.end())
|
if (const auto it = m_values.find("downloader_url_registered"); it != m_values.end())
|
||||||
downloader->allow(it->second == "1");
|
downloader->allow(it->second == "1");
|
||||||
if (!downloader->on_finish())
|
if (!downloader->on_finish())
|
||||||
return;
|
return;
|
||||||
#if defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)
|
#if defined(__linux__)
|
||||||
if( downloader->get_perform_registration_linux())
|
if( downloader->get_perform_registration_linux())
|
||||||
DesktopIntegrationDialog::perform_downloader_desktop_integration();
|
DesktopIntegrationDialog::perform_downloader_desktop_integration();
|
||||||
#endif //(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
std::vector<std::string> options_to_recreate_GUI = { "no_defaults", "tabs_as_menu", "sys_menu_enabled", "font_pt_size", "suppress_round_corners" };
|
std::vector<std::string> options_to_recreate_GUI = { "no_defaults", "tabs_as_menu", "sys_menu_enabled", "font_pt_size", "suppress_round_corners" };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user