diff --git a/src/slic3r/GUI/UpdateDialogs.cpp b/src/slic3r/GUI/UpdateDialogs.cpp index dd789a1da..64f0597be 100644 --- a/src/slic3r/GUI/UpdateDialogs.cpp +++ b/src/slic3r/GUI/UpdateDialogs.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -58,11 +57,13 @@ MsgUpdateSlic3r::MsgUpdateSlic3r(const Semver &ver_current, const Semver &ver_on const std::string url_log = (boost::format(URL_CHANGELOG) % lang_code).str(); const wxString url_log_wx = from_u8(url_log); auto *link_log = new wxHyperlinkCtrl(this, wxID_ANY, _(L("Open changelog page")), url_log_wx); + link_log->Bind(wxEVT_HYPERLINK, &MsgUpdateSlic3r::on_hyperlink, this); content_sizer->Add(link_log); const std::string url_dw = (boost::format(URL_DOWNLOAD) % lang_code).str(); const wxString url_dw_wx = from_u8(url_dw); auto *link_dw = new wxHyperlinkCtrl(this, wxID_ANY, _(L("Open download page")), url_dw_wx); + link_dw->Bind(wxEVT_HYPERLINK, &MsgUpdateSlic3r::on_hyperlink, this); content_sizer->Add(link_dw); } @@ -77,12 +78,16 @@ MsgUpdateSlic3r::MsgUpdateSlic3r(const Semver &ver_current, const Semver &ver_on MsgUpdateSlic3r::~MsgUpdateSlic3r() {} +void MsgUpdateSlic3r::on_hyperlink(wxHyperlinkEvent& evt) +{ + wxGetApp().open_browser_with_warning_dialog(evt.GetURL()); +} + bool MsgUpdateSlic3r::disable_version_check() const { return cbox->GetValue(); } - // MsgUpdateConfig MsgUpdateConfig::MsgUpdateConfig(const std::vector &updates, bool force_before_wizard/* = false*/) : diff --git a/src/slic3r/GUI/UpdateDialogs.hpp b/src/slic3r/GUI/UpdateDialogs.hpp index aa3a10677..435a8ccbd 100644 --- a/src/slic3r/GUI/UpdateDialogs.hpp +++ b/src/slic3r/GUI/UpdateDialogs.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "libslic3r/Semver.hpp" #include "MsgDialog.hpp" @@ -30,6 +31,7 @@ public: // Tells whether the user checked the "don't bother me again" checkbox bool disable_version_check() const; + void on_hyperlink(wxHyperlinkEvent& evt); private: wxCheckBox *cbox; };