mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 08:17:51 -06:00
Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer
This commit is contained in:
commit
877e824de1
27 changed files with 737 additions and 813 deletions
|
@ -25,6 +25,7 @@
|
|||
#include "wxExtensions.hpp"
|
||||
#include "GUI_ObjectList.hpp"
|
||||
#include "Mouse3DController.hpp"
|
||||
#include "RemovableDriveManager.hpp"
|
||||
#include "I18N.hpp"
|
||||
|
||||
#include <fstream>
|
||||
|
@ -124,6 +125,9 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
|
|||
// Store the device parameter database back to appconfig.
|
||||
m_plater->get_mouse3d_controller().save_config(*wxGetApp().app_config);
|
||||
|
||||
// Stop the background thread of the removable drive manager, so that no new updates will be sent to the Plater.
|
||||
wxGetApp().removable_drive_manager()->shutdown();
|
||||
|
||||
// Save the slic3r.ini.Usually the ini file is saved from "on idle" callback,
|
||||
// but in rare cases it may not have been called yet.
|
||||
wxGetApp().app_config->save();
|
||||
|
@ -323,6 +327,27 @@ bool MainFrame::can_send_gcode() const
|
|||
return print_host_opt != nullptr && !print_host_opt->value.empty();
|
||||
}
|
||||
|
||||
bool MainFrame::can_export_gcode_sd() const
|
||||
{
|
||||
if (m_plater == nullptr)
|
||||
return false;
|
||||
|
||||
if (m_plater->model().objects.empty())
|
||||
return false;
|
||||
|
||||
if (m_plater->is_export_gcode_scheduled())
|
||||
return false;
|
||||
|
||||
// TODO:: add other filters
|
||||
|
||||
return wxGetApp().removable_drive_manager()->status().has_removable_drives;
|
||||
}
|
||||
|
||||
bool MainFrame::can_eject() const
|
||||
{
|
||||
return wxGetApp().removable_drive_manager()->status().has_eject;
|
||||
}
|
||||
|
||||
bool MainFrame::can_slice() const
|
||||
{
|
||||
bool bg_proc = wxGetApp().app_config->get("background_processing") == "1";
|
||||
|
@ -493,6 +518,9 @@ void MainFrame::init_menubar()
|
|||
[this](wxCommandEvent&) { if (m_plater) m_plater->send_gcode(); }, "export_gcode", nullptr,
|
||||
[this](){return can_send_gcode(); }, this);
|
||||
m_changeable_menu_items.push_back(item_send_gcode);
|
||||
append_menu_item(export_menu, wxID_ANY, _(L("Export G-code to SD card / Flash drive")) + dots + "\tCtrl+U", _(L("Export current plate as G-code to SD card / Flash drive")),
|
||||
[this](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(true); }, "export_to_sd", nullptr,
|
||||
[this]() {return can_export_gcode_sd(); }, this);
|
||||
export_menu->AppendSeparator();
|
||||
append_menu_item(export_menu, wxID_ANY, _(L("Export plate as &STL")) + dots, _(L("Export current plate as STL")),
|
||||
[this](wxCommandEvent&) { if (m_plater) m_plater->export_stl(); }, "export_plater", nullptr,
|
||||
|
@ -516,6 +544,10 @@ void MainFrame::init_menubar()
|
|||
[this]() {return true; }, this);
|
||||
append_submenu(fileMenu, export_menu, wxID_ANY, _(L("&Export")), "");
|
||||
|
||||
append_menu_item(fileMenu, wxID_ANY, _(L("Ejec&t SD card / Flash drive")) + dots + "\tCtrl+T", _(L("Eject SD card / Flash drive after the G-code was exported to it.")),
|
||||
[this](wxCommandEvent&) { if (m_plater) m_plater->eject_drive(); }, "eject_sd", nullptr,
|
||||
[this]() {return can_eject(); }, this);
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
|
||||
#if 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue