From b969323ab2ab096ec2d5bb479350a2be3040eb7d Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sun, 6 Mar 2016 12:50:22 +1000 Subject: [PATCH] Clean up versioning, and make Release Notes welcome message translatable --- sleepyhead/SleepLib/common.cpp | 2 + sleepyhead/SleepLib/common.h | 1 + .../loader_plugins/intellipap_loader.cpp | 19 +++- .../SleepLib/loader_plugins/prs1_loader.cpp | 6 +- .../SleepLib/loader_plugins/prs1_loader.h | 2 +- .../SleepLib/loader_plugins/resmed_loader.h | 2 +- sleepyhead/SleepLib/profiles.cpp | 2 +- sleepyhead/UpdaterWindow.cpp | 107 ++++++++++++++---- sleepyhead/docs/release_notes.html | 34 +++--- sleepyhead/main.cpp | 93 +++++++++++---- sleepyhead/mainwindow.cpp | 18 ++- sleepyhead/mainwindow.ui | 7 +- sleepyhead/newprofile.cpp | 2 +- sleepyhead/oximeterimport.cpp | 9 +- sleepyhead/oximeterimport.h | 2 + sleepyhead/oximeterimport.ui | 8 +- sleepyhead/profileselect.cpp | 2 +- sleepyhead/statistics.cpp | 2 +- sleepyhead/version.h | 13 +-- 19 files changed, 233 insertions(+), 98 deletions(-) diff --git a/sleepyhead/SleepLib/common.cpp b/sleepyhead/SleepLib/common.cpp index f10be2c4..39b642fe 100644 --- a/sleepyhead/SleepLib/common.cpp +++ b/sleepyhead/SleepLib/common.cpp @@ -267,6 +267,7 @@ QString STR_TR_PrRelief; // Pressure Relief QString STR_TR_Bookmarks; QString STR_TR_SleepyHead; +QString STR_TR_AppVersion; QString STR_TR_Default; @@ -461,6 +462,7 @@ void initializeStrings() STR_TR_Bookmarks = QObject::tr("Bookmarks"); STR_TR_SleepyHead = QObject::tr("SleepyHead"); + STR_TR_AppVersion = QObject::tr("v%1").arg(VersionString); STR_TR_Mode = QObject::tr("Mode"); STR_TR_Model = QObject::tr("Model"); diff --git a/sleepyhead/SleepLib/common.h b/sleepyhead/SleepLib/common.h index 098cbf7e..6bf2a256 100644 --- a/sleepyhead/SleepLib/common.h +++ b/sleepyhead/SleepLib/common.h @@ -297,6 +297,7 @@ extern QString STR_TR_SensAwake; extern QString STR_TR_Bookmarks; extern QString STR_TR_SleepyHead; +extern QString STR_TR_AppVersion; extern QString STR_TR_Mode; extern QString STR_TR_Model; diff --git a/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp b/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp index 47ca33ae..a65e2014 100644 --- a/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp @@ -43,7 +43,12 @@ IntellipapLoader::~IntellipapLoader() bool IntellipapLoader::Detect(const QString & givenpath) { - QDir dir(givenpath); + QString path = givenpath; + if (path.endsWith("/SL")) { + path.chop(3); + } + + QDir dir(path); if (!dir.exists()) { return false; @@ -51,6 +56,7 @@ bool IntellipapLoader::Detect(const QString & givenpath) // Intellipap has a folder called SL in the root directory if (!dir.cd("SL")) { + return false; } @@ -66,9 +72,12 @@ int IntellipapLoader::Open(QString path) { // Check for SL directory // Check for DV5MFirm.bin? - QString newpath; - path = path.replace("\\", "/"); + if (path.endsWith("/SL")) { + path.chop(3); + } + QString newpath = path; + QString dirtag = "SL"; @@ -87,7 +96,9 @@ int IntellipapLoader::Open(QString path) filename = newpath + "/SET1"; QFile f(filename); - if (!f.exists()) { return -1; } + if (!f.exists()) { + return -1; + } f.open(QFile::ReadOnly); QTextStream tstream(&f); diff --git a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp index 226e84dd..3ca4a2c7 100644 --- a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp @@ -1394,14 +1394,14 @@ bool PRS1Import::ParseF0Events() } // data1 = buffer[pos++]; - tt = t + qint64((data0+data1)*2) * 1000L; + //tt = t - qint64((data0+data1)*2) * 1000L; if (!Code[12]) { Code[12] = session->AddEventList(PRS1_0B, EVL_Event); } // FIXME - Code[12]->AddEvent(tt, data0); + Code[12]->AddEvent(t, data0); break; case 0x0d: // Vibratory Snore @@ -2937,7 +2937,7 @@ void PRS1Loader::initChannels() QString(unknownshort).arg(0xa,2,16,QChar('0')), STR_UNIT_Unknown, DEFAULT, QColor("black"))); - channel.add(GRP_CPAP, new Channel(PRS1_0B = 0x1155, SPAN, MT_CPAP, SESSION, + channel.add(GRP_CPAP, new Channel(PRS1_0B = 0x1155, UNKNOWN, MT_CPAP, SESSION, "PRS1_0B", QString(unknownname).arg(0xb,2,16,QChar('0')), QString(unknowndesc).arg(0xb,2,16,QChar('0')), diff --git a/sleepyhead/SleepLib/loader_plugins/prs1_loader.h b/sleepyhead/SleepLib/loader_plugins/prs1_loader.h index 0c34abe9..3dc0324b 100644 --- a/sleepyhead/SleepLib/loader_plugins/prs1_loader.h +++ b/sleepyhead/SleepLib/loader_plugins/prs1_loader.h @@ -20,7 +20,7 @@ //******************************************************************************************** // Please INCREMENT the following value when making changes to this loaders implementation. // -const int prs1_data_version = 13; +const int prs1_data_version = 14; // //******************************************************************************************** diff --git a/sleepyhead/SleepLib/loader_plugins/resmed_loader.h b/sleepyhead/SleepLib/loader_plugins/resmed_loader.h index e569d27d..84beae23 100644 --- a/sleepyhead/SleepLib/loader_plugins/resmed_loader.h +++ b/sleepyhead/SleepLib/loader_plugins/resmed_loader.h @@ -20,7 +20,7 @@ //******************************************************************************************** // Please INCREMENT the following value when making changes to this loaders implementation. // -const int resmed_data_version = 9; +const int resmed_data_version = 10; // //******************************************************************************************** diff --git a/sleepyhead/SleepLib/profiles.cpp b/sleepyhead/SleepLib/profiles.cpp index d7f1e13b..5b9b9afa 100644 --- a/sleepyhead/SleepLib/profiles.cpp +++ b/sleepyhead/SleepLib/profiles.cpp @@ -490,7 +490,7 @@ void Profile::DataFormatError(Machine *m) QString msg; msg = ""+QObject::tr("SleepyHead (%1) needs to upgrade its database for %2 %3 %4"). - arg(FullVersionString). + arg(VersionString). arg(m->brand()).arg(m->model()).arg(m->serial()) + "

