mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 11:40:42 +00:00
Update version display throughout to use the new information and be consistent.
The full version now includes the build/git information embedded within it as build metadata according to the Semantic Versioning 2.0.0 spec, for example: "1.1.0-beta-1+branch-name-a1b2c3d". Now the full version string, with all detail is always displayed EXCEPT for release versions, in which case just the simple version number ("1.1.0") is displayed in the primary UI. - Main window title: simple version for release versions, full version string otherwise - Notifications: same as main window title - System tray: same as main window title - About window title: same as main window title - About window release notes: always include full version string - Reports: always include full version string - Under the logo (about dialog, profile selector, new profile window): removed, as it is largely redundant and can interfere with the window geometry. - Database upgrade alert: same as main window title - Database newer alert: same as main window title The full version string is also included within the preference and profile .xml files, but because build metadata is ignored in version comparisons, differences in builds will not cause any spurious alerts. However, changes in prerelease versions will continue to be significant, as they should be.
This commit is contained in:
parent
80489a4b29
commit
2e92107cce
@ -556,7 +556,7 @@ QString STR_TR_PrRelief; // Pressure Relief
|
|||||||
|
|
||||||
QString STR_TR_Bookmarks;
|
QString STR_TR_Bookmarks;
|
||||||
QString STR_TR_OSCAR;
|
QString STR_TR_OSCAR;
|
||||||
QString STR_TR_AppVersion;
|
//QString STR_TR_AppVersion;
|
||||||
|
|
||||||
QString STR_TR_Default;
|
QString STR_TR_Default;
|
||||||
|
|
||||||
@ -761,7 +761,7 @@ void initializeStrings()
|
|||||||
|
|
||||||
STR_TR_Bookmarks = QObject::tr("Bookmarks");
|
STR_TR_Bookmarks = QObject::tr("Bookmarks");
|
||||||
STR_TR_OSCAR = QObject::tr("OSCAR");
|
STR_TR_OSCAR = QObject::tr("OSCAR");
|
||||||
STR_TR_AppVersion = QObject::tr("v%1").arg(getVersion());
|
//STR_TR_AppVersion = QObject::tr("v%1").arg(getVersion());
|
||||||
|
|
||||||
STR_TR_Mode = QObject::tr("Mode");
|
STR_TR_Mode = QObject::tr("Mode");
|
||||||
STR_TR_Model = QObject::tr("Model");
|
STR_TR_Model = QObject::tr("Model");
|
||||||
|
@ -505,8 +505,8 @@ void Profile::DataFormatError(Machine *m)
|
|||||||
{
|
{
|
||||||
QString msg;
|
QString msg;
|
||||||
|
|
||||||
msg = "<font size=+1>"+QObject::tr("OSCAR (%1) needs to upgrade its database for %2 %3 %4").
|
msg = "<font size=+1>"+QObject::tr("OSCAR %1 needs to upgrade its database for %2 %3 %4").
|
||||||
arg(getVersion()).
|
arg(getVersion().displayString()).
|
||||||
arg(m->brand()).arg(m->model()).arg(m->serial())
|
arg(m->brand()).arg(m->model()).arg(m->serial())
|
||||||
+ "</font><br/><br/>";
|
+ "</font><br/><br/>";
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
|
|||||||
ui->creditsText->setHtml(getCredits());
|
ui->creditsText->setHtml(getCredits());
|
||||||
ui->licenseText->setHtml(getLicense());
|
ui->licenseText->setHtml(getLicense());
|
||||||
ui->relnotesText->setHtml(getRelnotes());
|
ui->relnotesText->setHtml(getRelnotes());
|
||||||
ui->versionLabel->setText(getVersion());
|
ui->versionLabel->setText("");
|
||||||
|
|
||||||
// QString gitrev = gitRevision();
|
// QString gitrev = gitRevision();
|
||||||
//
|
//
|
||||||
@ -44,7 +44,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
|
|||||||
ui->infoLabel->setText(text);
|
ui->infoLabel->setText(text);
|
||||||
|
|
||||||
|
|
||||||
setWindowTitle(tr("About OSCAR"));
|
setWindowTitle(tr("About OSCAR %1").arg(getVersion().displayString()));
|
||||||
setMinimumSize(QSize(400,400));
|
setMinimumSize(QSize(400,400));
|
||||||
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
connect(ui->closeButton, SIGNAL(clicked(bool)), this, SLOT(accept()));
|
connect(ui->closeButton, SIGNAL(clicked(bool)), this, SLOT(accept()));
|
||||||
@ -123,7 +123,7 @@ QString AboutDialog::getRelnotes()
|
|||||||
QString text = "<html>"
|
QString text = "<html>"
|
||||||
"<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head>"
|
"<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head>"
|
||||||
"<body><span style=\" font-size:20pt;\">"+tr("Release Notes")+"</span><br/>"
|
"<body><span style=\" font-size:20pt;\">"+tr("Release Notes")+"</span><br/>"
|
||||||
"<span style=\" font-size:14pt;\">"+tr("OSCAR v%1").arg(getVersion())+"</span>"
|
"<span style=\" font-size:14pt;\">"+tr("OSCAR %1").arg(getVersion())+"</span>"
|
||||||
"<hr/>";
|
"<hr/>";
|
||||||
if (getVersion().IsReleaseVersion() == false) {
|
if (getVersion().IsReleaseVersion() == false) {
|
||||||
text += "<p><font color='red' size=+1><b>"+tr("Important:")+"</b></font> "
|
text += "<p><font color='red' size=+1><b>"+tr("Important:")+"</b></font> "
|
||||||
|
@ -246,7 +246,7 @@ bool migrateFromSH(QString destDir) {
|
|||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
initializeStrings();
|
initializeStrings();
|
||||||
qDebug() << STR_TR_OSCAR + " " + getBranchVersion();
|
qDebug() << STR_TR_OSCAR + " " + getVersion();
|
||||||
|
|
||||||
AutoTest::run(argc, argv);
|
AutoTest::run(argc, argv);
|
||||||
}
|
}
|
||||||
@ -554,8 +554,10 @@ int main(int argc, char *argv[]) {
|
|||||||
// check_updates = false;
|
// check_updates = false;
|
||||||
} else if (currentVersion < settingsVersion) {
|
} else if (currentVersion < settingsVersion) {
|
||||||
if (QMessageBox::warning(nullptr, STR_MessageBox_Error,
|
if (QMessageBox::warning(nullptr, STR_MessageBox_Error,
|
||||||
QObject::tr("The version of OSCAR you just ran is OLDER than the one used to create this data (%1).").
|
QObject::tr("The version of OSCAR you are running (%1) is OLDER than the one used to create this data (%2).")
|
||||||
arg(AppSetting->versionString()) +"\n\n"+
|
.arg(currentVersion.displayString())
|
||||||
|
.arg(settingsVersion.displayString())
|
||||||
|
+"\n\n"+
|
||||||
QObject::tr("It is likely that doing this will cause data corruption, are you sure you want to do this?"),
|
QObject::tr("It is likely that doing this will cause data corruption, are you sure you want to do this?"),
|
||||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) {
|
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) {
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
// seems to need the systray menu for notifications to work
|
// seems to need the systray menu for notifications to work
|
||||||
systraymenu = new QMenu(this);
|
systraymenu = new QMenu(this);
|
||||||
systray->setContextMenu(systraymenu);
|
systray->setContextMenu(systraymenu);
|
||||||
QAction *a = systraymenu->addAction(STR_TR_OSCAR + " v" + getVersion());
|
QAction *a = systraymenu->addAction(STR_TR_OSCAR + " " + getVersion().displayString());
|
||||||
a->setEnabled(false);
|
a->setEnabled(false);
|
||||||
systraymenu->addSeparator();
|
systraymenu->addSeparator();
|
||||||
systraymenu->addAction(tr("&About"), this, SLOT(on_action_About_triggered()));
|
systraymenu->addAction(tr("&About"), this, SLOT(on_action_About_triggered()));
|
||||||
@ -113,11 +113,19 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
|
|
||||||
bool setupRunning = false;
|
bool setupRunning = false;
|
||||||
|
|
||||||
|
QString MainWindow::getMainWindowTitle()
|
||||||
|
{
|
||||||
|
QString title = STR_TR_OSCAR + " " + getVersion().displayString();
|
||||||
|
#ifdef BROKEN_OPENGL_BUILD
|
||||||
|
title += " ["+CSTR_GFX_BrokenGL+"]";
|
||||||
|
#endif
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::SetupGUI()
|
void MainWindow::SetupGUI()
|
||||||
{
|
{
|
||||||
setupRunning = true;
|
setupRunning = true;
|
||||||
QString version = getBranchVersion();
|
setWindowTitle(getMainWindowTitle());
|
||||||
setWindowTitle(STR_TR_OSCAR + QString(" %1").arg(version));
|
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
ui->action_About->setMenuRole(QAction::ApplicationSpecificRole);
|
ui->action_About->setMenuRole(QAction::ApplicationSpecificRole);
|
||||||
@ -317,7 +325,7 @@ void MainWindow::EnableTabs(bool b)
|
|||||||
void MainWindow::Notify(QString s, QString title, int ms)
|
void MainWindow::Notify(QString s, QString title, int ms)
|
||||||
{
|
{
|
||||||
if (title.isEmpty()) {
|
if (title.isEmpty()) {
|
||||||
title = tr("%1 %2").arg(STR_TR_OSCAR).arg(STR_TR_AppVersion);
|
title = STR_TR_OSCAR + " " + getVersion().displayString();
|
||||||
}
|
}
|
||||||
if (systray) {
|
if (systray) {
|
||||||
QString msg = s;
|
QString msg = s;
|
||||||
@ -527,7 +535,7 @@ bool MainWindow::OpenProfile(QString profileName, bool skippassword)
|
|||||||
PopulatePurgeMenu();
|
PopulatePurgeMenu();
|
||||||
|
|
||||||
AppSetting->setProfileName(p_profile->user->userName());
|
AppSetting->setProfileName(p_profile->user->userName());
|
||||||
setWindowTitle(STR_TR_OSCAR + QString(" %1 (" + tr("Profile") + ": %2)").arg(getBranchVersion()).arg(AppSetting->profileName()));
|
setWindowTitle(tr("%1 (Profile: %2)").arg(getMainWindowTitle()).arg(AppSetting->profileName()));
|
||||||
|
|
||||||
QList<Machine *> oximachines = p_profile->GetMachines(MT_OXIMETER); // Machines of any type except Journal
|
QList<Machine *> oximachines = p_profile->GetMachines(MT_OXIMETER); // Machines of any type except Journal
|
||||||
QList<Machine *> posmachines = p_profile->GetMachines(MT_POSITION);
|
QList<Machine *> posmachines = p_profile->GetMachines(MT_POSITION);
|
||||||
|
@ -113,7 +113,7 @@ class MainWindow : public QMainWindow
|
|||||||
void CloseProfile();
|
void CloseProfile();
|
||||||
bool OpenProfile(QString name, bool skippassword = false);
|
bool OpenProfile(QString name, bool skippassword = false);
|
||||||
|
|
||||||
/*! \fn Notify(QString s,int ms=5000, QString title="OSCAR v"+getVersion());
|
/*! \fn Notify(QString s, QString title="OSCAR (version)", int ms=5000);
|
||||||
\brief Pops up a message box near the system tray
|
\brief Pops up a message box near the system tray
|
||||||
\param QString string
|
\param QString string
|
||||||
\param title
|
\param title
|
||||||
@ -348,6 +348,7 @@ class MainWindow : public QMainWindow
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QString getMainWindowTitle();
|
||||||
void importCPAPBackups();
|
void importCPAPBackups();
|
||||||
void finishCPAPImport();
|
void finishCPAPImport();
|
||||||
QList<ImportPath> detectCPAPCards();
|
QList<ImportPath> detectCPAPCards();
|
||||||
|
@ -93,7 +93,7 @@ NewProfile::NewProfile(QWidget *parent, const QString *user) :
|
|||||||
|
|
||||||
f.close();
|
f.close();
|
||||||
}
|
}
|
||||||
ui->versionLabel->setText(getVersion());
|
ui->versionLabel->setText("");
|
||||||
|
|
||||||
ui->textBrowser->setHtml(getIntroHTML());
|
ui->textBrowser->setHtml(getIntroHTML());
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ ProfileSelect::ProfileSelect(QWidget *parent) :
|
|||||||
popupMenu->addAction(tr("Delete Profile"), this, SLOT(deleteProfile()));
|
popupMenu->addAction(tr("Delete Profile"), this, SLOT(deleteProfile()));
|
||||||
|
|
||||||
ui->labelAppName->setText(STR_TR_OSCAR);
|
ui->labelAppName->setText(STR_TR_OSCAR);
|
||||||
ui->labelVersion->setText(STR_TR_AppVersion);
|
ui->labelVersion->setText("");
|
||||||
// if (GIT_BRANCH!="master")
|
// if (GIT_BRANCH!="master")
|
||||||
// ui->labelBuild->setText(GIT_BRANCH);
|
// ui->labelBuild->setText(GIT_BRANCH);
|
||||||
// else ui->labelBuild->setText(QString());
|
// else ui->labelBuild->setText(QString());
|
||||||
|
@ -56,7 +56,7 @@ ProfileSelector::ProfileSelector(QWidget *parent) :
|
|||||||
showDiskUsage = false; // in case I want to preference it later
|
showDiskUsage = false; // in case I want to preference it later
|
||||||
on_diskSpaceInfo_linkActivated(showDiskUsage ? "show" : "hide");
|
on_diskSpaceInfo_linkActivated(showDiskUsage ? "show" : "hide");
|
||||||
|
|
||||||
ui->versionLabel->setText(getVersion());
|
ui->versionLabel->setText("");
|
||||||
ui->diskSpaceInfo->setVisible(false);
|
ui->diskSpaceInfo->setVisible(false);
|
||||||
|
|
||||||
QItemSelectionModel * sm = ui->profileView->selectionModel();
|
QItemSelectionModel * sm = ui->profileView->selectionModel();
|
||||||
|
@ -558,8 +558,9 @@ void Report::PrintReport(gGraphView *gv, QString name, QDate date)
|
|||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
QDateTime timestamp = QDateTime::currentDateTime();
|
QDateTime timestamp = QDateTime::currentDateTime();
|
||||||
QString footer = QObject::tr("%1 OSCAR v%2").arg(timestamp.toString(MedDateFormat+" hh:mm"))
|
QString footer = QObject::tr("%1 %2 %3").arg(timestamp.toString(MedDateFormat+" hh:mm"))
|
||||||
.arg(getVersion()+" (" + gitRevision() + ")");
|
.arg(STR_TR_OSCAR)
|
||||||
|
.arg(getVersion());
|
||||||
|
|
||||||
|
|
||||||
QRectF bounds = painter.boundingRect(QRectF(0, virt_height, virt_width, normal_height), footer,
|
QRectF bounds = painter.boundingRect(QRectF(0, virt_height, virt_width, normal_height), footer,
|
||||||
|
@ -719,8 +719,8 @@ QString Statistics::generateFooter(bool showinfo)
|
|||||||
if (showinfo) {
|
if (showinfo) {
|
||||||
html += "<hr><div align=center><font size='-1'><i>";
|
html += "<hr><div align=center><font size='-1'><i>";
|
||||||
QDateTime timestamp = QDateTime::currentDateTime();
|
QDateTime timestamp = QDateTime::currentDateTime();
|
||||||
html += tr("This report was prepared on %1 by OSCAR v%2").arg(timestamp.toString(MedDateFormat + " hh:mm"))
|
html += tr("This report was prepared on %1 by OSCAR %2").arg(timestamp.toString(MedDateFormat + " hh:mm"))
|
||||||
.arg(getVersion() + " (" + gitRevision() + ")")
|
.arg(getVersion())
|
||||||
+ "<br/>"
|
+ "<br/>"
|
||||||
+ tr("OSCAR is free open-source CPAP report software");
|
+ tr("OSCAR is free open-source CPAP report software");
|
||||||
html += "</i></font></div>";
|
html += "</i></font></div>";
|
||||||
|
@ -35,24 +35,6 @@ const QString & gitBranch()
|
|||||||
return GIT_BRANCH;
|
return GIT_BRANCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getBranchVersion()
|
|
||||||
{
|
|
||||||
QString version = STR_TR_AppVersion;
|
|
||||||
|
|
||||||
if (getVersion().IsReleaseVersion() == false)
|
|
||||||
version += " ("+GIT_REVISION + ")";
|
|
||||||
|
|
||||||
if (GIT_BRANCH != "master") {
|
|
||||||
version += " [Branch: " + GIT_BRANCH + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef BROKEN_OPENGL_BUILD
|
|
||||||
version += " ["+CSTR_GFX_BrokenGL+"]";
|
|
||||||
#endif
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString getPrereleaseSuffix()
|
QString getPrereleaseSuffix()
|
||||||
{
|
{
|
||||||
QString suffix;
|
QString suffix;
|
||||||
@ -100,7 +82,7 @@ const QString & Version::toString() const
|
|||||||
// Alternate formatting of the version string for display or logging
|
// Alternate formatting of the version string for display or logging
|
||||||
const QString Version::minimalString() const
|
const QString Version::minimalString() const
|
||||||
{
|
{
|
||||||
return toString().section("+", 0);
|
return toString().section("+", 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString & Version::getBuildMetadata() const
|
const QString & Version::getBuildMetadata() const
|
||||||
@ -120,10 +102,10 @@ const QString Version::displayString() const
|
|||||||
const QString Version::PrereleaseType() const
|
const QString Version::PrereleaseType() const
|
||||||
{
|
{
|
||||||
// Extract the first identifier
|
// Extract the first identifier
|
||||||
QString type = mPrerelease.section(".", 0);
|
QString type = mPrerelease.section(".", 0, 0);
|
||||||
|
|
||||||
// Remove any "-2", etc. that's included in the first identifier rather than as a dot-separated identifier
|
// Remove any "-2", etc. that's included in the first identifier rather than as a dot-separated identifier
|
||||||
type = type.section("-", 0);
|
type = type.section("-", 0, 0);
|
||||||
|
|
||||||
return type.toLower();
|
return type.toLower();
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,6 @@ protected:
|
|||||||
//!brief Get the current version of the application.
|
//!brief Get the current version of the application.
|
||||||
const Version & getVersion();
|
const Version & getVersion();
|
||||||
|
|
||||||
QString getBranchVersion();
|
|
||||||
QString getPrereleaseSuffix();
|
QString getPrereleaseSuffix();
|
||||||
const QString & gitRevision();
|
const QString & gitRevision();
|
||||||
const QString & gitBranch();
|
const QString & gitBranch();
|
||||||
|
Loading…
Reference in New Issue
Block a user