FIX:Use url links to display Releasenote
Change-Id: Ib57931d71702d1356b10bd4c665017b3331189aa
This commit is contained in:
parent
42e08b5414
commit
ecc76d0f33
3 changed files with 21 additions and 4 deletions
|
@ -2019,8 +2019,8 @@ bool GUI_App::on_init_inner()
|
|||
if (!skip_this_version
|
||||
|| evt.GetInt() != 0) {
|
||||
UpdateVersionDialog dialog(this->mainframe);
|
||||
wxString extmsg = wxString::FromUTF8(version_info.description);
|
||||
dialog.update_version_info(extmsg, version_info.version_str);
|
||||
//dialog.update_version_info(extmsg, version_info.version_str);
|
||||
dialog.update_version_info(version_info.description);
|
||||
if (evt.GetInt() != 0) {
|
||||
dialog.m_remind_choice->Hide();
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ void UpdateVersionDialog::on_dpi_changed(const wxRect &suggested_rect) {
|
|||
m_button_cancel->Rescale();
|
||||
}
|
||||
|
||||
void UpdateVersionDialog::update_version_info(wxString release_note, wxString version)
|
||||
void UpdateVersionDialog::update_version_info(std::string url)
|
||||
{
|
||||
/*m_text_up_info->SetLabel(wxString::Format(_L("Click to download new version in default browser: %s"), version));
|
||||
wxBoxSizer *sizer_text_release_note = new wxBoxSizer(wxVERTICAL);
|
||||
|
@ -281,6 +281,23 @@ void UpdateVersionDialog::update_version_info(wxString release_note, wxString ve
|
|||
sizer_text_release_note->Add(m_staticText_release_note, 0, wxALL, 5);
|
||||
m_scrollwindw_release_note->SetSizer(sizer_text_release_note);
|
||||
m_scrollwindw_release_note->Layout();*/
|
||||
|
||||
if (url.empty()) {
|
||||
fs::path ph(data_dir());
|
||||
ph /= "resources/tooltip/common/releasenote.html";
|
||||
if (!fs::exists(ph)) {
|
||||
ph = resources_dir();
|
||||
ph /= "tooltip/releasenote.html";
|
||||
}
|
||||
auto url = ph.string();
|
||||
std::replace(url.begin(), url.end(), '\\', '/');
|
||||
url = "file:///" + url;
|
||||
m_scrollwindw_release_note->LoadURL(from_u8(url));
|
||||
}
|
||||
else {
|
||||
m_scrollwindw_release_note->LoadURL(from_u8(url));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
bool ShowReleaseNote(std::string content);
|
||||
void RunScript(std::string script);
|
||||
void on_dpi_changed(const wxRect& suggested_rect) override;
|
||||
void update_version_info(wxString release_note, wxString version);
|
||||
void update_version_info(std::string url);
|
||||
void alter_choice(wxCommandEvent& event);
|
||||
|
||||
wxStaticText * m_text_up_info{nullptr};
|
||||
|
|
Loading…
Reference in a new issue