Merge branch 'dk_updater'

This commit is contained in:
David Kocik 2021-11-15 13:00:22 +01:00
commit 3c4095cec2
2 changed files with 9 additions and 2 deletions

View file

@ -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*/) :

View file

@ -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;
};