"; diff --git a/sleepyhead/UpdaterWindow.cpp b/sleepyhead/UpdaterWindow.cpp index 253208ad..a893306b 100644 --- a/sleepyhead/UpdaterWindow.cpp +++ b/sleepyhead/UpdaterWindow.cpp @@ -187,10 +187,65 @@ void UpdaterWindow::requestFile() qint64))); } +int checkVersionStatus(QString statusstr) +{ + if (statusstr.compare("testing", Qt::CaseInsensitive) == 0) return 0; + else if (statusstr.compare("beta", Qt::CaseInsensitive) == 0) return 1; + else if (statusstr.compare("rc", Qt::CaseInsensitive) == 0) return 2; + else if (statusstr.compare("r", Qt::CaseInsensitive) == 0) return 3; + + return 0; +} +struct VersionStruct { + short major; + short minor; + short revision; + short status; + short build; +}; + +VersionStruct parseVersion(QString versionstring) +{ + static VersionStruct version; + + QStringList parts = versionstring.split("."); + bool ok, dodgy = false; + + if (parts.size() < 3) dodgy = true; + + short major = parts[0].toInt(&ok); + if (!ok) dodgy = true; + + short minor = parts[1].toInt(&ok); + if (!ok) dodgy = true; + + QStringList patchver = parts[2].split("-"); + if (patchver.size() < 3) dodgy = true; + + short rev = patchver[0].toInt(&ok); + if (!ok) dodgy = true; + + short build = patchver[2].toInt(&ok); + if (!ok) dodgy = true; + + int status = checkVersionStatus(patchver[1]); + + if (!dodgy) { + version.major = major; + version.minor = minor; + version.revision = rev; + version.status = status; + version.build = build; + } + return version; +} + + // Compare supplied version string with current version // < 0 = this one is newer or version supplied is dodgy, 0 = same, and > 0 there is a newer version int compareVersion(QString version) { + // v1.0.0-beta-2 QStringList parts = version.split("."); bool ok; @@ -218,8 +273,30 @@ int compareVersion(QString version) } QStringList patchver = parts[2].split("-"); - short build = patchver[0].toInt(&ok); + if (patchver.size() < 3) { + // dodgy version string supplied. + return -1; + } + + short rev = patchver[0].toInt(&ok); if (!ok) return -1; + if (rev > revision_number) { + return 1; + } else if (rev < revision_number) { + return -1; + } + + short build = patchver[2].toInt(&ok); + if (!ok) return -1; + + int status = checkVersionStatus(patchver[1]); + int rstatus = checkVersionStatus(ReleaseStatus); + + if (status > rstatus) { + return 1; + } else if (status < rstatus) { + return -1; + } if (build > build_number) { return 1; @@ -227,26 +304,6 @@ int compareVersion(QString version) return -1; } - if ((patchver[1]=="beta") && (ReleaseStatus!="beta")) { - return 1; - } else if (patchver[1] == ReleaseStatus) { - return 0; - } else { - return -1; - } - -// short revision = patchver[0].toInt(&ok); -// if (!ok) return -1; - -// if (revision > revision_number) { -// return 1; -// } else if (revision < revision_number) { -// return -1; -// } - - - // patchver[1] = tag.. - // Versions match return 0; } @@ -337,7 +394,7 @@ void UpdaterWindow::ParseUpdateXML(QIODevice *dev) updates.push_back(upq); } - if (upd && upd->version > FullVersionString) { + if (upd && upd->version > VersionString) { updates.push_back(upd); } @@ -353,12 +410,12 @@ void UpdaterWindow::ParseUpdateXML(QIODevice *dev) if (compareVersion(release->version)) { ui->Title->setText("" + tr("A new version of SleepyHead is available!") + ""); info = tr("Shiny new v%1 is available. You're running old and busted v%2"). - arg(latestapp).arg(FullVersionString); + arg(latestapp).arg(VersionString); ui->notesTabWidget->setCurrentIndex(0); } else { ui->Title->setText("" + tr("An update for SleepyHead is available.") + ""); info = tr("Version %1 is available. You're currently running v%1"). - arg(latestapp).arg(FullVersionString); + arg(latestapp).arg(VersionString); ui->notesTabWidget->setCurrentIndex(1); } @@ -369,7 +426,7 @@ void UpdaterWindow::ParseUpdateXML(QIODevice *dev) for (int i = 0; i < release->updates[platform].size(); i++) { update = &release->updates[platform][i]; - if ((update->type == "application") && (update->version > FullVersionString)) { + if ((update->type == "application") && (update->version > VersionString)) { notes += "" + tr("SleepyHead v%1 build notes").arg(update->version) + "
" + update->notes.trimmed() + "

