Compare commits

..

No commits in common. "master" and "v1.5.2-beta-2" have entirely different histories.

106 changed files with 55424 additions and 38501 deletions

View File

@ -17,7 +17,7 @@ After installing the required packages:
$ mkdir OSCAR $ mkdir OSCAR
$ cd OSCAR $ cd OSCAR
$ git clone https://gitlab.com/CrimsonNape/OSCAR-code.git $ git clone https://gitlab.com/pholy/OSCAR-code.git
$ mkdir build $ mkdir build
$ cd build $ cd build
$ qmake ../OSCAR-code/OSCAR_QT.pro. $ qmake ../OSCAR-code/OSCAR_QT.pro.

View File

@ -93,7 +93,7 @@ if [[ ${VERSION} == *-* ]]; then
if [[ ${PRERELEASE} == *rc* ]]; then if [[ ${PRERELEASE} == *rc* ]]; then
RC=1 RC=1
fi fi
VERSION="${VERSION}-${PRERELEASE}" VERSION="${VERSION}~${PRERELEASE}"
fi fi
GIT_REVISION=`awk '/#define GIT_REVISION / { gsub(/"/, "", $3); print $3 }' ${SRC}/git_info.h` GIT_REVISION=`awk '/#define GIT_REVISION / { gsub(/"/, "", $3); print $3 }' ${SRC}/git_info.h`
echo Version: ${VERSION} echo Version: ${VERSION}
@ -142,15 +142,14 @@ if [ -f "./$deb_file" ]; then
exit exit
fi fi
## retrieve packages version for the dependencies # retrieve packages version for the dependencies
getPkg libqt5core getPkg libqt5core
qtver=$PKGVERS qtver=$PKGVERS
corePkg=$PKGNAME
getPkg libdouble getPkg libdouble
dblPkg=$PKGNAME dblPkg=$PKGNAME
echo "QT name version " $corePkg $qtver echo "QT version " $qtver
echo "DblConv package " $dblPkg echo "DblConv package " $dblPkg
# clean folders need to create the package # clean folders need to create the package
@ -242,7 +241,7 @@ fpm --input-type dir --output-type deb \
--depends $dblPkg \ --depends $dblPkg \
--depends libpcre16-3 \ --depends libpcre16-3 \
--depends qttranslations5-l10n \ --depends qttranslations5-l10n \
--depends "${corePkg} >= ${qtver}" \ --depends "libqt5core5a >= 5.9" \
--depends libqt5serialport5 \ --depends libqt5serialport5 \
--depends libqt5xml5 \ --depends libqt5xml5 \
--depends libqt5network5 \ --depends libqt5network5 \

View File

@ -47,7 +47,7 @@ if [[ ${VERSION} == *-* ]]; then
if [[ ${PRERELEASE} == *rc* ]]; then if [[ ${PRERELEASE} == *rc* ]]; then
RC=1 RC=1
fi fi
VERSION="${VERSION}-${PRERELEASE}" VERSION="${VERSION}~${PRERELEASE}"
fi fi
GIT_REVISION=`awk '/#define GIT_REVISION / { gsub(/"/, "", $3); print $3 }' ${SRC}/git_info.h` GIT_REVISION=`awk '/#define GIT_REVISION / { gsub(/"/, "", $3); print $3 }' ${SRC}/git_info.h`
echo Version: ${VERSION} echo Version: ${VERSION}

View File

@ -52,7 +52,7 @@ NOTE: Official builds are currently made with [macOS 10.14 Mojave] and Command-L
1. Build OSCAR: 1. Build OSCAR:
git clone https://gitlab.com/CrimsonNape/OSCAR-code.git git clone https://gitlab.com/pholy/OSCAR-code.git
cd OSCAR-code cd OSCAR-code
mkdir build mkdir build
cd build cd build

View File

@ -181,7 +181,7 @@ This also allows building using windows shortcuts.
## Start Developing Oscar in Qt Creator ## Start Developing Oscar in Qt Creator
In browser, log into your account at gitlab.com. Select the Oscar project at https://gitlab.com/CrimsonNape/OSCAR-code. Clone a copy of the repository to a location on your computer. In browser, log into your account at gitlab.com. Select the Oscar project at https://gitlab.com/pholy/OSCAR-code. Clone a copy of the repository to a location on your computer.
Start QT. There are two QT Oscar project files: OSCAR_QT.pro in the Oscar-code directory, and Oscar.pro in the Oscar-code\\oscar directory. You may use *either* project file. Both will create a running version of Oscar. I find building with Oscar.pro in the Oscar-code\\oscar directory to be very slightly faster, but the difference is negligible. Start QT. There are two QT Oscar project files: OSCAR_QT.pro in the Oscar-code directory, and Oscar.pro in the Oscar-code\\oscar directory. You may use *either* project file. Both will create a running version of Oscar. I find building with Oscar.pro in the Oscar-code\\oscar directory to be very slightly faster, but the difference is negligible.

View File

@ -22,7 +22,7 @@ Setting aside the religious wars that can arise over any development methodology
### How Do I Develop in a Branch? ### How Do I Develop in a Branch?
0. Create your own fork of the repo and configure it to stay up-to-date with the upstream repo. 0. Create your own fork of the repo and configure it to stay up-to-date with the upstream repo.
* Go to https://gitlab.com/CrimsonNape/OSCAR-code and click on **Fork** in the top right of the project page. * Go to https://gitlab.com/pholy/OSCAR-code and click on **Fork** in the top right of the project page.
* In your fork's sidebar, go to **Settings > Repository** then click on **Expand** for "Mirroring repositories". * In your fork's sidebar, go to **Settings > Repository** then click on **Expand** for "Mirroring repositories".
* Enter "https://gitlab.com/pholy/OSCAR-code.git" for the repository **URL**, make sure the mirror is set to **Pull** and then click **Mirror repository**. * Enter "https://gitlab.com/pholy/OSCAR-code.git" for the repository **URL**, make sure the mirror is set to **Pull** and then click **Mirror repository**.

View File

@ -30,17 +30,17 @@
<p> <p>
<b>Developers</b> <b>Developers</b>
<br> <br>
Phil Olynyk (pholynyk) (<i>Lead Developer</i>), GuyScharf, sawinglogz, Ray Elliott (LoudSnorer), sgearhart (Crimson Nape), untoutseul05</p> Phil Olynyk (pholynyk) (<i>Lead Developer</i>), GuyScharf, sawinglogz, Ray Elliott (LoudSnorer), untoutseul05</p>
<p> <p>
<b>Reporters</b> <b>Reporters</b>
<br>palerider, TechieHusband</p> <br>Crimson Nape, palerider</p>
<p> <p>
<b>Testers</b> <b>Testers</b>
<br> <br>
Fred Bonjour (Gideon) (<i>Lead Tester</i>), ARBatteiger, ArcherNeedsSleep, bollar, c137jayde, cberistain, coldfeet7, dohm, Expat31, fishfinderG, Frankiboy, geraldbergeron, Gooffy44, Gralli, GuyScharf, Homerec130, JJJ, johnnyb00, jr3586, minderbinder, motorsrunnin, NicoFR, pilothaz, ronfario, Ruud J, ScottZZZ, Shnorky, silverdr, Sleepy Quixote, SleepyHenry, SleepyJoseph, stbrown3rd, Tdragone, TechieHippie, TechieHusband, tedpearson, unidee, untoutseul05</p> Fred Bonjour (Gideon) (<i>Lead Tester</i>), GuyScharf, Jeff8356, bollar, c137jayde, cberistain, coldfeet7, geraldbergeron, Homerec130, johnnyb00, jr3586, minderbinder, ScottZZZ, Shnorky, SleepyHenry, stbrown3rd, unidee</p>
<p> <p>
<b>Advisors</b> <b>Advisors</b>
<br>Sleeprider, srlevine1, harre, rhashimoto </p> <br>SkepticDoc, Sleeprider, srlevine1, harre, rhashimoto </p>
<p> <p>
<b>Translators</b> <b>Translators</b>
<br> <br>

View File

@ -10,28 +10,10 @@
<p> <p>
<b>This page in other languages:</b> <b>This page in other languages:</b>
<br><a href=http://www.apneaboard.com/wiki/index.php/OSCAR_Release_Notes>http://www.apneaboard.com/wiki/index.php/OSCAR_Release_Notes</a></p> <br><a href=http://www.apneaboard.com/wiki/index.php/OSCAR_Release_Notes>http://www.apneaboard.com/wiki/index.php/OSCAR_Release_Notes</a></p>
<p>
<p>
<b>Changes and fixes in OSCAR v1.5.3</b>
<br>Portions of OSCAR are &copy; 2019-2024 by
<i>The OSCAR Team</i></p>
<ul>
<li>[fix] No name in user profile - user unable to access data.</li>
<li>[fix] Daily Search: Add search at first imstall.</li>
<li>[fix] Statstics: Prevent Data Range from listing future dates.</li>
<li>[fix] Correct validation for Lanuage and Help files.</li>
<li>[added] Daily Search Item: Searh for any Journal item (notes,bookmarks,weight,feelings).</li>
<li>[added] Import(restore) Journal.</li>
<li>[added] Confgurable Daily Left Side Bar.</li>
<li>[update] Credits.html - Member updates. </li>
</ul>
<b>Changes and fixes in OSCAR v1.5.2</b> <b>Changes and fixes in OSCAR v1.5.2</b>
<br>Portions of OSCAR are &copy; 2019-2024 by <br>Portions of OSCAR are &copy; 2019-2024 by
<i>The OSCAR Team</i></p> <i>The OSCAR Team</i></p>
<ul> <ul>
<li>[fix] VHigh Resolution Control File Location. Now in Oscar Data Folder.</li>
<li>[fix] Statistics: Add configuration of alternating colored lines background.</li>
<li>[fix] Viatom/Wellue file extension (.dat) was preventing the name from changing the start time</li> <li>[fix] Viatom/Wellue file extension (.dat) was preventing the name from changing the start time</li>
<li>[fix] Time display issues encountered when summer time is changed to winter time.</li> <li>[fix] Time display issues encountered when summer time is changed to winter time.</li>
<li>[fix] Statistics display mode is now restored when Oscar starts.</li> <li>[fix] Statistics display mode is now restored when Oscar starts.</li>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

10668
Translations/Filipino.ph.ts Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

90
Translations/qt/oscar_qt_af.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="af_ZA" sourcelanguage="en">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Nee</translation>
</message>
<message>
<source>Yes</source>
<translation>Ja</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Nee</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Ja</translation>
</message>
<message>
<source>Help</source>
<translation>Hulp</translation>
</message>
<message>
<source>Open</source>
<translation>Oopmaak</translation>
</message>
<message>
<source>Save</source>
<translation>Stoor</translation>
</message>
<message>
<source>Abort</source>
<translation>Afbreek</translation>
</message>
<message>
<source>Apply</source>
<translation>Toepas</translation>
</message>
<message>
<source>Close</source>
<translation>Sluit</translation>
</message>
<message>
<source>Reset</source>
<translation>Herstel</translation>
</message>
<message>
<source>Retry</source>
<translation>Weer</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Herstel verstek</translation>
</message>
<message>
<source>Cancel</source>
<translation>Kanselleer</translation>
</message>
<message>
<source>Ignore</source>
<translation>Ignoreer</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>N&amp;ee vir almal</translation>
</message>
<message>
<source>Save All</source>
<translation>Spaar alles</translation>
</message>
<message>
<source>Discard</source>
<translation>Weggooi</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Ja vir &amp;alles</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_ar.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ar">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>لا</translation>
</message>
<message>
<source>Yes</source>
<translation>نعم</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>حسنًا</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;لا</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;نعم</translation>
</message>
<message>
<source>Help</source>
<translation>مساعدة</translation>
</message>
<message>
<source>Open</source>
<translation>افتح</translation>
</message>
<message>
<source>Save</source>
<translation>احفظ</translation>
</message>
<message>
<source>Abort</source>
<translation>أجهض</translation>
</message>
<message>
<source>Apply</source>
<translation>طبّق</translation>
</message>
<message>
<source>Close</source>
<translation>أغلق</translation>
</message>
<message>
<source>Reset</source>
<translation>صفّر</translation>
</message>
<message>
<source>Retry</source>
<translation>حاول مجدّدًا</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>استعد الافتراضيّات</translation>
</message>
<message>
<source>Cancel</source>
<translation>ألغِ</translation>
</message>
<message>
<source>Ignore</source>
<translation>تجاهل</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>لا لل&amp;كلّ</translation>
</message>
<message>
<source>Save All</source>
<translation>احفظ الكلّ</translation>
</message>
<message>
<source>Discard</source>
<translation>ارفض</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>ن&amp;عم للكلّ</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_bg.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="bg">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Не</translation>
</message>
<message>
<source>Yes</source>
<translation>Да</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>Добре</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Не</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Да</translation>
</message>
<message>
<source>Help</source>
<translation>Помощ</translation>
</message>
<message>
<source>Open</source>
<translation>Отваряне</translation>
</message>
<message>
<source>Save</source>
<translation>Запазване</translation>
</message>
<message>
<source>Abort</source>
<translation>Прекъсване</translation>
</message>
<message>
<source>Apply</source>
<translation>Прилагане</translation>
</message>
<message>
<source>Close</source>
<translation>Затваряне</translation>
</message>
<message>
<source>Reset</source>
<translation>Нулиране</translation>
</message>
<message>
<source>Retry</source>
<translation>Повторен опит</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>По подразбиране</translation>
</message>
<message>
<source>Cancel</source>
<translation>Отказ</translation>
</message>
<message>
<source>Ignore</source>
<translation>Пренебрегване</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>Н&amp;е за всички</translation>
</message>
<message>
<source>Save All</source>
<translation>Запазване на всичко</translation>
</message>
<message>
<source>Discard</source>
<translation>Отхвърляне</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Да за &amp;всички</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_da.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="da">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Ingen</translation>
</message>
<message>
<source>Yes</source>
<translation>Ja</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>Okay</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Ingen</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Ja</translation>
</message>
<message>
<source>Help</source>
<translation>Hjælp</translation>
</message>
<message>
<source>Open</source>
<translation>Åben</translation>
</message>
<message>
<source>Save</source>
<translation>Gemme</translation>
</message>
<message>
<source>Abort</source>
<translation>Abort</translation>
</message>
<message>
<source>Apply</source>
<translation>Ansøge</translation>
</message>
<message>
<source>Close</source>
<translation>Tæt</translation>
</message>
<message>
<source>Reset</source>
<translation>Nulstil</translation>
</message>
<message>
<source>Retry</source>
<translation>Prøve igen</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Gendanne standardindstillingerne</translation>
</message>
<message>
<source>Cancel</source>
<translation>Afbestille</translation>
</message>
<message>
<source>Ignore</source>
<translation>Ignorere</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>&amp;Ingen for alle</translation>
</message>
<message>
<source>Save All</source>
<translation>Gem alle</translation>
</message>
<message>
<source>Discard</source>
<translation>Kassér</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Ja til &amp;alle</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_de.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Nein</translation>
</message>
<message>
<source>Yes</source>
<translation>Ja</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Nein</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Ja</translation>
</message>
<message>
<source>Help</source>
<translation>Hilfe</translation>
</message>
<message>
<source>Open</source>
<translation>Öffnen</translation>
</message>
<message>
<source>Save</source>
<translation>Speichern</translation>
</message>
<message>
<source>Abort</source>
<translation>Abbrechen</translation>
</message>
<message>
<source>Apply</source>
<translation>Anwenden</translation>
</message>
<message>
<source>Close</source>
<translation>Schließen</translation>
</message>
<message>
<source>Reset</source>
<translation>Zurücksetzen</translation>
</message>
<message>
<source>Retry</source>
<translation>Wiederholen</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Voreinstellungen</translation>
</message>
<message>
<source>Cancel</source>
<translation>Abbrechen</translation>
</message>
<message>
<source>Ignore</source>
<translation>Ignorieren</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>N&amp;ein, keine</translation>
</message>
<message>
<source>Save All</source>
<translation>Alles speichern</translation>
</message>
<message>
<source>Discard</source>
<translation>Verwerfen</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Ja, &amp;alle</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_el.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="el_GR">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Οχι</translation>
</message>
<message>
<source>Yes</source>
<translation>Ναί</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>Εντάξει</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Οχι</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Ναί</translation>
</message>
<message>
<source>Help</source>
<translation>Βοήθεια</translation>
</message>
<message>
<source>Open</source>
<translation>Ανοιξε</translation>
</message>
<message>
<source>Save</source>
<translation>Σώσει</translation>
</message>
<message>
<source>Abort</source>
<translation>Αποβάλλω</translation>
</message>
<message>
<source>Apply</source>
<translation>Ισχύουν</translation>
</message>
<message>
<source>Close</source>
<translation>Κλείσε</translation>
</message>
<message>
<source>Reset</source>
<translation>Επαναφορά</translation>
</message>
<message>
<source>Retry</source>
<translation>Προσπαθησε ξανα</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Επαναφέρετε τις προεπιλογές</translation>
</message>
<message>
<source>Cancel</source>
<translation>Ματαίωση</translation>
</message>
<message>
<source>Ignore</source>
<translation>Αγνοώ</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>N&amp;o σε όλους</translation>
</message>
<message>
<source>Save All</source>
<translation>Αποθήκευση όλων</translation>
</message>
<message>
<source>Discard</source>
<translation>Απορρίπτω</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Ν&amp;αι σε όλα</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_es.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="es">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>No</translation>
</message>
<message>
<source>Yes</source>
<translation></translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>Aceptar</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;No</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;</translation>
</message>
<message>
<source>Help</source>
<translation>Ayuda</translation>
</message>
<message>
<source>Open</source>
<translation>Abrir</translation>
</message>
<message>
<source>Save</source>
<translation>Guardar</translation>
</message>
<message>
<source>Abort</source>
<translation>Interrumpir</translation>
</message>
<message>
<source>Apply</source>
<translation>Aplicar</translation>
</message>
<message>
<source>Close</source>
<translation>Cerrar</translation>
</message>
<message>
<source>Reset</source>
<translation>Reinicializar</translation>
</message>
<message>
<source>Retry</source>
<translation>Reintentar</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Restaurar los valores predeterminados</translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancelar</translation>
</message>
<message>
<source>Ignore</source>
<translation>Ignorar</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>N&amp;o a todo</translation>
</message>
<message>
<source>Save All</source>
<translation>Guardar todo</translation>
</message>
<message>
<source>Discard</source>
<translation>Descartar</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation> a &amp;todo</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_fi.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fi">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Ei</translation>
</message>
<message>
<source>Yes</source>
<translation>Kyllä</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Ei</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Kyllä</translation>
</message>
<message>
<source>Help</source>
<translation>Ohje</translation>
</message>
<message>
<source>Open</source>
<translation>Avaa</translation>
</message>
<message>
<source>Save</source>
<translation>Tallenna</translation>
</message>
<message>
<source>Abort</source>
<translation>Keskeytä</translation>
</message>
<message>
<source>Apply</source>
<translation>Käytä</translation>
</message>
<message>
<source>Close</source>
<translation>Sulje</translation>
</message>
<message>
<source>Reset</source>
<translation>Palauta</translation>
</message>
<message>
<source>Retry</source>
<translation>Yritä uudelleen</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Palauta oletukset</translation>
</message>
<message>
<source>Cancel</source>
<translation>Peru</translation>
</message>
<message>
<source>Ignore</source>
<translation>Ohita</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>E&amp;i kaikkiin</translation>
</message>
<message>
<source>Save All</source>
<translation>Tallenna kaikki</translation>
</message>
<message>
<source>Discard</source>
<translation>Hylkää</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Kyllä k&amp;aikkiin</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_fil.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fil_PH">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Hindi</translation>
</message>
<message>
<source>Yes</source>
<translation>Oo</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Hindi</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Oo</translation>
</message>
<message>
<source>Help</source>
<translation>Tulong</translation>
</message>
<message>
<source>Open</source>
<translation>Buksan</translation>
</message>
<message>
<source>Save</source>
<translation>I-save</translation>
</message>
<message>
<source>Abort</source>
<translation>Abort</translation>
</message>
<message>
<source>Apply</source>
<translation>Mag-apply</translation>
</message>
<message>
<source>Close</source>
<translation>Isara</translation>
</message>
<message>
<source>Reset</source>
<translation>I-reset</translation>
</message>
<message>
<source>Retry</source>
<translation>Ulitin</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Ibalik sa dating ayos</translation>
</message>
<message>
<source>Cancel</source>
<translation>Pagkansela</translation>
</message>
<message>
<source>Ignore</source>
<translation>ignorahin</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>H&amp;indi sa lahat</translation>
</message>
<message>
<source>Save All</source>
<translation>Iligtas lahat</translation>
</message>
<message>
<source>Discard</source>
<translation>Itapon</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Oo sa &amp;lahat</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_fr.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fr">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Non</translation>
</message>
<message>
<source>Yes</source>
<translation>Oui</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Non</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Oui</translation>
</message>
<message>
<source>Help</source>
<translation>Aide</translation>
</message>
<message>
<source>Open</source>
<translation>Ouvrir</translation>
</message>
<message>
<source>Save</source>
<translation>Enregistrer</translation>
</message>
<message>
<source>Abort</source>
<translation>Abandonner</translation>
</message>
<message>
<source>Apply</source>
<translation>Appliquer</translation>
</message>
<message>
<source>Close</source>
<translation>Fermer</translation>
</message>
<message>
<source>Reset</source>
<translation>Réinitialiser</translation>
</message>
<message>
<source>Retry</source>
<translation>Réessayer</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Restaurer les valeurs par défaut</translation>
</message>
<message>
<source>Cancel</source>
<translation>Annuler</translation>
</message>
<message>
<source>Ignore</source>
<translation>Ignorer</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>Non à to&amp;ut</translation>
</message>
<message>
<source>Save All</source>
<translation>Tout enregistrer</translation>
</message>
<message>
<source>Discard</source>
<translation>Ne pas tenir compte</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Oui à &amp;tout</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_he.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="he_IL">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>לא</translation>
</message>
<message>
<source>Yes</source>
<translation>כן</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>בסדר</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;לא</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;כן</translation>
</message>
<message>
<source>Help</source>
<translation>עזרה</translation>
</message>
<message>
<source>Open</source>
<translation>פתוח</translation>
</message>
<message>
<source>Save</source>
<translation>לְהוֹשִׁיעַ</translation>
</message>
<message>
<source>Abort</source>
<translation>בטל</translation>
</message>
<message>
<source>Apply</source>
<translation>שלח</translation>
</message>
<message>
<source>Close</source>
<translation>סגור</translation>
</message>
<message>
<source>Reset</source>
<translation>אפס</translation>
</message>
<message>
<source>Retry</source>
<translation>נסה שוב</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>לשחזר את ברירות מחדל</translation>
</message>
<message>
<source>Cancel</source>
<translation>ביטול</translation>
</message>
<message>
<source>Ignore</source>
<translation>להתעלם</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>לא לכולם</translation>
</message>
<message>
<source>Save All</source>
<translation>שמור הכל</translation>
</message>
<message>
<source>Discard</source>
<translation>להשליך</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>כן לכולם</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_it.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="it">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>No</translation>
</message>
<message>
<source>Yes</source>
<translation></translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;No</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;</translation>
</message>
<message>
<source>Help</source>
<translation>Aiuto</translation>
</message>
<message>
<source>Open</source>
<translation>Apri</translation>
</message>
<message>
<source>Save</source>
<translation>Salva</translation>
</message>
<message>
<source>Abort</source>
<translation>Interrompi</translation>
</message>
<message>
<source>Apply</source>
<translation>Applica</translation>
</message>
<message>
<source>Close</source>
<translation>Chiudi</translation>
</message>
<message>
<source>Reset</source>
<translation>Ripristina</translation>
</message>
<message>
<source>Retry</source>
<translation>Riprova</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Ripristina valori predefiniti</translation>
</message>
<message>
<source>Cancel</source>
<translation>Annulla</translation>
</message>
<message>
<source>Ignore</source>
<translation>Ignora</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>N&amp;o a tutti</translation>
</message>
<message>
<source>Save All</source>
<translation>Salva tutti</translation>
</message>
<message>
<source>Discard</source>
<translation>Tralascia</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation> &amp;a tutti</translation>
</message>
</context>
</TS>

