blob: 6d089415f35860e15f64aa9bada2023cf631569d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
#ifndef slic3r_PhysicalPrinterDialog_hpp_
#define slic3r_PhysicalPrinterDialog_hpp_
#include <vector>
#include <wx/gdicmn.h>
#include "libslic3r/Preset.hpp"
#include "GUI_Utils.hpp"
class wxString;
class wxTextCtrl;
class wxStaticText;
class ScalableButton;
class wxBoxSizer;
namespace Slic3r {
namespace GUI {
class PresetComboBox;
//------------------------------------------
// PresetForPrinter
//------------------------------------------
//static std::string g_info_string = " (modified)";
class PhysicalPrinterDialog;
class PresetForPrinter
{
PhysicalPrinterDialog* m_parent { nullptr };
PresetComboBox* m_presets_list { nullptr };
ScalableButton* m_delete_preset_btn { nullptr };
wxStaticText* m_info_line { nullptr };
wxStaticText* m_full_printer_name { nullptr };
wxBoxSizer* m_sizer { nullptr };
void DeletePreset(wxEvent& event);
public:
PresetForPrinter(PhysicalPrinterDialog* parent, const std::string& preset_name = "");
~PresetForPrinter();
wxBoxSizer* sizer() { return m_sizer; }
void update_full_printer_name();
std::string get_preset_name();
void SuppressDelete();
void AllowDelete();
void msw_rescale();
void on_sys_color_changed() {};
};
//------------------------------------------
// PhysicalPrinterDialog
//------------------------------------------
class ConfigOptionsGroup;
class PhysicalPrinterDialog : public DPIDialog
{
PhysicalPrinter m_printer;
wxString m_default_name;
DynamicPrintConfig* m_config { nullptr };
wxTextCtrl* m_printer_name { nullptr };
std::vector<PresetForPrinter*> m_presets;
ConfigOptionsGroup* m_optgroup { nullptr };
ScalableButton* m_add_preset_btn {nullptr};
ScalableButton* m_printhost_browse_btn {nullptr};
ScalableButton* m_printhost_test_btn {nullptr};
ScalableButton* m_printhost_cafile_browse_btn {nullptr};
ScalableButton* m_printhost_port_browse_btn {nullptr};
wxBoxSizer* m_presets_sizer {nullptr};
void build_printhost_settings(ConfigOptionsGroup* optgroup);
void OnOK(wxEvent& event);
void AddPreset(wxEvent& event);
public:
PhysicalPrinterDialog(wxString printer_name);
~PhysicalPrinterDialog();
void update();
void update_printers();
wxString get_printer_name();
void update_full_printer_names();
PhysicalPrinter* get_printer() {return &m_printer; }
void set_printer_technology(PrinterTechnology pt);
PrinterTechnology get_printer_technology();
void DeletePreset(PresetForPrinter* preset_for_printer);
protected:
void on_dpi_changed(const wxRect& suggested_rect) override;
void on_sys_color_changed() override {};
};
} // namespace GUI
} // namespace Slic3r
#endif
|