Merge branch 'lessrelnotes' into dev
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtkmm.h>
|
#include <gtkmm.h>
|
||||||
|
#include <regex>
|
||||||
#include "rtwindow.h"
|
#include "rtwindow.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
@@ -319,22 +320,38 @@ void RTWindow::on_realize ()
|
|||||||
|
|
||||||
mainWindowCursorManager.init(get_window());
|
mainWindowCursorManager.init(get_window());
|
||||||
|
|
||||||
// Check if first run of this version, then display the Release Notes text
|
// Display release notes only if new major version.
|
||||||
if (options.version != versionString) {
|
// Pattern matches "5.1" from "5.1-23-g12345678"
|
||||||
|
std::string vs[] = {versionString, options.version};
|
||||||
|
std::regex pat("(^[0-9.]+).*");
|
||||||
|
std::smatch sm;
|
||||||
|
std::vector<std::string> vMajor;
|
||||||
|
for (const auto &v : vs) {
|
||||||
|
if (std::regex_match(v, sm, pat)) {
|
||||||
|
if (sm.size() == 2) {
|
||||||
|
std::ssub_match smsub = sm[1];
|
||||||
|
vMajor.push_back(smsub.str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update the version parameter with the right value
|
if (vMajor.size() == 2) {
|
||||||
options.version = versionString;
|
if (vMajor[0] != vMajor[1]) {
|
||||||
|
|
||||||
splash = new Splash (*this);
|
// Update the version parameter with the right value
|
||||||
splash->set_transient_for (*this);
|
options.version = versionString;
|
||||||
splash->signal_delete_event().connect( sigc::mem_fun(*this, &RTWindow::splashClosed) );
|
|
||||||
|
|
||||||
if (splash->hasReleaseNotes()) {
|
splash = new Splash (*this);
|
||||||
splash->showReleaseNotes();
|
splash->set_transient_for (*this);
|
||||||
splash->show ();
|
splash->signal_delete_event().connect( sigc::mem_fun(*this, &RTWindow::splashClosed) );
|
||||||
} else {
|
|
||||||
delete splash;
|
if (splash->hasReleaseNotes()) {
|
||||||
splash = nullptr;
|
splash->showReleaseNotes();
|
||||||
|
splash->show ();
|
||||||
|
} else {
|
||||||
|
delete splash;
|
||||||
|
splash = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user