91
Translations/qt/oscar_qt_ja.ts Executable file
View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ja_JP">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation></translation>
</message>
<message>
<source>Yes</source>
<translation></translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translatorcomment>I believe this is a better fit.</translatorcomment>
<translation></translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;N </translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Y </translation>
</message>
<message>
<source>Help</source>
<translation></translation>
</message>
<message>
<source>Open</source>
<translation></translation>
</message>
<message>
<source>Save</source>
<translation></translation>
</message>
<message>
<source>Abort</source>
<translation></translation>
</message>
<message>
<source>Apply</source>
<translation></translation>
</message>
<message>
<source>Close</source>
<translation></translation>
</message>
<message>
<source>Reset</source>
<translation></translation>
</message>
<message>
<source>Retry</source>
<translation></translation>
</message>
<message>
<source>Restore Defaults</source>
<translation></translation>
</message>
<message>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<source>Ignore</source>
<translation></translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>&amp;o </translation>
</message>
<message>
<source>Save All</source>
<translation></translation>
</message>
<message>
<source>Discard</source>
<translation></translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>&amp;A </translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_ko.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ko">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation></translation>
</message>
<message>
<source>Yes</source>
<translation></translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation></translation>
</message>
<message>
<source>&amp;Yes</source>
<translation></translation>
</message>
<message>
<source>Help</source>
<translation></translation>
</message>
<message>
<source>Open</source>
<translation></translation>
</message>
<message>
<source>Save</source>
<translation></translation>
</message>
<message>
<source>Abort</source>
<translation></translation>
</message>
<message>
<source>Apply</source>
<translation></translation>
</message>
<message>
<source>Close</source>
<translation></translation>
</message>
<message>
<source>Reset</source>
<translation></translation>
</message>
<message>
<source>Retry</source>
<translation></translation>
</message>
<message>
<source>Restore Defaults</source>
<translation> </translation>
</message>
<message>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<source>Ignore</source>
<translation></translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation> </translation>
</message>
<message>
<source>Save All</source>
<translation> </translation>
</message>
<message>
<source>Discard</source>
<translation></translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation> </translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_nl.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="nl">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Nee</translation>
</message>
<message>
<source>Yes</source>
<translation>Ja</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Nee</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Ja</translation>
</message>
<message>
<source>Help</source>
<translation>Hulp</translation>
</message>
<message>
<source>Open</source>
<translation>Openen</translation>
</message>
<message>
<source>Save</source>
<translation>Opslaan</translation>
</message>
<message>
<source>Abort</source>
<translation>Afbreken</translation>
</message>
<message>
<source>Apply</source>
<translation>Toepassen</translation>
</message>
<message>
<source>Close</source>
<translation>Sluiten</translation>
</message>
<message>
<source>Reset</source>
<translation>Herstellen</translation>
</message>
<message>
<source>Retry</source>
<translation>Opnieuw</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Standaardwaarden</translation>
</message>
<message>
<source>Cancel</source>
<translation>Annuleren</translation>
</message>
<message>
<source>Ignore</source>
<translation>Negeren</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>N&amp;ee, geen enkele</translation>
</message>
<message>
<source>Save All</source>
<translation>Sla alles op</translation>
</message>
<message>
<source>Discard</source>
<translation>Verwijderen</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Ja, &amp;allemaal</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_no.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="nn_NO">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Nei</translation>
</message>
<message>
<source>Yes</source>
<translation>Ja</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Nei</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Ja</translation>
</message>
<message>
<source>Help</source>
<translation>Hjelp</translation>
</message>
<message>
<source>Open</source>
<translation>Åpen</translation>
</message>
<message>
<source>Save</source>
<translation>Lagre</translation>
</message>
<message>
<source>Abort</source>
<translation>Avbryte</translation>
</message>
<message>
<source>Apply</source>
<translation>Søke om</translation>
</message>
<message>
<source>Close</source>
<translation>lukke</translation>
</message>
<message>
<source>Reset</source>
<translation>tilbakestille</translation>
</message>
<message>
<source>Retry</source>
<translation>Prøv nytt</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Gjenopprett standardverdier</translation>
</message>
<message>
<source>Cancel</source>
<translation>kansellere</translation>
</message>
<message>
<source>Ignore</source>
<translation>Overse</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>N&amp;ei til alle</translation>
</message>
<message>
<source>Save All</source>
<translation>Lagre alt</translation>
</message>
<message>
<source>Discard</source>
<translation>Forkast</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Ja til &amp;alt</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_pl.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pl">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Nie</translation>
</message>
<message>
<source>Yes</source>
<translation>Tak</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Nie</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Tak</translation>
</message>
<message>
<source>Help</source>
<translation>Pomoc</translation>
</message>
<message>
<source>Open</source>
<translation>Otwórz</translation>
</message>
<message>
<source>Save</source>
<translation>Zachowaj</translation>
</message>
<message>
<source>Abort</source>
<translation>Przerwij</translation>
</message>
<message>
<source>Apply</source>
<translation>Zastosuj</translation>
</message>
<message>
<source>Close</source>
<translation>Zamknij</translation>
</message>
<message>
<source>Reset</source>
<translation>Zresetuj</translation>
</message>
<message>
<source>Retry</source>
<translation>Ponów</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Przywróć domyślne</translation>
</message>
<message>
<source>Cancel</source>
<translation>Anuluj</translation>
</message>
<message>
<source>Ignore</source>
<translation>Zignoruj</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>Ni&amp;e dla wszystkich</translation>
</message>
<message>
<source>Save All</source>
<translation>Zachowaj wszystko</translation>
</message>
<message>
<source>Discard</source>
<translation>Odrzuć</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Ta&amp;k dla wszystkich</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_pt.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pt">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Não</translation>
</message>
<message>
<source>Yes</source>
<translation>sim</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Não</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;sim</translation>
</message>
<message>
<source>Help</source>
<translation>Socorro</translation>
</message>
<message>
<source>Open</source>
<translation>Abrir</translation>
</message>
<message>
<source>Save</source>
<translation>salvar</translation>
</message>
<message>
<source>Abort</source>
<translation>Abortar</translation>
</message>
<message>
<source>Apply</source>
<translation>aplicar</translation>
</message>
<message>
<source>Close</source>
<translation>Fechar</translation>
</message>
<message>
<source>Reset</source>
<translation>Restabelecer</translation>
</message>
<message>
<source>Retry</source>
<translation>Repetir</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Restaurar padrões</translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancelar</translation>
</message>
<message>
<source>Ignore</source>
<translation>Ignorar</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>&amp;o para todos</translation>
</message>
<message>
<source>Save All</source>
<translation>Salvar tudo</translation>
</message>
<message>
<source>Discard</source>
<translation>Descartar</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Sim para &amp;tudo</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_ro.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ro_RO">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Nu</translation>
</message>
<message>
<source>Yes</source>
<translation>da</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>O.K</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Nu</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Da</translation>
</message>
<message>
<source>Help</source>
<translation>Ajutor</translation>
</message>
<message>
<source>Open</source>
<translation>Deschis</translation>
</message>
<message>
<source>Save</source>
<translation>salva</translation>
</message>
<message>
<source>Abort</source>
<translation>Abandonați</translation>
</message>
<message>
<source>Apply</source>
<translation>aplica</translation>
</message>
<message>
<source>Close</source>
<translation>Închide</translation>
</message>
<message>
<source>Reset</source>
<translation>Resetați</translation>
</message>
<message>
<source>Retry</source>
<translation>Reîncercați</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Restabiliti setarile de baza</translation>
</message>
<message>
<source>Cancel</source>
<translation>Anulare</translation>
</message>
<message>
<source>Ignore</source>
<translation>Ignora</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>N&amp;u tuturor</translation>
</message>
<message>
<source>Save All</source>
<translation>Salvează tot</translation>
</message>
<message>
<source>Discard</source>
<translation>Renunțați</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>D&amp;a la toate</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_ru.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru" sourcelanguage="en">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Нет</translation>
</message>
<message>
<source>Yes</source>
<translation>Да</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Нет</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Да</translation>
</message>
<message>
<source>Help</source>
<translation>Помощь</translation>
</message>
<message>
<source>Open</source>
<translation>Открыть</translation>
</message>
<message>
<source>Save</source>
<translation>Сохранить</translation>
</message>
<message>
<source>Abort</source>
<translation>Прервать</translation>
</message>
<message>
<source>Apply</source>
<translation>Применить</translation>
</message>
<message>
<source>Close</source>
<translation>Закрыть</translation>
</message>
<message>
<source>Reset</source>
<translation>Сброс</translation>
</message>
<message>
<source>Retry</source>
<translation>Повторная попытка</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Восстановление настроек по умолчанию</translation>
</message>
<message>
<source>Cancel</source>
<translation>Отмена</translation>
</message>
<message>
<source>Ignore</source>
<translation>Игнорировать</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>Н&amp;ет всем</translation>
</message>
<message>
<source>Save All</source>
<translation>Сохранить все</translation>
</message>
<message>
<source>Discard</source>
<translation>Отбросить</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Д&amp;а всем</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_sv.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="sv_SE">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Nej</translation>
</message>
<message>
<source>Yes</source>
<translation>Ja</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Nej</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Ja</translation>
</message>
<message>
<source>Help</source>
<translation>Hjälp</translation>
</message>
<message>
<source>Open</source>
<translation>Öppen</translation>
</message>
<message>
<source>Save</source>
<translation>Spara</translation>
</message>
<message>
<source>Abort</source>
<translation>Avbryta</translation>
</message>
<message>
<source>Apply</source>
<translation>Tillämpa</translation>
</message>
<message>
<source>Close</source>
<translation>Stänga</translation>
</message>
<message>
<source>Reset</source>
<translation>Återställa</translation>
</message>
<message>
<source>Retry</source>
<translation>Försök igen</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Återgå till grundinställningarna</translation>
</message>
<message>
<source>Cancel</source>
<translation>Avbryt</translation>
</message>
<message>
<source>Ignore</source>
<translation>Ignorera</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>&amp;Inte till alla</translation>
</message>
<message>
<source>Save All</source>
<translation>Rädda alla</translation>
</message>
<message>
<source>Discard</source>
<translation>Kassera</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Ja till &amp;allt</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_th.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="th_TH" sourcelanguage="en">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation></translation>
</message>
<message>
<source>Yes</source>
<translation></translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation></translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;</translation>
</message>
<message>
<source>Help</source>
<translation></translation>
</message>
<message>
<source>Open</source>
<translation></translation>
</message>
<message>
<source>Save</source>
<translation></translation>
</message>
<message>
<source>Abort</source>
<translation></translation>
</message>
<message>
<source>Apply</source>
<translation></translation>
</message>
<message>
<source>Close</source>
<translation></translation>
</message>
<message>
<source>Reset</source>
<translation></translation>
</message>
<message>
<source>Retry</source>
<translation></translation>
</message>
<message>
<source>Restore Defaults</source>
<translation></translation>
</message>
<message>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<source>Ignore</source>
<translation></translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>&amp;</translation>
</message>
<message>
<source>Save All</source>
<translation></translation>
</message>
<message>
<source>Discard</source>
<translation></translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>&amp;</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_tr.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="tr_TR">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation>Hayır</translation>
</message>
<message>
<source>Yes</source>
<translation>Evet</translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation>Tamam</translation>
</message>
<message>
<source>&amp;No</source>
<translation>&amp;Hayır</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>&amp;Evet</translation>
</message>
<message>
<source>Help</source>
<translation>Yardım</translation>
</message>
<message>
<source>Open</source>
<translation></translation>
</message>
<message>
<source>Save</source>
<translation>Kaydet</translation>
</message>
<message>
<source>Abort</source>
<translation>Durdur</translation>
</message>
<message>
<source>Apply</source>
<translation>Uygula</translation>
</message>
<message>
<source>Close</source>
<translation>Kapat</translation>
</message>
<message>
<source>Reset</source>
<translation>Sıfırla</translation>
</message>
<message>
<source>Retry</source>
<translation>Tekrar Dene</translation>
</message>
<message>
<source>Restore Defaults</source>
<translation>Varsayılanları Geri Yükle</translation>
</message>
<message>
<source>Cancel</source>
<translation>İptal</translation>
</message>
<message>
<source>Ignore</source>
<translation>Görmezden Gel</translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>&amp;Tümüne Hayır</translation>
</message>
<message>
<source>Save All</source>
<translation>Hepsini Kaydet</translation>
</message>
<message>
<source>Discard</source>
<translation>At</translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>Tümüne E&amp;vet</translation>
</message>
</context>
</TS>

90
Translations/qt/oscar_qt_zh.ts Executable file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh">
<context>
<name>QShortcut</name>
<message>
<source>No</source>
<translation></translation>
</message>
<message>
<source>Yes</source>
<translation></translation>
</message>
</context>
<context>
<name>QPlatformTheme</name>
<message>
<source>OK</source>
<translation></translation>
</message>
<message>
<source>&amp;No</source>
<translation>(&amp;N)</translation>
</message>
<message>
<source>&amp;Yes</source>
<translation>(&amp;Y)</translation>
</message>
<message>
<source>Help</source>
<translation></translation>
</message>
<message>
<source>Open</source>
<translation></translation>
</message>
<message>
<source>Save</source>
<translation></translation>
</message>
<message>
<source>Abort</source>
<translation></translation>
</message>
<message>
<source>Apply</source>
<translation></translation>
</message>
<message>
<source>Close</source>
<translation></translation>
</message>
<message>
<source>Reset</source>
<translation></translation>
</message>
<message>
<source>Retry</source>
<translation></translation>
</message>
<message>
<source>Restore Defaults</source>
<translation></translation>
</message>
<message>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<source>Ignore</source>
<translation></translation>
</message>
<message>
<source>N&amp;o to All</source>
<translation>(&amp;O)</translation>
</message>
<message>
<source>Save All</source>
<translation></translation>
</message>
<message>
<source>Discard</source>
<translation></translation>
</message>
<message>
<source>Yes to &amp;All</source>
<translation>(&amp;A)</translation>
</message>
</context>
</TS>

View File

