mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-08 16:21:14 +00:00
* Remove Unused Project Includes and Forward-Declare Where a Type Is Only Referenced Generated with include-what-you-use and applied conservatively. Only OrcaSlicer's own headers, the ones under src/ and tests/, are removed or forward-declared; standard-library and third-party includes are left alone. An include is removed only when both the Release and the Debug configuration leave it unused, never from inside a conditional block, and never from a file with platform-specific blocks, which only gain includes. Files whose only use of a header sits behind a feature or debug macro (libvgcode's OpenGL ES and marker code, the ARACHNE/TESTS_EXPORT_SVGS debug output) keep their includes. clonable_ptr.hpp gains #pragma once; it had no include guard and was only safe while Config.hpp was its sole includer. * Remove Unused Project Includes From Files With Platform-Specific Code A Linux include-what-you-use run cannot see the code inside _WIN32, __APPLE__ or __linux__ blocks, so its verdict is only taken where nothing the removed header declares, directly or through what it includes, is named inside those blocks. Removals also have to hold in both the Release and Debug configuration and never touch a line inside a conditional block. * Restore the libslic3r Precompiled Header and Direct Includes Lost in the Platform Pass The platform-file pass treated pchheader.hpp as an ordinary header and emptied it, and left GUI_Preview.hpp and 14 other files relying on headers they no longer reached directly. * Restore MainFrame.hpp in ParamsDialog.cpp for the Windows-Only Reparent Call * Include Headers That Files Reached Through Ones the Cleanup Removed * Drop Includes Duplicated by the Cleanup or by Main's Own Additions * Leave PreciseSeam.cpp as Main Has It After the Precise Seam Rework
133 lines
3.9 KiB
C++
133 lines
3.9 KiB
C++
#ifndef slic3r_SavePresetDialog_hpp_
|
|
#define slic3r_SavePresetDialog_hpp_
|
|
|
|
//#include <wx/gdicmn.h>
|
|
|
|
#include "libslic3r/Preset.hpp"
|
|
#include "GUI_Utils.hpp"
|
|
#include <string>
|
|
#include <wx/anybutton.h>
|
|
#include <wx/sizer.h>
|
|
#include <wx/checklst.h>
|
|
#include <vector>
|
|
#include <wx/event.h>
|
|
|
|
class RadioGroup;
|
|
class TextInput;
|
|
class wxBoxSizer;
|
|
class wxCommandEvent;
|
|
|
|
class wxStaticText;
|
|
class wxComboBox;
|
|
class wxStaticBitmap;
|
|
|
|
#define SAVE_PRESET_DIALOG_DEF_COLOUR wxColour(255, 255, 255)
|
|
#define SAVE_PRESET_DIALOG_INPUT_SIZE wxSize(FromDIP(360), FromDIP(24))
|
|
#define SAVE_PRESET_DIALOG_BUTTON_SIZE wxSize(FromDIP(60), FromDIP(24))
|
|
|
|
namespace Slic3r {
|
|
namespace GUI {
|
|
|
|
class SavePresetDialog : public DPIDialog
|
|
{
|
|
enum ActionType
|
|
{
|
|
ChangePreset,
|
|
AddPreset,
|
|
Switch,
|
|
UndefAction
|
|
};
|
|
|
|
class Item : public wxWindow
|
|
{
|
|
public:
|
|
enum ValidationType
|
|
{
|
|
Valid,
|
|
NoValid,
|
|
Warning
|
|
};
|
|
|
|
Item(Preset::Type type, const std::string& suffix, wxBoxSizer* sizer, SavePresetDialog* parent);
|
|
|
|
void update_valid_bmp();
|
|
void accept();
|
|
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
|
|
|
bool is_valid() const { return m_valid_type != NoValid; }
|
|
Preset::Type type() const { return m_type; }
|
|
std::string preset_name() const { return m_preset_name; }
|
|
//BBS: add project embedded preset relate logic
|
|
bool save_to_project() const { return m_save_to_project; }
|
|
|
|
// Method to get detach state
|
|
bool is_detached() const { return m_detach; }
|
|
|
|
Preset::Type m_type;
|
|
ValidationType m_valid_type;
|
|
std::string m_preset_name;
|
|
|
|
SavePresetDialog* m_parent {nullptr};
|
|
wxStaticBitmap* m_valid_bmp {nullptr};
|
|
wxComboBox* m_combo {nullptr};
|
|
TextInput* m_input_ctrl {nullptr};
|
|
wxStaticText* m_valid_label {nullptr};
|
|
|
|
PresetCollection* m_presets {nullptr};
|
|
|
|
//BBS: add project embedded preset relate logic
|
|
bool m_save_to_project {false};
|
|
RadioGroup* m_radio_group; // ORCA
|
|
bool m_detach{false};
|
|
|
|
void update();
|
|
};
|
|
|
|
std::vector<Item*> m_items;
|
|
|
|
wxBoxSizer* m_presets_sizer {nullptr};
|
|
wxStaticText* m_label {nullptr};
|
|
wxBoxSizer* m_radio_sizer {nullptr};
|
|
ActionType m_action {UndefAction};
|
|
int m_mode;
|
|
|
|
std::string m_ph_printer_name;
|
|
std::string m_old_preset_name;
|
|
|
|
public:
|
|
SavePresetDialog(wxWindow* parent, Preset::Type type, int mode = 0, std::string suffix = "");
|
|
SavePresetDialog(wxWindow* parent, std::vector<Preset::Type> types, int mode = 0, std::string suffix = "");
|
|
~SavePresetDialog();
|
|
|
|
void AddItem(Preset::Type type, const std::string& suffix);
|
|
|
|
std::string get_name();
|
|
std::string get_name(Preset::Type type);
|
|
void input_name_from_other(std::string new_preset_name);
|
|
void confirm_from_other();
|
|
|
|
bool enable_ok_btn() const;
|
|
void add_info_for_edit_ph_printer(wxBoxSizer *sizer);
|
|
void update_info_for_edit_ph_printer(const std::string &preset_name);
|
|
void layout();
|
|
//BBS: add project embedded preset relate logic
|
|
bool get_save_to_project_selection(Preset::Type type);
|
|
// Method to get the detach state
|
|
bool get_detach_value(Preset::Type type);
|
|
|
|
protected:
|
|
void on_dpi_changed(const wxRect& suggested_rect) override;
|
|
void on_sys_color_changed() override {}
|
|
|
|
private:
|
|
void build(std::vector<Preset::Type> types, std::string suffix = "");
|
|
void on_select_cancel(wxCommandEvent &event);
|
|
void update_physical_printers(const std::string &preset_name);
|
|
void accept(wxCommandEvent &event);
|
|
};
|
|
|
|
} // namespace GUI
|
|
} // namespace Slic3r
|
|
|
|
#endif
|