Trim Heavy Includes From GUI_App.hpp (#16841)

* Trim Heavy Includes from GUI_App.hpp

* Include winternl.h in the Windows Troubleshoot Dialog Code

The Windows builds failed in TroubleshootDialog.cpp with unknown type name NTSTATUS.
This commit is contained in:
HanifKoh authored and GitHub committed 2026-10-26 12:39:32 +08:00
1 parent 0fb11ef556
commit cbbe590230
15 files changed
+127 -93

No files matched your search

+1
View File
@@ -101,6 +101,7 @@ set(SLIC3R_GUI_SOURCES
GUI/ConfigValueFormatter.hpp
GUI/ConfigWizard.cpp
GUI/ConfigWizard.hpp
GUI/ConfigWizardTypes.hpp
GUI/ConfigWizard_private.hpp
GUI/ConnectPrinter.cpp
GUI/ConnectPrinter.hpp
+14 -13
View File
@@ -1,6 +1,7 @@
// FIXME: extract absolute units -> em
#include "ConfigWizard_private.hpp"
#include "ConfigWizardTypes.hpp"
#include "libslic3r_version.h"
#include <algorithm>
@@ -551,9 +552,9 @@ PageWelcome::PageWelcome(ConfigWizard *parent)
cbox_integrate->Hide();
}
void PageWelcome::set_run_reason(ConfigWizard::RunReason run_reason)
void PageWelcome::set_run_reason(RunReason run_reason)
{
const bool data_empty = run_reason == ConfigWizard::RR_DATA_EMPTY;
const bool data_empty = run_reason == RunReason::RR_DATA_EMPTY;
welcome_text->Show(data_empty);
cbox_reset->Show(!data_empty);
#if defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)
@@ -647,11 +648,11 @@ std::set<std::string> PagePrinters::get_selected_models()
return ret_set;
}
void PagePrinters::set_run_reason(ConfigWizard::RunReason run_reason)
void PagePrinters::set_run_reason(RunReason run_reason)
{
//Orca: add custom as default
if (is_primary_printer_page
&& (run_reason == ConfigWizard::RR_DATA_EMPTY || run_reason == ConfigWizard::RR_DATA_LEGACY)
&& (run_reason == RunReason::RR_DATA_EMPTY || run_reason == RunReason::RR_DATA_LEGACY)
&& printer_pickers.size() > 0
&& printer_pickers[0]->vendor_id == PresetBundle::ORCA_DEFAULT_BUNDLE) {
//printer_pickers[0]->select_one(0, true);
@@ -1929,18 +1930,18 @@ void ConfigWizard::priv::enable_next(bool enable)
btn_finish->Enable(enable);
}
void ConfigWizard::priv::set_start_page(ConfigWizard::StartPage start_page)
void ConfigWizard::priv::set_start_page(StartPage start_page)
{
switch (start_page) {
case ConfigWizard::SP_CUSTOM:
case StartPage::SP_CUSTOM:
index->go_to(page_custom);
btn_next->SetFocus();
break;
case ConfigWizard::SP_FILAMENTS:
case StartPage::SP_FILAMENTS:
index->go_to(page_filaments);
btn_finish->SetFocus();
break;
case ConfigWizard::SP_MATERIALS:
case StartPage::SP_MATERIALS:
index->go_to(page_sla_materials);
btn_finish->SetFocus();
break;
@@ -2455,18 +2456,18 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
bool snapshot = true;
Snapshot::Reason snapshot_reason = Snapshot::SNAPSHOT_UPGRADE;
switch (run_reason) {
case ConfigWizard::RR_DATA_EMPTY:
case RunReason::RR_DATA_EMPTY:
snapshot = false;
break;
case ConfigWizard::RR_DATA_LEGACY:
case RunReason::RR_DATA_LEGACY:
snapshot = true;
break;
case ConfigWizard::RR_DATA_INCOMPAT:
case RunReason::RR_DATA_INCOMPAT:
// In this case snapshot has already been taken by
// PresetUpdater with the appropriate reason
snapshot = false;
break;
case ConfigWizard::RR_USER:
case RunReason::RR_USER:
snapshot = false;
snapshot_reason = Snapshot::SNAPSHOT_USER;
break;
@@ -2798,7 +2799,7 @@ ConfigWizard::~ConfigWizard() {}
bool ConfigWizard::run(RunReason reason, StartPage start_page)
{
BOOST_LOG_TRIVIAL(info) << boost::format("Running ConfigWizard, reason: %1%, start_page: %2%") % reason % start_page;
BOOST_LOG_TRIVIAL(info) << boost::format("Running ConfigWizard, reason: %1%, start_page: %2%") % static_cast<int>(reason) % static_cast<int>(start_page);
GUI_App &app = wxGetApp();
+2 -18
View File
@@ -6,6 +6,7 @@
#include <wx/dialog.h>
#include <wx/string.h>
#include "ConfigWizardTypes.hpp"
#include "GUI_Utils.hpp"
namespace Slic3r {
@@ -19,23 +20,6 @@ namespace GUI {
class ConfigWizard: public DPIDialog
{
public:
// Why is the Wizard run
enum RunReason {
RR_DATA_EMPTY, // No or empty datadir
RR_DATA_LEGACY, // Pre-updating datadir
RR_DATA_INCOMPAT, // Incompatible datadir - Slic3r downgrade situation
RR_USER, // User requested the Wizard from the menus
};
// What page should wizard start on
enum StartPage {
SP_WELCOME,
SP_PRINTERS,
SP_FILAMENTS,
SP_MATERIALS,
SP_CUSTOM,
};
ConfigWizard(wxWindow *parent);
ConfigWizard(ConfigWizard &&) = delete;
ConfigWizard(const ConfigWizard &) = delete;
@@ -44,7 +28,7 @@ public:
~ConfigWizard();
// Run the Wizard. Return whether it was completed.
bool run(RunReason reason, StartPage start_page = SP_WELCOME);
bool run(RunReason reason, StartPage start_page = StartPage::SP_WELCOME);
static const wxString& name(const bool from_menu = false);
protected:
+25
View File
@@ -0,0 +1,25 @@
#pragma once
namespace Slic3r {
namespace GUI {
// Kept apart from ConfigWizard so GUI_App.hpp can name these without the wizard's dialog headers.
// Why is the Wizard run
enum class RunReason {
RR_DATA_EMPTY, // No or empty datadir
RR_DATA_LEGACY, // Pre-updating datadir
RR_DATA_INCOMPAT, // Incompatible datadir - Slic3r downgrade situation
RR_USER, // User requested the Wizard from the menus
};
// What page should wizard start on
enum class StartPage {
SP_WELCOME,
SP_PRINTERS,
SP_FILAMENTS,
SP_MATERIALS,
SP_CUSTOM,
};
}} // namespace Slic3r::GUI
+6 -5
View File
@@ -2,6 +2,7 @@
#define slic3r_ConfigWizard_private_hpp_
#include "ConfigWizard.hpp"
#include "ConfigWizardTypes.hpp"
#include <memory>
#include "libslic3r/Preset.hpp"
@@ -236,7 +237,7 @@ struct ConfigWizardPage: wxPanel
ConfigWizard::priv *wizard_p() const { return parent->p.get(); }
virtual void apply_custom_config(DynamicPrintConfig &config) {}
virtual void set_run_reason(ConfigWizard::RunReason run_reason) {}
virtual void set_run_reason(RunReason run_reason) {}
virtual void on_activate() {}
};
@@ -251,7 +252,7 @@ struct PageWelcome: ConfigWizardPage
bool reset_user_profile() const { return cbox_reset != nullptr ? cbox_reset->GetValue() : false; }
bool integrate_desktop() const { return cbox_integrate != nullptr ? cbox_integrate->GetValue() : false; }
virtual void set_run_reason(ConfigWizard::RunReason run_reason) override;
virtual void set_run_reason(RunReason run_reason) override;
};
struct PagePrinters: ConfigWizardPage //TO check
@@ -273,7 +274,7 @@ struct PagePrinters: ConfigWizardPage //TO check
std::string get_vendor_id() const { return printer_pickers.empty() ? "" : printer_pickers[0]->vendor_id; }
virtual void set_run_reason(ConfigWizard::RunReason run_reason) override;
virtual void set_run_reason(RunReason run_reason) override;
bool has_printers { false };
bool is_primary_printer_page { false };
@@ -540,7 +541,7 @@ typedef std::map<std::string, std::set<std::string>> PresetAliases;
struct ConfigWizard::priv
{
ConfigWizard *q;
ConfigWizard::RunReason run_reason = RR_USER;
RunReason run_reason = RunReason::RR_USER;
AppConfig appconfig_new; // Backing for vendor/model/variant and material selections in the GUI
BundleMap bundles; // Holds all loaded config bundles, the key is the vendor names.
// Materials refers to Presets in those bundles by pointers.
@@ -602,7 +603,7 @@ struct ConfigWizard::priv
void load_vendors();
void add_page(ConfigWizardPage *page);
void enable_next(bool enable);
void set_start_page(ConfigWizard::StartPage start_page);
void set_start_page(StartPage start_page);
void create_3rdparty_pages();
void set_run_reason(RunReason run_reason);
void update_materials(Technology technology);
+32 -22
View File
@@ -250,6 +250,7 @@
#include "slic3r/GUI/ActionRegistry.hpp"
#include "slic3r/GUI/Camera.hpp"
#include "slic3r/GUI/ConfigWizard.hpp"
#include "slic3r/GUI/ConfigWizardTypes.hpp"
#include "slic3r/GUI/Gizmos/GLGizmosManager.hpp"
#include "slic3r/GUI/HttpServer.hpp"
#include "slic3r/GUI/ImGuiWrapper.hpp"
@@ -1257,10 +1258,13 @@ GUI_App::GUI_App()
//, m_app_mode(mode)
, m_app_mode(EAppMode::Editor)
, m_em_unit(10)
, m_opengl_mgr(std::make_unique<OpenGLManager>())
, m_imgui(new ImGuiWrapper())
, m_removable_drive_manager(std::make_unique<RemovableDriveManager>())
, m_downloader(std::make_unique<Downloader>())
, m_other_instance_message_handler(std::make_unique<OtherInstanceMessageHandler>())
, m_http_server(std::make_unique<HttpServer>())
, m_action_registry(std::make_unique<ActionRegistry>())
{
//app config initializes early becasuse it is used in instance checking in OrcaSlicer.cpp
this->init_app_config();
@@ -1275,6 +1279,12 @@ GUI_App::GUI_App()
reset_to_active();
}
GLShaderProgram* GUI_App::get_shader(const std::string& shader_name) { return m_opengl_mgr->get_shader(shader_name); }
GLShaderProgram* GUI_App::get_current_shader() { return m_opengl_mgr->get_current_shader(); }
bool GUI_App::is_gl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const { return m_opengl_mgr->get_gl_info().is_version_greater_or_equal_to(major, minor); }
bool GUI_App::is_glsl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const { return m_opengl_mgr->get_gl_info().is_glsl_version_greater_or_equal_to(major, minor); }
void GUI_App::shutdown()
{
BOOST_LOG_TRIVIAL(info) << "GUI_App::shutdown enter";
@@ -2623,19 +2633,19 @@ std::string GUI_App::get_gl_info(bool for_github)
wxGLContext* GUI_App::init_glcontext(wxGLCanvas& canvas)
{
return m_opengl_mgr.init_glcontext(canvas, init_params != nullptr ? init_params->opengl_version : std::make_pair(0, 0),
return m_opengl_mgr->init_glcontext(canvas, init_params != nullptr ? init_params->opengl_version : std::make_pair(0, 0),
init_params != nullptr ? init_params->opengl_compatibility_profile : false, init_params != nullptr ? init_params->opengl_debug : false);
}
bool GUI_App::init_opengl()
{
#ifdef __linux__
bool status = m_opengl_mgr.init_gl();
bool status = m_opengl_mgr->init_gl();
if (status)
m_opengl_initialized = true;
return status;
#else
return m_opengl_mgr.init_gl();
return m_opengl_mgr->init_gl();
#endif
}
@@ -3613,7 +3623,7 @@ bool GUI_App::on_init_inner()
init_plugin_gui_wiring();
// Subscribe to the plugin loader and enumerate current actions (UI thread, once).
m_action_registry.init();
m_action_registry->init();
for (const std::string& plugin_key : plugin_mgr.get_enabled_plugin_keys()) {
if (!plugin_mgr.is_plugin_loaded(plugin_key)) {
@@ -8364,12 +8374,12 @@ void GUI_App::on_stealth_mode_enter()
void GUI_App::start_http_server(const std::string& provider)
{
m_http_server.set_request_handler([provider](const std::string& url) {
m_http_server->set_request_handler([provider](const std::string& url) {
return HttpServer::auth_handle_request(url, provider);
});
if (!m_http_server.is_started())
m_http_server.start();
if (!m_http_server->is_started())
m_http_server->start();
}
void GUI_App::start_http_server(int port, const std::string& provider)
@@ -8379,24 +8389,24 @@ void GUI_App::start_http_server(int port, const std::string& provider)
return;
}
m_http_server.set_request_handler([provider](const std::string& url) {
m_http_server->set_request_handler([provider](const std::string& url) {
return HttpServer::auth_handle_request(url, provider);
});
if (m_http_server.is_started()) {
if (m_http_server.get_port() == static_cast<boost::asio::ip::port_type>(port)) {
if (m_http_server->is_started()) {
if (m_http_server->get_port() == static_cast<boost::asio::ip::port_type>(port)) {
return;
}
m_http_server.stop();
m_http_server->stop();
}
m_http_server.set_port(static_cast<boost::asio::ip::port_type>(port));
m_http_server.start();
m_http_server->set_port(static_cast<boost::asio::ip::port_type>(port));
m_http_server->start();
}
void GUI_App::stop_http_server()
{
m_http_server.stop();
m_http_server->stop();
}
#ifdef __linux__
@@ -9172,7 +9182,7 @@ void GUI_App::open_preferences(PreferencesTab tab, const std::string& highlight_
}
// Built-in Speed Dial command titles are copied from the catalog at init and don't follow a
// live locale switch; rebuild them in the new language before the GUI (and palette) rebuilds.
m_action_registry.relocalize_builtins();
m_action_registry->relocalize_builtins();
}
if (need_recreate_gui)
@@ -9999,7 +10009,7 @@ bool GUI_App::may_switch_to_SLA_preset(const wxString& caption)
return true;
}
bool GUI_App::run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage start_page)
bool GUI_App::run_wizard(RunReason reason, StartPage start_page)
{
wxCHECK_MSG(mainframe != nullptr, false, "Internal error: Main frame not created / null");
@@ -10018,7 +10028,7 @@ bool GUI_App::run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage
}
#endif
//if (reason == ConfigWizard::RR_USER) {
//if (reason == RunReason::RR_USER) {
// //TODO: turn off it currently, maybe need to turn on in the future
// if (preset_updater->config_update(app_config->orig_version(), PresetUpdater::UpdateParams::FORCED_BEFORE_WIZARD) == PresetUpdater::R_ALL_CANCELED)
// return false;
@@ -10033,9 +10043,9 @@ bool GUI_App::run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage
pStyle = wxCAPTION | wxTAB_TRAVERSAL;
GuideFrame wizard(this, pStyle);
auto page = start_page == ConfigWizard::SP_WELCOME ? GuideFrame::BBL_WELCOME :
start_page == ConfigWizard::SP_FILAMENTS ? GuideFrame::BBL_FILAMENT_ONLY :
start_page == ConfigWizard::SP_PRINTERS ? GuideFrame::BBL_MODELS_ONLY :
auto page = start_page == StartPage::SP_WELCOME ? GuideFrame::BBL_WELCOME :
start_page == StartPage::SP_FILAMENTS ? GuideFrame::BBL_FILAMENT_ONLY :
start_page == StartPage::SP_PRINTERS ? GuideFrame::BBL_MODELS_ONLY :
GuideFrame::BBL_MODELS;
wizard.SetStartPage(page);
bool res = wizard.run();
@@ -10202,7 +10212,7 @@ bool GUI_App::config_wizard_startup()
{
if (!m_app_conf_exists || preset_bundle->printers.only_default_printers()) {
BOOST_LOG_TRIVIAL(info) << "run wizard...";
run_wizard(ConfigWizard::RR_DATA_EMPTY);
run_wizard(RunReason::RR_DATA_EMPTY);
BOOST_LOG_TRIVIAL(info) << "finished run wizard";
return true;
} /*else if (get_app_config()->legacy_datadir()) {
@@ -10212,7 +10222,7 @@ bool GUI_App::config_wizard_startup()
MsgDataLegacy dlg;
dlg.ShowModal();
run_wizard(ConfigWizard::RR_DATA_LEGACY);
run_wizard(RunReason::RR_DATA_LEGACY);
return true;
}*/
return false;
+23 -18
View File
@@ -5,6 +5,7 @@
#include <boost/algorithm/string/classification.hpp>
#include <atomic>
#include <boost/optional/optional.hpp>
#include <boost/thread/thread.hpp>
#include <chrono>
#include <cstdint>
#include <cstddef>
@@ -16,20 +17,13 @@
#include "libslic3r/Semver.hpp"
#include <memory>
#include <set>
#include "slic3r/GUI/GLShader.hpp"
#include <string>
#include "ActionRegistry.hpp"
#include "ImGuiWrapper.hpp"
#include "ConfigWizard.hpp"
#include "OpenGLManager.hpp"
#include "ConfigWizardTypes.hpp"
#include "libslic3r/Preset.hpp"
#include "libslic3r/PresetBundle.hpp"
#include "libslic3r_version.h"
#include "slic3r/GUI/UserNotification.hpp"
#include "slic3r/Utils/CloudProvider.hpp"
#include "slic3r/GUI/Jobs/UpgradeNetworkJob.hpp"
#include "slic3r/GUI/HttpServer.hpp"
#include "../Utils/PrintHost.hpp"
#include "libslic3r/Point.hpp"
#include <vector>
@@ -63,6 +57,8 @@ class wxMenuBar;
class wxTopLevelWindow;
class wxDataViewCtrl;
class wxBookCtrlBase;
class wxGLCanvas;
class wxGLContext;
// BBS
class Notebook;
struct wxLanguageInfo;
@@ -82,6 +78,8 @@ class MachineObject;
class NetworkAgent;
class IPrinterAgent;
class TaskManager;
class GLShaderProgram;
class PrintHostJobQueue;
// Same typedef as in bambu_networking.hpp, so this header need not include it.
typedef std::function<bool()> WasCancelledFn;
@@ -113,6 +111,13 @@ class NetworkErrorDialog;
class PluginsDialog;
class SpeedDialWebDialog;
class TerminalDialog;
class ActionRegistry;
class HttpServer;
class ImGuiWrapper;
class OpenGLManager;
class UpgradeNetworkJob;
typedef std::function<void(int status, int percent, bool& cancel)> InstallProgressFn;
enum FileType
@@ -306,7 +311,7 @@ private:
const wxLanguageInfo *m_language_info_best = nullptr;
wxString m_active_language_code;
OpenGLManager m_opengl_mgr;
std::unique_ptr<OpenGLManager> m_opengl_mgr;
std::unique_ptr<RemovableDriveManager> m_removable_drive_manager;
std::unique_ptr<ImGuiWrapper> m_imgui;
@@ -376,7 +381,7 @@ private:
uint64_t m_cloud_handoff_gen { 0 };
bool m_show_error_msgdlg{false};
wxString m_info_dialog_content;
HttpServer m_http_server;
std::unique_ptr<HttpServer> m_http_server;
bool m_show_gcode_window{true};
boost::thread m_check_network_thread;
public:
@@ -648,7 +653,7 @@ public:
PluginsDialog* m_plugins_dlg{nullptr};
SpeedDialWebDialog* m_speed_dial_dialog{nullptr};
TerminalDialog* m_terminal_dlg{nullptr};
ActionRegistry m_action_registry;
std::unique_ptr<ActionRegistry> m_action_registry;
void start_http_server(const std::string& provider = ORCA_CLOUD_PROVIDER);
@@ -727,7 +732,7 @@ public:
void install_local_plugin();
void open_terminal_dialog();
void open_speed_dial();
ActionRegistry& action_registry() { return m_action_registry; }
ActionRegistry& action_registry() { return *m_action_registry; }
void open_exportpresetbundledialog(size_t open_on_tab = 0, const std::string& highlight_option = std::string());
virtual bool OnExceptionInMainLoop() override;
// Calls wxLaunchDefaultBrowser if user confirms in dialog.
@@ -825,7 +830,7 @@ public:
void open_web_page_localized(const std::string &http_address);
bool may_switch_to_SLA_preset(const wxString& caption);
bool run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage start_page = ConfigWizard::SP_WELCOME);
bool run_wizard(RunReason reason, StartPage start_page = StartPage::SP_WELCOME);
void show_desktop_integration_dialog();
#if ENABLE_THUMBNAIL_GENERATOR_DEBUG
@@ -833,12 +838,12 @@ public:
void gcode_thumbnails_debug();
#endif // ENABLE_THUMBNAIL_GENERATOR_DEBUG
OpenGLManager& get_opengl_manager() { return m_opengl_mgr; }
GLShaderProgram* get_shader(const std::string& shader_name) { return m_opengl_mgr.get_shader(shader_name); }
GLShaderProgram* get_current_shader() { return m_opengl_mgr.get_current_shader(); }
OpenGLManager& get_opengl_manager() { return *m_opengl_mgr; }
GLShaderProgram* get_shader(const std::string& shader_name);
GLShaderProgram* get_current_shader();
bool is_gl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const { return m_opengl_mgr.get_gl_info().is_version_greater_or_equal_to(major, minor); }
bool is_glsl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const { return m_opengl_mgr.get_gl_info().is_glsl_version_greater_or_equal_to(major, minor); }
bool is_gl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const;
bool is_glsl_version_greater_or_equal_to(unsigned int major, unsigned int minor) const;
int GetSingleChoiceIndex(const wxString& message, const wxString& caption, const wxArrayString& choices, int initialSelection);
// extend is stl/3mf/gcode/step etc
+1 -1
View File
@@ -2,6 +2,7 @@
#include "EmbossStyleManager.hpp"
#include "slic3r/GUI/GLCanvas3D.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/ImGuiWrapper.hpp"
#include "slic3r/GUI/Shortcuts.hpp"
#include "slic3r/GUI/GUI_ObjectList.hpp"
#include "slic3r/GUI/Gizmos/GizmoObjectManipulation.hpp"
@@ -1625,7 +1626,6 @@ void GLGizmoEmboss::draw_window(float x, float y)
#include "slic3r/GUI/GUI_Geometry.hpp"
#include "slic3r/GUI/Gizmos/GLGizmoRotate.hpp"
#include "slic3r/GUI/Gizmos/GLGizmosManager.hpp"
#include "slic3r/GUI/ImGuiWrapper.hpp"
#include "slic3r/Utils/RaycastManager.hpp"
namespace Slic3r::GUI { struct Camera; }
+1
View File
@@ -1,6 +1,7 @@
#include "GLGizmoSVG.hpp"
#include "slic3r/GUI/GLCanvas3D.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/ImGuiWrapper.hpp"
#include "slic3r/GUI/GUI_ObjectList.hpp"
#include "slic3r/GUI/Gizmos/GizmoObjectManipulation.hpp"
#include "slic3r/GUI/MainFrame.hpp" // to update title when add text
@@ -1,6 +1,7 @@
#include "GLGizmoSimplify.hpp"
#include "slic3r/GUI/GLCanvas3D.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/ImGuiWrapper.hpp"
#include "slic3r/GUI/GUI_ObjectList.hpp"
#include "slic3r/GUI/MsgDialog.hpp"
#include "slic3r/GUI/NotificationManager.hpp"
+1
View File
@@ -6,6 +6,7 @@
#include "Camera.hpp"
#include "GUI_App.hpp"
#include "ImGuiWrapper.hpp"
#include "GLCanvas3D.hpp"
#include "Plater.hpp"
#include "NotificationManager.hpp"
+1
View File
@@ -51,6 +51,7 @@
#include <wx/time.h>
#include "GUI_App.hpp"
#include "slic3r/Utils/PrintHost.hpp"
#include "FilamentMapDialog.hpp"
#ifndef IMGUI_DEFINE_MATH_OPERATORS
+4 -3
View File
@@ -233,6 +233,7 @@
#include "SendMultiMachinePage.hpp"
#include "SendToPrinter.hpp"
#include "ConfigWizard.hpp"
#include "ConfigWizardTypes.hpp"
#include "SyncAmsInfoDialog.hpp"
#include "../Utils/ASCIIFolding.hpp"
#include "../Utils/UndoRedo.hpp"
@@ -2825,7 +2826,7 @@ Sidebar::Sidebar(Plater *parent)
p->m_printer_icon->Bind(wxEVT_BUTTON, [](wxCommandEvent& e) {
//auto wizard_t = new ConfigWizard(wxGetApp().mainframe);
//wizard_t->run(ConfigWizard::RR_USER, ConfigWizard::SP_CUSTOM);
//wizard_t->run(RunReason::RR_USER, StartPage::SP_CUSTOM);
});
// ORCA use connect button on titlebar
@@ -2848,7 +2849,7 @@ Sidebar::Sidebar(Plater *parent)
// p->editing_filament = -1;
// wxGetApp().params_dialog()->Popup();
// wxGetApp().get_tab(Preset::TYPE_FILAMENT)->restore_last_select_item();
wxGetApp().run_wizard(ConfigWizard::RR_USER, ConfigWizard::SP_PRINTERS);
wxGetApp().run_wizard(RunReason::RR_USER, StartPage::SP_PRINTERS);
});
wxBoxSizer* h_sizer_title = new wxBoxSizer(wxHORIZONTAL);
@@ -3378,7 +3379,7 @@ Sidebar::Sidebar(Plater *parent)
p->editing_filament = -1;
// wxGetApp().params_dialog()->Popup();
// wxGetApp().get_tab(Preset::TYPE_FILAMENT)->restore_last_select_item();
wxGetApp().run_wizard(ConfigWizard::RR_USER, ConfigWizard::SP_FILAMENTS);
wxGetApp().run_wizard(RunReason::RR_USER, StartPage::SP_FILAMENTS);
});
p->m_bpButton_set_filament = set_btn;
+14 -13
View File
@@ -63,6 +63,7 @@
#include "format.hpp"
#include "Tab.hpp"
#include "ConfigWizard.hpp"
#include "ConfigWizardTypes.hpp"
#include "../Utils/UndoRedo.hpp"
#include "BitmapCache.hpp"
#include "SavePresetDialog.hpp"
@@ -1005,9 +1006,9 @@ PlaterPresetComboBox::~PlaterPresetComboBox()
clr_picker->Destroy();
}
static void run_wizard(ConfigWizard::StartPage sp)
static void run_wizard(StartPage sp)
{
wxGetApp().run_wizard(ConfigWizard::RR_USER, sp);
wxGetApp().run_wizard(RunReason::RR_USER, sp);
}
void PlaterPresetComboBox::OnSelect(wxCommandEvent &evt)
@@ -1027,11 +1028,11 @@ void PlaterPresetComboBox::OnSelect(wxCommandEvent &evt)
//if (marker == LABEL_ITEM_WIZARD_PRINTERS)
// show_add_menu();
//else {
ConfigWizard::StartPage sp = ConfigWizard::SP_WELCOME;
StartPage sp = StartPage::SP_WELCOME;
switch (marker) {
case LABEL_ITEM_WIZARD_PRINTERS: sp = ConfigWizard::SP_PRINTERS; break;
case LABEL_ITEM_WIZARD_FILAMENTS: sp = ConfigWizard::SP_FILAMENTS; break;
case LABEL_ITEM_WIZARD_MATERIALS: sp = ConfigWizard::SP_MATERIALS; break;
case LABEL_ITEM_WIZARD_PRINTERS: sp = StartPage::SP_PRINTERS; break;
case LABEL_ITEM_WIZARD_FILAMENTS: sp = StartPage::SP_FILAMENTS; break;
case LABEL_ITEM_WIZARD_MATERIALS: sp = StartPage::SP_MATERIALS; break;
default: break;
}
wxTheApp->CallAfter([sp]() { run_wizard(sp); });
@@ -1126,7 +1127,7 @@ void PlaterPresetComboBox::show_add_menu()
append_menu_item(menu, wxID_ANY, _L("Add/Remove presets"), "",
[](wxCommandEvent&) {
wxTheApp->CallAfter([]() { run_wizard(ConfigWizard::SP_PRINTERS); });
wxTheApp->CallAfter([]() { run_wizard(StartPage::SP_PRINTERS); });
}, "menu_edit_preset", menu, []() { return true; }, wxGetApp().plater());
wxGetApp().plater()->PopupMenu(menu);
@@ -1151,7 +1152,7 @@ void PlaterPresetComboBox::show_edit_menu()
append_menu_item(menu, wxID_ANY, _L("Add/Remove presets"), "",
[](wxCommandEvent&) {
wxTheApp->CallAfter([]() { run_wizard(ConfigWizard::SP_PRINTERS); });
wxTheApp->CallAfter([]() { run_wizard(StartPage::SP_PRINTERS); });
}, "menu_edit_preset", menu, []() { return true; }, wxGetApp().plater());
wxGetApp().plater()->PopupMenu(menu);
@@ -1678,14 +1679,14 @@ void TabPresetComboBox::OnSelect(wxCommandEvent &evt)
if (marker >= LABEL_ITEM_DISABLED && marker < LABEL_ITEM_MAX) {
this->SetSelection(m_last_selected);
// BBS: Add/Remove filaments
ConfigWizard::StartPage sp = ConfigWizard::SP_WELCOME;
StartPage sp = StartPage::SP_WELCOME;
switch (marker) {
case LABEL_ITEM_WIZARD_PRINTERS: sp = ConfigWizard::SP_PRINTERS; break;
case LABEL_ITEM_WIZARD_FILAMENTS: sp = ConfigWizard::SP_FILAMENTS; break;
case LABEL_ITEM_WIZARD_MATERIALS: sp = ConfigWizard::SP_MATERIALS; break;
case LABEL_ITEM_WIZARD_PRINTERS: sp = StartPage::SP_PRINTERS; break;
case LABEL_ITEM_WIZARD_FILAMENTS: sp = StartPage::SP_FILAMENTS; break;
case LABEL_ITEM_WIZARD_MATERIALS: sp = StartPage::SP_MATERIALS; break;
default: break;
}
if (sp != ConfigWizard::SP_WELCOME) {
if (sp != StartPage::SP_WELCOME) {
wxTheApp->CallAfter([sp]() {
run_wizard(sp);
});
+1
View File
@@ -71,6 +71,7 @@
#include <windows.h>
#include <VersionHelpers.h>
#include <sysinfoapi.h>
#include <winternl.h>
#endif
#ifdef __LINUX__