@ -462,6 +462,7 @@ void RecalcMAP::updateSpanData(int &currentLoc, int & currentEL,int& currentData
void RecalcMAP::updateEventsChannel(Session*sess,ChannelID chanId, QVector<int> &dataArray, PressureInfo & info ) void RecalcMAP::updateEventsChannel(Session*sess,ChannelID chanId, QVector<int> &dataArray, PressureInfo & info )
{ {
this->chanId=chanId; this->chanId=chanId;
int qtyEvents=0;
EventDataType duration = 0, gain; EventDataType duration = 0, gain;
qint64 t , start; qint64 t , start;
@ -501,6 +502,7 @@ void RecalcMAP::updateEventsChannel(Session*sess,ChannelID chanId, QVector<int>
if (ts>maxx) continue; if (ts>maxx) continue;
if (ts<minx) ts=minx; if (ts<minx) ts=minx;
if (t>maxx) t=maxx; if (t>maxx) t=maxx;
qtyEvents++;
updateSpanData(currentLoc , currentEL , currentData , ts , t , dataArray , info ) ; updateSpanData(currentLoc , currentEL , currentData , ts , t , dataArray , info ) ;
} else { } else {
if (t>maxx) continue; if (t>maxx) continue;
@ -623,10 +625,6 @@ void RecalcMAP::updateTimes(PressureInfo & info) {
void RecalcMAP:: setSelectionRange(gGraph* graph) { void RecalcMAP:: setSelectionRange(gGraph* graph) {
graph->graphView()->GetXBounds(minTime, maxTime); graph->graphView()->GetXBounds(minTime, maxTime);
// changes suggested by grnbrg
qint64 clockdrift = qint64(p_profile->cpap->clockDrift()) * 1000L;
minTime -= clockdrift;
maxTime -= clockdrift;
} }
void RecalcMAP::run() void RecalcMAP::run()

View File

@ -1413,15 +1413,9 @@ bool gGraphView::renderGraphs(QPainter &painter)
// Calculate the height of pinned graphs // Calculate the height of pinned graphs
float pinned_height = 0; // pixel height total float pinned_height = 0; // pixel height total
int pinned_graphs = 0; // count
bool showTitle=!AppSetting->disableDailyGraphTitles();
bool dailyGraph= mainwin->getDaily()->graphView() == this;
for (auto & g : m_graphs) { for (auto & g : m_graphs) {
if (dailyGraph) {
// suppress graph titles in daily graphs based on user preferences
g->setShowTitle(showTitle) ;
}
int minh = g->minHeight(); int minh = g->minHeight();
if (g->height() < minh) { if (g->height() < minh) {
g->setHeight(minh); g->setHeight(minh);
@ -1434,6 +1428,7 @@ bool gGraphView::renderGraphs(QPainter &painter)
h = g->height() * m_scaleY; h = g->height() * m_scaleY;
pinned_height += h + graphSpacer; pinned_height += h + graphSpacer;
pinned_graphs++;
} }
py += pinned_height; // start drawing at the end of pinned space py += pinned_height; // start drawing at the end of pinned space

View File

@ -468,8 +468,11 @@ void gOverviewGraph::paint(QPainter &painter, gGraph &w, const QRegion &region)
l_height = height; l_height = height;
float py; float py;
EventDataType total; EventDataType total;
int daynum = 0;
EventDataType h, tmp; EventDataType h, tmp;
l_offset = (minx) % 86400000L; l_offset = (minx) % 86400000L;
offset = float(l_offset) / 86400000.0; offset = float(l_offset) / 86400000.0;
@ -556,6 +559,7 @@ void gOverviewGraph::paint(QPainter &painter, gGraph &w, const QRegion &region)
float compliance_hours = 0; float compliance_hours = 0;
int incompliant = 0;
Day *day; Day *day;
EventDataType hours; EventDataType hours;
@ -721,6 +725,7 @@ void gOverviewGraph::paint(QPainter &painter, gGraph &w, const QRegion &region)
if (type == ST_HOURS) { if (type == ST_HOURS) {
if (tmp < compliance_hours) { if (tmp < compliance_hours) {
col = QColor("#f04040"); col = QColor("#f04040");
incompliant++;
} else if (summary_only) { } else if (summary_only) {
col = summaryColor; col = summaryColor;
} }
@ -829,6 +834,10 @@ void gOverviewGraph::paint(QPainter &painter, gGraph &w, const QRegion &region)
lastdaygood = true; lastdaygood = true;
// if (Q>maxx+extra) break; // if (Q>maxx+extra) break;
} else { } else {
if (Q < maxx) {
incompliant++;
}
lastdaygood = false; lastdaygood = false;
} }
@ -840,6 +849,8 @@ jumpnext:
px += barw; px += barw;
daynum++;
//lastQ=Q;
} }
painter.setClipping(false); painter.setClipping(false);

View File

@ -28,7 +28,6 @@ AppWideSetting::AppWideSetting(Preferences *pref) : PrefSettings(pref)
initPref(STR_AS_IncludeSerial, false); initPref(STR_AS_IncludeSerial, false);
initPref(STR_AS_MonochromePrinting, false); initPref(STR_AS_MonochromePrinting, false);
//initPref(STR_AS_EventFlagSessionBar, false); //initPref(STR_AS_EventFlagSessionBar, false);
initPref(STR_AS_DisableDailyGraphTitles, false);
initPref(STR_AS_ShowPieChart, false); initPref(STR_AS_ShowPieChart, false);
m_animations = initPref(STR_AS_Animations, true).toBool(); m_animations = initPref(STR_AS_Animations, true).toBool();
m_squareWavePlots = initPref(STR_AS_SquareWave, false).toBool(); m_squareWavePlots = initPref(STR_AS_SquareWave, false).toBool();
@ -36,8 +35,6 @@ AppWideSetting::AppWideSetting(Preferences *pref) : PrefSettings(pref)
m_graphTooltips = initPref(STR_AS_GraphTooltips, true).toBool(); m_graphTooltips = initPref(STR_AS_GraphTooltips, true).toBool();
m_usePixmapCaching = initPref(STR_AS_UsePixmapCaching, false).toBool(); m_usePixmapCaching = initPref(STR_AS_UsePixmapCaching, false).toBool();
m_odt = (OverlayDisplayType)initPref(STR_AS_OverlayType, (int)ODT_Bars).toInt(); m_odt = (OverlayDisplayType)initPref(STR_AS_OverlayType, (int)ODT_Bars).toInt();
initPref(STR_AS_GraphTooltips, 0);
m_alternatingColorsCombo = initPref(STR_AS_setAlternatingColorsCombo, 0).toInt();
#ifndef REMOVE_FITNESS #ifndef REMOVE_FITNESS
m_olm = (OverviewLinechartModes)initPref(STR_AS_OverviewLinechartMode, (int)OLC_Bartop).toInt(); m_olm = (OverviewLinechartModes)initPref(STR_AS_OverviewLinechartMode, (int)OLC_Bartop).toInt();
#endif #endif
@ -52,7 +49,6 @@ AppWideSetting::AppWideSetting(Preferences *pref) : PrefSettings(pref)
initPref(STR_US_AutoLaunchImport, false); initPref(STR_US_AutoLaunchImport, false);
m_cacheSessions = initPref(STR_IS_CacheSessions, false).toBool(); m_cacheSessions = initPref(STR_IS_CacheSessions, false).toBool();
initPref(STR_US_RemoveCardReminder, true); initPref(STR_US_RemoveCardReminder, true);
initPref(STR_US_NotifyMessagBoxOption, false);
initPref(STR_US_DontAskWhenSavingScreenshots, false); initPref(STR_US_DontAskWhenSavingScreenshots, false);
m_profileName = initPref(STR_GEN_Profile, "").toString(); m_profileName = initPref(STR_GEN_Profile, "").toString();
initPref(STR_GEN_AutoOpenLastUsed, true); initPref(STR_GEN_AutoOpenLastUsed, true);

View File

@ -39,7 +39,6 @@ const QString STR_AS_ShowPieChart = "EnablePieChart";
const QString STR_AS_Animations = "AnimationsAndTransitions"; const QString STR_AS_Animations = "AnimationsAndTransitions";
const QString STR_AS_SquareWave = "SquareWavePlots"; const QString STR_AS_SquareWave = "SquareWavePlots";
const QString STR_AS_OverlayType = "OverlayType"; const QString STR_AS_OverlayType = "OverlayType";
const QString STR_AS_setAlternatingColorsCombo = "AlternatingColorsCombo";
#ifndef REMOVE_FITNESS #ifndef REMOVE_FITNESS
const QString STR_AS_OverviewLinechartMode = "OverviewLinechartMode"; const QString STR_AS_OverviewLinechartMode = "OverviewLinechartMode";
#endif #endif
@ -48,7 +47,6 @@ const QString STR_AS_AllowYAxisScaling = "AllowYAxisScaling";
const QString STR_AS_IncludeSerial = "IncludeSerial"; const QString STR_AS_IncludeSerial = "IncludeSerial";
const QString STR_AS_MonochromePrinting = "PrintBW"; const QString STR_AS_MonochromePrinting = "PrintBW";
//const QString STR_AS_EventFlagSessionBar = "EventFlagSessionBar"; //const QString STR_AS_EventFlagSessionBar = "EventFlagSessionBar";
const QString STR_AS_DisableDailyGraphTitles = "DisableDailyGraphTitles";
const QString STR_AS_GraphTooltips = "GraphTooltips"; const QString STR_AS_GraphTooltips = "GraphTooltips";
const QString STR_AS_LineThickness = "LineThickness"; const QString STR_AS_LineThickness = "LineThickness";
const QString STR_AS_LineCursorMode = "LineCursorMode"; const QString STR_AS_LineCursorMode = "LineCursorMode";
@ -63,7 +61,6 @@ const QString STR_US_OpenTabAtStart = "OpenTabAtStart";
const QString STR_US_OpenTabAfterImport = "OpenTabAfterImport"; const QString STR_US_OpenTabAfterImport = "OpenTabAfterImport";
const QString STR_US_AutoLaunchImport = "AutoLaunchImport"; const QString STR_US_AutoLaunchImport = "AutoLaunchImport";
const QString STR_US_RemoveCardReminder = "RemoveCardReminder"; const QString STR_US_RemoveCardReminder = "RemoveCardReminder";
const QString STR_US_NotifyMessagBoxOption = "NotifyMessagBoxOption";
const QString STR_US_DontAskWhenSavingScreenshots = "DontAskWhenSavingScreenshots"; const QString STR_US_DontAskWhenSavingScreenshots = "DontAskWhenSavingScreenshots";
const QString STR_US_ShowPersonalData = "ShowPersonalData"; const QString STR_US_ShowPersonalData = "ShowPersonalData";
const QString STR_IS_CacheSessions = "MemoryHog"; const QString STR_IS_CacheSessions = "MemoryHog";
@ -90,7 +87,6 @@ public:
bool m_usePixmapCaching, m_antiAliasing, m_squareWavePlots,m_graphTooltips, m_lineCursorMode, m_animations; bool m_usePixmapCaching, m_antiAliasing, m_squareWavePlots,m_graphTooltips, m_lineCursorMode, m_animations;
bool m_showPerformance, m_showDebug; bool m_showPerformance, m_showDebug;
int m_tooltipTimeout, m_graphHeight, m_scrollDampening; int m_tooltipTimeout, m_graphHeight, m_scrollDampening;
int m_alternatingColorsCombo;
bool m_multithreading, m_cacheSessions; bool m_multithreading, m_cacheSessions;
float m_lineThickness; float m_lineThickness;
@ -143,11 +139,9 @@ public:
//! \brief Whether to print reports in black and white, which can be more legible on non-color printers //! \brief Whether to print reports in black and white, which can be more legible on non-color printers
bool monochromePrinting() const { return getPref(STR_AS_MonochromePrinting).toBool(); } bool monochromePrinting() const { return getPref(STR_AS_MonochromePrinting).toBool(); }
//bool eventFlagSessionBar() const { return getPref(STR_AS_EventFlagSessionBar).toBool(); } //bool eventFlagSessionBar() const { return getPref(STR_AS_EventFlagSessionBar).toBool(); }
bool disableDailyGraphTitles() const { return getPref(STR_AS_DisableDailyGraphTitles).toBool(); }
//! \Allow disabling of sessions //! \Allow disabling of sessions
//! \brief Whether to show graph tooltips //! \brief Whether to show graph tooltips
inline bool graphTooltips() const { return m_graphTooltips; } inline bool graphTooltips() const { return m_graphTooltips; }
inline int alternatingColorsCombo() { return m_alternatingColorsCombo;}
//! \brief Pen width of line plots //! \brief Pen width of line plots
inline float lineThickness() const { return m_lineThickness; } inline float lineThickness() const { return m_lineThickness; }
//! \brief Whether to show line cursor //! \brief Whether to show line cursor
@ -165,7 +159,6 @@ public:
int openTabAtStart() const { return getPref(STR_US_OpenTabAtStart).toInt(); } int openTabAtStart() const { return getPref(STR_US_OpenTabAtStart).toInt(); }
int openTabAfterImport() const { return getPref(STR_US_OpenTabAfterImport).toInt(); } int openTabAfterImport() const { return getPref(STR_US_OpenTabAfterImport).toInt(); }
bool removeCardReminder() const { return getPref(STR_US_RemoveCardReminder).toBool(); } bool removeCardReminder() const { return getPref(STR_US_RemoveCardReminder).toBool(); }
bool notifyMessagBoxOption() const { return getPref(STR_US_NotifyMessagBoxOption).toBool(); }
bool dontAskWhenSavingScreenshots() const { return getPref(STR_US_DontAskWhenSavingScreenshots).toBool(); } bool dontAskWhenSavingScreenshots() const { return getPref(STR_US_DontAskWhenSavingScreenshots).toBool(); }
bool autoOpenLastUsed() const { return getPref(STR_GEN_AutoOpenLastUsed).toBool(); } bool autoOpenLastUsed() const { return getPref(STR_GEN_AutoOpenLastUsed).toBool(); }
inline const QString & language() const { return m_language; } inline const QString & language() const { return m_language; }
@ -207,11 +200,9 @@ public:
//! \brief Sets whether to print reports in black and white, which can be more legible on non-color printers //! \brief Sets whether to print reports in black and white, which can be more legible on non-color printers
void setMonochromePrinting(bool b) { setPref(STR_AS_MonochromePrinting, b); } void setMonochromePrinting(bool b) { setPref(STR_AS_MonochromePrinting, b); }
// void setEventFlagSessionBar(bool b) { setPref(STR_AS_EventFlagSessionBar, b); } // void setEventFlagSessionBar(bool b) { setPref(STR_AS_EventFlagSessionBar, b); }
void setDisableDailyGraphTitles(bool b) { setPref(STR_AS_DisableDailyGraphTitles, b); }
//! \brief Sets whether to allow double clicking on Y-Axis labels to change vertical scaling mode //! \brief Sets whether to allow double clicking on Y-Axis labels to change vertical scaling mode
void setGraphTooltips(bool b) { setPref(STR_AS_GraphTooltips, m_graphTooltips=b); } void setGraphTooltips(bool b) { setPref(STR_AS_GraphTooltips, m_graphTooltips=b); }
//! \brief Sets the type of overlay flags (which are displayed over the Flow Waveform) //! \brief Sets the type of overlay flags (which are displayed over the Flow Waveform)
void setAlternatingColorsCombo(int b) { setPref(STR_AS_setAlternatingColorsCombo, m_alternatingColorsCombo=b); }
#ifndef REMOVE_FITNESS #ifndef REMOVE_FITNESS
void setOverviewLinechartMode(OverviewLinechartModes olm) { setPref(STR_AS_OverviewLinechartMode, (int)(m_olm=olm)); } void setOverviewLinechartMode(OverviewLinechartModes olm) { setPref(STR_AS_OverviewLinechartMode, (int)(m_olm=olm)); }
#endif #endif
@ -226,7 +217,6 @@ public:
void setOpenTabAtStart(int idx) { setPref(STR_US_OpenTabAtStart, idx); } void setOpenTabAtStart(int idx) { setPref(STR_US_OpenTabAtStart, idx); }
void setOpenTabAfterImport(int idx) { setPref(STR_US_OpenTabAfterImport, idx); } void setOpenTabAfterImport(int idx) { setPref(STR_US_OpenTabAfterImport, idx); }
void setRemoveCardReminder(bool b) { setPref(STR_US_RemoveCardReminder, b); } void setRemoveCardReminder(bool b) { setPref(STR_US_RemoveCardReminder, b); }
void setNotifyMessagBoxOption(bool b) { setPref(STR_US_NotifyMessagBoxOption, b); }
void setDontAskWhenSavingScreenshots(bool b) { setPref(STR_US_DontAskWhenSavingScreenshots, b); } void setDontAskWhenSavingScreenshots(bool b) { setPref(STR_US_DontAskWhenSavingScreenshots, b); }
void setShowPersonalData(bool b) { setPref(STR_US_ShowPersonalData, b); } void setShowPersonalData(bool b) { setPref(STR_US_ShowPersonalData, b); }

View File

@ -1498,7 +1498,7 @@ int calcSPO2Drop(Session *session)
//qint64 rtime[ringsize]={0}; //qint64 rtime[ringsize]={0};
//int rp=0; //int rp=0;
int min; int min;
// int cnt = 0; int cnt = 0;
// tmp = 0; // tmp = 0;
qint64 start = 0; qint64 start = 0;
@ -1520,7 +1520,7 @@ int calcSPO2Drop(Session *session)
if (time > start + 3600000) { break; } // just look at the first hour if (time > start + 3600000) { break; } // just look at the first hour
// tmp += val; // tmp += val;
// cnt++; cnt++;
} }
} }
@ -1551,8 +1551,7 @@ int calcSPO2Drop(Session *session)
if (!current) { continue; } if (!current) { continue; }
time = el->time(i); time = el->time(i);
/* /*ring[rp]=val;
ring[rp]=val;
rtime[rp]=time; rtime[rp]=time;
rp++; rp++;
rp=rp % ringsize; rp=rp % ringsize;
@ -1573,8 +1572,7 @@ int calcSPO2Drop(Session *session)
if (!cnt) { if (!cnt) {
unsigned j=abs((rp-1) % ringsize); unsigned j=abs((rp-1) % ringsize);
tmp=(ring[j]+val)/2; tmp=(ring[j]+val)/2;
} else tmp/=EventDataType(cnt); } else tmp/=EventDataType(cnt); */
*/
val = baseline; val = baseline;
lastt = 0; lastt = 0;

View File

@ -256,7 +256,7 @@ QString appResourcePath()
paths.append( QString( "/usr/local/share/" ) + appName ); paths.append( QString( "/usr/local/share/" ) + appName );
#endif #endif
for (auto p = begin(paths); p != end(paths); ++p ) { for (auto p = begin(paths); p != end(paths); ++p ) {
QString fname = *p+QString("/Html/about.html"); // was "/Translations/oscar_qt_fr.qm" - Crimson Nape QString fname = *p+QString("/Translations/oscar_qt_fr.qm");
qDebug() << "Trying" << fname; qDebug() << "Trying" << fname;
QFileInfo f = QFileInfo(fname); QFileInfo f = QFileInfo(fname);
if ( f.exists() ) { if ( f.exists() ) {

View File

@ -158,9 +158,7 @@ const QString STR_GEN_DataFolder = "DataFolder";
const QString STR_PREF_ReimportBackup = "ReimportBackup"; const QString STR_PREF_ReimportBackup = "ReimportBackup";
const QString STR_PREF_LastCPAPPath = "LastCPAPPath"; const QString STR_PREF_LastCPAPPath = "LastCPAPPath";
const QString STR_PREF_LastJournalPath = "LastJouralPath";
const QString STR_PREF_LastOximetryPath = "LastOximetryPath"; const QString STR_PREF_LastOximetryPath = "LastOximetryPath";
const QString STR_PREF_LastExportCsvPath = "LastExportCsvPath";
const QString STR_MACH_ResMed = "ResMed"; const QString STR_MACH_ResMed = "ResMed";
const QString STR_MACH_PRS1 = "PRS1"; const QString STR_MACH_PRS1 = "PRS1";

View File

@ -1452,7 +1452,6 @@ int Day::getCPAPMode()
if (!mach) return 0; if (!mach) return 0;
CPAPLoader * loader = qobject_cast<CPAPLoader *>(mach->loader()); CPAPLoader * loader = qobject_cast<CPAPLoader *>(mach->loader());
if (!loader) return 0;
ChannelID modechan = loader->CPAPModeChannel(); ChannelID modechan = loader->CPAPModeChannel();
*/ */
@ -1473,9 +1472,6 @@ QString Day::getCPAPModeStr()
if (!mach) return STR_MessageBox_Error; if (!mach) return STR_MessageBox_Error;
CPAPLoader * loader = qobject_cast<CPAPLoader *>(mach->loader()); CPAPLoader * loader = qobject_cast<CPAPLoader *>(mach->loader());
if (!loader) {
return QObject::tr("ERROR:NOT AVAILABLE"); //STR_MessageBox_Error;
}
ChannelID modechan = loader->CPAPModeChannel(); ChannelID modechan = loader->CPAPModeChannel();
@ -1515,9 +1511,8 @@ QString Day::getPressureRelief()
if (!mach) return STR_MessageBox_Error; if (!mach) return STR_MessageBox_Error;
CPAPLoader * loader = qobject_cast<CPAPLoader *>(mach->loader()); CPAPLoader * loader = qobject_cast<CPAPLoader *>(mach->loader());
if (!loader) {
return QObject::tr("ERROR:NOT AVAILABLE"); //STR_MessageBox_Error; if (!loader) return STR_MessageBox_Error;
}
QString pr_str; QString pr_str;

View File

@ -7,30 +7,210 @@
* License. See the file COPYING in the main directory of the source code * License. See the file COPYING in the main directory of the source code
* for more details. */ * for more details. */
#define TEST_MACROS_ENABLED #define TEST_MACROS_ENABLEDoff
#include <test_macros.h> #include <test_macros.h>
#include <QMessageBox> #include "journal.h"
#include "machine_common.h"
#include <QDomDocument> #include <QDomDocument>
#include <QDomElement> #include <QDomElement>
#include <QFile> #include <QFile>
#include <QTextStream> #include <QTextStream>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QDir> #include <QDir>
#include "journal.h" #include <QMessageBox>
#include "daily.h"
#include "SleepLib/common.h"
#include "SleepLib/machine_common.h"
#include "SleepLib/session.h"
#include "SleepLib/profiles.h"
#include "mainwindow.h"
extern MainWindow * mainwin; const int journal_data_version = 1;
const QString OLD_ZOMBIE = QString("zombie");
const QString ZOMBIE = QString("Feelings");
const QString WEIGHT = QString("weight");
bool Journal::BackupJournal(QString filename) JournalEntry::JournalEntry(QDate date)
{
Machine * jmach = p_profile->GetMachine(MT_JOURNAL);
if (jmach == nullptr) { // Create Journal Device record if it doesn't already exist
MachineInfo info(MT_JOURNAL,0, "Journal", QObject::tr("Journal Data"), QString(), QString(), QString(), QString("OSCAR"), QDateTime::currentDateTime(), journal_data_version);
// Using device ID 1 rather than a random number, so in future, if profile.xml gets screwed up they'll get their data back..
// TODO: Perhaps search for unlinked journal folders here to save some anger and frustration? :P
MachineID machid = 1;
QString path = p_profile->Get("{" + STR_GEN_DataFolder + "}");
QDir dir(path);
QStringList filters;
filters << "Journal_*";
QStringList dirs = dir.entryList(filters,QDir::Dirs);
int journals = dirs.size();
if (journals > 0) {
QString tmp = dirs[0].section("_", -1);
bool ok;
machid = tmp.toUInt(&ok, 16);
if (!ok) {
QMessageBox::warning(nullptr, STR_MessageBox_Warning,
QObject::tr("OSCAR found an old Journal folder, but it looks like it's been renamed:")+"\n\n"+
QString("%1").arg(dirs[0])+
QObject::tr("OSCAR will not touch this folder, and will create a new one instead.")+"\n\n"+
QObject::tr("Please be careful when playing in OSCAR's profile folders :-P"), QMessageBox::Ok);
// User renamed the folder.. report this
machid = 1;
}
if (journals > 1) {
QMessageBox::warning(nullptr, STR_MessageBox_Warning,
QObject::tr("For some reason, OSCAR couldn't find a journal object record in your profile, but did find multiple Journal data folders.\n\n")+
QObject::tr("OSCAR picked only the first one of these, and will use it in future:\n\n")+
QString("%1").arg(dirs[0])+
QObject::tr("If your old data is missing, copy the contents of all the other Journal_XXXXXXX folders to this one manually."), QMessageBox::Ok);
// more then one.. report this.
}
}
jmach = p_profile->CreateMachine(info, machid);
}
m_date = date;
session = nullptr;
day = p_profile->GetDay(date, MT_JOURNAL);
if (day != nullptr) {
session = day->firstSession(MT_JOURNAL);
} else {
// Doesn't exist.. create a new one..
session = new Session(jmach,0);
qint64 st,et;
QDateTime dt(date,QTime(22,0)); // 10pm localtime
st=qint64(dt.toTime_t())*1000L;
et=st+3600000L;
session->set_first(st);
session->set_last(et);
// Let it live in memory...but not on disk unless data is changed...
jmach->AddSession(session, true);
// and where does day get set??? does day actually need to be set??
day = p_profile->GetDay(date, MT_JOURNAL);
}
}
JournalEntry::~JournalEntry()
{
if (session && session->IsChanged()) {
Save();
}
}
bool JournalEntry::Save()
{
if (session && session->IsChanged()) {
qDebug() << "Saving journal session for" << m_date;
// just need to write bookmarks, the rest are already stored in the session
QVariantList start;
QVariantList end;
QStringList notes;
int size = bookmarks.size();
for (int i=0; i<size; ++i) {
const Bookmark & bm = bookmarks.at(i);
start.append(bm.start);
end.append(bm.end);
notes.append(bm.notes);
}
session->settings[Bookmark_Start] = start;
session->settings[Bookmark_End] = end;
session->settings[Bookmark_Notes] = notes;
session->settings[LastUpdated] = QDateTime::currentDateTime().toTime_t();
session->StoreSummary();
return true;
}
return false;
}
QString JournalEntry::notes()
{
QHash<ChannelID, QVariant>::iterator it;
if (session && ((it=session->settings.find(Journal_Notes)) != session->settings.end())) {
return it.value().toString();
}
return QString();
}
void JournalEntry::setNotes(QString notes)
{
if (!session) return;
session->settings[Journal_Notes] = notes;
session->SetChanged(true);
}
EventDataType JournalEntry::weight()
{
QHash<ChannelID, QVariant>::iterator it;
if (session && ((it = session->settings.find(Journal_Weight)) != session->settings.end())) {
return it.value().toFloat();
}
return 0;
}
void JournalEntry::setWeight(EventDataType weight)
{
if (!session) return;
session->settings[Journal_Weight] = weight;
session->SetChanged(true);
}
int JournalEntry::zombie()
{
QHash<ChannelID, QVariant>::iterator it;
if (session && ((it = session->settings.find(Journal_ZombieMeter)) != session->settings.end())) {
return it.value().toFloat();
}
return 0;
}
void JournalEntry::setZombie(int zombie)
{
if (!session) return;
session->settings[Journal_ZombieMeter] = zombie;
session->SetChanged(true);
}
QList<Bookmark> & JournalEntry::getBookmarks()
{
bookmarks.clear();
if (!session || !session->settings.contains(Bookmark_Start)) {
return bookmarks;
}
QVariantList start=session->settings[Bookmark_Start].toList();
QVariantList end=session->settings[Bookmark_End].toList();
QStringList notes=session->settings[Bookmark_Notes].toStringList();
int size = start.size();
for (int i=0; i < size; ++i) {
bookmarks.append(Bookmark(start.at(i).toLongLong(), end.at(i).toLongLong(), notes.at(i)));
}
return bookmarks;
}
void JournalEntry::addBookmark(qint64 start, qint64 end, QString note)
{
bookmarks.append(Bookmark(start,end,note));
session->SetChanged(true);
}
void JournalEntry::delBookmark(qint64 start, qint64 end)
{
bool removed;
do {
removed = false;
int size = bookmarks.size();
for (int i=0; i<size; ++i) {
const Bookmark & bm = bookmarks.at(i);
if ((bm.start == start) && (bm.end == end)) {
bookmarks.removeAt(i);
session->SetChanged(true); // make sure it gets saved later..
removed=true;
break;
}
}
} while (removed); // clean up any stupid duplicates just in case.. :P
// if I wanted to be nice above, I could add the note string to the search as well..
// (some users might be suprised to see the lot go with the same start and end index)
}
void BackupJournal(QString filename)
{ {
QString outBuf; QString outBuf;
QXmlStreamWriter stream(&outBuf); QXmlStreamWriter stream(&outBuf);
@ -40,22 +220,13 @@ bool Journal::BackupJournal(QString filename)
stream.writeStartDocument(); stream.writeStartDocument();
// stream.writeProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\""); // stream.writeProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\"");
stream.writeStartElement("OSCAR"); stream.writeStartElement("OSCAR");
stream.writeAttribute("created", QDateTime::currentDateTime().toString(Qt::ISODate));
stream.writeStartElement("Journal"); stream.writeStartElement("Journal");
stream.writeAttribute("username", p_profile->user->userName()); stream.writeAttribute("username", p_profile->user->userName());
stream.writeAttribute("height_cm", QString::number(p_profile->user->height()));
if (p_profile->general->unitSystem()!=US_Undefined) {
stream.writeAttribute("systemUnits", ( p_profile->general->unitSystem()==US_Metric?"Metric":"Englsh") );
}
QDate first = p_profile->FirstDay(MT_JOURNAL); QDate first = p_profile->FirstDay(MT_JOURNAL);
QDate last = p_profile->LastDay(MT_JOURNAL); QDate last = p_profile->LastDay(MT_JOURNAL);
DEBUGFC Q(first) Q(last);
QDate date = first.addDays(-1); QDate date = first.addDays(-1);
int days_saved = 0 ;
do { do {
date = date.addDays(1); date = date.addDays(1);
@ -72,33 +243,18 @@ bool Journal::BackupJournal(QString filename)
&& !journal->settingExists(Bookmark_Start)) { && !journal->settingExists(Bookmark_Start)) {
continue; continue;
} }
QString weight;
QString zombie;
QString notes;
QString lastupdated;
QVariantList start;
int havedata=0;
stream.writeStartElement("day");
stream.writeAttribute("date", date.toString());
if (journal->settingExists(Journal_Weight)) { if (journal->settingExists(Journal_Weight)) {
weight = sess->settings[Journal_Weight].toString(); QString weight = sess->settings[Journal_Weight].toString();
havedata |= JRNL_Weight ; stream.writeAttribute("weight", weight);
} }
if (journal->settingExists(Journal_ZombieMeter)) { if (journal->settingExists(Journal_ZombieMeter)) {
zombie = sess->settings[Journal_ZombieMeter].toString(); QString zombie = sess->settings[Journal_ZombieMeter].toString();
havedata |= JRNL_Zombie ; stream.writeAttribute("zombie", zombie);
}
if (journal->settingExists(Journal_Notes)) {
notes = sess->settings[Journal_Notes].toString();
//notes = Daily::convertHtmlToPlainText(notes).trimmed();
havedata |= JRNL_Notes ;
}
if (journal->settingExists(Bookmark_Start)) {
start=sess->settings[Bookmark_Start].toList();
if (start.size()>0) havedata |= JRNL_Bookmarks ;
} }
if (journal->settingExists(LastUpdated)) { if (journal->settingExists(LastUpdated)) {
@ -108,45 +264,35 @@ bool Journal::BackupJournal(QString filename)
#else #else
qint64 dtx = dt.toSecsSinceEpoch(); qint64 dtx = dt.toSecsSinceEpoch();
#endif #endif
lastupdated = QString::number(dtx); QString dts = QString::number(dtx);
stream.writeAttribute("lastupdated", dts);
} }
if (!havedata) { if (journal->settingExists(Journal_Notes)) {
// No data to archive. stream.writeStartElement("note");
continue ; stream.writeTextElement("text", sess->settings[Journal_Notes].toString());
stream.writeEndElement(); // notes
} }
//QString dateStr = ((++count & 1)==0) ? date.toString(/*Qt::ISODate*/) : date.toString(Qt::ISODate) ;
QString dateStr =date.toString(Qt::ISODate) ;
stream.writeStartElement("day");
stream.writeAttribute("date", dateStr);
if(!weight.isEmpty()) stream.writeAttribute(WEIGHT, weight);
if(!zombie.isEmpty()) stream.writeAttribute(ZOMBIE, zombie);
stream.writeAttribute("lastupdated", lastupdated);
if (!notes.isEmpty() ) { if (journal->settingExists(Bookmark_Start)) {
stream.writeStartElement("note"); QVariantList start=sess->settings[Bookmark_Start].toList();
stream.writeTextElement("text", notes); QVariantList end=sess->settings[Bookmark_End].toList();
stream.writeEndElement(); // notes QStringList notes=sess->settings[Bookmark_Notes].toStringList();
stream.writeStartElement("bookmarks");
int size = start.size();
for (int i=0; i< size; i++) {
stream.writeStartElement("bookmark");
stream.writeAttribute("notes",notes.at(i));
stream.writeAttribute("start",start.at(i).toString());
stream.writeAttribute("end",end.at(i).toString());
stream.writeEndElement(); // bookmark
} }
stream.writeEndElement(); // bookmarks
}
if (start.size()>0) {
QVariantList end=sess->settings[Bookmark_End].toList();
QStringList notes=sess->settings[Bookmark_Notes].toStringList();
stream.writeStartElement("bookmarks");
int size = start.size();
for (int i=0; i< size; i++) {
stream.writeStartElement("bookmark");
stream.writeAttribute("notes",notes.at(i));
stream.writeAttribute("start",start.at(i).toString());
stream.writeAttribute("end",end.at(i).toString());
stream.writeEndElement(); // bookmark
}
stream.writeEndElement(); // bookmarks
}
days_saved++;
stream.writeEndElement(); // day stream.writeEndElement(); // day
} while (date <= last); } while (date <= last);
// //stream.writeAttribute("DaysSaved", QString::number(days_saved));
stream.writeEndElement(); // Journal stream.writeEndElement(); // Journal
stream.writeEndElement(); // OSCAR stream.writeEndElement(); // OSCAR
@ -156,7 +302,7 @@ bool Journal::BackupJournal(QString filename)
if (!file.open(QIODevice::WriteOnly)) { if (!file.open(QIODevice::WriteOnly)) {
qWarning() << "Couldn't open journal file" << filename << "error code" << file.error() << file.errorString(); qWarning() << "Couldn't open journal file" << filename << "error code" << file.error() << file.errorString();
return false; return;
} }
QTextStream ts(&file); QTextStream ts(&file);
@ -164,263 +310,23 @@ bool Journal::BackupJournal(QString filename)
ts.setGenerateByteOrderMark(true); ts.setGenerateByteOrderMark(true);
ts << outBuf; ts << outBuf;
file.close(); file.close();
QMessageBox::information(nullptr, STR_MessageBox_Information,
QString(QObject::tr("%1 days Journal Data was saved in file %2")).arg(days_saved).arg(filename) ,
QMessageBox::Ok);
return true;
} }
void Journal::getJournal(Daily*& daily,QDate& date,Session* & journal) { DayController::DayController()
if (journal) return;
journal = daily->GetJournalSession(date,true);
if (journal) return;
journal = daily->CreateJournalSession(date);
}
bool Journal::RestoreDay (QDomElement& dayElement,QDate& date,QString& filename) {
Daily* daily = mainwin->getDaily();
if (!daily) return false;
Session* journal = nullptr;
bool changed = false;
// handle zombie - feelings
bool ok = false;
int zombie = 0;
zombie = (dayElement.attribute(ZOMBIE)).toInt(&ok);
if (!ok) { zombie=0; }
if (zombie == 0 ) {
zombie = (dayElement.attribute(OLD_ZOMBIE)).toInt(&ok);
if (!ok) { zombie=0; }
}
DEBUGFC O("\n\n") ;
DEBUGFC O(date) O(filename); Q_UNUSED(filename);
if (zombie>0) {
int jvalue = 0 ;
getJournal(daily,date,journal);
if (journal->settings.contains(Journal_ZombieMeter)) {
jvalue = journal->settings[Journal_ZombieMeter].toInt();
}
if (jvalue == 0) {
DEBUGFC O(date) Q(zombie);
daily->set_JournalZombie(date,zombie);
if (date == daily->getDate()) daily->set_ZombieUI(zombie);
changed = true;
}
}
// handle Weight
double weight = (dayElement.attribute(WEIGHT)).toDouble(&ok);
if (weight>zeroD) {
getJournal(daily,date,journal);
double jvalue = 0.0 ;
if (journal->settings.contains(Journal_Weight)) {
jvalue = journal->settings[Journal_Weight].toDouble();
}
if (jvalue < zeroD ) {
DEBUGFC O(date) Q(weight);
daily->set_JournalWeightValue(date,weight);
if (date == daily->getDate()) daily->set_WeightUI(weight);
changed = true;
}
}
// Handle Notes.
QDomElement noteText = dayElement.elementsByTagName("note").at(0).toElement().elementsByTagName("text").at(0).toElement();
if (!noteText.text().isEmpty() ) {
getJournal(daily,date,journal);
// there are characters in notes. maybe just spaces. Ignore spaces.
QString plainTextToAdd = Daily::convertHtmlToPlainText(noteText.text());
// get existing note if any.
QString currNoteHtml = journal->settings[Journal_Notes].toString();
QString currNotePlainText = Daily::convertHtmlToPlainText(currNoteHtml);
if (currNotePlainText.contains(plainTextToAdd) ) {
// plainText to add is equal to curr or is it a subset of the current Note
// use the current notes.. ignore text in backup.
} else {
// plainText is not equal to curr nor is it a subset of the current Note
if (plainTextToAdd.contains(currNotePlainText) ) {
//curr note is a subset of the new - so use new.
currNoteHtml = noteText.text();
} else {
// ToAdd text and Current text are different.
// use previous verson append with current
currNoteHtml.prepend(noteText.text());
}
daily->set_JournalNotesHtml(date,currNoteHtml);
if (date == daily->getDate()) daily->set_NotesUI(noteText.text());
DEBUGFC O(date) Q((void*)journal) O( )Daily::convertHtmlToPlainText(currNoteHtml);
changed = true;
}
}
QDomNodeList bookmarks = dayElement.elementsByTagName("bookmarks").at(0).toElement().elementsByTagName("bookmark");
if (bookmarks.size()>0) {
DEBUGFC Q(bookmarks.size());
getJournal(daily,date,journal);
// get list of bookmarks for journal. These will not be removed.
QVariantList start;
QVariantList end;
QStringList notes;
if (journal->settings.contains(Bookmark_Start)) {
//DEBUGFC;
start=journal->settings[Bookmark_Start].toList();
end=journal->settings[Bookmark_End].toList();
notes=journal->settings[Bookmark_Notes].toStringList();
}
// check if arcived bookmark is current list
bool bmChanged = false;
for (int idx=0 ; idx < bookmarks.size() ; idx++) {
// get archived bookmark
//DEBUGFC Q(idx) Q(bookmarks.size()) Q(start.size()) ;
QDomElement bookmark = bookmarks.at(idx).toElement();
qint64 archiveStart = bookmark.attribute("start").toLongLong();
qint64 archiveEnd = bookmark.attribute("end").toLongLong();
QString archiveNote = bookmark.attribute("notes");
// check if bookmark already exists.
bool duplicate = false;
bool bNoteChanged = false;
for (int idy=0 ; idy < start.size() ; idy++) {
//DEBUGFC Q(idy);
qint64 bmStart = start.at(idy).toLongLong();
qint64 bmEnd = end.at(idy).toLongLong();
if ( (bmStart == archiveStart) && (bmEnd == archiveEnd) ) {
duplicate = true;
//DEBUGFC Q(idx) Q(idy);
// have same bookmark - new check if notes need merging
QString aNote = archiveNote.simplified();
QString bmNote = notes.at(idy);
QString bNote = bmNote.simplified();
DEBUGFC Q(aNote) Q(bNote) Q(bNote.contains(aNote)) Q(aNote.contains(bNote));
if (bNote.contains(aNote) ) {
// no action needed.
//DEBUGFC Q(idx) Q(idy) Q(bNote);;
break;
} else {
// updated existing bookmark label
//DEBUGFC Q(idx) Q(idy);
// if an append is needed.
if (aNote.contains(bNote)) {
// use archived note
//DEBUGFC Q(idx) Q(idy);
} else {
//DEBUGFC Q(idx) Q(idy);
// prepend archive note to bmNote
archiveNote.append(" :: ").append(bmNote);
}
// use archiveNote.
notes[idy]= archiveNote;
bmChanged = true;
bNoteChanged = true;
}
}
}
if (!duplicate) {
DEBUGFC Q(date) Q(idx) Q(archiveNote);
// here if need to add archive bookmark.
// add archive bookmark to currrent list
start.push_back(archiveStart);
end.push_back(archiveEnd);
notes.push_back(archiveNote);
bmChanged = true;
} else if (bNoteChanged) {
DEBUGFC Q(date) Q(idx) Q(archiveNote);
}
}
if (bmChanged) {
//DEBUGFC Q(bmChanged);
getJournal(daily,date,journal);
journal->settings[Bookmark_Start]=start;
journal->settings[Bookmark_End]=end;
journal->settings[Bookmark_Notes]=notes;
if (date == daily->getDate()) daily->set_BookmarksUI(start,end,notes,0);
} else {
DEBUGFC O("bookmark ignored") ;
}
}
if (!journal) {
return true;
}
if (!journal->machine()) {
return true;
}
if (changed) {
journal->SetChanged(true);
journal->settings[LastUpdated] = QDateTime::currentDateTime();
journal->machine()->SaveSummaryCache();
journal->SetChanged(false);
}
DEBUGFC O(date) O("\n\n");
return true;
}
bool Journal::RestoreJournal(QString filename)
{ {
QFile file(filename); journal = nullptr;
if (!file.open(QFile::ReadOnly)) { cpap = nullptr;
qWarning() << "Could not open" << filename.toLocal8Bit().data() << "for reading, error code" << file.error() << file.errorString(); oximeter = nullptr;
return false; }
} DayController::~DayController()
{
QDomDocument doc("machines.xml"); delete journal;
if (!doc.setContent(&file)) {
qWarning() << "Invalid XML Content in" << filename.toLocal8Bit().data();
return false;
}
file.close();
QDomElement root = doc.documentElement(); // Get the root element of the document
if (root.isNull()) {
return false;
}
QDomNodeList days = doc.elementsByTagName("day");
if (days.isEmpty()) {
return false;
}
QDate first = p_profile->FirstDay();
QDate last = p_profile->LastDay();
QDate current = QDate::currentDate();
//int used=0;
for (int idx=0 ; idx < days.size() ; idx++) {
QDomElement dayElement = days.at(idx).toElement();
QString dateStr = dayElement.attribute("date") ;
QDate date = QDate::fromString(dateStr,Qt::ISODate) ;
if (!date.isValid()) {
QDate newdate = QDate::fromString(dateStr) ; // read original date format
date = newdate;
}
if (!date.isValid()) {
continue;
}
if (date < first) {
continue;
}
if (date > last) {
continue;
}
if (date > current) {
continue;
}
if ( RestoreDay(dayElement,date,filename) ) {
//used++;
}
}
double user_height_cm = p_profile->user->height();
if (user_height_cm<zeroD) {
QDomElement journal = root.elementsByTagName("Journal").at(0).toElement();
double height_cm = journal.attribute("height_cm").toDouble();
DEBUGFC Q(journal.tagName()) Q(height_cm);
if (height_cm>=zeroD) p_profile->user->setHeight(height_cm);
}
return true;
} }
void DayController::setDate(QDate date)
{
if (journal) {
delete journal;
}
journal = new JournalEntry(date);
}

View File

@ -11,22 +11,72 @@
#ifndef JOURNAL_H #ifndef JOURNAL_H
#define JOURNAL_H #define JOURNAL_H
class Session;
#include <QString>
#include <QDate>
#include <QDomDocument>
#include "daily.h"
#include "SleepLib/profiles.h" #include "SleepLib/profiles.h"
class Journal {
void BackupJournal(QString filename);
class Bookmark {
public: public:
enum { JRNL_Zombie = 1 , JRNL_Weight = 2 , JRNL_Notes = 4 , JRNL_Bookmarks = 8 }; Bookmark() {
static bool BackupJournal(QString filename); start = end = 0;
static bool RestoreJournal(QString filename); }
private: Bookmark(const Bookmark & copy) {
constexpr static double zeroD = 0.0001; start = copy.start;
static void getJournal(Daily*& daily,QDate& date,Session* & journal); end = copy.end;
static bool RestoreDay (QDomElement& dayElement,QDate& date,QString& filename) ; notes = copy.notes;
}
Bookmark& operator=(const Bookmark & other) = default;
Bookmark(qint64 start, qint64 end, QString notes):
start(start), end(end), notes(notes) {}
qint64 start;
qint64 end;
QString notes;
};
class JournalEntry
{
public:
JournalEntry(QDate date);
~JournalEntry();
bool Save();
QString notes();
void setNotes(QString notes);
EventDataType weight();
void setWeight(EventDataType weight);
int zombie();
void setZombie(int zombie);
QList<Bookmark> & getBookmarks();
void addBookmark(qint64 start, qint64 end, QString note);
void delBookmark(qint64 start, qint64 end);
protected:
QDate m_date;
QList<Bookmark> bookmarks;
Day * day;
Session * session;
bool newsession;
};
void BackupJournal(QString filename);
class DayController
{
DayController();
~DayController();
void setDate(QDate date);
QDate m_date;
JournalEntry * journal;
Day * cpap;
Day * oximeter;
}; };
#endif // JOURNAL_H #endif // JOURNAL_H

View File

@ -7,9 +7,6 @@
* License. See the file COPYING in the main directory of the source code * License. See the file COPYING in the main directory of the source code
* for more details. */ * for more details. */
#define TEST_MACROS_ENABLEDoff
#include <test_macros.h>
#include <QDateTime> #include <QDateTime>
#include <QTimeZone> #include <QTimeZone>
#include <QDebug> #include <QDebug>
@ -308,11 +305,6 @@ bool EDFInfo::ParseSignalData() {
for (int j=0;j<sig.sampleCnt;j++) { // Big endian safe for (int j=0;j<sig.sampleCnt;j++) { // Big endian safe
qint16 t=Read16(); qint16 t=Read16();
sig.dataArray[recNo*sig.sampleCnt+j]=t; sig.dataArray[recNo*sig.sampleCnt+j]=t;
// c++ macros IF DEBUGFC Q QQ will expand when TEST_MACROS_ENABLED is enabled
// Displays the first entry in an edf signal when data is valid (not all ones).
IF ( (j==0) && (t !=-1) ) {
DEBUGFC Q(&sig) QQ(rec,recNo) QQ(Cnt,sig.sampleCnt) QQ(off,j) QQ(dat,t) QQ(lab,sig.label);
}
} }
} }
} }

