From 59f6d75df762e46cd181acff87a0a98922063555 Mon Sep 17 00:00:00 2001 From: Aleksandr Dobkin Date: Wed, 11 Mar 2026 16:50:52 -0700 Subject: [PATCH] Revert extraneous changes. --- src/libslic3r/libslic3r_version.h.in | 1 - src/slic3r/GUI/GUI_App.cpp | 39 +++++----------------------- src/slic3r/GUI/GUI_App.hpp | 1 - src/slic3r/GUI/MainFrame.cpp | 3 --- src/slic3r/GUI/OptionsGroup.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 7 ++--- src/slic3r/GUI/Search.cpp | 20 ++++---------- 7 files changed, 14 insertions(+), 59 deletions(-) diff --git a/src/libslic3r/libslic3r_version.h.in b/src/libslic3r/libslic3r_version.h.in index df2a92f75b..750e092d28 100644 --- a/src/libslic3r/libslic3r_version.h.in +++ b/src/libslic3r/libslic3r_version.h.in @@ -5,7 +5,6 @@ #define SLIC3R_APP_KEY "@SLIC3R_APP_KEY@" #define SLIC3R_VERSION "@SLIC3R_VERSION@" #define SoftFever_VERSION "@SoftFever_VERSION@" -#define ZAA_VERSION "@ZAA_VERSION@" #ifndef GIT_COMMIT_HASH #define GIT_COMMIT_HASH "0000000" // 0000000 means uninitialized #endif diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 9f08cdcbbf..157b168372 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -2572,32 +2572,13 @@ void GUI_App::init_single_instance_checker(const std::string &name, const std::s m_single_instance_checker = std::make_unique(boost::nowide::widen(name), boost::nowide::widen(path)); } -bool GUI_App::CallOnInit() -{ - // Override wxApp::CallOnInit to catch exceptions from ~wxMacAutoreleasePool - try { - return wxApp::CallOnInit(); - } catch (const std::exception& e) { - BOOST_LOG_TRIVIAL(fatal) << "Exception in CallOnInit: " << e.what(); - return false; - } catch (...) { - // The app was initialized, just the autorelease pool cleanup threw. - // Return true to let the app continue. - return m_initialized; - } -} - bool GUI_App::OnInit() { try { return on_init_inner(); } catch (const std::exception& e) { BOOST_LOG_TRIVIAL(fatal) << "OnInit Got Fatal error: " << e.what(); - flush_logs(); - return false; - } catch (...) { - BOOST_LOG_TRIVIAL(fatal) << "OnInit caught non-std exception"; - flush_logs(); + generic_exception_handle(); return false; } } @@ -3420,16 +3401,8 @@ bool GUI_App::on_init_network(bool try_backup) Slic3r::NetworkAgentFactory::register_all_agents(); // m_agent = new Slic3r::NetworkAgent(data_directory); - try { - std::unique_ptr agent_ptr = Slic3r::create_agent_from_config(data_directory, app_config); - m_agent = agent_ptr.release(); - } catch (const std::exception& e) { - BOOST_LOG_TRIVIAL(error) << "Failed to create network agent: " << e.what(); - m_agent = nullptr; - } catch (...) { - BOOST_LOG_TRIVIAL(error) << "Failed to create network agent: unknown exception (code signing?)"; - m_agent = nullptr; - } + std::unique_ptr agent_ptr = Slic3r::create_agent_from_config(data_directory, app_config); + m_agent = agent_ptr.release(); if (!m_device_manager) m_device_manager = new Slic3r::DeviceManager(m_agent); @@ -5731,7 +5704,6 @@ std::string GUI_App::format_display_version() if (!version_display.empty()) return version_display; version_display = SoftFever_VERSION; - version_display += " / ZAA v" + std::string(ZAA_VERSION); return version_display; } @@ -6563,8 +6535,7 @@ void GUI_App::update_mode() mainframe->m_param_dialog->panel()->update_mode(); if (mainframe->m_printer_view) mainframe->m_printer_view->update_mode(); - if (mainframe->m_webview) - mainframe->m_webview->update_mode(); + mainframe->m_webview->update_mode(); #ifdef _MSW_DARK_MODE if (!wxGetApp().tabs_as_menu()) @@ -6576,6 +6547,8 @@ void GUI_App::update_mode() for (auto tab : model_tabs_list) tab->update_mode(); + //BBS plater()->update_menus(); + plater()->canvas3D()->update_gizmos_on_off_state(); } diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index fadd2ae24e..ae51add264 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -324,7 +324,6 @@ public: void on_start_subscribe_again(std::string dev_id); std::string get_local_models_path(); bool OnInit() override; - bool CallOnInit() override; int OnExit() override; bool initialized() const { return m_initialized; } inline bool is_enable_multi_machine() { return this->app_config&& this->app_config->get("enable_multi_machine") == "true"; } diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 74a7756b62..80b801a4c0 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1,7 +1,5 @@ #include "MainFrame.hpp" -#include -#include #include #include #include @@ -25,7 +23,6 @@ #include "libslic3r/PrintConfig.hpp" #include "libslic3r/SLAPrint.hpp" #include "libslic3r/PresetBundle.hpp" -#include "libslic3r/Utils.hpp" #include "Tab.hpp" #include "ProgressStatusBar.hpp" diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index b1cc8804e4..534646d593 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -622,7 +622,7 @@ void OptionsGroup::on_change_OG(const t_config_option_key& opt_id, const boost:: Option ConfigOptionsGroup::get_option(const std::string& opt_key, int opt_index /*= -1*/) { if (!m_config->has(opt_key)) { - // Option not in config — may be newly added (e.g. ZAA options) + std::cerr << "No " << opt_key << " in ConfigOptionsGroup config.\n"; } std::string opt_id = opt_index == -1 ? opt_key : opt_key + "#" + std::to_string(opt_index); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 18d2c13e5c..671d5674b6 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3846,7 +3846,7 @@ static std::vector get_search_inputs(ConfigOptionMode mode) auto& tabs_list = wxGetApp().tabs_list; auto print_tech = wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology(); for (auto tab : tabs_list) - if (tab && tab->supports_printer_technology(print_tech) && tab->get_config()) + if (tab->supports_printer_technology(print_tech)) ret.emplace_back(Search::InputInfo {tab->get_config(), tab->type(), mode}); return ret; @@ -3870,9 +3870,7 @@ void Sidebar::update_mode() //obj_list()->get_sizer()->Show(m_mode > comSimple); obj_list()->unselect_objects(); - // Guard: during startup the 3D canvas selection may not be fully initialized - if (wxGetApp().initialized()) - obj_list()->update_selections(); + obj_list()->update_selections(); // obj_list()->update_object_menu(); Layout(); @@ -10417,7 +10415,6 @@ void Plater::priv::set_project_name(const wxString& project_name) { BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << __LINE__ << " project is:" << project_name; m_project_name = project_name; - wxString name = project_name + " - OrcaSlicer-ZAA"; //update topbar title #ifdef __APPLE__ wxGetApp().mainframe->SetTitle(m_project_name); diff --git a/src/slic3r/GUI/Search.cpp b/src/slic3r/GUI/Search.cpp index db885c4310..1aef329297 100644 --- a/src/slic3r/GUI/Search.cpp +++ b/src/slic3r/GUI/Search.cpp @@ -70,7 +70,6 @@ static std::string get_key(const std::string &opt_key, Preset::Type type) { retu void OptionsSearcher::append_options(DynamicPrintConfig *config, Preset::Type type, ConfigOptionMode mode) { - if (!config) return; auto emplace = [this, type](const std::string key, const wxString &label) { const GroupAndCategory &gc = groups_and_categories[key]; if (gc.group.IsEmpty() || gc.category.IsEmpty()) return; @@ -90,19 +89,13 @@ void OptionsSearcher::append_options(DynamicPrintConfig *config, Preset::Type ty }; for (std::string opt_key : config->keys()) { - auto def_it = config->def()->options.find(opt_key); - if (def_it == config->def()->options.end()) { - continue; - } - const ConfigOptionDef &opt = def_it->second; + const ConfigOptionDef &opt = config->def()->options.at(opt_key); if (opt.mode > mode) continue; int cnt = 0; - if ((type == Preset::TYPE_SLA_MATERIAL || type == Preset::TYPE_PRINTER || type == Preset::TYPE_PRINT) && opt_key != "printable_area") { - const ConfigOption *opt_ptr = config->option(opt_key); - if (!opt_ptr) continue; - switch (opt_ptr->type()) { + if ((type == Preset::TYPE_SLA_MATERIAL || type == Preset::TYPE_PRINTER) && opt_key != "printable_area") + switch (config->option(opt_key)->type()) { case coInts: change_opt_key(opt_key, config, cnt); break; case coBools: change_opt_key(opt_key, config, cnt); break; case coFloats: change_opt_key(opt_key, config, cnt); break; @@ -113,7 +106,6 @@ void OptionsSearcher::append_options(DynamicPrintConfig *config, Preset::Type ty case coEnums: change_opt_key(opt_key, config, cnt); break; default: break; } - } wxString label = opt.full_label.empty() ? opt.label : opt.full_label; @@ -230,7 +222,7 @@ bool OptionsSearcher::search(const std::string &search, bool force /* = false*/, if (full_list) { std::string label = into_u8(get_label(opt)); //all - if (type == Preset::TYPE_INVALID) { + if (type == Preset::TYPE_INVALID) { found.emplace_back(FoundOption{label, label, into_u8(get_tooltip(opt)), i, 0}); } else if (type == opt.type){ found.emplace_back(FoundOption{label, label, into_u8(get_tooltip(opt)), i, 0}); @@ -297,9 +289,7 @@ OptionsSearcher::~OptionsSearcher() {} void OptionsSearcher::init(std::vector input_values) { options.clear(); - for (size_t idx = 0; idx < input_values.size(); ++idx) { - append_options(input_values[idx].config, input_values[idx].type, input_values[idx].mode); - } + for (auto i : input_values) append_options(i.config, i.type, i.mode); sort_options(); search(search_line, true, search_type);