FIX: show plugin version in about dialog

Change-Id: I8bf5c42fad5131e21d6b3cd0f5636e1e5e40bc14
Jira: none
This commit is contained in:
chunmao.guo 2023-10-07 12:09:53 +08:00 committed by Lane.Wei
parent eb1d7247f7
commit d7778359ad
2 changed files with 9 additions and 2 deletions

View File

@ -242,7 +242,8 @@ AboutDialog::AboutDialog()
vesizer->Add(0, FromDIP(165), 1, wxEXPAND, FromDIP(5));
auto version_text = GUI_App::format_display_version();
#if BBL_INTERNAL_TESTING
auto version_string = _L("Internal Version") + " " + std::string(version_text);
wxString versionText = BBL_INTERNAL_TESTING == 1 ? _L("Internal Version") : _L("Beta Version");
auto version_string = versionText + " " + std::string(version_text);
#else
auto version_string = _L("Version") + " " + std::string(version_text);
#endif
@ -259,6 +260,12 @@ AboutDialog::AboutDialog()
version->SetBackgroundColour(wxColour("#00AF42"));
vesizer->Add(version, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, FromDIP(5));
#if BBL_INTERNAL_TESTING
wxString plugin_version = wxString::Format("Plugin Version: %s", wxGetApp().getAgent() ? wxGetApp().getAgent()->get_version() : "");
wxStaticText *plugin_version_text = new wxStaticText(this, wxID_ANY, plugin_version, wxDefaultPosition, wxDefaultSize);
plugin_version_text->SetForegroundColour(wxColour("#FFFFFE"));
plugin_version_text->SetBackgroundColour(wxColour("#00AF42"));
vesizer->Add(plugin_version_text, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, FromDIP(5));
wxString build_time = wxString::Format("Build Time: %s", std::string(SLIC3R_BUILD_TIME));
wxStaticText* build_time_text = new wxStaticText(this, wxID_ANY, build_time, wxDefaultPosition, wxDefaultSize);
build_time_text->SetForegroundColour(wxColour("#FFFFFE"));

View File

@ -299,7 +299,7 @@ public:
memDc.DrawLabel(m_constant_text.version, version_rect, wxALIGN_LEFT | wxALIGN_BOTTOM);
#if BBL_INTERNAL_TESTING
wxString versionText = BBL_INTERNAL_TESTING == 1 ? "Internal Version" : "Beta Version";
wxString versionText = BBL_INTERNAL_TESTING == 1 ? _L("Internal Version") : _L("Beta Version");
wxSize text_rect = memDc.GetTextExtent(versionText);
int start_x = (title_rect.GetLeft() + version_rect.GetRight()) / 2 - text_rect.GetWidth();
int start_y = version_rect.GetBottom() + 10;