mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 00:37:51 -06:00
GCode viewer using the proper layout when started as a standalone application
This commit is contained in:
parent
8579184d70
commit
ab556a398b
16 changed files with 341 additions and 115 deletions
BIN
resources/icons/PrusaSlicer-gcodeviewer_128px.png
Normal file
BIN
resources/icons/PrusaSlicer-gcodeviewer_128px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
|
@ -534,7 +534,11 @@ int CLI::run(int argc, char **argv)
|
||||||
if (start_gui) {
|
if (start_gui) {
|
||||||
#ifdef SLIC3R_GUI
|
#ifdef SLIC3R_GUI
|
||||||
// #ifdef USE_WX
|
// #ifdef USE_WX
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
GUI::GUI_App* gui = new GUI::GUI_App(start_as_gcodeviewer ? GUI::GUI_App::EAppMode::GCodeViewer : GUI::GUI_App::EAppMode::Editor);
|
||||||
|
#else
|
||||||
GUI::GUI_App *gui = new GUI::GUI_App();
|
GUI::GUI_App *gui = new GUI::GUI_App();
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
bool gui_single_instance_setting = gui->app_config->get("single_instance") == "1";
|
bool gui_single_instance_setting = gui->app_config->get("single_instance") == "1";
|
||||||
if (Slic3r::instance_check(argc, argv, gui_single_instance_setting)) {
|
if (Slic3r::instance_check(argc, argv, gui_single_instance_setting)) {
|
||||||
|
|
|
@ -179,6 +179,11 @@ std::string AppConfig::load()
|
||||||
|
|
||||||
void AppConfig::save()
|
void AppConfig::save()
|
||||||
{
|
{
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (!m_save_enabled)
|
||||||
|
return;
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
// The config is first written to a file with a PID suffix and then moved
|
// The config is first written to a file with a PID suffix and then moved
|
||||||
// to avoid race conditions with multiple instances of Slic3r
|
// to avoid race conditions with multiple instances of Slic3r
|
||||||
const auto path = config_path();
|
const auto path = config_path();
|
||||||
|
|
|
@ -18,6 +18,9 @@ public:
|
||||||
AppConfig() :
|
AppConfig() :
|
||||||
m_dirty(false),
|
m_dirty(false),
|
||||||
m_orig_version(Semver::invalid()),
|
m_orig_version(Semver::invalid()),
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
m_save_enabled(true),
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
m_legacy_datadir(false)
|
m_legacy_datadir(false)
|
||||||
{
|
{
|
||||||
this->reset();
|
this->reset();
|
||||||
|
@ -157,6 +160,10 @@ public:
|
||||||
bool get_mouse_device_swap_yz(const std::string& name, bool& swap) const
|
bool get_mouse_device_swap_yz(const std::string& name, bool& swap) const
|
||||||
{ return get_3dmouse_device_numeric_value(name, "swap_yz", swap); }
|
{ return get_3dmouse_device_numeric_value(name, "swap_yz", swap); }
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
void enable_save(bool enable) { m_save_enabled = enable; }
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
static const std::string SECTION_FILAMENTS;
|
static const std::string SECTION_FILAMENTS;
|
||||||
static const std::string SECTION_MATERIALS;
|
static const std::string SECTION_MATERIALS;
|
||||||
|
|
||||||
|
@ -183,6 +190,10 @@ private:
|
||||||
bool m_dirty;
|
bool m_dirty;
|
||||||
// Original version found in the ini file before it was overwritten
|
// Original version found in the ini file before it was overwritten
|
||||||
Semver m_orig_version;
|
Semver m_orig_version;
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
// Whether or not calls to save() should take effect
|
||||||
|
bool m_save_enabled;
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
// Whether the existing version is before system profiles & configuration updating
|
// Whether the existing version is before system profiles & configuration updating
|
||||||
bool m_legacy_datadir;
|
bool m_legacy_datadir;
|
||||||
};
|
};
|
||||||
|
|
|
@ -59,5 +59,6 @@
|
||||||
#define ENABLE_GCODE_VIEWER_STATISTICS (0 && ENABLE_GCODE_VIEWER)
|
#define ENABLE_GCODE_VIEWER_STATISTICS (0 && ENABLE_GCODE_VIEWER)
|
||||||
#define ENABLE_GCODE_VIEWER_DATA_CHECKING (0 && ENABLE_GCODE_VIEWER)
|
#define ENABLE_GCODE_VIEWER_DATA_CHECKING (0 && ENABLE_GCODE_VIEWER)
|
||||||
#define ENABLE_GCODE_VIEWER_TASKBAR_ICON (0 && ENABLE_GCODE_VIEWER)
|
#define ENABLE_GCODE_VIEWER_TASKBAR_ICON (0 && ENABLE_GCODE_VIEWER)
|
||||||
|
#define ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION (1 && ENABLE_GCODE_VIEWER)
|
||||||
|
|
||||||
#endif // _prusaslicer_technologies_h_
|
#endif // _prusaslicer_technologies_h_
|
||||||
|
|
|
@ -339,7 +339,11 @@ void GCodeViewer::load(const GCodeProcessor::Result& gcode_result, const Print&
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
load_toolpaths(gcode_result);
|
load_toolpaths(gcode_result);
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_editor())
|
||||||
|
#else
|
||||||
if (wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer)
|
if (wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer)
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
load_shells(print, initialized);
|
load_shells(print, initialized);
|
||||||
else {
|
else {
|
||||||
Pointfs bed_shape;
|
Pointfs bed_shape;
|
||||||
|
@ -875,7 +879,11 @@ void GCodeViewer::load_toolpaths(const GCodeProcessor::Result& gcode_result)
|
||||||
|
|
||||||
for (size_t i = 0; i < m_vertices_count; ++i) {
|
for (size_t i = 0; i < m_vertices_count; ++i) {
|
||||||
const GCodeProcessor::MoveVertex& move = gcode_result.moves[i];
|
const GCodeProcessor::MoveVertex& move = gcode_result.moves[i];
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_gcode_viewer())
|
||||||
|
#else
|
||||||
if (wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer)
|
if (wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer)
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
// for the gcode viewer we need all moves to correctly size the printbed
|
// for the gcode viewer we need all moves to correctly size the printbed
|
||||||
m_paths_bounding_box.merge(move.position.cast<double>());
|
m_paths_bounding_box.merge(move.position.cast<double>());
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -2732,7 +2732,11 @@ static void load_gcode_retractions(const GCodePreviewData::Retraction& retractio
|
||||||
void GLCanvas3D::load_gcode_preview(const GCodeProcessor::Result& gcode_result)
|
void GLCanvas3D::load_gcode_preview(const GCodeProcessor::Result& gcode_result)
|
||||||
{
|
{
|
||||||
m_gcode_viewer.load(gcode_result, *this->fff_print(), m_initialized);
|
m_gcode_viewer.load(gcode_result, *this->fff_print(), m_initialized);
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_editor())
|
||||||
|
#else
|
||||||
if (wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer)
|
if (wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer)
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
_show_warning_texture_if_needed(WarningTexture::ToolpathOutside);
|
_show_warning_texture_if_needed(WarningTexture::ToolpathOutside);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4302,7 +4306,11 @@ void GLCanvas3D::update_ui_from_settings()
|
||||||
#endif // ENABLE_RETINA_GL
|
#endif // ENABLE_RETINA_GL
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_editor())
|
||||||
|
#else
|
||||||
if (wxGetApp().mainframe != nullptr && wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer)
|
if (wxGetApp().mainframe != nullptr && wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer)
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
wxGetApp().plater()->get_collapse_toolbar().set_enabled(wxGetApp().app_config->get("show_collapse_button") == "1");
|
wxGetApp().plater()->get_collapse_toolbar().set_enabled(wxGetApp().app_config->get("show_collapse_button") == "1");
|
||||||
#else
|
#else
|
||||||
bool enable_collapse = wxGetApp().app_config->get("show_collapse_button") == "1";
|
bool enable_collapse = wxGetApp().app_config->get("show_collapse_button") == "1";
|
||||||
|
@ -5405,7 +5413,11 @@ void GLCanvas3D::_render_background() const
|
||||||
{
|
{
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
bool use_error_color = false;
|
bool use_error_color = false;
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_editor()) {
|
||||||
|
#else
|
||||||
if (wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer) {
|
if (wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer) {
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
use_error_color = m_dynamic_background_enabled;
|
use_error_color = m_dynamic_background_enabled;
|
||||||
if (!m_volumes.empty())
|
if (!m_volumes.empty())
|
||||||
use_error_color &= _is_any_volume_outside();
|
use_error_color &= _is_any_volume_outside();
|
||||||
|
@ -7134,7 +7146,11 @@ void GLCanvas3D::_show_warning_texture_if_needed(WarningTexture::Warning warning
|
||||||
if (!m_volumes.empty())
|
if (!m_volumes.empty())
|
||||||
show = _is_any_volume_outside();
|
show = _is_any_volume_outside();
|
||||||
else {
|
else {
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_editor()) {
|
||||||
|
#else
|
||||||
if (wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer) {
|
if (wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer) {
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
BoundingBoxf3 test_volume = (m_config != nullptr) ? print_volume(*m_config) : BoundingBoxf3();
|
BoundingBoxf3 test_volume = (m_config != nullptr) ? print_volume(*m_config) : BoundingBoxf3();
|
||||||
const BoundingBoxf3& paths_volume = m_gcode_viewer.get_paths_bounding_box();
|
const BoundingBoxf3& paths_volume = m_gcode_viewer.get_paths_bounding_box();
|
||||||
if (test_volume.radius() > 0.0 && paths_volume.radius() > 0.0)
|
if (test_volume.radius() > 0.0 && paths_volume.radius() > 0.0)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include "libslic3r/Technologies.hpp"
|
||||||
#include "GUI_App.hpp"
|
#include "GUI_App.hpp"
|
||||||
#include "GUI_ObjectList.hpp"
|
#include "GUI_ObjectList.hpp"
|
||||||
#include "GUI_ObjectManipulation.hpp"
|
#include "GUI_ObjectManipulation.hpp"
|
||||||
|
@ -309,8 +310,15 @@ static void generic_exception_handle()
|
||||||
|
|
||||||
IMPLEMENT_APP(GUI_App)
|
IMPLEMENT_APP(GUI_App)
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
GUI_App::GUI_App(EAppMode mode)
|
||||||
|
#else
|
||||||
GUI_App::GUI_App()
|
GUI_App::GUI_App()
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
: wxApp()
|
: wxApp()
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
, m_app_mode(mode)
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
, m_em_unit(10)
|
, m_em_unit(10)
|
||||||
, m_imgui(new ImGuiWrapper())
|
, m_imgui(new ImGuiWrapper())
|
||||||
, m_wizard(nullptr)
|
, m_wizard(nullptr)
|
||||||
|
@ -366,6 +374,12 @@ void GUI_App::init_app_config()
|
||||||
if (!app_config)
|
if (!app_config)
|
||||||
app_config = new AppConfig();
|
app_config = new AppConfig();
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (is_gcode_viewer())
|
||||||
|
// disable config save to avoid to mess it up for the editor
|
||||||
|
app_config->enable_save(false);
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
// load settings
|
// load settings
|
||||||
app_conf_exists = app_config->exists();
|
app_conf_exists = app_config->exists();
|
||||||
if (app_conf_exists) {
|
if (app_conf_exists) {
|
||||||
|
@ -441,20 +455,26 @@ bool GUI_App::on_init_inner()
|
||||||
// supplied as argument to --datadir; in that case we should still run the wizard
|
// supplied as argument to --datadir; in that case we should still run the wizard
|
||||||
preset_bundle->setup_directories();
|
preset_bundle->setup_directories();
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (is_editor()) {
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
associate_3mf_files();
|
associate_3mf_files();
|
||||||
#endif // __WXMSW__
|
#endif // __WXMSW__
|
||||||
|
|
||||||
preset_updater = new PresetUpdater();
|
preset_updater = new PresetUpdater();
|
||||||
Bind(EVT_SLIC3R_VERSION_ONLINE, [this](const wxCommandEvent &evt) {
|
Bind(EVT_SLIC3R_VERSION_ONLINE, [this](const wxCommandEvent& evt) {
|
||||||
app_config->set("version_online", into_u8(evt.GetString()));
|
app_config->set("version_online", into_u8(evt.GetString()));
|
||||||
app_config->save();
|
app_config->save();
|
||||||
if(this->plater_ != nullptr) {
|
if (this->plater_ != nullptr) {
|
||||||
if (*Semver::parse(SLIC3R_VERSION) < * Semver::parse(into_u8(evt.GetString()))) {
|
if (*Semver::parse(SLIC3R_VERSION) < *Semver::parse(into_u8(evt.GetString()))) {
|
||||||
this->plater_->get_notification_manager()->push_notification(NotificationType::NewAppAviable, *(this->plater_->get_current_canvas3D()));
|
this->plater_->get_notification_manager()->push_notification(NotificationType::NewAppAviable, *(this->plater_->get_current_canvas3D()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
}
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
// initialize label colors and fonts
|
// initialize label colors and fonts
|
||||||
init_label_colours();
|
init_label_colours();
|
||||||
|
@ -484,6 +504,10 @@ bool GUI_App::on_init_inner()
|
||||||
// application frame
|
// application frame
|
||||||
if (wxImage::FindHandler(wxBITMAP_TYPE_PNG) == nullptr)
|
if (wxImage::FindHandler(wxBITMAP_TYPE_PNG) == nullptr)
|
||||||
wxImage::AddHandler(new wxPNGHandler());
|
wxImage::AddHandler(new wxPNGHandler());
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (is_editor())
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
scrn->SetText(_L("Creating settings tabs..."));
|
scrn->SetText(_L("Creating settings tabs..."));
|
||||||
|
|
||||||
mainframe = new MainFrame();
|
mainframe = new MainFrame();
|
||||||
|
@ -519,6 +543,9 @@ bool GUI_App::on_init_inner()
|
||||||
static bool once = true;
|
static bool once = true;
|
||||||
if (once) {
|
if (once) {
|
||||||
once = false;
|
once = false;
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (preset_updater != nullptr) {
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
check_updates(false);
|
check_updates(false);
|
||||||
|
|
||||||
CallAfter([this] {
|
CallAfter([this] {
|
||||||
|
@ -526,6 +553,10 @@ bool GUI_App::on_init_inner()
|
||||||
preset_updater->slic3r_update_notify();
|
preset_updater->slic3r_update_notify();
|
||||||
preset_updater->sync(preset_bundle);
|
preset_updater->sync(preset_bundle);
|
||||||
});
|
});
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
}
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
//sets window property to mainframe so other instances can indentify it
|
//sets window property to mainframe so other instances can indentify it
|
||||||
OtherInstanceMessageHandler::init_windows_properties(mainframe, m_instance_hash_int);
|
OtherInstanceMessageHandler::init_windows_properties(mainframe, m_instance_hash_int);
|
||||||
|
@ -533,8 +564,16 @@ bool GUI_App::on_init_inner()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (is_gcode_viewer()) {
|
||||||
|
mainframe->update_layout();
|
||||||
|
if (plater_ != nullptr)
|
||||||
|
// ensure the selected technology is ptFFF
|
||||||
|
plater_->set_printer_technology(ptFFF);
|
||||||
|
}
|
||||||
|
#else
|
||||||
load_current_presets();
|
load_current_presets();
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
mainframe->Show(true);
|
mainframe->Show(true);
|
||||||
|
|
||||||
/* Temporary workaround for the correct behavior of the Scrolled sidebar panel:
|
/* Temporary workaround for the correct behavior of the Scrolled sidebar panel:
|
||||||
|
|
|
@ -94,8 +94,22 @@ static wxString dots("…", wxConvUTF8);
|
||||||
|
|
||||||
class GUI_App : public wxApp
|
class GUI_App : public wxApp
|
||||||
{
|
{
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
public:
|
||||||
|
enum class EAppMode : unsigned char
|
||||||
|
{
|
||||||
|
Editor,
|
||||||
|
GCodeViewer
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
bool m_initialized { false };
|
bool m_initialized { false };
|
||||||
bool app_conf_exists{ false };
|
bool app_conf_exists{ false };
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
EAppMode m_app_mode{ EAppMode::Editor };
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
wxColour m_color_label_modified;
|
wxColour m_color_label_modified;
|
||||||
wxColour m_color_label_sys;
|
wxColour m_color_label_sys;
|
||||||
|
@ -125,13 +139,24 @@ class GUI_App : public wxApp
|
||||||
std::unique_ptr <wxSingleInstanceChecker> m_single_instance_checker;
|
std::unique_ptr <wxSingleInstanceChecker> m_single_instance_checker;
|
||||||
std::string m_instance_hash_string;
|
std::string m_instance_hash_string;
|
||||||
size_t m_instance_hash_int;
|
size_t m_instance_hash_int;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool OnInit() override;
|
bool OnInit() override;
|
||||||
bool initialized() const { return m_initialized; }
|
bool initialized() const { return m_initialized; }
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
explicit GUI_App(EAppMode mode = EAppMode::Editor);
|
||||||
|
#else
|
||||||
GUI_App();
|
GUI_App();
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
~GUI_App() override;
|
~GUI_App() override;
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
EAppMode get_app_mode() const { return m_app_mode; }
|
||||||
|
bool is_editor() const { return m_app_mode == EAppMode::Editor; }
|
||||||
|
bool is_gcode_viewer() const { return m_app_mode == EAppMode::GCodeViewer; }
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
static std::string get_gl_info(bool format_as_html, bool extensions);
|
static std::string get_gl_info(bool format_as_html, bool extensions);
|
||||||
wxGLContext* init_glcontext(wxGLCanvas& canvas);
|
wxGLContext* init_glcontext(wxGLCanvas& canvas);
|
||||||
bool init_opengl();
|
bool init_opengl();
|
||||||
|
|
|
@ -1234,7 +1234,11 @@ void Preview::load_print_as_fff(bool keep_z_range)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_editor() && !has_layers)
|
||||||
|
#else
|
||||||
if (wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer && !has_layers)
|
if (wxGetApp().mainframe->get_mode() != MainFrame::EMode::GCodeViewer && !has_layers)
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#else
|
#else
|
||||||
if (! has_layers)
|
if (! has_layers)
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
|
|
@ -194,6 +194,9 @@ Preview(wxWindow* parent, Model* model, DynamicPrintConfig* config,
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
void update_bottom_toolbar();
|
void update_bottom_toolbar();
|
||||||
void update_moves_slider();
|
void update_moves_slider();
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
void hide_layers_slider();
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -203,7 +206,9 @@ private:
|
||||||
void unbind_event_handlers();
|
void unbind_event_handlers();
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#if !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
void hide_layers_slider();
|
void hide_layers_slider();
|
||||||
|
#endif // !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#else
|
#else
|
||||||
void show_hide_ui_elements(const std::string& what);
|
void show_hide_ui_elements(const std::string& what);
|
||||||
|
|
||||||
|
|
|
@ -95,9 +95,15 @@ void KBShortcutsDialog::fill_shortcuts()
|
||||||
const std::string& alt = GUI::shortkey_alt_prefix();
|
const std::string& alt = GUI::shortkey_alt_prefix();
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#if !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
bool is_gcode_viewer = wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer;
|
bool is_gcode_viewer = wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer;
|
||||||
|
#endif // !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_editor()) {
|
||||||
|
#else
|
||||||
if (!is_gcode_viewer) {
|
if (!is_gcode_viewer) {
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
Shortcuts commands_shortcuts = {
|
Shortcuts commands_shortcuts = {
|
||||||
// File
|
// File
|
||||||
|
|
|
@ -92,7 +92,6 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER_TASKBAR_ICON
|
#endif // ENABLE_GCODE_VIEWER_TASKBAR_ICON
|
||||||
|
|
||||||
// SetIcon(wxIcon(Slic3r::var("PrusaSlicer_128px.png"), wxBITMAP_TYPE_PNG));
|
|
||||||
// Load the icon either from the exe, or from the ico file.
|
// Load the icon either from the exe, or from the ico file.
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
{
|
{
|
||||||
|
@ -102,7 +101,24 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
|
||||||
SetIcon(wxIcon(szExeFileName, wxBITMAP_TYPE_ICO));
|
SetIcon(wxIcon(szExeFileName, wxBITMAP_TYPE_ICO));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
switch (wxGetApp().get_mode())
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case GUI_App::EMode::Editor:
|
||||||
|
{
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
SetIcon(wxIcon(Slic3r::var("PrusaSlicer_128px.png"), wxBITMAP_TYPE_PNG));
|
SetIcon(wxIcon(Slic3r::var("PrusaSlicer_128px.png"), wxBITMAP_TYPE_PNG));
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GUI_App::EMode::GCodeViewer:
|
||||||
|
{
|
||||||
|
SetIcon(wxIcon(Slic3r::var("PrusaSlicer-gcodeviewer_128px.png"), wxBITMAP_TYPE_PNG));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
// initialize status bar
|
// initialize status bar
|
||||||
|
@ -116,8 +132,15 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
|
||||||
// initialize tabpanel and menubar
|
// initialize tabpanel and menubar
|
||||||
init_tabpanel();
|
init_tabpanel();
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
init_editor_menubar();
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
init_gcodeviewer_menubar();
|
if (wxGetApp().is_gcode_viewer())
|
||||||
|
init_menubar_as_gcodeviewer();
|
||||||
|
else
|
||||||
|
init_menubar_as_editor();
|
||||||
|
#else
|
||||||
|
init_menubar_as_editor();
|
||||||
|
init_menubar_as_gcodeviewer();
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
// This is needed on Windows to fake the CTRL+# of the window menu when using the numpad
|
// This is needed on Windows to fake the CTRL+# of the window menu when using the numpad
|
||||||
|
@ -148,6 +171,9 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
|
||||||
sizer->Add(m_main_sizer, 1, wxEXPAND);
|
sizer->Add(m_main_sizer, 1, wxEXPAND);
|
||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
// initialize layout from config
|
// initialize layout from config
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_editor())
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
update_layout();
|
update_layout();
|
||||||
sizer->SetSizeHints(this);
|
sizer->SetSizeHints(this);
|
||||||
Fit();
|
Fit();
|
||||||
|
@ -300,10 +326,17 @@ void MainFrame::update_layout()
|
||||||
};
|
};
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
ESettingsLayout layout = wxGetApp().is_gcode_viewer() ? ESettingsLayout::GCodeViewer :
|
||||||
|
(wxGetApp().app_config->get("old_settings_layout_mode") == "1" ? ESettingsLayout::Old :
|
||||||
|
wxGetApp().app_config->get("new_settings_layout_mode") == "1" ? ESettingsLayout::New :
|
||||||
|
wxGetApp().app_config->get("dlg_settings_layout_mode") == "1" ? ESettingsLayout::Dlg : ESettingsLayout::Old);
|
||||||
|
#else
|
||||||
ESettingsLayout layout = (m_mode == EMode::GCodeViewer) ? ESettingsLayout::GCodeViewer :
|
ESettingsLayout layout = (m_mode == EMode::GCodeViewer) ? ESettingsLayout::GCodeViewer :
|
||||||
(wxGetApp().app_config->get("old_settings_layout_mode") == "1" ? ESettingsLayout::Old :
|
(wxGetApp().app_config->get("old_settings_layout_mode") == "1" ? ESettingsLayout::Old :
|
||||||
wxGetApp().app_config->get("new_settings_layout_mode") == "1" ? ESettingsLayout::New :
|
wxGetApp().app_config->get("new_settings_layout_mode") == "1" ? ESettingsLayout::New :
|
||||||
wxGetApp().app_config->get("dlg_settings_layout_mode") == "1" ? ESettingsLayout::Dlg : ESettingsLayout::Old);
|
wxGetApp().app_config->get("dlg_settings_layout_mode") == "1" ? ESettingsLayout::Dlg : ESettingsLayout::Old);
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#else
|
#else
|
||||||
ESettingsLayout layout = wxGetApp().app_config->get("old_settings_layout_mode") == "1" ? ESettingsLayout::Old :
|
ESettingsLayout layout = wxGetApp().app_config->get("old_settings_layout_mode") == "1" ? ESettingsLayout::Old :
|
||||||
wxGetApp().app_config->get("new_settings_layout_mode") == "1" ? ESettingsLayout::New :
|
wxGetApp().app_config->get("new_settings_layout_mode") == "1" ? ESettingsLayout::New :
|
||||||
|
@ -375,6 +408,12 @@ void MainFrame::update_layout()
|
||||||
case ESettingsLayout::GCodeViewer:
|
case ESettingsLayout::GCodeViewer:
|
||||||
{
|
{
|
||||||
m_main_sizer->Add(m_plater, 1, wxEXPAND);
|
m_main_sizer->Add(m_plater, 1, wxEXPAND);
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
m_plater->set_bed_shape({ { 0.0, 0.0 }, { 200.0, 0.0 }, { 200.0, 200.0 }, { 0.0, 200.0 } }, "", "", true);
|
||||||
|
m_plater->enable_view_toolbar(false);
|
||||||
|
m_plater->get_collapse_toolbar().set_enabled(false);
|
||||||
|
m_plater->collapse_sidebar(true);
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
m_plater->Show();
|
m_plater->Show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -482,6 +521,7 @@ void MainFrame::shutdown()
|
||||||
|
|
||||||
if (m_plater != nullptr) {
|
if (m_plater != nullptr) {
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#if !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
// restore sidebar if it was hidden when switching to gcode viewer mode
|
// restore sidebar if it was hidden when switching to gcode viewer mode
|
||||||
if (m_restore_from_gcode_viewer.collapsed_sidebar)
|
if (m_restore_from_gcode_viewer.collapsed_sidebar)
|
||||||
m_plater->collapse_sidebar(false);
|
m_plater->collapse_sidebar(false);
|
||||||
|
@ -489,6 +529,7 @@ void MainFrame::shutdown()
|
||||||
// restore sla printer if it was deselected when switching to gcode viewer mode
|
// restore sla printer if it was deselected when switching to gcode viewer mode
|
||||||
if (m_restore_from_gcode_viewer.sla_technology)
|
if (m_restore_from_gcode_viewer.sla_technology)
|
||||||
m_plater->set_printer_technology(ptSLA);
|
m_plater->set_printer_technology(ptSLA);
|
||||||
|
#endif // !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
// Stop the background thread (Windows and Linux).
|
// Stop the background thread (Windows and Linux).
|
||||||
// Disconnect from a 3DConnextion driver (OSX).
|
// Disconnect from a 3DConnextion driver (OSX).
|
||||||
|
@ -590,6 +631,9 @@ void MainFrame::init_tabpanel()
|
||||||
// or when the preset's "modified" status changes.
|
// or when the preset's "modified" status changes.
|
||||||
Bind(EVT_TAB_PRESETS_CHANGED, &MainFrame::on_presets_changed, this); // #ys_FIXME_to_delete
|
Bind(EVT_TAB_PRESETS_CHANGED, &MainFrame::on_presets_changed, this); // #ys_FIXME_to_delete
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_editor())
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
create_preset_tabs();
|
create_preset_tabs();
|
||||||
|
|
||||||
if (m_plater) {
|
if (m_plater) {
|
||||||
|
@ -891,7 +935,7 @@ static void add_common_view_menu_items(wxMenu* view_menu, MainFrame* mainFrame,
|
||||||
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
|
"", nullptr, [can_change_view]() { return can_change_view(); }, mainFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainFrame::init_editor_menubar()
|
void MainFrame::init_menubar_as_editor()
|
||||||
#else
|
#else
|
||||||
void MainFrame::init_menubar()
|
void MainFrame::init_menubar()
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
@ -1055,6 +1099,7 @@ void MainFrame::init_menubar()
|
||||||
[this](wxCommandEvent&) { repair_stl(); }, "wrench", nullptr,
|
[this](wxCommandEvent&) { repair_stl(); }, "wrench", nullptr,
|
||||||
[this]() { return true; }, this);
|
[this]() { return true; }, this);
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#if !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
append_menu_item(fileMenu, wxID_ANY, _L("&G-code preview"), _L("Switch to G-code preview mode"),
|
append_menu_item(fileMenu, wxID_ANY, _L("&G-code preview"), _L("Switch to G-code preview mode"),
|
||||||
[this](wxCommandEvent&) {
|
[this](wxCommandEvent&) {
|
||||||
|
@ -1063,6 +1108,7 @@ void MainFrame::init_menubar()
|
||||||
wxString(SLIC3R_APP_NAME) + " - " + _L("Switch to G-code preview mode"), wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION | wxCENTRE).ShowModal() == wxID_YES)
|
wxString(SLIC3R_APP_NAME) + " - " + _L("Switch to G-code preview mode"), wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION | wxCENTRE).ShowModal() == wxID_YES)
|
||||||
set_mode(EMode::GCodeViewer);
|
set_mode(EMode::GCodeViewer);
|
||||||
}, "", nullptr);
|
}, "", nullptr);
|
||||||
|
#endif // !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
append_menu_item(fileMenu, wxID_EXIT, _L("&Quit"), wxString::Format(_L("Quit %s"), SLIC3R_APP_NAME),
|
append_menu_item(fileMenu, wxID_EXIT, _L("&Quit"), wxString::Format(_L("Quit %s"), SLIC3R_APP_NAME),
|
||||||
|
@ -1286,6 +1332,17 @@ void MainFrame::init_menubar()
|
||||||
// assign menubar to frame after appending items, otherwise special items
|
// assign menubar to frame after appending items, otherwise special items
|
||||||
// will not be handled correctly
|
// will not be handled correctly
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
m_menubar = new wxMenuBar();
|
||||||
|
m_menubar->Append(fileMenu, _L("&File"));
|
||||||
|
if (editMenu) m_menubar->Append(editMenu, _L("&Edit"));
|
||||||
|
m_menubar->Append(windowMenu, _L("&Window"));
|
||||||
|
if (viewMenu) m_menubar->Append(viewMenu, _L("&View"));
|
||||||
|
// Add additional menus from C++
|
||||||
|
wxGetApp().add_config_menu(m_menubar);
|
||||||
|
m_menubar->Append(helpMenu, _L("&Help"));
|
||||||
|
SetMenuBar(m_menubar);
|
||||||
|
#else
|
||||||
m_editor_menubar = new wxMenuBar();
|
m_editor_menubar = new wxMenuBar();
|
||||||
m_editor_menubar->Append(fileMenu, _L("&File"));
|
m_editor_menubar->Append(fileMenu, _L("&File"));
|
||||||
if (editMenu) m_editor_menubar->Append(editMenu, _L("&Edit"));
|
if (editMenu) m_editor_menubar->Append(editMenu, _L("&Edit"));
|
||||||
|
@ -1295,6 +1352,7 @@ void MainFrame::init_menubar()
|
||||||
wxGetApp().add_config_menu(m_editor_menubar);
|
wxGetApp().add_config_menu(m_editor_menubar);
|
||||||
m_editor_menubar->Append(helpMenu, _L("&Help"));
|
m_editor_menubar->Append(helpMenu, _L("&Help"));
|
||||||
SetMenuBar(m_editor_menubar);
|
SetMenuBar(m_editor_menubar);
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#else
|
#else
|
||||||
auto menubar = new wxMenuBar();
|
auto menubar = new wxMenuBar();
|
||||||
menubar->Append(fileMenu, _(L("&File")));
|
menubar->Append(fileMenu, _(L("&File")));
|
||||||
|
@ -1323,15 +1381,11 @@ void MainFrame::init_menubar()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (plater()->printer_technology() == ptSLA)
|
if (plater()->printer_technology() == ptSLA)
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
update_editor_menubar();
|
|
||||||
#else
|
|
||||||
update_menubar();
|
update_menubar();
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
void MainFrame::init_gcodeviewer_menubar()
|
void MainFrame::init_menubar_as_gcodeviewer()
|
||||||
{
|
{
|
||||||
wxMenu* fileMenu = new wxMenu;
|
wxMenu* fileMenu = new wxMenu;
|
||||||
{
|
{
|
||||||
|
@ -1342,9 +1396,11 @@ void MainFrame::init_gcodeviewer_menubar()
|
||||||
append_menu_item(fileMenu, wxID_ANY, _L("Export &toolpaths as OBJ") + dots, _L("Export toolpaths as OBJ"),
|
append_menu_item(fileMenu, wxID_ANY, _L("Export &toolpaths as OBJ") + dots, _L("Export toolpaths as OBJ"),
|
||||||
[this](wxCommandEvent&) { if (m_plater != nullptr) m_plater->export_toolpaths_to_obj(); }, "export_plater", nullptr,
|
[this](wxCommandEvent&) { if (m_plater != nullptr) m_plater->export_toolpaths_to_obj(); }, "export_plater", nullptr,
|
||||||
[this]() {return can_export_toolpaths(); }, this);
|
[this]() {return can_export_toolpaths(); }, this);
|
||||||
|
#if !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
append_menu_item(fileMenu, wxID_ANY, _L("Exit &G-code preview"), _L("Switch to editor mode"),
|
append_menu_item(fileMenu, wxID_ANY, _L("Exit &G-code preview"), _L("Switch to editor mode"),
|
||||||
[this](wxCommandEvent&) { set_mode(EMode::Editor); });
|
[this](wxCommandEvent&) { set_mode(EMode::Editor); });
|
||||||
|
#endif // !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
append_menu_item(fileMenu, wxID_EXIT, _L("&Quit"), wxString::Format(_L("Quit %s"), SLIC3R_APP_NAME),
|
append_menu_item(fileMenu, wxID_EXIT, _L("&Quit"), wxString::Format(_L("Quit %s"), SLIC3R_APP_NAME),
|
||||||
[this](wxCommandEvent&) { Close(false); });
|
[this](wxCommandEvent&) { Close(false); });
|
||||||
|
@ -1360,13 +1416,22 @@ void MainFrame::init_gcodeviewer_menubar()
|
||||||
// helpmenu
|
// helpmenu
|
||||||
auto helpMenu = generate_help_menu();
|
auto helpMenu = generate_help_menu();
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
m_menubar = new wxMenuBar();
|
||||||
|
m_menubar->Append(fileMenu, _L("&File"));
|
||||||
|
if (viewMenu != nullptr) m_menubar->Append(viewMenu, _L("&View"));
|
||||||
|
m_menubar->Append(helpMenu, _L("&Help"));
|
||||||
|
SetMenuBar(m_menubar);
|
||||||
|
#else
|
||||||
m_gcodeviewer_menubar = new wxMenuBar();
|
m_gcodeviewer_menubar = new wxMenuBar();
|
||||||
m_gcodeviewer_menubar->Append(fileMenu, _L("&File"));
|
m_gcodeviewer_menubar->Append(fileMenu, _L("&File"));
|
||||||
if ((viewMenu != nullptr))
|
if (viewMenu != nullptr)
|
||||||
m_gcodeviewer_menubar->Append(viewMenu, _L("&View"));
|
m_gcodeviewer_menubar->Append(viewMenu, _L("&View"));
|
||||||
m_gcodeviewer_menubar->Append(helpMenu, _L("&Help"));
|
m_gcodeviewer_menubar->Append(helpMenu, _L("&Help"));
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
void MainFrame::set_mode(EMode mode)
|
void MainFrame::set_mode(EMode mode)
|
||||||
{
|
{
|
||||||
if (m_mode == mode)
|
if (m_mode == mode)
|
||||||
|
@ -1488,11 +1553,11 @@ void MainFrame::set_mode(EMode mode)
|
||||||
|
|
||||||
m_plater->Thaw();
|
m_plater->Thaw();
|
||||||
|
|
||||||
SetIcon(wxIcon(Slic3r::var("PrusaSlicerGCodeViewer_128px.png"), wxBITMAP_TYPE_PNG));
|
SetIcon(wxIcon(Slic3r::var("PrusaSlicer-gcodeviewer_128px.png"), wxBITMAP_TYPE_PNG));
|
||||||
#if ENABLE_GCODE_VIEWER_TASKBAR_ICON
|
#if ENABLE_GCODE_VIEWER_TASKBAR_ICON
|
||||||
if (m_taskbar_icon != nullptr) {
|
if (m_taskbar_icon != nullptr) {
|
||||||
m_taskbar_icon->RemoveIcon();
|
m_taskbar_icon->RemoveIcon();
|
||||||
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("PrusaSlicerGCodeViewer_128px.png"), wxBITMAP_TYPE_PNG), "PrusaSlicer-GCode viewer");
|
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("PrusaSlicer-gcodeviewer_128px.png"), wxBITMAP_TYPE_PNG), "PrusaSlicer-GCode viewer");
|
||||||
}
|
}
|
||||||
#endif // ENABLE_GCODE_VIEWER_TASKBAR_ICON
|
#endif // ENABLE_GCODE_VIEWER_TASKBAR_ICON
|
||||||
|
|
||||||
|
@ -1500,20 +1565,22 @@ void MainFrame::set_mode(EMode mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
void MainFrame::update_editor_menubar()
|
|
||||||
#else
|
|
||||||
void MainFrame::update_menubar()
|
void MainFrame::update_menubar()
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
{
|
{
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_gcode_viewer())
|
||||||
|
return;
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
const bool is_fff = plater()->printer_technology() == ptFFF;
|
const bool is_fff = plater()->printer_technology() == ptFFF;
|
||||||
|
|
||||||
m_changeable_menu_items[miExport] ->SetItemLabel((is_fff ? _(L("Export &G-code")) : _(L("E&xport")) ) + dots + "\tCtrl+G");
|
m_changeable_menu_items[miExport] ->SetItemLabel((is_fff ? _L("Export &G-code") : _L("E&xport")) + dots + "\tCtrl+G");
|
||||||
m_changeable_menu_items[miSend] ->SetItemLabel((is_fff ? _(L("S&end G-code")) : _(L("S&end to print"))) + dots + "\tCtrl+Shift+G");
|
m_changeable_menu_items[miSend] ->SetItemLabel((is_fff ? _L("S&end G-code") : _L("S&end to print")) + dots + "\tCtrl+Shift+G");
|
||||||
|
|
||||||
m_changeable_menu_items[miMaterialTab] ->SetItemLabel((is_fff ? _(L("&Filament Settings Tab")) : _(L("Mate&rial Settings Tab"))) + "\tCtrl+3");
|
m_changeable_menu_items[miMaterialTab] ->SetItemLabel((is_fff ? _L("&Filament Settings Tab") : _L("Mate&rial Settings Tab")) + "\tCtrl+3");
|
||||||
m_changeable_menu_items[miMaterialTab] ->SetBitmap(create_scaled_bitmap(is_fff ? "spool" : "resin"));
|
m_changeable_menu_items[miMaterialTab] ->SetBitmap(create_scaled_bitmap(is_fff ? "spool" : "resin"));
|
||||||
|
|
||||||
m_changeable_menu_items[miPrinterTab] ->SetBitmap(create_scaled_bitmap(is_fff ? "printer" : "sla_printer"));
|
m_changeable_menu_items[miPrinterTab] ->SetBitmap(create_scaled_bitmap(is_fff ? "printer" : "sla_printer"));
|
||||||
|
@ -1996,6 +2063,11 @@ SettingsDialog::SettingsDialog(MainFrame* mainframe)
|
||||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX, "settings_dialog"),
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX, "settings_dialog"),
|
||||||
m_main_frame(mainframe)
|
m_main_frame(mainframe)
|
||||||
{
|
{
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_gcode_viewer())
|
||||||
|
return;
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
#if ENABLE_WX_3_1_3_DPI_CHANGED_EVENT && defined(__WXMSW__)
|
#if ENABLE_WX_3_1_3_DPI_CHANGED_EVENT && defined(__WXMSW__)
|
||||||
// ys_FIXME! temporary workaround for correct font scaling
|
// ys_FIXME! temporary workaround for correct font scaling
|
||||||
// Because of from wxWidgets 3.1.3 auto rescaling is implemented for the Fonts,
|
// Because of from wxWidgets 3.1.3 auto rescaling is implemented for the Fonts,
|
||||||
|
@ -2006,8 +2078,6 @@ SettingsDialog::SettingsDialog(MainFrame* mainframe)
|
||||||
#endif // ENABLE_WX_3_1_3_DPI_CHANGED_EVENT
|
#endif // ENABLE_WX_3_1_3_DPI_CHANGED_EVENT
|
||||||
this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
||||||
|
|
||||||
|
|
||||||
// SetIcon(wxIcon(Slic3r::var("PrusaSlicer_128px.png"), wxBITMAP_TYPE_PNG));
|
|
||||||
// Load the icon either from the exe, or from the ico file.
|
// Load the icon either from the exe, or from the ico file.
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
{
|
{
|
||||||
|
@ -2070,6 +2140,11 @@ SettingsDialog::SettingsDialog(MainFrame* mainframe)
|
||||||
|
|
||||||
void SettingsDialog::on_dpi_changed(const wxRect& suggested_rect)
|
void SettingsDialog::on_dpi_changed(const wxRect& suggested_rect)
|
||||||
{
|
{
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_gcode_viewer())
|
||||||
|
return;
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
const int& em = em_unit();
|
const int& em = em_unit();
|
||||||
const wxSize& size = wxSize(85 * em, 50 * em);
|
const wxSize& size = wxSize(85 * em, 50 * em);
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ class SettingsDialog : public DPIDialog
|
||||||
MainFrame* m_main_frame { nullptr };
|
MainFrame* m_main_frame { nullptr };
|
||||||
public:
|
public:
|
||||||
SettingsDialog(MainFrame* mainframe);
|
SettingsDialog(MainFrame* mainframe);
|
||||||
~SettingsDialog() {}
|
~SettingsDialog() = default;
|
||||||
void set_tabpanel(wxNotebook* tabpanel) { m_tabpanel = tabpanel; }
|
void set_tabpanel(wxNotebook* tabpanel) { m_tabpanel = tabpanel; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -72,6 +72,9 @@ class MainFrame : public DPIFrame
|
||||||
wxString m_qs_last_output_file = wxEmptyString;
|
wxString m_qs_last_output_file = wxEmptyString;
|
||||||
wxString m_last_config = wxEmptyString;
|
wxString m_last_config = wxEmptyString;
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
wxMenuBar* m_menubar{ nullptr };
|
||||||
|
#else
|
||||||
wxMenuBar* m_editor_menubar{ nullptr };
|
wxMenuBar* m_editor_menubar{ nullptr };
|
||||||
wxMenuBar* m_gcodeviewer_menubar{ nullptr };
|
wxMenuBar* m_gcodeviewer_menubar{ nullptr };
|
||||||
|
|
||||||
|
@ -83,6 +86,7 @@ class MainFrame : public DPIFrame
|
||||||
};
|
};
|
||||||
|
|
||||||
RestoreFromGCodeViewer m_restore_from_gcode_viewer;
|
RestoreFromGCodeViewer m_restore_from_gcode_viewer;
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -146,6 +150,7 @@ class MainFrame : public DPIFrame
|
||||||
ESettingsLayout m_layout{ ESettingsLayout::Unknown };
|
ESettingsLayout m_layout{ ESettingsLayout::Unknown };
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#if !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
public:
|
public:
|
||||||
enum class EMode : unsigned char
|
enum class EMode : unsigned char
|
||||||
{
|
{
|
||||||
|
@ -155,6 +160,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EMode m_mode{ EMode::Editor };
|
EMode m_mode{ EMode::Editor };
|
||||||
|
#endif // !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -182,16 +188,17 @@ public:
|
||||||
void create_preset_tabs();
|
void create_preset_tabs();
|
||||||
void add_created_tab(Tab* panel);
|
void add_created_tab(Tab* panel);
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
void init_editor_menubar();
|
void init_menubar_as_editor();
|
||||||
void update_editor_menubar();
|
void init_menubar_as_gcodeviewer();
|
||||||
void init_gcodeviewer_menubar();
|
|
||||||
|
|
||||||
|
#if !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
EMode get_mode() const { return m_mode; }
|
EMode get_mode() const { return m_mode; }
|
||||||
void set_mode(EMode mode);
|
void set_mode(EMode mode);
|
||||||
|
#endif // !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#else
|
#else
|
||||||
void init_menubar();
|
void init_menubar();
|
||||||
void update_menubar();
|
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
void update_menubar();
|
||||||
|
|
||||||
void update_ui_from_settings();
|
void update_ui_from_settings();
|
||||||
bool is_loaded() const { return m_loaded; }
|
bool is_loaded() const { return m_loaded; }
|
||||||
|
|
|
@ -1369,6 +1369,9 @@ bool PlaterDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &fi
|
||||||
this->MSWUpdateDragImageOnLeave();
|
this->MSWUpdateDragImageOnLeave();
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_gcode_viewer()) {
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
// gcode section
|
// gcode section
|
||||||
for (const auto& filename : filenames) {
|
for (const auto& filename : filenames) {
|
||||||
fs::path path(into_path(filename));
|
fs::path path(into_path(filename));
|
||||||
|
@ -1382,9 +1385,12 @@ bool PlaterDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &fi
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (paths.size() == 1) {
|
else if (paths.size() == 1) {
|
||||||
|
#if !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
if (wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer) {
|
if (wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer) {
|
||||||
|
#endif // !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
plater->load_gcode(from_path(paths.front()));
|
plater->load_gcode(from_path(paths.front()));
|
||||||
return true;
|
return true;
|
||||||
|
#if !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (wxMessageDialog((wxWindow*)plater, _L("Do you want to switch to G-code preview ?"),
|
if (wxMessageDialog((wxWindow*)plater, _L("Do you want to switch to G-code preview ?"),
|
||||||
|
@ -1400,10 +1406,15 @@ bool PlaterDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &fi
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif // !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
}
|
}
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif //ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
|
||||||
// model section
|
// editor section
|
||||||
for (const auto &filename : filenames) {
|
for (const auto &filename : filenames) {
|
||||||
fs::path path(into_path(filename));
|
fs::path path(into_path(filename));
|
||||||
if (std::regex_match(path.string(), pattern_drop))
|
if (std::regex_match(path.string(), pattern_drop))
|
||||||
|
@ -1413,6 +1424,7 @@ bool PlaterDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#if !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
if (wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer) {
|
if (wxGetApp().mainframe->get_mode() == MainFrame::EMode::GCodeViewer) {
|
||||||
if (wxMessageDialog((wxWindow*)plater, _L("Do you want to exit G-code preview ?"),
|
if (wxMessageDialog((wxWindow*)plater, _L("Do you want to exit G-code preview ?"),
|
||||||
wxString(SLIC3R_APP_NAME) + " - " + _L("Drag and drop model file"), wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT | wxCENTRE).ShowModal() == wxID_YES)
|
wxString(SLIC3R_APP_NAME) + " - " + _L("Drag and drop model file"), wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT | wxCENTRE).ShowModal() == wxID_YES)
|
||||||
|
@ -1420,6 +1432,7 @@ bool PlaterDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &fi
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif // !ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
|
||||||
wxString snapshot_label;
|
wxString snapshot_label;
|
||||||
|
@ -1970,7 +1983,13 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||||
q->SetDropTarget(new PlaterDropTarget(q)); // if my understanding is right, wxWindow takes the owenership
|
q->SetDropTarget(new PlaterDropTarget(q)); // if my understanding is right, wxWindow takes the owenership
|
||||||
q->Layout();
|
q->Layout();
|
||||||
|
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
set_current_panel(wxGetApp().is_editor() ? (wxPanel*)view3D : (wxPanel*)preview);
|
||||||
|
if (wxGetApp().is_gcode_viewer())
|
||||||
|
preview->hide_layers_slider();
|
||||||
|
#else
|
||||||
set_current_panel(view3D);
|
set_current_panel(view3D);
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
// updates camera type from .ini file
|
// updates camera type from .ini file
|
||||||
camera.set_type(get_config("use_perspective_camera"));
|
camera.set_type(get_config("use_perspective_camera"));
|
||||||
|
@ -1990,10 +2009,12 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
notification_manager = new NotificationManager(this->q);
|
notification_manager = new NotificationManager(this->q);
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
if (wxGetApp().is_editor()) {
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
this->q->Bind(EVT_EJECT_DRIVE_NOTIFICAION_CLICKED, [this](EjectDriveNotificationClickedEvent&) { this->q->eject_drive(); });
|
this->q->Bind(EVT_EJECT_DRIVE_NOTIFICAION_CLICKED, [this](EjectDriveNotificationClickedEvent&) { this->q->eject_drive(); });
|
||||||
this->q->Bind(EVT_EXPORT_GCODE_NOTIFICAION_CLICKED, [this](ExportGcodeNotificationClickedEvent&) { this->q->export_gcode(true); });
|
this->q->Bind(EVT_EXPORT_GCODE_NOTIFICAION_CLICKED, [this](ExportGcodeNotificationClickedEvent&) { this->q->export_gcode(true); });
|
||||||
this->q->Bind(EVT_PRESET_UPDATE_AVIABLE_CLICKED, [this](PresetUpdateAviableClickedEvent&) { wxGetApp().get_preset_updater()->on_update_notification_confirm(); });
|
this->q->Bind(EVT_PRESET_UPDATE_AVIABLE_CLICKED, [this](PresetUpdateAviableClickedEvent&) { wxGetApp().get_preset_updater()->on_update_notification_confirm(); });
|
||||||
|
|
||||||
this->q->Bind(EVT_REMOVABLE_DRIVE_EJECTED, [this, q](RemovableDriveEjectEvent &evt) {
|
this->q->Bind(EVT_REMOVABLE_DRIVE_EJECTED, [this, q](RemovableDriveEjectEvent &evt) {
|
||||||
if (evt.data.second) {
|
if (evt.data.second) {
|
||||||
this->show_action_buttons(this->ready_to_slice);
|
this->show_action_buttons(this->ready_to_slice);
|
||||||
|
@ -2017,6 +2038,9 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||||
this->q->Bind(EVT_VOLUME_ATTACHED, [this](VolumeAttachedEvent &evt) { wxGetApp().removable_drive_manager()->volumes_changed(); });
|
this->q->Bind(EVT_VOLUME_ATTACHED, [this](VolumeAttachedEvent &evt) { wxGetApp().removable_drive_manager()->volumes_changed(); });
|
||||||
this->q->Bind(EVT_VOLUME_DETACHED, [this](VolumeDetachedEvent &evt) { wxGetApp().removable_drive_manager()->volumes_changed(); });
|
this->q->Bind(EVT_VOLUME_DETACHED, [this](VolumeDetachedEvent &evt) { wxGetApp().removable_drive_manager()->volumes_changed(); });
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
#if ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
}
|
||||||
|
#endif // ENABLE_GCODE_VIEWER_AS_STANDALONE_APPLICATION
|
||||||
|
|
||||||
// Initialize the Undo / Redo stack with a first snapshot.
|
// Initialize the Undo / Redo stack with a first snapshot.
|
||||||
this->take_snapshot(_L("New Project"));
|
this->take_snapshot(_L("New Project"));
|
||||||
|
@ -5628,11 +5652,7 @@ void Plater::set_printer_technology(PrinterTechnology printer_technology)
|
||||||
p->label_btn_send = printer_technology == ptFFF ? L("Send G-code") : L("Send to printer");
|
p->label_btn_send = printer_technology == ptFFF ? L("Send G-code") : L("Send to printer");
|
||||||
|
|
||||||
if (wxGetApp().mainframe != nullptr)
|
if (wxGetApp().mainframe != nullptr)
|
||||||
#if ENABLE_GCODE_VIEWER
|
|
||||||
wxGetApp().mainframe->update_editor_menubar();
|
|
||||||
#else
|
|
||||||
wxGetApp().mainframe->update_menubar();
|
wxGetApp().mainframe->update_menubar();
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
|
||||||
|
|
||||||
p->update_main_toolbar_tooltips();
|
p->update_main_toolbar_tooltips();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue