Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVojtech Kral <vojtech@kral.hk>2019-01-29 17:57:22 +0300
committerVojtech Kral <vojtech@kral.hk>2019-01-29 19:11:07 +0300
commitf7529dbef5cf60ab9f3a7e7e2737f28ad4247a76 (patch)
tree7dfa3ade65ef178b9645e3c98535b99366aee455
parenta99c82340100847e56fa712f4a60c927ce4a3500 (diff)
Tab: Update print host address and cafile properly, fix #1687
-rw-r--r--src/slic3r/GUI/Field.hpp4
-rw-r--r--src/slic3r/GUI/Tab.cpp7
2 files changed, 7 insertions, 4 deletions
diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp
index 3273f84c9..8391a111b 100644
--- a/src/slic3r/GUI/Field.hpp
+++ b/src/slic3r/GUI/Field.hpp
@@ -115,7 +115,7 @@ public:
/// subclasses should overload with a specific version
/// Postcondition: Method does not fire the on_change event.
virtual void set_value(const boost::any& value, bool change_event) = 0;
-
+
/// Gets a boost::any representing this control.
/// subclasses should overload with a specific version
virtual boost::any& get_value() = 0;
@@ -128,6 +128,8 @@ public:
virtual wxString get_tooltip_text(const wxString& default_string);
+ void field_changed() { on_change_field(); }
+
// set icon to "UndoToSystemValue" button according to an inheritance of preset
// void set_nonsys_btn_icon(const wxBitmap& icon);
diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp
index 79952f184..c37e04ab9 100644
--- a/src/slic3r/GUI/Tab.cpp
+++ b/src/slic3r/GUI/Tab.cpp
@@ -1587,11 +1587,11 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup)
auto sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(btn);
- btn->Bind(wxEVT_BUTTON, [this, parent, optgroup](wxCommandEvent e) {
+ btn->Bind(wxEVT_BUTTON, [this, parent, optgroup](wxCommandEvent &e) {
BonjourDialog dialog(parent);
if (dialog.show_and_lookup()) {
optgroup->set_value("print_host", std::move(dialog.get_selected()), true);
- // FIXME: emit killfocus on the edit widget
+ optgroup->get_field("print_host")->field_changed();
}
});
@@ -1605,7 +1605,7 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup)
auto sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(btn);
- btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent e) {
+ btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
std::unique_ptr<PrintHost> host(PrintHost::get_print_host(m_config));
if (! host) {
const auto text = wxString::Format("%s",
@@ -1646,6 +1646,7 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup)
wxFileDialog openFileDialog(this, _(L("Open CA certificate file")), "", "", filemasks, wxFD_OPEN | wxFD_FILE_MUST_EXIST);
if (openFileDialog.ShowModal() != wxID_CANCEL) {
optgroup->set_value("printhost_cafile", std::move(openFileDialog.GetPath()), true);
+ optgroup->get_field("printhost_cafile")->field_changed();
}
});