Our opening of url in wxHyperlink
This commit is contained in:
parent
6ebd58e7a0
commit
ad2760f82b
2 changed files with 9 additions and 2 deletions
|
@ -9,7 +9,6 @@
|
|||
#include <wx/event.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/hyperlink.h>
|
||||
#include <wx/statbmp.h>
|
||||
#include <wx/checkbox.h>
|
||||
|
||||
|
@ -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<Update> &updates, bool force_before_wizard/* = false*/) :
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <wx/hyperlink.h>
|
||||
|
||||
#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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue