Check version string for alpha and beta release versions.

Preferences setting to show / not show alpha beta releases.
This commit is contained in:
David Kocik 2021-10-11 09:44:22 +02:00
parent e1104d5f7d
commit c4f78fcdc9
7 changed files with 88 additions and 14 deletions

View file

@ -918,6 +918,25 @@ bool GUI_App::on_init_inner()
}
}
});
Bind(EVT_SLIC3R_ALPHA_VERSION_ONLINE, [this](const wxCommandEvent& evt) {
//app_config->set("version_alpha_online", into_u8(evt.GetString()));
app_config->save();
if (this->plater_ != nullptr && app_config->get("notify_testing_release") == "1") {
if (*Semver::parse(SLIC3R_VERSION) < *Semver::parse(into_u8(evt.GetString()))) {
this->plater_->get_notification_manager()->push_notification(NotificationType::NewAlphaAvailable);
}
}
});
Bind(EVT_SLIC3R_BETA_VERSION_ONLINE, [this](const wxCommandEvent& evt) {
//app_config->set("version_beta_online", into_u8(evt.GetString()));
app_config->save();
if (this->plater_ != nullptr && app_config->get("notify_testing_release") == "1") {
if (*Semver::parse(SLIC3R_VERSION) < *Semver::parse(into_u8(evt.GetString()))) {
this->plater_->get_notification_manager()->close_notification_of_type(NotificationType::NewAlphaAvailable);
this->plater_->get_notification_manager()->push_notification(NotificationType::NewBetaAvailable);
}
}
});
}
else {
#ifdef __WXMSW__

View file

@ -43,6 +43,10 @@ const NotificationManager::NotificationData NotificationManager::basic_notificat
},
{NotificationType::NewAppAvailable, NotificationLevel::ImportantNotificationLevel, 20, _u8L("New version is available."), _u8L("See Releases page."), [](wxEvtHandler* evnthndlr) {
wxGetApp().open_browser_with_warning_dialog("https://github.com/prusa3d/PrusaSlicer/releases"); return true; }},
{NotificationType::NewAlphaAvailable, NotificationLevel::ImportantNotificationLevel, 20, _u8L("New alpha release is available."), _u8L("See Releases page."), [](wxEvtHandler* evnthndlr) {
wxGetApp().open_browser_with_warning_dialog("https://github.com/prusa3d/PrusaSlicer/releases"); return true; }},
{NotificationType::NewBetaAvailable, NotificationLevel::ImportantNotificationLevel, 20, _u8L("New beta release is available."), _u8L("See Releases page."), [](wxEvtHandler* evnthndlr) {
wxGetApp().open_browser_with_warning_dialog("https://github.com/prusa3d/PrusaSlicer/releases"); return true; }},
{NotificationType::EmptyColorChangeCode, NotificationLevel::PrintInfoNotificationLevel, 10,
_u8L("You have just added a G-code for color change, but its value is empty.\n"
"To export the G-code correctly, check the \"Color Change G-code\" in \"Printer Settings > Custom G-code\"") },

View file

@ -52,6 +52,9 @@ enum class NotificationType
// Notification on the start of PrusaSlicer, when a new PrusaSlicer version is published.
// Contains a hyperlink to open a web browser pointing to the PrusaSlicer download location.
NewAppAvailable,
// Like NewAppAvailable but with text and link for alpha / bet release
NewAlphaAvailable,
NewBetaAvailable,
// Notification on the start of PrusaSlicer, when updates of system profiles are detected.
// Contains a hyperlink to execute installation of the new system profiles.
PresetUpdateAvailable,

View file

@ -375,6 +375,13 @@ void PreferencesDialog::build(size_t selected_tab)
def.set_default_value(new ConfigOptionBool{ app_config->get("use_custom_toolbar_size") == "1" });
option = Option(def, "use_custom_toolbar_size");
m_optgroup_gui->append_single_option_line(option);
def.label = L("Notify about testing releases");
def.type = coBool;
def.tooltip = L("If enabled, you will be notified about alpha / beta releases available for download.");
def.set_default_value(new ConfigOptionBool{ app_config->get("notify_testing_release") == "1" });
option = Option(def, "notify_testing_release");
m_optgroup_gui->append_single_option_line(option);
}
activate_options_tab(m_optgroup_gui);