View File

@ -669,9 +669,8 @@ void parseModel(MachineInfo & info, const QString & modelnum)
info.series = series; info.series = series;
} }
bool PRS1Loader::PeekProperties(const QString & filePath, QHash<QString,QString> & props) bool PRS1Loader::PeekProperties(const QString & filename, QHash<QString,QString> & props)
{ {
QString filename = filePath;
const static QMap<QString,QString> s_longFieldNames = { const static QMap<QString,QString> s_longFieldNames = {
// CF? // CF?
{ "SN", "SerialNumber" }, { "SN", "SerialNumber" },
@ -698,21 +697,6 @@ bool PRS1Loader::PeekProperties(const QString & filePath, QHash<QString,QString>
{ "VC", "ValidCheck" }, { "VC", "ValidCheck" },
}; };
#if 1
// fix enpty PROP.TXT file problem. use PROP.BAK if it exists
// Otherwise import will fail.
// Just readis bak file instead of prop.txt. No other changes.
QFileInfo fi(filename);
if (fi.isFile() && fi.size()==0 && fi.suffix().toUpper() == "TXT") {
QString newFilePath = fi.absolutePath() + "/" + fi.completeBaseName() + ".BAK";
fi = QFileInfo(newFilePath);
if (fi.isFile() && fi.size()>0) {
filename = newFilePath;
}
}
// END fix enpty PROP.TXT file problem. use PROP.BAK if it exists
#endif
QFile f(filename); QFile f(filename);
if (!f.open(QFile::ReadOnly)) { if (!f.open(QFile::ReadOnly)) {
return false; return false;

View File

@ -64,7 +64,7 @@ void ResmedLoader::LogUnexpectedMessage(const QString & message)
m_importMutex.unlock(); m_importMutex.unlock();
} }
static const QVector<int> AS11TestedModels {39463, 39420, 39421, 39423, 39483, 39485, 39517, 39520, 39494, 39491, 0}; static const QVector<int> AS11TestedModels {39463, 39420, 39421, 39423, 39483, 39485, 39517, 0};
ResmedLoader::ResmedLoader() { ResmedLoader::ResmedLoader() {
#ifndef UNITTEST_MODE #ifndef UNITTEST_MODE
@ -118,10 +118,10 @@ void ResmedLoader::initChannels()
chan->addOption(0, QObject::tr("CPAP")); chan->addOption(0, QObject::tr("CPAP"));
chan->addOption(1, QObject::tr("APAP")); chan->addOption(1, QObject::tr("APAP"));
chan->addOption(2, QObject::tr("BiLevel-T")); chan->addOption(2, QObject::tr("BiPAP-T"));
chan->addOption(3, QObject::tr("BiLevel-S")); chan->addOption(3, QObject::tr("BiPAP-S"));
chan->addOption(4, QObject::tr("BiLevel-S/T")); chan->addOption(4, QObject::tr("BiPAP-S/T"));
chan->addOption(5, QObject::tr("BiLevel-T")); chan->addOption(5, QObject::tr("BiPAP-T"));
chan->addOption(6, QObject::tr("VPAPauto")); chan->addOption(6, QObject::tr("VPAPauto"));
chan->addOption(7, QObject::tr("ASV")); chan->addOption(7, QObject::tr("ASV"));
chan->addOption(8, QObject::tr("ASVAuto")); chan->addOption(8, QObject::tr("ASVAuto"));
@ -1413,15 +1413,10 @@ bool ResmedLoader::ProcessSTRfiles(Machine *mach, QMap<QDate, STRFile> & STRmap,
R.maskevents = maskeventcount->dataArray[rec]; R.maskevents = maskeventcount->dataArray[rec];
CPAPMode mode = MODE_UNKNOWN; CPAPMode mode = MODE_UNKNOWN;
IF (AS_eleven)
DEBUGFC Q(AS_eleven) Q(mode) Q(CPAP_Mode) Q(MODE_CPAP) Q((void*)str.lookupSignal(CPAP_Mode)) O("___________________________________");
if ((sig = str.lookupSignal(CPAP_Mode))) { if ((sig = str.lookupSignal(CPAP_Mode))) {
int mod = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; int mod = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset;
R.rms9_mode = mod; R.rms9_mode = mod;
// Convert AirCurve 11 and AirSense 11 to appropiate resmed 10 modes.
DEBUGFC Q(rec) Q(sig->label) Q(sig->transducer_type);
DEBUGFC Q(mod) O("=") Q(sig->dataArray[rec]) O("*") Q(sig->gain) Q("+") Q(sig->offset);
if ( AS_eleven ) { // translate AS11 mode values back to S9 / AS10 values if ( AS_eleven ) { // translate AS11 mode values back to S9 / AS10 values
switch ( mod ) { switch ( mod ) {
case 0: case 0:
@ -1436,12 +1431,6 @@ bool ResmedLoader::ProcessSTRfiles(Machine *mach, QMap<QDate, STRFile> & STRmap,
case 3: case 3:
R.rms9_mode = 0; // make it be CPAP R.rms9_mode = 0; // make it be CPAP
break; break;
case 7: // Added for ASV .
case 8: // Added for vAuto .
//case 9:
//case 10:
//case 11: // will 11 (A4Her) ever be generated by AS/AC 11?
break; // no change these are the same as in aircurve 10
default: default:
R.rms9_mode = 16; // unknown for now R.rms9_mode = 16; // unknown for now
break; break;
@ -1877,7 +1866,7 @@ bool ResmedLoader::ProcessSTRfiles(Machine *mach, QMap<QDate, STRFile> & STRmap,
R.s_SmartStop = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; R.s_SmartStop = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset;
if ( AS_eleven ) if ( AS_eleven )
R.s_SmartStop--; R.s_SmartStop--;
//qDebug() << "SmartStop is set to" << R.s_SmartStop; qDebug() << "SmartStop is set to" << R.s_SmartStop;
} }
if ((sig = str.lookupLabel("S.HumEnable"))) { if ((sig = str.lookupLabel("S.HumEnable"))) {
R.s_HumEnable = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; R.s_HumEnable = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset;
@ -1899,7 +1888,7 @@ bool ResmedLoader::ProcessSTRfiles(Machine *mach, QMap<QDate, STRFile> & STRmap,
R.s_Tube = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; R.s_Tube = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset;
} }
if ((R.rms9_mode >= 2) && (R.rms9_mode <= 5)) { // S, ST, or T modes if ((R.rms9_mode >= 2) && (R.rms9_mode <= 5)) { // S, ST, or T modes
//qDebug() << "BiLevel Mode found" << R.rms9_mode; qDebug() << "BiLevel Mode found" << R.rms9_mode;
if (R.rms9_mode == 3) { // S mode only if (R.rms9_mode == 3) { // S mode only
if ((sig = str.lookupLabel("S.EasyBreathe"))) { if ((sig = str.lookupLabel("S.EasyBreathe"))) {
R.s_EasyBreathe = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; R.s_EasyBreathe = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset;
@ -1930,19 +1919,19 @@ bool ResmedLoader::ProcessSTRfiles(Machine *mach, QMap<QDate, STRFile> & STRmap,
qDebug() << "vAuto mode found" << 6; qDebug() << "vAuto mode found" << 6;
if ((sig = str.lookupLabel("S.Cycle"))) { if ((sig = str.lookupLabel("S.Cycle"))) {
R.s_Cycle = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; R.s_Cycle = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset;
// qDebug() << "Cycle" << R.s_Cycle; qDebug() << "Cycle" << R.s_Cycle;
} }
if ((sig = str.lookupLabel("S.Trigger"))) { if ((sig = str.lookupLabel("S.Trigger"))) {
R.s_Trigger = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; R.s_Trigger = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset;
// qDebug() << "Trigger" << R.s_Trigger; qDebug() << "Trigger" << R.s_Trigger;
} }
if ((sig = str.lookupLabel("S.TiMax"))) { if ((sig = str.lookupLabel("S.TiMax"))) {
R.s_TiMax = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; R.s_TiMax = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset;
// qDebug() << QString("TiMax %1").arg( R.s_TiMax, 0, 'f', 1); qDebug() << QString("TiMax %1").arg( R.s_TiMax, 0, 'f', 1);
} }
if ((sig = str.lookupLabel("S.TiMin"))) { if ((sig = str.lookupLabel("S.TiMin"))) {
R.s_TiMin = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; R.s_TiMin = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset;
// qDebug() << QString("TiMin %1").arg( R.s_TiMin, 0, 'f', 1); qDebug() << QString("TiMin %1").arg( R.s_TiMin, 0, 'f', 1);
} }
} }
if ( R.min_pressure == 0 ) { if ( R.min_pressure == 0 ) {
@ -3582,10 +3571,9 @@ void ResmedLoader::ToTimeDelta(Session *sess, ResMedEDFInfo &edf, EDFSignal &es,
el->AddEvent(tt, c); el->AddEvent(tt, c);
if (forceDebug && ((code == CPAP_Pressure) || (code == CPAP_IPAP) || (code == CPAP_EPAP)) ) if (forceDebug && ((code == CPAP_Pressure) || (code == CPAP_IPAP) || (code == CPAP_EPAP)) )
qDebug() << "Last Event:" << tmp << QDateTime::fromMSecsSinceEpoch(tt).toString() << "Pos:" << (sptr-1) - es.dataArray; qDebug() << "Last Event:" << tmp << QDateTime::fromMSecsSinceEpoch(tt).toString() << "Pos:" << (sptr-1) - es.dataArray;
} else { } else
qDebug() << "Failed to add last event - Code:" << QString::number(code, 16) << "Value:" << tmp << qDebug() << "Failed to add last event - Code:" << QString::number(code, 16) << "Value:" << tmp <<
QDateTime::fromMSecsSinceEpoch(tt).toString() << "Pos:" << (sptr-1) - es.dataArray; QDateTime::fromMSecsSinceEpoch(tt).toString() << "Pos:" << (sptr-1) - es.dataArray;
}
sess->updateMin(code, min); sess->updateMin(code, min);
sess->updateMax(code, max); sess->updateMax(code, max);

View File

@ -688,8 +688,6 @@ bool SleepStyleLoader::OpenSummary(Machine *mach, const QString & filename)
if (ts == 0xffffffff) { if (ts == 0xffffffff) {
#ifdef DEBUGSS #ifdef DEBUGSS
qDebug() << "SS SUM 0xffffffff terminator found at block" << nblock; qDebug() << "SS SUM 0xffffffff terminator found at block" << nblock;
#else
Q_UNUSED(nblock);
#endif #endif
break; break;
} }
@ -998,8 +996,6 @@ bool SleepStyleLoader::OpenDetail(Machine *mach, const QString & filename)
#ifdef DEBUGSS #ifdef DEBUGSS
qDebug() << "SS DET pressure events" << PR->count() << "prSessVount" << PRSessCount << "beginning" << QDateTime::fromSecsSinceEpoch(ti/1000).toString("MM/dd/yyyy hh:mm:ss"); qDebug() << "SS DET pressure events" << PR->count() << "prSessVount" << PRSessCount << "beginning" << QDateTime::fromSecsSinceEpoch(ti/1000).toString("MM/dd/yyyy hh:mm:ss");
#else
Q_UNUSED(PRSessCount);
#endif #endif
// Update indexes, process waveform and perform flagging // Update indexes, process waveform and perform flagging
sess->setSummaryOnly(false); sess->setSummaryOnly(false);

View File

@ -21,7 +21,6 @@
#include <QMessageBox> #include <QMessageBox>
#include "viatom_loader.h" #include "viatom_loader.h"
#include "SleepLib/machine.h" #include "SleepLib/machine.h"
#include <memory>
// TODO: Merge this with PRS1 macros and generalize for all loaders. // TODO: Merge this with PRS1 macros and generalize for all loaders.
#define SESSIONID m_session->session() #define SESSIONID m_session->session()
@ -128,35 +127,8 @@ Session* ViatomLoader::ParseFile(const QString & filename, bool *existing)
return nullptr; return nullptr;
} }
// Read in Viatom database version number ViatomFile v(file);
QByteArray data = file.read(2); if (v.ParseHeader() == false) {
if (data.size() < 2) {
qDebug() << filename << "too short for a Viatom data file";
return nullptr;
}
const unsigned char* header = (const unsigned char*) data.constData();
int sig = header[0] | (header[1] << 8);
std::unique_ptr<ViatomFile> v = nullptr;
switch (sig) {
case 0x0003:
case 0x0005:
v = std::unique_ptr<ViatomFile>(new ViatomFile(file));
break;
case 0x0301:
v = std::unique_ptr<O2RingS>(new O2RingS(file));
break;
default:
qDebug() << filename << "Unrecognized DB version number in Viatom data file" << sig;
return nullptr;
}
if (!file.seek(0)) {
qDebug() << filename << "unable to seek to begining of file";
return nullptr;
}
// Parse header specific to database version number
if (v->ParseHeader() == false) {
return nullptr; return nullptr;
} }
@ -172,7 +144,7 @@ Session* ViatomLoader::ParseFile(const QString & filename, bool *existing)
} }
Machine *mach = p_profile->CreateMachine(info); Machine *mach = p_profile->CreateMachine(info);
if (mach->SessionExists(v->sessionid())) { if (mach->SessionExists(v.sessionid())) {
// Skip already imported session // Skip already imported session
//qDebug() << filename << "session already exists, skipping" << v.sessionid(); //qDebug() << filename << "session already exists, skipping" << v.sessionid();
if (existing) { if (existing) {
@ -182,12 +154,12 @@ Session* ViatomLoader::ParseFile(const QString & filename, bool *existing)
return nullptr; return nullptr;
} }
qint64 time_ms = v->timestamp(); qint64 time_ms = v.timestamp();
m_session = new Session(mach, v->sessionid()); m_session = new Session(mach, v.sessionid());
m_session->set_first(time_ms); m_session->set_first(time_ms);
QList<ViatomFile::Record> records = v->ReadData(); QList<ViatomFile::Record> records = v.ReadData();
m_step = v->duration() / records.size() * 1000L; m_step = v.duration() / records.size() * 1000L;
// Import data // Import data
for (auto & rec : records) { for (auto & rec : records) {
@ -295,20 +267,6 @@ ViatomFile::ViatomFile(QFile & file) : m_file(file)
{ {
} }
QDateTime ViatomFile::getFilenameTimestamp()
{
QString date_string = QFileInfo(m_file).fileName().section("_", -1); // Strip any SleepU_ etc. prefix.
int lastPoint = date_string.lastIndexOf("."); // Added to strip off any filename extension
date_string = date_string.left(lastPoint);
QString format_string = "yyyyMMddHHmmss";
if (date_string.contains(":")) {
format_string = "yyyy-MM-dd HH:mm:ss";
}
return QDateTime::fromString(date_string, format_string);
}
bool ViatomFile::ParseHeader() bool ViatomFile::ParseHeader()
{ {
static const int HEADER_SIZE = 40; static const int HEADER_SIZE = 40;
@ -354,7 +312,17 @@ bool ViatomFile::ParseHeader()
// starting timestamp). Technically these should probably be square charts, but // starting timestamp). Technically these should probably be square charts, but
// the code currently forces them to be non-square. // the code currently forces them to be non-square.
QDateTime data_timestamp = QDateTime(QDate(year, month, day), QTime(hour, min, sec)); QDateTime data_timestamp = QDateTime(QDate(year, month, day), QTime(hour, min, sec));
QDateTime filename_timestamp = getFilenameTimestamp();
QString date_string = QFileInfo(m_file).fileName().section("_", -1); // Strip any SleepU_ etc. prefix.
int lastPoint = date_string.lastIndexOf("."); // Added to strip off any filename extension
date_string = date_string.left(lastPoint);
QString format_string = "yyyyMMddHHmmss";
if (date_string.contains(":")) {
format_string = "yyyy-MM-dd HH:mm:ss";
}
QDateTime filename_timestamp = QDateTime::fromString(date_string, format_string);
if (filename_timestamp.isValid()) { if (filename_timestamp.isValid()) {
if (filename_timestamp != data_timestamp) { if (filename_timestamp != data_timestamp) {
// TODO: Once there's a better/easier way to adjust session times within OSCAR, we can remove the below. // TODO: Once there's a better/easier way to adjust session times within OSCAR, we can remove the below.
@ -494,57 +462,3 @@ QList<ViatomFile::Record> ViatomFile::ReadData()
return records; return records;
} }
O2RingS::O2RingS(QFile & file) : ViatomFile(file)
{
}
bool O2RingS::ParseHeader()
{
// For the O2Ring S, the header only contains the signature
// Additional metadata is stored at the end of the file
// The record count is stored 36 bytes prior to EOF
int record_count_loc = m_file.size() - 36;
if (record_count_loc < 0 || !m_file.seek(record_count_loc)) {
qDebug() << m_file.fileName() << "error locating Viatom record count";
return false;
}
// read record count as a 2-byte little endian value
// max number of records in a O2Ring S file is 36000
QDataStream in(m_file.read(2));
in.setByteOrder(QDataStream::LittleEndian);
quint16 record_count;
in >> record_count;
m_sig = 0x0301;
m_record_count = m_duration = record_count;
m_timestamp = getFilenameTimestamp().toMSecsSinceEpoch();
m_sessionid = m_timestamp / 1000L;
m_resolution = 1000;
// advance past the header
return m_file.seek(10);
}
QList<ViatomFile::Record> O2RingS::ReadData()
{
QList<ViatomFile::Record> records;
// Read all Pulse, SPO2 and Motion data
// 0xFF for spo2 or hr indicates an interruption in measurement
// Vibration data is likely stored in a variable length block following the
// fixed-width pulse/SPO2/motion data. Zero out for now since OSCAR doesn't
// use this data.
QDataStream in(m_file.readAll());
do {
ViatomFile::Record rec;
in >> rec.spo2 >> rec.hr >> rec.motion;
rec.oximetry_invalid = (rec.spo2 == 0xFF || rec.hr == 0xFF) ? 0xFF : 0;
rec.vibration = 0;
records.append(rec);
} while (records.size() < m_record_count);
// Confirm that we have a 1s sample rate
CHECK_VALUE(duration() / records.size(), 1);
return records;
}

View File

@ -71,14 +71,13 @@ public:
unsigned char vibration; unsigned char vibration;
}; };
ViatomFile(QFile & file); ViatomFile(QFile & file);
virtual ~ViatomFile() = default; ~ViatomFile() = default;
virtual bool ParseHeader(); bool ParseHeader();
virtual QList<Record> ReadData(); QList<Record> ReadData();
SessionID sessionid() const { return m_sessionid; } SessionID sessionid() const { return m_sessionid; }
quint64 timestamp() const { return m_timestamp; } quint64 timestamp() const { return m_timestamp; }
int duration() const { return m_duration; } int duration() const { return m_duration; }
QDateTime getFilenameTimestamp();
protected: protected:
static const int RECORD_SIZE = 5; static const int RECORD_SIZE = 5;
@ -91,13 +90,4 @@ protected:
SessionID m_sessionid; SessionID m_sessionid;
}; };
class O2RingS : public ViatomFile
{
public:
O2RingS(QFile & file);
~O2RingS() = default;
bool ParseHeader();
QList<Record> ReadData();
};
#endif // VIATOMLOADER_H #endif // VIATOMLOADER_H

View File

@ -1145,7 +1145,7 @@ bool Machine::SaveSummaryCache()
bool Machine::Save() bool Machine::Save()
{ {
//int size; //int size;
// int cnt = 0; int cnt = 0;
QString path = getDataPath(); QString path = getDataPath();
QDir dir(path); QDir dir(path);
@ -1160,7 +1160,7 @@ bool Machine::Save()
// store any event summaries.. // store any event summaries..
for (s = sessionlist.begin(); s != sessionlist.end(); s++) { for (s = sessionlist.begin(); s != sessionlist.end(); s++) {
// cnt++; cnt++;
if ((*s)->IsChanged()) { if ((*s)->IsChanged()) {
queTask(new SaveTask(*s, this)); queTask(new SaveTask(*s, this));

View File

@ -316,7 +316,7 @@ bool compressFile(QString infile, QString outfile)
int MachineLoader::Open(const QStringList & paths) int MachineLoader::Open(const QStringList & paths)
{ {
int i = 0; int i, skipped = 0;
int size = paths.size(); int size = paths.size();
for (i=0; i < size; i++) { for (i=0; i < size; i++) {
if (isAborted()) { if (isAborted()) {
@ -328,6 +328,10 @@ int MachineLoader::Open(const QStringList & paths)
if (res < 0) { if (res < 0) {
break; break;
} }
if (res == 0) {
// Should we report on skipped count?
skipped++;
}
emit setProgressValue(i+1); emit setProgressValue(i+1);
QCoreApplication::processEvents(); QCoreApplication::processEvents();
} }

View File

@ -1151,8 +1151,16 @@ void Scan()
// validate user name in profile. // validate user name in profile.
QString dbname = prof->user->userName(); QString dbname = prof->user->userName();
if (dbname.isEmpty()) {
qWarning() << "Not a Profile " << npath;
delete prof;
continue; // skip over this folder. it is not a profile.
}
QString fname = QFileInfo(fi).fileName(); QString fname = QFileInfo(fi).fileName();
if (fname != dbname) { if (fname != dbname) {
// this condition currently causes an infinite loop - causes oscar issue.
// one solution is to avoid putting this profile in profiles MAP.
// the other solution is to update userName with its new name.
prof->user->setUserName(fname); prof->user->setUserName(fname);
QString message = QString("%1 %2 %3 %4").arg("Changing Profile Name").arg(dbname).arg("==>").arg(fname); QString message = QString("%1 %2 %3 %4").arg("Changing Profile Name").arg(dbname).arg("==>").arg(fname);
qDebug() << message; qDebug() << message;
@ -1170,7 +1178,7 @@ void Scan()
} }
// Update profiles.xml for mobile version // Update profiles.xml for mobile version
// profiles.xml is never read so it does not need to be saved. // profiles.xml is never read so it does not need to be saved.
// saveProfileList(); // saveProfileList();
} }

View File

@ -400,7 +400,7 @@ void done()
// ahiChannels did not get cleared since day1 OSCAR when a reset was required. // ahiChannels did not get cleared since day1 OSCAR when a reset was required.
// when reset occured then the Overview AHI graph would should an addtional set of channels. // when reset occured then the Overview AHI graph would should an addtional set of channels.
// this fix just clears the variable that stores ahi data. // this fix just clears the variable that stores ahi data.
// probelm #59 https://gitlab.com/.../OSCAR-code/-/issues/59 // probelm #59 https://gitlab.com/pholy/OSCAR-code/-/issues/59
ahiChannels.clear(); ahiChannels.clear();
schema_initialized = false; schema_initialized = false;

View File

@ -1,5 +1,5 @@
// Update the string below to set OSCAR's version and release status. // Update the string below to set OSCAR's version and release status.
// See https://semver.org/spec/v2.0.0.html for details on format. // See https://semver.org/spec/v2.0.0.html for details on format.
#define VERSION "1.5.3" #define VERSION "1.5.2-beta-2"

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,6 @@
#include <QScrollBar> #include <QScrollBar>
#include <QTableWidgetItem> #include <QTableWidgetItem>
#include <QTextBrowser> #include <QTextBrowser>
#include <QBitArray>
#include "SleepLib/profiles.h" #include "SleepLib/profiles.h"
#include "mainwindow.h" #include "mainwindow.h"
@ -48,7 +47,6 @@ class Daily : public QWidget
{ {
Q_OBJECT Q_OBJECT
friend class Journal;
public: public:
/*! \fn Daily() /*! \fn Daily()
\brief Constructs a Daily object \brief Constructs a Daily object
@ -114,7 +112,7 @@ public:
\param QDate date \param QDate date
\returns Session * containing valid Journal Session object or nullptr if none found. \returns Session * containing valid Journal Session object or nullptr if none found.
*/ */
Session * GetJournalSession(QDate date, bool create=true); Session * GetJournalSession(QDate date);
QString GetDetailsText(); QString GetDetailsText();
/*! \fn eventBreakdownPie() /*! \fn eventBreakdownPie()
@ -151,7 +149,7 @@ public:
QString STR_SHOW_ALL_EVENTS =QString(tr("Show All Events")); QString STR_SHOW_ALL_EVENTS =QString(tr("Show All Events"));
QString STR_HIDE_ALL_GRAPHS =QString(tr("Hide All Graphs")); QString STR_HIDE_ALL_GRAPHS =QString(tr("Hide All Graphs"));
QString STR_SHOW_ALL_GRAPHS =QString(tr("Show All Graphs")); QString STR_SHOW_ALL_GRAPHS =QString(tr("Show All Graphs"));
static QString convertHtmlToPlainText(QString html) ;
public slots: public slots:
void on_LineCursorUpdate(double time); void on_LineCursorUpdate(double time);
void on_RangeUpdate(double minx, double maxx); void on_RangeUpdate(double minx, double maxx);
@ -232,13 +230,11 @@ private slots:
*/ */
void on_removeBookmarkButton_clicked(); void on_removeBookmarkButton_clicked();
/*! \fn on_bookmarkTable_currentItemChanged(QTableWidgetItem *item, QTableWidgetItem *previous) /*! \fn on_bookmarkTable_itemClicked(QTableWidgetItem *item);
\brief Called when a bookmark has been selected.. Zooms in on the area \brief Called when a bookmark has been selected.. Zooms in on the area
\param QTableWidgetItem *item \param QTableWidgetItem *item
\param QTableWidgetItem *previous
*/ */
void on_bookmarkTable_itemClicked(QTableWidgetItem *item);
void on_bookmarkTable_currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous);
/*! \fn on_bookmarkTable_itemChanged(QTableWidgetItem *item); /*! \fn on_bookmarkTable_itemChanged(QTableWidgetItem *item);
\brief Called when bookmarks have been altered.. Saves the bookmark list to Journal object. \brief Called when bookmarks have been altered.. Saves the bookmark list to Journal object.
@ -255,11 +251,9 @@ private slots:
*/ */
void on_ZombieMeter_valueChanged(int value); void on_ZombieMeter_valueChanged(int value);
void set_ZombieUI(int value); void set_ZombieMeterLabel();
void set_WeightUI(double weight_kg); void set_WeightUI(double weight_kg);
void set_BmiUI(double weight_kg); // should be a part of weight. void set_BmiUI(Session *journal = nullptr);
void set_NotesUI(QString htmlNote);
void set_BookmarksUI( QVariantList& start , QVariantList& end , QStringList& notes, qint64 drift=0);
/*! \fn on_weightSpinBox_editingFinished(); /*! \fn on_weightSpinBox_editingFinished();
\brief Called when weight has changed.. Updates the BMI dislpay and journal objects. \brief Called when weight has changed.. Updates the BMI dislpay and journal objects.
@ -289,11 +283,6 @@ protected:
virtual void showEvent(QShowEvent *); virtual void showEvent(QShowEvent *);
private: private:
double calculateBMI(double weight_kg, double height_cm);
void set_JournalZombie(QDate&, int);
void set_JournalWeightValue(QDate&, double kgs);
void set_JournalNotesHtml(QDate&, QString html);
/*! \fn CreateJournalSession() /*! \fn CreateJournalSession()
\brief Create a new journal session for this date, if one doesn't exist. \brief Create a new journal session for this date, if one doesn't exist.
\param QDate date \param QDate date
@ -333,7 +322,7 @@ private:
DailySearchTab* dailySearchTab = nullptr; DailySearchTab* dailySearchTab = nullptr;
QString getAHI (Day * day, bool isBrick); //QString getLeftAHI (Day * day);
QString getSessionInformation(Day *); QString getSessionInformation(Day *);
QString getMachineSettings(Day *); QString getMachineSettings(Day *);
QString getStatisticsInfo(Day *); QString getStatisticsInfo(Day *);
@ -341,7 +330,7 @@ private:
QString getOximeterInformation(Day *); QString getOximeterInformation(Day *);
QString getEventBreakdown(Day *); QString getEventBreakdown(Day *);
QString getPieChart(float values, Day *); QString getPieChart(float values, Day *);
QString getIndices(Day * day, QHash<ChannelID, EventDataType>& values ); //QString getIndicesAndPie(Day *, float hours, bool isBrick);
QString getSleepTime(Day *); QString getSleepTime(Day *);
QString getLeftSidebar (bool honorPieChart); QString getLeftSidebar (bool honorPieChart);
@ -379,27 +368,13 @@ private:
const int eventTypeEnd = QTreeWidgetItem::UserType+2; const int eventTypeEnd = QTreeWidgetItem::UserType+2;
#ifndef REMOVE_FITNESS #ifndef REMOVE_FITNESS
bool ZombieMeterMoved;
double user_weight_kg; double user_weight_kg;
double user_height_cm; double user_height_cm;
constexpr static double zeroD = 0.0001 ;
#endif #endif
bool BookmarksChanged; bool BookmarksChanged;
SaveGraphLayoutSettings* saveGraphLayoutSettings=nullptr; SaveGraphLayoutSettings* saveGraphLayoutSettings=nullptr;
enum LEFT_SIDEBAR { LSB_FIRST ,
LSB_MACHINE_INFO ,
LSB_SLEEPTIME_INDICES ,
LSB_PIE_CHART ,
LSB_STATISTICS ,
LSB_OXIMETER_INFORMATION ,
LSB_DEVICE_SETTINGS ,
LSB_SESSION_INFORMATION ,
LSB_END_SIZE };
QBitArray leftSideBarEnable = QBitArray(LSB_END_SIZE,true);
void htmlLsbSectionHeader (QString& html, const QString& name,LEFT_SIDEBAR checkBox) ;
void htmlLsbSectionHeaderInit (bool section=true) ;
bool htmlLsbPrevSectionHeader = true;
}; };
#endif // DAILY_H #endif // DAILY_H

View File

@ -30,7 +30,6 @@
#include "dailySearchTab.h" #include "dailySearchTab.h"
#include "SleepLib/day.h" #include "SleepLib/day.h"
#include "SleepLib/profiles.h" #include "SleepLib/profiles.h"
#include "SleepLib/journal.h"
#include "daily.h" #include "daily.h"
#include "SleepLib/machine_common.h" #include "SleepLib/machine_common.h"
@ -382,6 +381,25 @@ void DailySearchTab::addCommandItem(QString str,int topic) {
commandList->setItemWidget(item, topicButton); commandList->setItemWidget(item, topicButton);
} }
void DailySearchTab::debugStates() {
#ifdef TEST_MACROS_ENABLED
return;
qDebug() ;
for (int ind = 0; ind <commandList->count() ; ++ind) {
QListWidgetItem *item = commandList->item(ind);
QAbstractButton* topicButton = dynamic_cast<QAbstractButton*>(commandList->itemWidget(item));
if (!topicButton) continue;
int topic = buttonGroup->id(topicButton);
DEBUGFC
QQ("checkable",topicButton->isCheckable())
QQ("check",topicButton->isChecked())
O(topicButton->text())
O(topic)
;
}
#endif
}
void DailySearchTab::showOnlyAhiChannels(bool ahiOnly) { void DailySearchTab::showOnlyAhiChannels(bool ahiOnly) {
for (int ind = 0; ind <commandList->count() ; ++ind) { for (int ind = 0; ind <commandList->count() ; ++ind) {
QListWidgetItem *item = commandList->item(ind); QListWidgetItem *item = commandList->item(ind);
@ -405,6 +423,7 @@ void DailySearchTab::showOnlyAhiChannels(bool ahiOnly) {
lastButton = nullptr; lastButton = nullptr;
lastTopic = ST_NONE ; lastTopic = ST_NONE ;
}; };
debugStates();
}; };
void DailySearchTab::on_matchGroupButton_toggled(QAbstractButton* topicButton ) { void DailySearchTab::on_matchGroupButton_toggled(QAbstractButton* topicButton ) {
@ -468,8 +487,12 @@ void DailySearchTab::populateControl() {
operationCombo->addItem(opCodeStr(OP_NE)); operationCombo->addItem(opCodeStr(OP_NE));
// Now add events // Now add events
QDate date = p_profile->LastDay(MT_CPAP);
if ( !date.isValid()) return;
Day* day = p_profile->GetDay(date);
if (!day) return;
commandList->clear(); commandList->clear();
addCommandItem(tr("Journal"),ST_JOURNAL);
addCommandItem(tr("Notes"),ST_NOTES); addCommandItem(tr("Notes"),ST_NOTES);
addCommandItem(tr("Notes containing"),ST_NOTES_STRING); addCommandItem(tr("Notes containing"),ST_NOTES_STRING);
addCommandItem(tr("Bookmarks"),ST_BOOKMARKS); addCommandItem(tr("Bookmarks"),ST_BOOKMARKS);
@ -485,10 +508,6 @@ void DailySearchTab::populateControl() {
} }
addCommandItem(tr("Number of Sessions"),ST_SESSIONS_QTY); addCommandItem(tr("Number of Sessions"),ST_SESSIONS_QTY);
QDate date = p_profile->LastDay(MT_CPAP);
if ( !date.isValid()) return;
Day* day = p_profile->GetDay(date);
if (!day) return;
if (p_profile->general->showUnknownFlags()) chans |= schema::UNKNOWN; if (p_profile->general->showUnknownFlags()) chans |= schema::UNKNOWN;
QList<ChannelID> available; QList<ChannelID> available;
@ -508,6 +527,7 @@ void DailySearchTab::setState(STATE newState) {
STATE prev=state; STATE prev=state;
state = newState; state = newState;
//enum STATE { reset , waitForSearchTopic , matching , multpileMatches , waitForStart , autoStart , searching , endOfSeaching , waitForContinue , noDataFound}; //enum STATE { reset , waitForSearchTopic , matching , multpileMatches , waitForStart , autoStart , searching , endOfSeaching , waitForContinue , noDataFound};
//DEBUGFC O(prev) O("==>") O(state) Q( matches.size()) QQ("name",match->matchName) O(match->opCodeStr) O(match->compareString) O(match->units);
switch (state) { switch (state) {
case multpileMatches : case multpileMatches :
break; break;
@ -578,6 +598,7 @@ void DailySearchTab::setState(STATE newState) {
hideResults(true); hideResults(true);
break; break;
}; };
//DEBUGFC O(prev) O("==>") O(state) Q(matchButton->isVisible()) Q(addMatchButton->isVisible()) Q( matches.size());
}; };
QRegExp Match::searchPatterToRegex (QString searchPattern) { QRegExp Match::searchPatterToRegex (QString searchPattern) {
@ -829,52 +850,11 @@ bool DailySearchTab::matchFind(Match* myMatch ,Day* day, QDate& date, Qt::Alignm
myMatch->updateMinMaxValues(numDisabled); myMatch->updateMinMaxValues(numDisabled);
} }
break; break;
case ST_JOURNAL :
{
Session* journal=daily->GetJournalSession(date,false);
if (journal) {
myMatch->foundString = journal->settings[LastUpdated].toDateTime().toString();
myMatch->foundString.append(" ");
bool empty =true;
if ( journal->settings.contains(Bookmark_Start) ) {
if (journal->settings[Bookmark_Start].toList().size()>0) {
empty = false;
myMatch->foundString.append("B");
/* Not reuired.
if ( journal->settings.contains(Bookmark_Notes) ) {
if (journal->settings[Bookmark_Start].toList().size()>0) {
myMatch->foundString.append("n");
}
}
*/
}
}
if ( journal->settings.contains(Journal_Notes) ) {
myMatch->foundString.append("N");
empty = false;
}
if ( journal->settings.contains(Journal_Weight) ) {
myMatch->foundString.append("W");
empty = false;
}
if ( journal->settings.contains(Journal_ZombieMeter) ) {
myMatch->foundString.append("F");
empty = false;
}
if (empty) {
break;
myMatch->foundString.append(tr("Empty"));
}
found=true;
alignment=Qt::AlignLeft;
}
}
break;
case ST_NOTES : case ST_NOTES :
{ {
Session* journal=daily->GetJournalSession(date,false); Session* journal=daily->GetJournalSession(date);
if (journal && journal->settings.contains(Journal_Notes)) { if (journal && journal->settings.contains(Journal_Notes)) {
QString jcontents = Daily::convertHtmlToPlainText(journal->settings[Journal_Notes].toString()); QString jcontents = convertRichText2Plain(journal->settings[Journal_Notes].toString());
myMatch->foundString = jcontents.simplified().left(stringDisplayLen).simplified(); myMatch->foundString = jcontents.simplified().left(stringDisplayLen).simplified();
found=true; found=true;
alignment=Qt::AlignLeft; alignment=Qt::AlignLeft;
@ -883,7 +863,7 @@ bool DailySearchTab::matchFind(Match* myMatch ,Day* day, QDate& date, Qt::Alignm
break; break;
case ST_BOOKMARKS : case ST_BOOKMARKS :
{ {
Session* journal=daily->GetJournalSession(date,false); Session* journal=daily->GetJournalSession(date);
if (journal && journal->settings.contains(Bookmark_Notes)) { if (journal && journal->settings.contains(Bookmark_Notes)) {
found=true; found=true;
QStringList notes = journal->settings[Bookmark_Notes].toStringList(); QStringList notes = journal->settings[Bookmark_Notes].toStringList();
@ -897,7 +877,7 @@ bool DailySearchTab::matchFind(Match* myMatch ,Day* day, QDate& date, Qt::Alignm
break; break;
case ST_BOOKMARKS_STRING : case ST_BOOKMARKS_STRING :
{ {
Session* journal=daily->GetJournalSession(date,false); Session* journal=daily->GetJournalSession(date);
if (journal && journal->settings.contains(Bookmark_Notes)) { if (journal && journal->settings.contains(Bookmark_Notes)) {
QStringList notes = journal->settings[Bookmark_Notes].toStringList(); QStringList notes = journal->settings[Bookmark_Notes].toStringList();
QString findStr = selectString->text(); QString findStr = selectString->text();
@ -915,9 +895,9 @@ bool DailySearchTab::matchFind(Match* myMatch ,Day* day, QDate& date, Qt::Alignm
break; break;
case ST_NOTES_STRING : case ST_NOTES_STRING :
{ {
Session* journal=daily->GetJournalSession(date,false); Session* journal=daily->GetJournalSession(date);
if (journal && journal->settings.contains(Journal_Notes)) { if (journal && journal->settings.contains(Journal_Notes)) {
QString jcontents = Daily::convertHtmlToPlainText(journal->settings[Journal_Notes].toString()); QString jcontents = convertRichText2Plain(journal->settings[Journal_Notes].toString());
QString findStr = selectString->text(); QString findStr = selectString->text();
if (jcontents.contains(findStr,Qt::CaseInsensitive) ) { if (jcontents.contains(findStr,Qt::CaseInsensitive) ) {
found=true; found=true;
@ -1167,6 +1147,7 @@ void DailySearchTab::process_match_info(QString text, int topic) {
// here to select new search criteria // here to select new search criteria
// must reset all variables and label, button, etc // must reset all variables and label, button, etc
clearMatch() ; clearMatch() ;
//DEBUGFC QQ("name",match->matchName) O(match->opCodeStr) O(match->compareString) O(match->units) O(selectUnits->text());
commandWidget->show(); commandWidget->show();
match->matchName = text; match->matchName = text;
// get item selected // get item selected
@ -1208,11 +1189,6 @@ void DailySearchTab::process_match_info(QString text, int topic) {
selectInteger->setValue(0); selectInteger->setValue(0);
setoperation(OP_NO_PARMS,displayWhole); setoperation(OP_NO_PARMS,displayWhole);
break; break;
case ST_JOURNAL :
setResult(DS_ROW_HEADER,1,QDate(),tr("JUmps\nJumps to Date's Notes"));
match->nextTab = TW_NOTES ;
setoperation( OP_NO_PARMS ,displayString);
break;
case ST_NOTES : case ST_NOTES :
setResult(DS_ROW_HEADER,1,QDate(),tr("Note\nJumps to Date's Notes")); setResult(DS_ROW_HEADER,1,QDate(),tr("Note\nJumps to Date's Notes"));
match->nextTab = TW_NOTES ; match->nextTab = TW_NOTES ;
@ -1757,6 +1733,12 @@ QString Match::formatTime (qint32 ms) {
return QString("%1:%2:%3").arg(hours).arg(minutes,2,10,QLatin1Char('0')).arg(seconds,2,10,QLatin1Char('0')); return QString("%1:%2:%3").arg(hours).arg(minutes,2,10,QLatin1Char('0')).arg(seconds,2,10,QLatin1Char('0'));
} }
QString DailySearchTab::convertRichText2Plain (QString rich) {
richText.setHtml(rich);
QString line=richText.toPlainText().simplified();
return line.replace(QRegExp("[\\s\\r\\n]+")," ").simplified();
}
QString DailySearchTab::opCodeStr(OpCode opCode) { QString DailySearchTab::opCodeStr(OpCode opCode) {
switch (opCode) { switch (opCode) {
case OP_LT : return "< "; case OP_LT : return "< ";

View File

@ -47,7 +47,7 @@ class Daily; //forward declaration.
enum ValueMode { invalidValueMode , notUsed , minutesToMs , hoursToMs , hundredths , opWhole , displayWhole , opString , displayString, secondsDisplayString}; enum ValueMode { invalidValueMode , notUsed , minutesToMs , hoursToMs , hundredths , opWhole , displayWhole , opString , displayString, secondsDisplayString};
enum SearchTopic { ST_NONE , ST_DAYS_SKIPPED , ST_DISABLED_SESSIONS , ST_JOURNAL , ST_NOTES , ST_NOTES_STRING , ST_BOOKMARKS , ST_BOOKMARKS_STRING , ST_AHI , ST_SESSION_LENGTH , ST_SESSIONS_QTY , ST_DAILY_USAGE , ST_APNEA_LENGTH , ST_APNEA_ALL , ST_CLEAR , ST_EVENT }; enum SearchTopic { ST_NONE , ST_DAYS_SKIPPED , ST_DISABLED_SESSIONS , ST_NOTES , ST_NOTES_STRING , ST_BOOKMARKS , ST_BOOKMARKS_STRING , ST_AHI , ST_SESSION_LENGTH , ST_SESSIONS_QTY , ST_DAILY_USAGE , ST_APNEA_LENGTH , ST_APNEA_ALL , ST_CLEAR , ST_EVENT };
enum OpCode { enum OpCode {
//DO NOT CHANGE NUMERIC OP CODES because THESE VALUES impact compare operations. //DO NOT CHANGE NUMERIC OP CODES because THESE VALUES impact compare operations.
@ -224,6 +224,7 @@ private:
bool helpMode=false; bool helpMode=false;
QString helpString = helpStr(); QString helpString = helpStr();
void clearMatch(); void clearMatch();
void debugStates();
void setState(STATE); void setState(STATE);
void createUi(); void createUi();
void populateControl(); void populateControl();
@ -256,6 +257,7 @@ private:
QString helpStr(); QString helpStr();
QString centerLine(QString line); QString centerLine(QString line);
QString convertRichText2Plain (QString rich);
QRegExp searchPatterToRegex (QString wildcard); QRegExp searchPatterToRegex (QString wildcard);
void addCommandItem(QString str,int topic); void addCommandItem(QString str,int topic);
float commandListItemMaxWidth = 0; float commandListItemMaxWidth = 0;
@ -281,6 +283,8 @@ private:
int DaysWithFileErrors; int DaysWithFileErrors;
void setoperation(OpCode opCode,ValueMode mode) ; void setoperation(OpCode opCode,ValueMode mode) ;
QTextDocument richText;
void process_match_info(QString text, int topic); void process_match_info(QString text, int topic);

View File

@ -7,9 +7,6 @@
* License. See the file COPYING in the main directory of the source code * License. See the file COPYING in the main directory of the source code
* for more details. */ * for more details. */
#define TEST_MACROS_ENABLEDoff
#include <test_macros.h>
#include <QFileDialog> #include <QFileDialog>
#include <QLocale> #include <QLocale>
#include <QMessageBox> #include <QMessageBox>
@ -88,10 +85,9 @@ void ExportCSV::on_filenameBrowseButton_clicked()
if (ui->startDate->date() != ui->endDate->date()) { timestamp += "_" + ui->endDate->date().toString(Qt::ISODate); } if (ui->startDate->date() != ui->endDate->date()) { timestamp += "_" + ui->endDate->date().toString(Qt::ISODate); }
timestamp += ".csv"; timestamp += ".csv";
QString folder = mainwin->profilePath(STR_PREF_LastExportCsvPath);
QString name = QFileDialog::getSaveFileName(this, tr("Select file to export to"), QString name = QFileDialog::getSaveFileName(this, tr("Select file to export to"),
folder + QDir::separator() + timestamp, tr("CSV Files (*.csv)")); p_pref->Get("{home}/") + timestamp, tr("CSV Files (*.csv)"));
if (name.isEmpty()) { if (name.isEmpty()) {
ui->exportButton->setEnabled(false); ui->exportButton->setEnabled(false);
return; return;
@ -103,8 +99,6 @@ void ExportCSV::on_filenameBrowseButton_clicked()
ui->filenameEdit->setText(name); ui->filenameEdit->setText(name);
ui->exportButton->setEnabled(true); ui->exportButton->setEnabled(true);
folder = QFileInfo(name).absolutePath();
mainwin->saveProfilePath(STR_PREF_LastExportCsvPath,folder);
} }
void ExportCSV::on_quickRangeCombo_activated(const QString &arg1) void ExportCSV::on_quickRangeCombo_activated(const QString &arg1)

View File

@ -44,7 +44,7 @@ namespace HighResolution {
} }
HiResolutionMode setHiResolutionMode(HiResolutionMode value) { HiResolutionMode setHiResolutionMode(HiResolutionMode value) {
QString filename = GetAppData() + QDir::separator() + HI_RES_FILENAME; QString filename = GetAppData() + HI_RES_FILENAME;
if (value == HRM_ENABLED ) { if (value == HRM_ENABLED ) {
writeMode( filename , HRM_ENABLED ,"HiResolutionMode Enabled"); writeMode( filename , HRM_ENABLED ,"HiResolutionMode Enabled");
return HRM_ENABLED; return HRM_ENABLED;
@ -55,22 +55,22 @@ namespace HighResolution {
} }
HiResolutionMode getHiResolutionMode() { HiResolutionMode getHiResolutionMode() {
QString filename = GetAppData() + QDir::separator() + HI_RES_FILENAME; QString filename = GetAppData() + HI_RES_FILENAME;
int hiResMode= readMode( filename ); int hiResMode= readMode( filename );
return (hiResMode == HRM_ENABLED ) ? HRM_ENABLED : HRM_DISABLED ; return (hiResMode == HRM_ENABLED ) ? HRM_ENABLED : HRM_DISABLED ;
} }
// this function is used to control the text name of the high resolution preference checkbox. // this function is used to control the text name of the high resolution preference checkbox.
bool checkBox(bool set,QCheckBox* button) { void checkBox(bool set,QCheckBox* button) {
if (set) { if (set) {
hiResolutionNextSessionMode = button->isChecked()? HRM_ENABLED : HRM_DISABLED ; hiResolutionNextSessionMode = button->isChecked()? HRM_ENABLED : HRM_DISABLED ;
setHiResolutionMode(hiResolutionNextSessionMode); setHiResolutionMode(hiResolutionNextSessionMode);
if ( hiResolutionOperaingMode != hiResolutionNextSessionMode ) { if ( hiResolutionOperaingMode != hiResolutionNextSessionMode ) {
QString msg = QString("%1\n%2").arg(QObject::tr("High Resolution Mode change will take effect when OSCAR is restarted.")) QMessageBox::information(nullptr,
.arg(QObject::tr("Restart Oscar now?") ); STR_MessageBox_Information,
return QMessageBox::question(nullptr, STR_MessageBox_Question, msg, QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes; QObject::tr("High Resolution Mode change will take effect when OSCAR is restarted."));
} }
return false; return;
} }
QString label; QString label;
if (hiResolutionNextSessionMode == HRM_ENABLED ) { if (hiResolutionNextSessionMode == HRM_ENABLED ) {
@ -89,7 +89,6 @@ namespace HighResolution {
button->setChecked(false); button->setChecked(false);
} }
button->setText(label); button->setText(label);
return false;
} }
// These functions are for main.cpp // These functions are for main.cpp

View File

@ -19,7 +19,7 @@ namespace HighResolution {
void display(bool); void display(bool);
// used by preferences // used by preferences
bool checkBox(bool set,QCheckBox* button); void checkBox(bool set,QCheckBox* button);
} }
#endif // HIGHRESOLUTION_H #endif // HIGHRESOLUTION_H

View File

@ -296,7 +296,7 @@ void optionExit(int exitCode, QString error) {
Help Menu Help Menu
Option Description Option Description
-p Pauses execution for 1 second -p Pauses execution for 1 second
--profile <name> Name of profile. if name does not exist then uses profile tab. --profile <name> Name of profile. if name does not exist then uses last used profile.
--l or --language Force language prompt --l or --language Force language prompt
--datadir <folderName> Use folderName as Oscar Data folder. For relatve paths: <Documents folder>/<relative path>. --datadir <folderName> Use folderName as Oscar Data folder. For relatve paths: <Documents folder>/<relative path>.
If folder does not exist then prompts user. If folder does not exist then prompts user.
@ -397,11 +397,11 @@ int main(int argc, char *argv[]) {
// selection QDialog, which waits indefinitely for user input before MainWindow is constructed. // selection QDialog, which waits indefinitely for user input before MainWindow is constructed.
bool force_data_dir = false; bool force_data_dir = false;
QString load_profile; // null profile means no --profile param QString load_profile = "";
for (int i = 1; i < args.size(); i++) { for (int i = 1; i < args.size(); i++) {
if ((args[i] == "--language") || (args[i] == "--l") ) { if ((args[i] == "--language") || (args[i] == "--l") ) {
settings.setValue(LangSetting,""); settings.setValue(LangSetting,"");
} else if ( (args[i] == "-l") || (args[i] == "-nop") || (args[i] == "") ){ } else if ( (args[i] == "-l") || (args[i] == "-nop")){
// do nothing. internal calls that current don't have any functions in main. // do nothing. internal calls that current don't have any functions in main.
} else if (args[i] == "-p") { } else if (args[i] == "-p") {
QThread::msleep(1000); QThread::msleep(1000);
@ -409,8 +409,7 @@ int main(int argc, char *argv[]) {
if ((i+1) < args.size()) if ((i+1) < args.size())
load_profile = args[++i]; load_profile = args[++i];
else { else {
// Just view all profiles. optionExit(1,"Missing argument to --profile");
load_profile = " ";
} }
} else if (args[i] == "--datadir") { // mltam's idea } else if (args[i] == "--datadir") { // mltam's idea
QString datadir, datadirwas ; QString datadir, datadirwas ;
@ -436,7 +435,7 @@ int main(int argc, char *argv[]) {
} else if (QString(args[i]).contains("help",Qt::CaseInsensitive)) { } else if (QString(args[i]).contains("help",Qt::CaseInsensitive)) {
optionExit(0,QString("")); optionExit(0,QString(""));
} else { } else {
optionExit(3,QString("Invalid Argument: '%1'").arg(args[i])); optionExit(3,QString("Invalid Argument. %1").arg(args[i]));
} }
} // end of for args loop } // end of for args loop
@ -646,7 +645,6 @@ int main(int argc, char *argv[]) {
QString language = settings.value(LangSetting, "").toString(); QString language = settings.value(LangSetting, "").toString();
AppSetting->setLanguage(language); AppSetting->setLanguage(language);
if (!load_profile.isEmpty()) AppSetting->setProfileName(load_profile);
// Set fonts from preferences file // Set fonts from preferences file
qDebug() << "App font before Prefs setting" << QApplication::font(); qDebug() << "App font before Prefs setting" << QApplication::font();

View File

@ -10,6 +10,7 @@
#define TEST_MACROS_ENABLEDoff #define TEST_MACROS_ENABLEDoff
#include <test_macros.h> #include <test_macros.h>
#include <QHostInfo> #include <QHostInfo>
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox> #include <QMessageBox>
@ -44,9 +45,6 @@
#include "common_gui.h" #include "common_gui.h"
#include "version.h" #include "version.h"
#include "SleepLib/appsettings.h" // defines for REMSTAR_M_SUPPORT #include "SleepLib/appsettings.h" // defines for REMSTAR_M_SUPPORT
#include "SleepLib/journal.h"
#include "SleepLib/common.h"
#include "notifyMessageBox.h"
// Custom loaders that don't autoscan.. // Custom loaders that don't autoscan..
@ -330,11 +328,11 @@ void MainWindow::EnableTabs(bool b)
void MainWindow::Notify(QString s, QString title, int ms) void MainWindow::Notify(QString s, QString title, int ms)
{ {
QString msg = s;
if (title.isEmpty()) { if (title.isEmpty()) {
title = STR_TR_OSCAR + " " + getVersion().displayString(); title = STR_TR_OSCAR + " " + getVersion().displayString();
} }
if (systray && !AppSetting->notifyMessagBoxOption()) { if (systray) {
QString msg = s;
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
// GNOME3's systray hides the last line of the displayed Qt message. // GNOME3's systray hides the last line of the displayed Qt message.
@ -348,8 +346,6 @@ void MainWindow::Notify(QString s, QString title, int ms)
#endif #endif
systray->showMessage(title, msg, QSystemTrayIcon::Information, ms); systray->showMessage(title, msg, QSystemTrayIcon::Information, ms);
} else {
createNotifyMessageBox(this, title , msg, (ms+999)/1000);
} }
} }
@ -1645,7 +1641,6 @@ void MainWindow::reloadProfile()
void MainWindow::RestartApplication(bool force_login, QString cmdline) void MainWindow::RestartApplication(bool force_login, QString cmdline)
{ {
qDebug() << "Restarting OSCAR";
CloseProfile(); CloseProfile();
p_pref->Save(); p_pref->Save();
@ -2274,34 +2269,9 @@ void MainWindow::on_actionChange_Data_Folder_triggered()
RestartApplication(false, "-d"); RestartApplication(false, "-d");
} }
QString MainWindow::profilePath(QString folderProfileName ) {
QString folderName;
if (p_profile->contains(folderProfileName)) {
folderName = (*p_profile)[folderProfileName].toString();
QFileInfo fi(folderName);
if (fi.exists() && fi.isDir()) {
return folderName;
}
}
QStringList paths = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation);
if (paths.size()>1) folderName = paths[0];
return folderName;
}
void MainWindow::saveProfilePath(QString folderProfileName , QString pathName) {
(*p_profile)[folderProfileName] = pathName;
}
void MainWindow::importNonCPAP(MachineLoader &loader) void MainWindow::importNonCPAP(MachineLoader &loader)
{ {
// get save location from profile.
QDir folder = QDir(profilePath(STR_PREF_LastOximetryPath));
QFileDialog w; QFileDialog w;
if (folder.exists() ) {
w.setDirectory(folder);
}
w.setFileMode(QFileDialog::ExistingFiles); w.setFileMode(QFileDialog::ExistingFiles);
w.setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); w.setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
w.setOption(QFileDialog::ShowDirsOnly, false); w.setOption(QFileDialog::ShowDirsOnly, false);
@ -2315,7 +2285,6 @@ void MainWindow::importNonCPAP(MachineLoader &loader)
ProgressDialog progress(this); ProgressDialog progress(this);
if (w.exec() == QFileDialog::Accepted) { if (w.exec() == QFileDialog::Accepted) {
saveProfilePath(STR_PREF_LastOximetryPath,w.directory().absolutePath());
QStringList files = w.selectedFiles(); QStringList files = w.selectedFiles();
int size = files.size(); int size = files.size();
if (size > 1) { if (size > 1) {
@ -2354,15 +2323,6 @@ void MainWindow::importNonCPAP(MachineLoader &loader)
progress.close(); progress.close();
QCoreApplication::processEvents(); QCoreApplication::processEvents();
} }
if (res < 0) {
// res is used as an index to an array and will cause a crash if not handled.
// Negative numbers indicate a problem with the file format or the file does not exist.
//QString fileName = QFileInfo(files[0]).fileName();
QString msg = QString(tr("There was a problem parsing %1 \nData File: %2")
.arg(name, QFileInfo( files[0]).fileName() ) );
//QString msg = QString(tr("There was a problem parsing %1 \nData File: %2") .arg(name, fileName) );
Notify(msg,"",20*1000 /* convert sec to ms */);
} else
if (res == 0) { if (res == 0) {
Notify(tr("There was a problem opening %1 Data File: %2").arg(name, files[0])); Notify(tr("There was a problem opening %1 Data File: %2").arg(name, files[0]));
return; return;
@ -2647,45 +2607,19 @@ void MainWindow::on_actionShowPersonalData_toggled(bool visible)
} }
} }
#include "SleepLib/journal.h"
void MainWindow::on_actionImport_Journal_triggered()
{
QString filename = QFileDialog::getOpenFileName(this,
tr("Choose where to read journal"),
profilePath(STR_PREF_LastJournalPath),
tr("XML Files (*.xml)"));
if (Journal::RestoreJournal(filename) ) {
QFileInfo fi(filename);
QDir dir = fi.dir();
if (dir.exists() ) {
saveProfilePath(STR_PREF_LastJournalPath,dir.absolutePath());
}
}
}
void MainWindow::on_actionExport_Journal_triggered() void MainWindow::on_actionExport_Journal_triggered()
{ {
QString folder; QString folder;
folder = profilePath(STR_PREF_LastJournalPath);
if (p_profile->contains(STR_PREF_LastJournalPath)) { folder = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
folder = (*p_profile)[STR_PREF_LastJournalPath].toString();
}
QFileInfo fi(folder);
if (!fi.isDir() ) {
folder = QStandardPaths::StandardLocation(QStandardPaths::DocumentsLocation);
}
folder += QDir::separator() + tr("%1's Journal").arg(p_profile->user->userName()) + ".xml"; folder += QDir::separator() + tr("%1's Journal").arg(p_profile->user->userName()) + ".xml";
QString filename = QFileDialog::getSaveFileName(this, tr("Choose where to save journal"), folder, tr("XML Files (*.xml)")); QString filename = QFileDialog::getSaveFileName(this, tr("Choose where to save journal"), folder, tr("XML Files (*.xml)"));
if (Journal::BackupJournal(filename) ) { BackupJournal(filename);
QFileInfo fi(filename);
QDir dir = fi.dir();
if (dir.exists() ) {
(*p_profile)[STR_PREF_LastJournalPath] = dir.absolutePath();
}
}
} }
void MainWindow::on_actionShow_Performance_Counters_toggled(bool arg1) void MainWindow::on_actionShow_Performance_Counters_toggled(bool arg1)

View File

@ -48,7 +48,7 @@ class MainWindow;
This document is an attempt to provide a little technical insight into OSCAR's program internals. This document is an attempt to provide a little technical insight into OSCAR's program internals.
\section project_info Further Information \section project_info Further Information
OSCAR is hosted on <a href="https://gitlab.com/CrimsonNape/OSCAR-code">Gitlab</a> with full source code available there. OSCAR is hosted on <a href="https://gitlab.com/pholy/OSCAR-code">Gitlab</a> with full source code available there.
Help for users can be found in the <a href="http://www.apneaboard.com/wiki/index.php?title=OSCAR_Help">OSCAR Help Wiki</a>. Help for users can be found in the <a href="http://www.apneaboard.com/wiki/index.php?title=OSCAR_Help">OSCAR Help Wiki</a>.
@ -138,6 +138,14 @@ class MainWindow : public QMainWindow
void updateOverview(); void updateOverview();
/*! \fn void RestartApplication(bool force_login=false);
\brief Closes down OSCAR and restarts it
\param bool force_login
If force_login is set, it will return to the login menu even if it's set to skip
*/
void RestartApplication(bool force_login = false, QString cmdline = QString());
void JumpDaily(); void JumpDaily();
void JumpOverview(); void JumpOverview();
void JumpStatistics(); void JumpStatistics();
@ -171,18 +179,7 @@ class MainWindow : public QMainWindow
//! \brief Recalculate all event summaries and flags //! \brief Recalculate all event summaries and flags
void doReprocessEvents(); void doReprocessEvents();
void doRecompressEvents(); void doRecompressEvents();
/*! \fn void RestartApplication(bool force_login=false);
\brief Closes down OSCAR and restarts it
\param bool force_login
If force_login is set, it will return to the login menu even if it's set to skip
allow timer to restart application.
*/
void RestartApplication(bool force_login = false, QString cmdline = QString());
QString profilePath(QString folderProfileName );
void saveProfilePath(QString folderProfileName , QString pathName);
protected: protected:
void closeEvent(QCloseEvent *) override; void closeEvent(QCloseEvent *) override;
@ -348,8 +345,6 @@ class MainWindow : public QMainWindow
void on_actionExport_Journal_triggered(); void on_actionExport_Journal_triggered();
void on_actionImport_Journal_triggered();
void on_actionShow_Performance_Counters_toggled(bool arg1); void on_actionShow_Performance_Counters_toggled(bool arg1);
void on_actionExport_CSV_triggered(); void on_actionExport_CSV_triggered();

View File

@ -2411,7 +2411,6 @@ p, li { white-space: pre-wrap; }
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="menuExp_ort_CSV_Data"/> <addaction name="menuExp_ort_CSV_Data"/>
<addaction name="actionExport_Journal"/> <addaction name="actionExport_Journal"/>
<addaction name="actionImport_Journal"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionChange_Data_Folder"/> <addaction name="actionChange_Data_Folder"/>
<addaction name="separator"/> <addaction name="separator"/>
@ -2825,11 +2824,6 @@ p, li { white-space: pre-wrap; }
<string>Backup Journal</string> <string>Backup Journal</string>
</property> </property>
</action> </action>
<action name="actionImport_Journal">
<property name="text">
<string>Import Journal</string>
</property>
</action>
<action name="actionShow_Performance_Counters"> <action name="actionShow_Performance_Counters">
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>

View File

@ -56,7 +56,7 @@ NewProfile::NewProfile(QWidget *parent, const QString *user) :
m_passwordHashed = false; m_passwordHashed = false;
ui->heightEdit2->setVisible(false); ui->heightEdit2->setVisible(false);
ui->heightEdit->setDecimals(0); ui->heightEdit->setDecimals(0);
ui->heightEdit->setSuffix(QString(" %1").arg(STR_UNIT_CM)); ui->heightEdit->setSuffix(STR_UNIT_CM);
{ {
// process countries list // process countries list
@ -141,10 +141,10 @@ QString NewProfile::getIntroHTML()
"</body>" "</body>"
"</html>"; "</html>";
} }
#include <cmath>
int cmToFeetInch( double cm, double& inches ) { int cmToFeetInch( double cm, double& inches ) {
inches = cm * inches_per_cm; inches = cm * inches_per_cm;
int feet = std::round(inches / 12); int feet = inches / 12;
inches -= (double)(feet *12); inches -= (double)(feet *12);
return feet; return feet;
} }
@ -448,15 +448,15 @@ void NewProfile::on_heightCombo_currentIndexChanged(int index)
if (index == 0) { if (index == 0) {
//metric //metric
ui->heightEdit->setDecimals(1); ui->heightEdit->setDecimals(1);
ui->heightEdit->setSuffix(QString(" %1").arg(STR_UNIT_CM)); ui->heightEdit->setSuffix(STR_UNIT_CM);
ui->heightEdit->setValue(m_tmp_height_cm); ui->heightEdit->setValue(m_tmp_height_cm);
ui->heightEdit2->setVisible(false); ui->heightEdit2->setVisible(false);
} else { //english } else { //evil
ui->heightEdit->setDecimals(0); // feet are always a whole number. ui->heightEdit->setDecimals(0); // feet are always a whole number.
ui->heightEdit2->setDecimals(1); // inches can be seen as double. ui->heightEdit2->setDecimals(1); // inches can be seen as double.
ui->heightEdit->setSuffix(QString(" %1").arg(STR_UNIT_FOOT)); ui->heightEdit->setSuffix(STR_UNIT_FOOT);
ui->heightEdit2->setVisible(true); ui->heightEdit2->setVisible(true);
ui->heightEdit2->setSuffix(QString(" %1").arg(STR_UNIT_INCH)); ui->heightEdit2->setSuffix(STR_UNIT_INCH);
double inches=0; double inches=0;
ui->heightEdit->setValue(cmToFeetInch(m_tmp_height_cm,inches)); ui->heightEdit->setValue(cmToFeetInch(m_tmp_height_cm,inches));
ui->heightEdit2->setValue(inches); ui->heightEdit2->setValue(inches);

View File

@ -1,159 +0,0 @@
/* Daily Panel
*
* Copyright (c) 2019-2024 The OSCAR Team
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of the source code
* for more details. */
#include "notifyMessageBox.h"
#define TEST_MACROS_ENABLEDoff
#include <test_macros.h>
int defaultTimeoutSeconds = 4 ;
//QString defaultTimeoutMessage = QObject::tr("Notifcation expires in %1 seconds.\nTo Dismiss: Press Escape or Enter.");
//QString timeoutStoppedMessage = QObject::tr("Timer Stopped.\nTo Dismiss: Press Escape or Enter.");
QString defaultTimeoutMessage = QObject::tr("Notifcation expires in %1 seconds.");
QString timeoutStoppedMessage = QObject::tr("");
NotifyMessageBox::NotifyMessageBox(const QString& title, const QString& message, int timeoutSeconds, const QString& timeoutMessage, QWidget* parent)
: QObject(parent), m_title(title), m_message(message), m_timeoutSeconds(timeoutSeconds), m_timeoutMessage(timeoutMessage), m_state(nmb_init)
{
if (timeoutSeconds<defaultTimeoutSeconds) m_timeoutSeconds=defaultTimeoutSeconds;
if ( timeoutMessage.isEmpty() ) m_timeoutMessage = defaultTimeoutMessage;
setupTimer();
}
NotifyMessageBox::~NotifyMessageBox()
{
};
void NotifyMessageBox::setupMessageBox()
{
m_msgBox = new QMessageBox(QMessageBox::Information,m_title,m_message);
//QFont boldFont;
//boldFont.setBold(true);
//m_msgBox->setFont(boldFont);
m_msgBox->setWindowTitle(m_title);
m_msgBox->setText(m_message);
#ifndef STOPTIMER
m_msgBox->setStandardButtons(QMessageBox::Ok);
#else
// Set action as the default button
QPushButton *terminateB = m_msgBox->addButton("Dismiss", QMessageBox::RejectRole);
m_msgBox->setDefaultButton(terminateB);
connect(m_msgBox, SIGNAL(rejected()), this, SLOT(onTerminate()));
if (m_state == nmb_stopped) {
m_msgBox->setInformativeText(timeoutStoppedMessage);
} else {
m_msgBox->setInformativeText(m_timeoutMessage.arg(m_timeoutSeconds));
m_msgBox->addButton("Stop Timer", QMessageBox::AcceptRole);
m_msgBox->setEscapeButton(QMessageBox::Cancel);
connect(m_msgBox, SIGNAL(accepted()), this, SLOT(onStop()));
}
#endif
m_msgBox->show();
m_msgBox->raise();
}
#if defined(STOPTIMER)
void NotifyMessageBox::onStop()
{
m_msgBox->close();
m_state = nmb_stopped;
setupMessageBox();
}
void NotifyMessageBox::onTerminate()
{
releaseResources();
}
#endif
void NotifyMessageBox::onTimeout()
{
switch (m_state) {
case nmb_init:
m_timer->setInterval(1000);
setupMessageBox();
m_state = nmb_running;
break;
case nmb_running:
m_timer->setInterval(1000);
m_timeoutSeconds--;
if (m_timeoutSeconds == 0) {
m_state = nmb_stopped;
releaseResources();
} else {
m_msgBox->setInformativeText(m_timeoutMessage.arg(m_timeoutSeconds));
}
break;
default:
case nmb_stopped:
break;
}
}
void NotifyMessageBox::setupTimer()
{
#if defined(STOPTIMER)
m_timer = new QTimer(this);
m_timer->setInterval(1);
m_timer->setSingleShot(false);
connect(m_timer, &QTimer::timeout, this, &NotifyMessageBox::onTimeout);
m_timer->start();
#endif
}
void NotifyMessageBox::releaseResources()
{
m_msgBox->close();
#if defined(STOPTIMER)
m_timer->deleteLater();
#endif
}
NotifyMessageBox* createNotifyMessageBox(
const QString& title,
const QString& message,
int timeoutSeconds,
const QString& timeoutMessage,
QWidget* parent)
{
NotifyMessageBox* msgBox = new NotifyMessageBox(title, message, timeoutSeconds, timeoutMessage, parent);
return msgBox;
}
NotifyMessageBox* createNotifyMessageBox (
QWidget* parent ,
const QString& title,
const QString& message,
int timeoutSeconds ,
const QString& timeoutMessage
) {
return createNotifyMessageBox(title, message, timeoutSeconds, timeoutMessage, parent);
};
#if 0
NotifyMessageBox* createNotifyMessageBox (
QWidget* parent ,
const QString& title,
const QString& message,
enum QMessageBox::Icon msgIcon,
int timeoutSeconds ,
const QString& timeoutMessage
) {
return createNotifyMessageBox(title, message, timeoutSeconds, timeoutMessage, parent);
};
#endif

View File

@ -1,94 +0,0 @@
/* search GUI Headers
*
* Copyright (c) 2024-2024 The OSCAR Team
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of the source code
* for more details. */
#ifndef NOTIFYMESSAGEBOX_H
#define NOTIFYMESSAGEBOX_H
#define STOPTIMER
#include <QMessageBox>
#include <QFont>
#include <QDebug>
#ifdef STOPTIMER
#include <QTimer>
#include <QPushButton>
#endif
class NotifyMessageBox : public QObject
{
Q_OBJECT
public:
enum NMB_STATE { nmb_init, nmb_running, nmb_stopped };
NotifyMessageBox(const QString& title,
const QString& message,
int timeoutSeconds = 0 ,
const QString& timeoutMessage = "" ,
QWidget* parent = nullptr);
virtual ~NotifyMessageBox();
private:
void setupMessageBox();
void setupTimer();
private slots:
void releaseResources();
void onTimeout();
#if defined(STOPTIMER)
void onStop() ;
void onTerminate() ;
#endif
private:
QWidget* m_parent;
QString m_title;
QString m_message;
QMessageBox* m_msgBox;
int m_timeoutSeconds;
QString m_timeoutMessage;
NMB_STATE m_state = nmb_init;
#if defined(STOPTIMER)
QTimer* m_timer;
QPushButton *stopB ;
QPushButton *terminateB ;
#endif
};
NotifyMessageBox* createNotifyMessageBox (
QWidget* parent ,
const QString& title,
const QString& message,
int timeoutSeconds = 0 ,
const QString& timeoutMessage = "" ) ;
#if 0
NotifyMessageBox* createNotifyMessageBox (
const QString& title,
const QString& message,
int timeoutSeconds = 0 ,
const QString& timeoutMessage = "" ,
QWidget* parent = nullptr);
NotifyMessageBox* createNotifyMessageBox (
const QString& title,
const QString& message,
int timeoutSeconds = 0 ,
enum QMessageBox::Icon msgIcon =
const QString& timeoutMessage = "" ,
QWidget* parent = nullptr);
#endif
#endif // NOTIFYMESSAGEBOX_H

View File

@ -255,7 +255,6 @@ lessThan(QT_MAJOR_VERSION,5)|lessThan(QT_MINOR_VERSION,12) {
SOURCES += \ SOURCES += \
checkupdates.cpp \ checkupdates.cpp \
notifyMessageBox.cpp \
highresolution.cpp \ highresolution.cpp \
Graphs/gGraph.cpp \ Graphs/gGraph.cpp \
Graphs/gGraphView.cpp \ Graphs/gGraphView.cpp \
@ -366,7 +365,6 @@ QMAKE_EXTRA_COMPILERS += optimize
HEADERS += \ HEADERS += \
checkupdates.h \ checkupdates.h \
notifyMessageBox.h \
highresolution.h \ highresolution.h \
dailySearchTab.h \ dailySearchTab.h \
daily.h \ daily.h \

Some files were not shown because too many files have changed in this diff Show More