feature update soft upgrade logic for protocol.

This commit is contained in:
alves
2026-01-15 19:12:00 +08:00
parent efff2b4700
commit a4096ea6c8
4 changed files with 122 additions and 68 deletions
+2 -14
View File
@@ -176,17 +176,12 @@ MsgUpdateConfig::MsgUpdateConfig(const std::vector<Update> &updates, bool force_
wxBoxSizer *content_sizer = new wxBoxSizer(wxVERTICAL);
const auto lang_code = wxGetApp().current_language_code_safe().ToStdString();
auto *versions = new wxBoxSizer(wxVERTICAL);
// BBS: use changelog string instead of url
wxStaticText *changelog_textctrl = new wxStaticText(m_scrollwindw_release_note, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(560), -1));
for (const auto &update : updates) {
auto* versions = new wxBoxSizer(wxVERTICAL);
wxStaticText* changelog_textctrl = new wxStaticText(m_scrollwindw_release_note, wxID_ANY, wxEmptyString, wxDefaultPosition,
@@ -211,12 +206,8 @@ MsgUpdateConfig::MsgUpdateConfig(const std::vector<Update> &updates, bool force_
versions->Add(flex);
// BBS: use changelog string instead of url
//auto change_log = new wxStaticText(m_scrollwindw_release_note, wxID_ANY, from_u8(update.change_log), wxDefaultPosition, wxDefaultSize);
changelog_textctrl->SetLabel(changelog_textctrl->GetLabel() + wxString::Format("%s\n", from_u8(update.change_log)));
//auto change_log = new wxStaticText(m_scrollwindw_release_note, wxID_ANY, from_u8(update.change_log), wxDefaultPosition, wxDefaultSize);
changelog_textctrl->SetLabel(changelog_textctrl->GetLabel() + wxString::Format("%s\n", from_u8(update.change_log)));
content_sizer->Add(versions);
@@ -224,16 +215,13 @@ MsgUpdateConfig::MsgUpdateConfig(const std::vector<Update> &updates, bool force_
if (changelog_textctrl)
content_sizer->Add(changelog_textctrl, 1, wxEXPAND | wxTOP, FromDIP(30));
}
m_butto_ok->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) { EndModal(wxID_OK); });
m_button_cancel->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) { EndModal(wxID_CLOSE); });
m_scrollwindw_release_note->SetSizer(content_sizer);
m_scrollwindw_release_note->Layout();
SetSizer(m_sizer_main);
Layout();
m_sizer_main->Fit(this);