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,8 +320,23 @@ 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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vMajor.size() == 2) {
|
||||||
|
if (vMajor[0] != vMajor[1]) {
|
||||||
|
|
||||||
// Update the version parameter with the right value
|
// Update the version parameter with the right value
|
||||||
options.version = versionString;
|
options.version = versionString;
|
||||||
@@ -338,6 +354,7 @@ void RTWindow::on_realize ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool RTWindow::on_window_state_event(GdkEventWindowState* event)
|
bool RTWindow::on_window_state_event(GdkEventWindowState* event)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user