"; } else if ((update->type == "qtlibs") && (update->version > QT_VERSION_STR)) { diff --git a/sleepyhead/docs/release_notes.html b/sleepyhead/docs/release_notes.html index 1530e92b..c4196fde 100644 --- a/sleepyhead/docs/release_notes.html +++ b/sleepyhead/docs/release_notes.html @@ -1,22 +1,12 @@ - - - -

SleepyHead v1.0.0 beta Release Notes

-

Greetings!

-

After four years in the making, this build brings SleepyHead into the final beta phase.

-

Things are not perfect yet, but the focus from now is putting on the finishing touches.

-

This version brings support for the new Philips Respironics DreamStation, and older PRS1 1060P AVAPS models.

-

Important: Back up your data folder manually, by making a copy the SleepyHeadData folder, as attempting to roll back later may break things.

-

Sleep Well, and good luck!

-

JediMark

- -
+ Changes and fixes in v1.0.0 beta + +
  • Make Release Notes welcome message translate-able (should the changelog be too?)
  • Tons of other bug fixes
  • Fix dodgy PRS1 ASV pressure settings
  • Resolve duplicate RX changes issue
  • -
  • PRS1 1060P AVAPS support... (No flow waveform on these, but still pretty good) +
  • PRS1 1060P support... (No flow waveform on these, but still pretty good)
  • Philips Respironics DreamStation support (Thanks for your assistance JediBob and PaleRider, and everyone who shared their data!)
  • AirCurve pressure reporting glitches
  • Fix F&P Import hang
  • @@ -24,9 +14,11 @@
  • Timezone/UTC fixes (Thanks Reznet!)
  • Various ResMed region specific fixes
  • +

    Bug fixes in v0.9.8-1 +
  • Made daily view left panel, and the right sidebar size changes persitent
  • Windows build related fixes
  • @@ -39,8 +31,10 @@
  • Fix PRS1 4x0P models accidentally being called Plus instead of Pro
  • Fix Profile delete not removing row properly
  • +

    New features & bug fixes in v0.9.8-0
    +
  • Rework of Records box
  • Initial support for Philips Respironics System One Oximetery attachment
  • @@ -49,8 +43,10 @@
  • Prescription changes now caches to disk to save having to reload all data every time
  • Implemented Demand loading for SleepyHead Summary data files
  • +

    New features & bug fixes in v0.9.7
    +
  • Experimental ResMed AirSense S10 import support
  • F&P Icon timestamp fix, thanks to Roy Stone for the patch!
  • @@ -106,8 +102,10 @@
  • Fixed a SleepyHead summary error that prevented count indexes from being stored properly
  • Some other minor fixed and stuff
  • +

    New features & bugs fixes in v0.9.6
    +
  • Threadsafety improvements to debug/logger
  • Multithreaded PRS1 and ResMed loader improvements
  • @@ -127,8 +125,10 @@
  • Added timeout dialog to CPAP card autoscanner
  • Microsoft compiler fixes
  • +

    New features & bugs fixes since v0.9.5
    +
  • Added ability to pin graphs to keep them on screen
  • Fixed tranlation loading on Mac
  • @@ -140,9 +140,11 @@
  • Datacard autodetection ability
  • Philips Respironics 60 series fixes
  • +

    New features & bugs fixes since v0.9.3
    +
  • Retina display fixes for Mac platform
  • Introduced yAxis Scaling modes
  • @@ -160,6 +162,4 @@
  • Some 64-bit fixes, and some other bugfixes mainly useful to those building from source, especially on linux.
  • Fixed some issues with the prescription changes table with certain machines.
  • - - - +
    diff --git a/sleepyhead/main.cpp b/sleepyhead/main.cpp index 954e7682..16c48baa 100644 --- a/sleepyhead/main.cpp +++ b/sleepyhead/main.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "version.h" #include "logger.h" @@ -61,21 +62,75 @@ void initialize() void release_notes() { + QString str = QObject::tr("SleepyHead Release Notes"); QDialog relnotes; - relnotes.setWindowTitle(STR_TR_SleepyHead + " " + QObject::tr("Release Notes") +" "+FullVersionString); - QVBoxLayout layout(&relnotes); - QWebView web(&relnotes); + relnotes.setWindowTitle(str); + relnotes.setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); + relnotes.setStyleSheet("QDialog { background:white; }"); + relnotes.setWindowFlags(Qt::Window | Qt::FramelessWindowHint); - // Language??? + QHBoxLayout * hlayout = new QHBoxLayout(); + QLabel * title = new QLabel("
    " + ""+STR_TR_SleepyHead+"   " + ""+STR_TR_AppVersion+"   " + ""+QObject::tr("Release Notes")+"" + "
    " + "
    ", &relnotes); + QPixmap img=QPixmap(":/docs/sheep.png").scaled(100,100); + QLabel * logo= new QLabel(&relnotes);//, * logo2 = new QLabel(); + logo->setPixmap(img); + hlayout->insertWidget(0, title, 1); + hlayout->insertWidget(1, logo, 0); - web.load(QUrl("qrc:/docs/release_notes.html")); + QVBoxLayout * layout = new QVBoxLayout(&relnotes); + QWebView * web = new QWebView(&relnotes); + + QString welcomeMessage = ""+ + QObject::tr("

    After four years in the making, this build brings SleepyHead into the final beta phase.

    ")+ + QObject::tr("

    Things are not perfect yet, but the focus from now is putting on the finishing touches. ")+ + QObject::tr("This version brings support for the new Philips Respironics DreamStation, and older PRS1 1060P models.

    ")+ + "
    "; + + QFile clfile(":/docs/release_notes.html"); + QString changeLog = QObject::tr("Sorry, could not locate changelog."); + if (clfile.open(QIODevice::ReadOnly)) { + QTextStream ts(&clfile); + changeLog = ts.readAll(); + } + + QString html = "" + "" + "" + "

    "+QObject::tr("Greetings!")+"

    "; + + html += welcomeMessage; + + + if (ReleaseStatus != "r") { + html += "

    "+QObject::tr("Important:")+" " + ""+QObject::tr("As this is a pre-release version, it is recommended that you back up your data folder manually before proceding, because attempting to roll back later may break things.")+"

    "; + } + + html += "

    "+QObject::tr("Sleep Well, and good luck!")+"

    " + "

    "+"JediMark"+"


    Change log


    "; + + html += changeLog; + html += ""; + + + + //QUrl("qrc:/docs/release_notes.html") + + // Should read these from online!!! with language code + web->setHtml(html); //web.page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOn); - relnotes.setLayout(&layout); - layout.insertWidget(0, &web, 1); - QPushButton okbtn(QObject::tr("&Ok, get on with it.."), &relnotes); - relnotes.connect(&okbtn, SIGNAL(clicked()), SLOT(accept())); - layout.insertWidget(1, &okbtn, 1); + relnotes.setLayout(layout); + layout->insertLayout(0, hlayout, 0); + layout->insertWidget(1, web, 1); + QPushButton * okbtn = new QPushButton(QObject::tr("&Ok, get on with it.."), &relnotes); + relnotes.connect(okbtn, SIGNAL(clicked()), SLOT(accept())); + layout->insertWidget(2, okbtn, 0); QApplication::processEvents(); // MW: Needed on Mac, as the html has to finish loading relnotes.exec(); @@ -112,7 +167,7 @@ void MigrateSettings() } oldcopy.setValue("Migrated", true); - settings.setValue("Version", FullVersionString); + settings.setValue("Version", VersionString); qDebug() << keys; @@ -349,10 +404,10 @@ retry_directory: //////////////////////////////////////////////////////////////////////////////////////////// // Check when last checked for updates.. //////////////////////////////////////////////////////////////////////////////////////////// - //bool check_updates = false; + bool check_updates = false; if (PREF[STR_GEN_UpdatesAutoCheck].toBool()) { - //int update_frequency = PREF[STR_GEN_UpdateCheckFrequency].toInt(); + int update_frequency = PREF[STR_GEN_UpdateCheckFrequency].toInt(); int days = 1000; lastchecked = PREF[STR_GEN_UpdatesLastChecked].toDateTime(); @@ -361,9 +416,9 @@ retry_directory: days /= 86400; }; -// if (days > update_frequency) { -// check_updates = true; -// } + if (days > update_frequency) { + check_updates = true; + } } if (!Profiles::profiles.size()) { @@ -382,7 +437,7 @@ retry_directory: if (vc < 0) { release_notes(); - //check_updates = false; + check_updates = false; } else if (vc > 0) { if (QMessageBox::warning(nullptr, STR_MessageBox_Error, QObject::tr("The version of SleepyHead you just ran is OLDER than the one used to create this data (%1).").arg(PREF[STR_PREF_VersionString].toString()) +"\n\n"+ 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) { @@ -412,7 +467,7 @@ retry_directory: } } - PREF[STR_PREF_VersionString] = FullVersionString; + PREF[STR_PREF_VersionString] = VersionString; p_profile = Profiles::Get(PREF[STR_GEN_Profile].toString()); @@ -452,7 +507,7 @@ retry_directory: } - // if (check_updates) { mainwin->CheckForUpdates(); } + //if (check_updates) { mainwin->CheckForUpdates(); } w.show(); diff --git a/sleepyhead/mainwindow.cpp b/sleepyhead/mainwindow.cpp index e2cb689a..a1e89e82 100644 --- a/sleepyhead/mainwindow.cpp +++ b/sleepyhead/mainwindow.cpp @@ -71,6 +71,7 @@ QStatusBar *qstatusbar; extern Profile *profile; + QString getOpenGLVersionString() { static QString glversion; @@ -143,16 +144,23 @@ MainWindow::MainWindow(QWidget *parent) : connect(logger, SIGNAL(outputLog(QString)), this, SLOT(logMessage(QString))); } - QString version = FullVersionString +"-" +QString(GIT_REVISION) +"-" +getGraphicsEngine(); + QString version = STR_TR_AppVersion; #ifndef TEST_BUILD ui->warningLabel->hide(); #endif - if (QString(GIT_BRANCH) != "master") { version += " [" + QString(GIT_BRANCH)+" branch]"; } + version += " ["; +#ifdef GIT_REVISION + if (QString(GIT_BRANCH) != "master") { + version += QString(GIT_BRANCH)+"-"; + } + version += QString(GIT_REVISION) +" "; +#endif + version += getGraphicsEngine()+"]"; - this->setWindowTitle(STR_TR_SleepyHead + QString(" v%1 (" + tr("Profile") + ": %2)").arg(version).arg(PREF[STR_GEN_Profile].toString())); + this->setWindowTitle(STR_TR_SleepyHead + QString(" %1 (" + tr("Profile") + ": %2)").arg(version).arg(PREF[STR_GEN_Profile].toString())); qDebug() << STR_TR_SleepyHead << VersionString << "built with Qt" << QT_VERSION_STR << "on" << __DATE__ << __TIME__; @@ -542,7 +550,7 @@ void MainWindow::log(QString text) void MainWindow::Notify(QString s, QString title, int ms) { if (title.isEmpty()) { - title = "SleepyHead v" + VersionString; + title = tr("%1 %2").arg(STR_TR_SleepyHead).arg(STR_TR_AppVersion); } if (systray) { // GNOME3's systray hides the last line of the displayed Qt message. @@ -1391,7 +1399,7 @@ void MainWindow::on_action_About_triggered() "" "
    " "

    " + STR_TR_SleepyHead + - QString(" v%1 (%2)

    ").arg(VersionString).arg(ReleaseStatus) + + QString(" %1

    ").arg(STR_TR_AppVersion) + tr("Build Date: %1 %2").arg(__DATE__).arg(__TIME__) + QString("
    %1
    ").arg(gitrev) + tr("Graphics Engine: %1").arg(getGraphicsEngine())+ diff --git a/sleepyhead/mainwindow.ui b/sleepyhead/mainwindow.ui index 0c0b4ad5..de6ba7f1 100644 --- a/sleepyhead/mainwindow.ui +++ b/sleepyhead/mainwindow.ui @@ -1482,7 +1482,7 @@ QToolBox::tab:selected { 0 0 - 98 + 95 606 @@ -1896,8 +1896,8 @@ border: 2px solid #56789a; border-radius: 30px; 0 0 - 100 - 30 + 77 + 236 @@ -3175,6 +3175,7 @@ border-radius: 10px; + diff --git a/sleepyhead/newprofile.cpp b/sleepyhead/newprofile.cpp index 5f34f46a..9acac994 100644 --- a/sleepyhead/newprofile.cpp +++ b/sleepyhead/newprofile.cpp @@ -90,7 +90,7 @@ NewProfile::NewProfile(QWidget *parent) : f.close(); } ui->AppTitle->setText("SleepyHead v" + VersionString); - ui->releaseStatus->setText(ReleaseStatus); + //ui->releaseStatus->setText(ReleaseStatus); ui->textBrowser->setHtml(getIntroHTML()); diff --git a/sleepyhead/oximeterimport.cpp b/sleepyhead/oximeterimport.cpp index 3082c886..11665b91 100644 --- a/sleepyhead/oximeterimport.cpp +++ b/sleepyhead/oximeterimport.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include "Graphs/gYAxis.h" #include "Graphs/gXAxis.h" @@ -1090,13 +1091,14 @@ void OximeterImport::setInformation() +tr("If you are trying to sync oximetery and CPAP data, please make sure you imported your CPAP sessions first before proceeding!")+"

    " "

    " ""+tr("Important Notes:")+" " - +tr("For SleepyHead to be able to locate and read directly from your Oximeter device, you need to ensure the correct device drivers (eg. USB to Serial UART) have been installed on your computer. For more information about this, %1click here%2.").arg("").arg("")+"

    " + +tr("For SleepyHead to be able to locate and read directly from your Oximeter device, you need to ensure the correct device drivers (eg. USB to Serial UART) have been installed on your computer. For more information about this, %1click here%2.").arg("").arg("")+"

    " "

    " +tr("Contec CMS50D+ devices do not have an internal clock, and do not record a starting time. If you do not have a CPAP session to link a recording to, you will have to enter the start time manually after the import process is completed.")+"

    " "

    " +tr("Even for devices with an internal clock, it is still recommended to get into the habit of starting oximeter records at the same time as CPAP sessions, because CPAP internal clocks tend to drift over time, and not all can be reset easily.")+"

    "; ui->textBrowser->setHtml(html); ui->textBrowser->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + ui->textBrowser->setOpenExternalLinks(true); } void OximeterImport::on_oximeterType_currentIndexChanged(int index) @@ -1145,3 +1147,8 @@ void OximeterImport::on_cms50DeviceName_textEdited(const QString &arg1) { p_profile->oxi->setDefaultDevice(arg1); } + +void OximeterImport::on_textBrowser_anchorClicked(const QUrl &arg1) +{ + QDesktopServices::openUrl(arg1); +} diff --git a/sleepyhead/oximeterimport.h b/sleepyhead/oximeterimport.h index 4d1e06f2..52df1fa2 100644 --- a/sleepyhead/oximeterimport.h +++ b/sleepyhead/oximeterimport.h @@ -85,6 +85,8 @@ private slots: void on_cms50DeviceName_textEdited(const QString &arg1); + void on_textBrowser_anchorClicked(const QUrl &arg1); + protected slots: void on_updatePlethy(QByteArray plethy); void finishedRecording(); diff --git a/sleepyhead/oximeterimport.ui b/sleepyhead/oximeterimport.ui index 23a2784c..7a758865 100644 --- a/sleepyhead/oximeterimport.ui +++ b/sleepyhead/oximeterimport.ui @@ -7,7 +7,7 @@ 0 0 1312 - 638 + 661 @@ -669,7 +669,7 @@ border-radius: 0px; - 1 + 0 @@ -730,8 +730,8 @@ border-radius: 0px; <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'.Lucida Grande UI'; font-size:13pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> +</style></head><body style=" font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Lucida Grande UI';"><br /></p></body></html> diff --git a/sleepyhead/profileselect.cpp b/sleepyhead/profileselect.cpp index 816c3d20..2dd08857 100644 --- a/sleepyhead/profileselect.cpp +++ b/sleepyhead/profileselect.cpp @@ -100,7 +100,7 @@ ProfileSelect::ProfileSelect(QWidget *parent) : popupMenu->addAction(tr("Delete Profile"), this, SLOT(deleteProfile())); ui->labelAppName->setText(STR_TR_SleepyHead); - ui->labelVersion->setText("v" + VersionString + " " + ReleaseStatus); + ui->labelVersion->setText(STR_TR_AppVersion); // if (GIT_BRANCH!="master") // ui->labelBuild->setText(GIT_BRANCH); // else ui->labelBuild->setText(QString()); diff --git a/sleepyhead/statistics.cpp b/sleepyhead/statistics.cpp index 86094159..89cb8f8d 100644 --- a/sleepyhead/statistics.cpp +++ b/sleepyhead/statistics.cpp @@ -640,7 +640,7 @@ QString htmlFooter(bool showinfo=true) if (showinfo) { html += "
    "; html += QString(QObject::tr("This report was generated by SleepyHead (%1), and has not been approved in any way for compliance or medical diagnostic purposes.")). - arg(FullVersionString) + "

    " + + arg(VersionString) + "

    " + QObject::tr("SleepyHead is free open-source software available from http://sourceforge.net/projects/SleepyHead"); html += "
    "; } diff --git a/sleepyhead/version.h b/sleepyhead/version.h index b41c55e7..80115ff7 100644 --- a/sleepyhead/version.h +++ b/sleepyhead/version.h @@ -17,19 +17,10 @@ const int major_version = 1; // incompatible API changes const int minor_version = 0; // new features that don't break things -const int revision_number = 0; // bugfixes, revisions - -#ifdef TEST_BUILD -const QString ReleaseStatus = "testing"; -#elif BETA_BUILD +const int revision_number = 0; // bugfixes, revisions const QString ReleaseStatus = "beta"; -#else -const QString ReleaseStatus = ""; -#endif - -const QString VersionString = QString().sprintf("%i.%i.%i", major_version, minor_version, build_number); // )+VersionStatus+QString().sprintf("%i", -const QString FullVersionString = VersionString+"-"+ReleaseStatus; +const QString VersionString = QString("%1.%2.%3-%4-%5").arg(major_version).arg(minor_version).arg(revision_number).arg(ReleaseStatus).arg(build_number); #ifdef Q_OS_MAC const QString PlatformString = "MacOSX";