mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-07 11:06:10 +08:00
Removed the "Quick Slice" menu items from the main menu,
a little bit of code cleaning / refactoring.
This commit is contained in:
parent
edc306db45
commit
79986188a7
@ -9,9 +9,6 @@
|
|||||||
#include "libslic3r/Model.hpp"
|
#include "libslic3r/Model.hpp"
|
||||||
#include "slic3r/GUI/GLCanvas3DManager.hpp"
|
#include "slic3r/GUI/GLCanvas3DManager.hpp"
|
||||||
|
|
||||||
class wxBitmap;
|
|
||||||
class wxWindow;
|
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
class Print;
|
class Print;
|
||||||
|
@ -11,16 +11,9 @@
|
|||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
#import <IOKit/pwr_mgt/IOPMLib.h>
|
#import <IOKit/pwr_mgt/IOPMLib.h>
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#define NOMINMAX
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
// Undefine min/max macros incompatible with the standard library
|
|
||||||
// For example, std::numeric_limits<std::streamsize>::max()
|
|
||||||
// produces some weird errors
|
|
||||||
#ifdef min
|
|
||||||
#undef min
|
|
||||||
#endif
|
|
||||||
#ifdef max
|
|
||||||
#undef max
|
|
||||||
#endif
|
|
||||||
#include "boost/nowide/convert.hpp"
|
#include "boost/nowide/convert.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -123,8 +123,8 @@ bool GUI_App::OnInit()
|
|||||||
|
|
||||||
// application frame
|
// application frame
|
||||||
std::cerr << "Creating main frame..." << std::endl;
|
std::cerr << "Creating main frame..." << std::endl;
|
||||||
// wxImage::FindHandlerType(wxBITMAP_TYPE_PNG) ||
|
if (wxImage::FindHandler(wxBITMAP_TYPE_PNG) == nullptr)
|
||||||
wxImage::AddHandler(new wxPNGHandler());
|
wxImage::AddHandler(new wxPNGHandler());
|
||||||
mainframe = new MainFrame(no_plater, false);
|
mainframe = new MainFrame(no_plater, false);
|
||||||
sidebar().obj_list()->init_objects(); // propagate model objects to object list
|
sidebar().obj_list()->init_objects(); // propagate model objects to object list
|
||||||
update_mode();
|
update_mode();
|
||||||
|
@ -262,6 +262,7 @@ void MainFrame::init_menubar()
|
|||||||
|
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
|
|
||||||
|
#if 0
|
||||||
m_menu_item_repeat = nullptr;
|
m_menu_item_repeat = nullptr;
|
||||||
append_menu_item(fileMenu, wxID_ANY, _(L("Quick Slice…\tCtrl+U")), _(L("Slice a file into a G-code")),
|
append_menu_item(fileMenu, wxID_ANY, _(L("Quick Slice…\tCtrl+U")), _(L("Slice a file into a G-code")),
|
||||||
[this](wxCommandEvent&) {
|
[this](wxCommandEvent&) {
|
||||||
@ -282,6 +283,7 @@ void MainFrame::init_menubar()
|
|||||||
}); }, "cog_go.png");
|
}); }, "cog_go.png");
|
||||||
m_menu_item_repeat->Enable(false);
|
m_menu_item_repeat->Enable(false);
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
|
#endif
|
||||||
m_menu_item_reslice_now = append_menu_item(fileMenu, wxID_ANY, _(L("(Re)Slice Now\tCtrl+R")), _(L("Start new slicing process")),
|
m_menu_item_reslice_now = append_menu_item(fileMenu, wxID_ANY, _(L("(Re)Slice Now\tCtrl+R")), _(L("Start new slicing process")),
|
||||||
[this](wxCommandEvent&) { reslice_now(); }, "shape_handles.png");
|
[this](wxCommandEvent&) { reslice_now(); }, "shape_handles.png");
|
||||||
fileMenu->AppendSeparator();
|
fileMenu->AppendSeparator();
|
||||||
|
@ -12,18 +12,13 @@
|
|||||||
#include "Plater.hpp"
|
#include "Plater.hpp"
|
||||||
#include "Event.hpp"
|
#include "Event.hpp"
|
||||||
|
|
||||||
class wxMenuBar;
|
|
||||||
class wxNotebook;
|
class wxNotebook;
|
||||||
class wxPanel;
|
|
||||||
class wxMenu;
|
|
||||||
class wxProgressDialog;
|
class wxProgressDialog;
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
class ProgressStatusBar;
|
class ProgressStatusBar;
|
||||||
|
|
||||||
// #define _(s) Slic3r::GUI::I18N::translate((s))
|
|
||||||
|
|
||||||
namespace GUI
|
namespace GUI
|
||||||
{
|
{
|
||||||
class Tab;
|
class Tab;
|
||||||
|
@ -2852,7 +2852,7 @@ void Plater::export_amf()
|
|||||||
wxString path = dialog->GetPath();
|
wxString path = dialog->GetPath();
|
||||||
auto path_cstr = path.c_str();
|
auto path_cstr = path.c_str();
|
||||||
|
|
||||||
DynamicPrintConfig cfg = wxGetApp().preset_bundle->full_config();
|
DynamicPrintConfig cfg = wxGetApp().preset_bundle->full_config_secure();
|
||||||
if (Slic3r::store_amf(path_cstr, &p->model, dialog->get_checkbox_value() ? &cfg : nullptr)) {
|
if (Slic3r::store_amf(path_cstr, &p->model, dialog->get_checkbox_value() ? &cfg : nullptr)) {
|
||||||
// Success
|
// Success
|
||||||
p->statusbar()->set_status_text(wxString::Format(_(L("AMF file exported to %s")), path));
|
p->statusbar()->set_status_text(wxString::Format(_(L("AMF file exported to %s")), path));
|
||||||
@ -2881,7 +2881,7 @@ void Plater::export_3mf(const boost::filesystem::path& output_path)
|
|||||||
if (!path.Lower().EndsWith(".3mf"))
|
if (!path.Lower().EndsWith(".3mf"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DynamicPrintConfig cfg = wxGetApp().preset_bundle->full_config();
|
DynamicPrintConfig cfg = wxGetApp().preset_bundle->full_config_secure();
|
||||||
if (Slic3r::store_3mf(path.c_str(), &p->model, export_config ? &cfg : nullptr)) {
|
if (Slic3r::store_3mf(path.c_str(), &p->model, export_config ? &cfg : nullptr)) {
|
||||||
// Success
|
// Success
|
||||||
p->statusbar()->set_status_text(wxString::Format(_(L("3MF file exported to %s")), path));
|
p->statusbar()->set_status_text(wxString::Format(_(L("3MF file exported to %s")), path));
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
#ifndef WIDGET_HPP
|
|
||||||
#define WIDGET_HPP
|
|
||||||
#include <wx/wxprec.h>
|
|
||||||
#ifndef WX_PRECOM
|
|
||||||
#include <wx/wx.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class Widget {
|
|
||||||
protected:
|
|
||||||
wxSizer* _sizer;
|
|
||||||
public:
|
|
||||||
Widget(): _sizer(nullptr) { }
|
|
||||||
bool valid() const { return _sizer != nullptr; }
|
|
||||||
wxSizer* sizer() const { return _sizer; }
|
|
||||||
};
|
|
||||||
#endif
|
|
Loading…
x
Reference in New Issue
Block a user