diff --git a/sleepyhead/Graphs/MinutesAtPressure.cpp b/sleepyhead/Graphs/MinutesAtPressure.cpp index 4a2b54b4..856a7fd5 100644 --- a/sleepyhead/Graphs/MinutesAtPressure.cpp +++ b/sleepyhead/Graphs/MinutesAtPressure.cpp @@ -221,6 +221,7 @@ void MinutesAtPressure::paint(QPainter &painter, gGraph &graph, const QRegion &r double p0, p1, p2, p3; QString label; + double s2; int widest_YAxis = 0; int mouseOverKey = 0; @@ -280,7 +281,7 @@ void MinutesAtPressure::paint(QPainter &painter, gGraph &graph, const QRegion &r } else { str.chop(1);// +=QObject::tr("No Data Here"); } - graph.ToolTip(str, mouse.x(), mouse.y(), TT_AlignLeft); + graph.ToolTip(str, mouse.x(), mouse.y(), TT_AlignRight); } @@ -314,14 +315,17 @@ void MinutesAtPressure::paint(QPainter &painter, gGraph &graph, const QRegion &r // Plot IPAP Time at Pressure //////////////////////////////////////////////////////////////////// xp=left; - double lastyp = bottom - (double(ipap.times[min-1]) * ystep); + s2 = double(ipap.times[qMax(0, min-1)]/60.0); + if (s2 < 0) s2=0; + + double lastyp = bottom - (s2 * ystep); for (int i=min; iappearance->lineThickness())); - xp=left, lastyp = bottom - (double(epap.times[min]) * ystep); + s2 = double(epap.times[qMax(min,0)]/60.0); + xp=left, lastyp = bottom - (s2 * ystep); for (int i=min; iappearance->lineThickness())); } - yp = bottom - (double(p1) * ystep); + yp = bottom - qMax((double(p1) * ystep), 0.0); painter.drawLine(xp, lastyp, xp+xstep, yp); lastyp = yp; xp += xstep; - double s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.2),0.0f); + s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.2), 0.0f); yp = qMax(double(bottom-height), (bottom - (s2 * ystep))); painter.drawLine(xp, lastyp, xp+xstep, yp); lastyp = yp; xp += xstep; - s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.4),0.0f); + s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.4), 0.0f); yp = qMax(double(bottom-height), (bottom - (s2 * ystep))); painter.drawLine(xp, lastyp, xp+xstep, yp); lastyp = yp; xp += xstep; - s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.6),0.0f); + s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.6), 0.0f); yp = qMax(double(bottom-height), (bottom - (s2 * ystep))); painter.drawLine(xp, lastyp, xp+xstep, yp); xp+=xstep; lastyp = yp; - s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.8),0.0f); + s2 = qMax(CatmullRomSpline(p0, p1, p2, p3, 0.8), 0.0f); yp = qMax(double(bottom-height), (bottom - (s2 * ystep))); painter.drawLine(xp, lastyp, xp+xstep, yp); xp+=xstep; diff --git a/sleepyhead/Graphs/gXAxis.cpp b/sleepyhead/Graphs/gXAxis.cpp index 000830eb..8ccb97da 100644 --- a/sleepyhead/Graphs/gXAxis.cpp +++ b/sleepyhead/Graphs/gXAxis.cpp @@ -482,6 +482,6 @@ int gXAxisPressure::minimumHeight() #endif } -void gXAxisPressure::paint(QPainter &painter, gGraph &graph, const QRegion ®ion) +void gXAxisPressure::paint(QPainter & /*painter*/, gGraph &/*graph*/, const QRegion &/*region*/) { } diff --git a/sleepyhead/SleepLib/common.cpp b/sleepyhead/SleepLib/common.cpp index 39b642fe..0e226c65 100644 --- a/sleepyhead/SleepLib/common.cpp +++ b/sleepyhead/SleepLib/common.cpp @@ -129,6 +129,10 @@ QString STR_UNIT_CMH2O; QString STR_UNIT_Hours; QString STR_UNIT_Minutes; QString STR_UNIT_Seconds; +QString STR_UNIT_h; +QString STR_UNIT_m; +QString STR_UNIT_s; +QString STR_UNIT_ms; QString STR_UNIT_BPM; // Beats per Minute QString STR_UNIT_LPM; // Litres per Minute QString STR_UNIT_ml; // MilliLitres @@ -325,6 +329,10 @@ void initializeStrings() STR_UNIT_Hours = QObject::tr("Hours"); STR_UNIT_Minutes = QObject::tr("Minutes"); STR_UNIT_Seconds = QObject::tr("Seconds"); + STR_UNIT_h = QObject::tr("h"); // hours shortform + STR_UNIT_m = QObject::tr("m"); // minutes shortform + STR_UNIT_s = QObject::tr("s"); // seconds shortform + STR_UNIT_ms = QObject::tr("ms"); // milliseconds STR_UNIT_EventsPerHour = QObject::tr("Events/hr"); // Events per hour STR_UNIT_Percentage = QObject::tr("%"); STR_UNIT_Hz = QObject::tr("Hz"); // Hertz diff --git a/sleepyhead/SleepLib/common.h b/sleepyhead/SleepLib/common.h index 17dcf9cd..10cca4fe 100644 --- a/sleepyhead/SleepLib/common.h +++ b/sleepyhead/SleepLib/common.h @@ -123,7 +123,6 @@ const QString STR_GEN_UpdatesAutoCheck = "Updates_AutoCheck"; const QString STR_GEN_UpdateCheckFrequency = "Updates_CheckFrequency"; const QString STR_GEN_DataFolder = "DataFolder"; -const QString STR_PREF_AllowEventRenaming = "AllowEventRenaming"; const QString STR_PREF_AllowEarlyUpdates = "AllowEarlyUpdates"; const QString STR_PREF_ReimportBackup = "ReimportBackup"; const QString STR_PREF_LastCPAPPath = "LastCPAPPath"; @@ -159,6 +158,10 @@ extern QString STR_UNIT_CMH2O; extern QString STR_UNIT_Hours; extern QString STR_UNIT_Minutes; extern QString STR_UNIT_Seconds; +extern QString STR_UNIT_h; // (h)ours, (m)inutes, (s)econds +extern QString STR_UNIT_m; +extern QString STR_UNIT_s; +extern QString STR_UNIT_ms; extern QString STR_UNIT_BPM; // Beats per Minute extern QString STR_UNIT_LPM; // Litres per Minute extern QString STR_UNIT_ml; // millilitres diff --git a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp index 7debd1ef..27d2d219 100644 --- a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp @@ -2102,6 +2102,8 @@ bool PRS1Import::ParseSummaryF5V2() CPAPMode cpapmode = MODE_UNKNOWN; summary_duration = data[0x18] | data[0x19] << 8; + + return true; } bool PRS1Import::ParseSummaryF0V6() diff --git a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp index 8666c584..c8332177 100644 --- a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp @@ -3340,8 +3340,6 @@ void ResmedLoader::initChannels() chan->addOption(10, QObject::tr("???")); chan->addOption(11, QObject::tr("Auto for Her")); - - channel.add(GRP_CPAP, chan = new Channel(RMS9_EPR = 0xe201, SETTING, MT_CPAP, SESSION, "EPR", QObject::tr("EPR"), QObject::tr("ResMed Exhale Pressure Relief"), diff --git a/sleepyhead/SleepLib/machine_common.h b/sleepyhead/SleepLib/machine_common.h index 2d4d88ea..510a8928 100644 --- a/sleepyhead/SleepLib/machine_common.h +++ b/sleepyhead/SleepLib/machine_common.h @@ -174,6 +174,8 @@ extern ChannelID POS_Orientation, POS_Inclination; const QString GRP_CPAP = "CPAP"; const QString GRP_POS = "POS"; const QString GRP_OXI = "OXI"; +const QString GRP_JOURNAL = "JOURNAL"; +const QString GRP_SLEEP = "SLEEP"; #endif // MACHINE_COMMON_H diff --git a/sleepyhead/SleepLib/schema.cpp b/sleepyhead/SleepLib/schema.cpp index 4437d19e..815e2fc0 100644 --- a/sleepyhead/SleepLib/schema.cpp +++ b/sleepyhead/SleepLib/schema.cpp @@ -106,6 +106,7 @@ void init() DataTypes["datetime"] = DATETIME; DataTypes["time"] = TIME; + // Note: Old channel names stored in channels.xml are not translatable.. they need to be moved to be defined AFTER here instead if (!schema::channel.Load(":/docs/channels.xml")) { QMessageBox::critical(0, STR_MessageBox_Error, QObject::tr("Couldn't parse Channels.xml, this build is seriously borked, no choice but to abort!!"), @@ -472,6 +473,136 @@ void init() ch->addOption(7, QObject::tr("ASV (Variable EPAP)")); ch->addOption(8, QObject::tr("AVAPS")); +// +// +// + + + // + schema::channel.add(GRP_JOURNAL, ch = new Channel(Journal_Weight = 0x0803, DATA, MT_JOURNAL, DAY, + "Weight", QObject::tr("Weight"), + QObject::tr("Weight"), + QObject::tr("Weight"), STR_UNIT_KG, + DOUBLE, Qt::black)); + +// Kids grow... but that adds a whole nother layer of complexity. + // + schema::channel.add(GRP_JOURNAL, ch = new Channel(0x0804, DATA, MT_JOURNAL, DAY, + "Height", QObject::tr("Height"), + QObject::tr("Physical Height"), + QObject::tr("Height"), STR_UNIT_CM, + DOUBLE, Qt::black)); + +// + schema::channel.add(GRP_JOURNAL, ch = new Channel(0x0805, DATA, MT_JOURNAL, DAY, + "BookmarkNotes", QObject::tr("Notes"), + QObject::tr("Bookmark Notes"), + QObject::tr("Notes"), QString(), + STRING, Qt::black)); + +// + schema::channel.add(GRP_JOURNAL, ch = new Channel(Journal_BMI = 0x0806, DATA, MT_JOURNAL, DAY, + "BMI", QObject::tr("BMI"), + QObject::tr("Body Mass Index"), + QObject::tr("BMI"), QString(), + DOUBLE, Qt::black)); + + +// + schema::channel.add(GRP_JOURNAL, ch = new Channel(Journal_ZombieMeter = 0x0807, DATA, MT_JOURNAL, DAY, + "ZombieMeter", QObject::tr("Zombie"), + QObject::tr("How you feel (0 = like crap, 10 = unstoppable)"), + QObject::tr("Zombie"), QString(), + DOUBLE, Qt::black)); + +// + schema::channel.add(GRP_JOURNAL, ch = new Channel(0x0808, DATA, MT_JOURNAL, DAY, + "BookmarkStart", QObject::tr("Start"), + QObject::tr("Bookmark Start"), + QObject::tr("Start"), QString(), + INTEGER, Qt::black)); +// + schema::channel.add(GRP_JOURNAL, ch = new Channel(0x0809, DATA, MT_JOURNAL, DAY, + "BookmarkEnd", QObject::tr("End"), + QObject::tr("Bookmark End"), + QObject::tr("End"), QString(), + DOUBLE, Qt::black)); +// + schema::channel.add(GRP_JOURNAL, ch = new Channel(0x080a, DATA, MT_JOURNAL, DAY, + "LastUpdated", QObject::tr("Last Updated"), + QObject::tr("Last Updated"), + QObject::tr("Last Updated"), QString(), + DATETIME, Qt::black)); +// + schema::channel.add(GRP_JOURNAL, ch = new Channel(Journal_Notes = 0xd000, DATA, MT_JOURNAL, DAY, + "Journal", QObject::tr("Journal Notes"), + QObject::tr("Journal Notes"), + QObject::tr("Journal"), QString(), + RICHTEXT, Qt::black)); + +// + schema::channel.add(GRP_SLEEP, ch = new Channel(ZEO_SleepStage = 0x2000, WAVEFORM, MT_SLEEPSTAGE, SESSION, + "SleepStage", QObject::tr("Sleep Stage"), + QObject::tr("1=Awake 2=REM 3=Light Sleep 4=Deep Sleep"), + QObject::tr("Sleep Stage"), QString(), + INTEGER, Qt::darkGray)); +// + schema::channel.add(GRP_SLEEP, ch = new Channel(0x2001, WAVEFORM, MT_SLEEPSTAGE, SESSION, + "ZeoBW", QObject::tr("Brain Wave"), + QObject::tr("Brain Wave"), + QObject::tr("BrainWave"), QString(), + INTEGER, Qt::black)); +// + schema::channel.add(GRP_SLEEP, ch = new Channel(ZEO_Awakenings = 0x2002, DATA, MT_SLEEPSTAGE, SESSION, + "Awakenings", QObject::tr("Awakenings"), + QObject::tr("Number of Awakenings"), + QObject::tr("Awakenings"), QString(), + INTEGER, Qt::black)); +// + schema::channel.add(GRP_SLEEP, ch = new Channel(ZEO_MorningFeel= 0x2003, DATA, MT_SLEEPSTAGE, SESSION, + "MorningFeel", QObject::tr("Morning Feel"), + QObject::tr("How you felt in the morning"), + QObject::tr("Morning Feel"), QString(), + INTEGER, Qt::black)); +// + schema::channel.add(GRP_SLEEP, ch = new Channel(ZEO_TimeInWake = 0x2004, DATA, MT_SLEEPSTAGE, SESSION, + "TimeInWake", QObject::tr("Time Awake"), + QObject::tr("Time spent awake"), + QObject::tr("Time Awake"), STR_UNIT_Minutes, + INTEGER, Qt::black)); + +// + schema::channel.add(GRP_SLEEP, ch = new Channel(ZEO_TimeInREM = 0x2005, DATA, MT_SLEEPSTAGE, SESSION, + "TimeInREM", QObject::tr("Time In REM Sleep"), + QObject::tr("Time spent in REM Sleep"), + QObject::tr("Time in REM Sleep"), STR_UNIT_Minutes, + INTEGER, Qt::black)); +// + schema::channel.add(GRP_SLEEP, ch = new Channel(ZEO_TimeInLight = 0x2006, DATA, MT_SLEEPSTAGE, SESSION, + "TimeInLight", QObject::tr("Time In Light Sleep"), + QObject::tr("Time spent in light sleep"), + QObject::tr("Time in Light Sleep"), STR_UNIT_Minutes, + INTEGER, Qt::black)); +// + schema::channel.add(GRP_SLEEP, ch = new Channel(ZEO_TimeInDeep= 0x2007, DATA, MT_SLEEPSTAGE, SESSION, + "TimeInDeep", QObject::tr("Time In Deep Sleep"), + QObject::tr("Time spent in deep sleep"), + QObject::tr("Time in Deep Sleep"), STR_UNIT_Minutes, + INTEGER, Qt::black)); +// + schema::channel.add(GRP_SLEEP, ch = new Channel(ZEO_TimeInDeep= 0x2008, DATA, MT_SLEEPSTAGE, SESSION, + "TimeToZ", QObject::tr("Time to Sleep"), + QObject::tr("Time taken to get to sleep"), + QObject::tr("Time to Sleep"), STR_UNIT_Minutes, + INTEGER, Qt::black)); +// + schema::channel.add(GRP_SLEEP, ch = new Channel(ZEO_ZQ=0x2009, DATA, MT_SLEEPSTAGE, SESSION, + "ZeoZQ", QObject::tr("Zeo ZQ"), + QObject::tr("Zeo sleep quality measurement"), + QObject::tr("ZEO ZQ"), QString(), + INTEGER, Qt::black)); + + // // + // + // + // + // + // + + NoChannel = 0; // CPAP_IPAP=schema::channel["IPAP"].id(); @@ -549,24 +699,24 @@ void init() // OXI_Plethy=schema::channel["Plethy"].id(); // CPAP_AHI=schema::channel["AHI"].id(); // CPAP_RDI=schema::channel["RDI"].id(); - Journal_Notes = schema::channel["Journal"].id(); - Journal_Weight = schema::channel["Weight"].id(); - Journal_BMI = schema::channel["BMI"].id(); - Journal_ZombieMeter = schema::channel["ZombieMeter"].id(); - LastUpdated = schema::channel["LastUpdated"].id(); - Bookmark_Start = schema::channel["BookmarkStart"].id(); - Bookmark_End = schema::channel["BookmarkEnd"].id(); - Bookmark_Notes = schema::channel["BookmarkNotes"].id(); +// Journal_Notes = schema::channel["Journal"].id(); +// Journal_Weight = schema::channel["Weight"].id(); +// Journal_BMI = schema::channel["BMI"].id(); +// Journal_ZombieMeter = schema::channel["ZombieMeter"].id(); +// LastUpdated = schema::channel["LastUpdated"].id(); +// Bookmark_Start = schema::channel["BookmarkStart"].id(); +// Bookmark_End = schema::channel["BookmarkEnd"].id(); +// Bookmark_Notes = schema::channel["BookmarkNotes"].id(); - ZEO_SleepStage = schema::channel["SleepStage"].id(); - ZEO_ZQ = schema::channel["ZeoZQ"].id(); - ZEO_Awakenings = schema::channel["Awakenings"].id(); - ZEO_MorningFeel = schema::channel["MorningFeel"].id(); - ZEO_TimeInWake = schema::channel["TimeInWake"].id(); - ZEO_TimeInREM = schema::channel["TimeInREM"].id(); - ZEO_TimeInLight = schema::channel["TimeInLight"].id(); - ZEO_TimeInDeep = schema::channel["TimeInDeep"].id(); - ZEO_TimeToZ = schema::channel["TimeToZ"].id(); +// ZEO_SleepStage = schema::channel["SleepStage"].id(); +// ZEO_ZQ = schema::channel["ZeoZQ"].id(); +// ZEO_Awakenings = schema::channel["Awakenings"].id(); +// ZEO_MorningFeel = schema::channel["MorningFeel"].id(); +// ZEO_TimeInWake = schema::channel["TimeInWake"].id(); +// ZEO_TimeInREM = schema::channel["TimeInREM"].id(); +// ZEO_TimeInLight = schema::channel["TimeInLight"].id(); +// ZEO_TimeInDeep = schema::channel["TimeInDeep"].id(); +// ZEO_TimeToZ = schema::channel["TimeToZ"].id(); schema::channel[CPAP_Leak].setShowInOverview(true); schema::channel[CPAP_RespRate].setShowInOverview(true); @@ -753,7 +903,7 @@ bool ChannelList::Load(QString filename) scope = Scopes[scopestr]; -// if (PREF[STR_PREF_AllowEventRenaming].toBool()) { +// if (PREF[STR_PREF_ResetEventNames].toBool()) { name = e.attribute("name", ""); details = e.attribute("details", ""); label = e.attribute("label", ""); @@ -843,17 +993,6 @@ bool ChannelList::Load(QString filename) return true; } -void ChannelList::resetStrings() -{ - QHash::iterator it; - QHash::iterator it_end = channels.end(); - for (it = channels.begin(); it != it_end; ++it) { - Channel * chan = it.value(); - chan->resetStrings(); - } -} - - void ChannelList::add(QString group, Channel *chan) { Q_ASSERT(chan != nullptr); diff --git a/sleepyhead/SleepLib/schema.h b/sleepyhead/SleepLib/schema.h index 6a4d514c..c09f45ed 100644 --- a/sleepyhead/SleepLib/schema.h +++ b/sleepyhead/SleepLib/schema.h @@ -129,11 +129,6 @@ class Channel void setOrder(short order) { m_order = order; } void setShowInOverview(bool b) { m_showInOverview = b; } - void resetStrings() { - m_fullname = default_fullname; - m_label = default_label; - m_description = default_description; - } QString option(int i) { if (m_options.contains(i)) { @@ -226,8 +221,6 @@ class ChannelList } } - void resetStrings(); - //! \brief Channel List indexed by integer ID QHash channels; diff --git a/sleepyhead/docs/channels.xml b/sleepyhead/docs/channels.xml index 90eb4641..47ff3615 100644 --- a/sleepyhead/docs/channels.xml +++ b/sleepyhead/docs/channels.xml @@ -24,52 +24,13 @@ Important: One id code per item, DO NOT CHANGE ID NUMBERS!!! - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sleepyhead/main.cpp b/sleepyhead/main.cpp index 98da0244..cea8e041 100644 --- a/sleepyhead/main.cpp +++ b/sleepyhead/main.cpp @@ -224,10 +224,12 @@ int main(int argc, char *argv[]) initializeStrings(); // Important, call this AFTER translator is installed. a.setApplicationName(STR_TR_SleepyHead); - if (settings.value(LangSetting, "").toString() == lastlanguage) { - // don't reset if they selected the same language again - changing_language = false; - } + + // Do reset strings if they selected the same langauge again.. +// if (settings.value(LangSetting, "").toString() == lastlanguage) { +// // don't reset if they selected the same language again +// changing_language = false; +// } //////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Detection @@ -402,8 +404,6 @@ retry_directory: PREF.init(STR_GEN_UpdateCheckFrequency, 7); // days PREF.init(STR_PREF_AllowEarlyUpdates, false); - PREF.init(STR_PREF_AllowEventRenaming, true); - //////////////////////////////////////////////////////////////////////////////////////////// // Check when last checked for updates.. //////////////////////////////////////////////////////////////////////////////////////////// @@ -502,13 +502,7 @@ retry_directory: MainWindow w; mainwin = &w; - loadChannels(); - - if (changing_language) { - qDebug() << "Resetting Channel strings to defaults for language change"; - schema::channel.resetStrings(); - } - + loadChannels(changing_language); // if (check_updates) { mainwin->CheckForUpdates(); } diff --git a/sleepyhead/mainwindow.cpp b/sleepyhead/mainwindow.cpp index 7d65c519..e29f0042 100644 --- a/sleepyhead/mainwindow.cpp +++ b/sleepyhead/mainwindow.cpp @@ -403,7 +403,7 @@ void saveChannels() } -void loadChannels() +void loadChannels(bool changing_language) { QString filename = p_profile->Get("{DataFolder}/") + "channels.dat"; QFile f(filename); @@ -478,7 +478,9 @@ void loadChannels() chan->setDefaultColor(color); // Don't import channel descriptions if event renaming is turned off. (helps pick up new translations) - if (PREF[STR_PREF_AllowEventRenaming].toBool()) { + if (changing_language) { + // Nothing + } else { chan->setFullname(fullname); chan->setLabel(label); chan->setDescription(description); @@ -2567,9 +2569,12 @@ void MainWindow::on_actionHelp_Support_SleepyHead_Development_triggered() void MainWindow::on_actionChange_Language_triggered() { - //QSettings *settings = new QSettings(getDeveloperName(), getAppName()); - //settings->remove("Settings/Language"); - //delete settings; + // Pop up a message box asking if you would like to reset Channel event/waveform names + // Sorry Translators who frequently language hop, this is an extra step, but this one is for the users. :/ + if (QMessageBox::question(this,STR_MessageBox_Warning,tr("Changing the language will reset custom Event and Waveform names/labels/descriptions.")+"\n\n"+tr("Are you sure you want to do this?"), QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) { + return; + } + p_profile->Save(); PREF.Save(); diff --git a/sleepyhead/mainwindow.h b/sleepyhead/mainwindow.h index 75183049..db59a220 100644 --- a/sleepyhead/mainwindow.h +++ b/sleepyhead/mainwindow.h @@ -66,7 +66,7 @@ class Daily; class Report; class Overview; -void loadChannels(); +void loadChannels(bool changing_language=false); void saveChannels(); diff --git a/sleepyhead/newprofile.ui b/sleepyhead/newprofile.ui index 29b04f8a..2ecd175f 100644 --- a/sleepyhead/newprofile.ui +++ b/sleepyhead/newprofile.ui @@ -864,7 +864,7 @@ - TextLabel + Qt::AlignCenter diff --git a/sleepyhead/preferencesdialog.cpp b/sleepyhead/preferencesdialog.cpp index 50e7233c..4ea1ef7c 100644 --- a/sleepyhead/preferencesdialog.cpp +++ b/sleepyhead/preferencesdialog.cpp @@ -173,14 +173,12 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) : float f = profile->general->prefCalcPercentile(); ui->prefCalcPercentile->setValue(f); - ui->tooltipTimeoutSlider->setValue(profile->general->tooltipTimeout() / 50); - ui->tooltipMS->display(profile->general->tooltipTimeout()); + ui->tooltipTimeoutSlider->setValue(profile->general->tooltipTimeout()); + on_tooltipTimeoutSlider_valueChanged(ui->tooltipTimeoutSlider->value()); + //ui->tooltipMS->display(profile->general->tooltipTimeout()); ui->scrollDampeningSlider->setValue(profile->general->scrollDampening() / 10); - - if (profile->general->scrollDampening() > 0) { - ui->scrollDampDisplay->display(profile->general->scrollDampening()); - } else { ui->scrollDampDisplay->display(STR_TR_Off); } + on_scrollDampeningSlider_valueChanged(ui->scrollDampeningSlider->value()); bool bcd = profile->session->backupCardData(); ui->createSDBackups->setChecked(bcd); @@ -201,8 +199,6 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) : RefreshLastChecked(); } else { ui->updateLastChecked->setText("Never"); } - ui->allowEventRenaming->setChecked(PREF[STR_PREF_AllowEventRenaming].toBool()); - ui->overlayFlagsCombo->setCurrentIndex(profile->appearance->overlayType()); ui->overviewLinecharts->setCurrentIndex(profile->appearance->overviewLinechartMode()); @@ -725,7 +721,7 @@ bool PreferencesDialog::Save() profile->general->setSkipEmptyDays(ui->skipEmptyDays->isChecked()); - profile->general->setTooltipTimeout(ui->tooltipTimeoutSlider->value() * 50); + profile->general->setTooltipTimeout(ui->tooltipTimeoutSlider->value()); profile->general->setScrollDampening(ui->scrollDampeningSlider->value() * 10); profile->general->setShowUnknownFlags(ui->showUnknownFlags->isChecked()); @@ -805,7 +801,6 @@ bool PreferencesDialog::Save() PREF[STR_GEN_UpdatesAutoCheck] = ui->automaticallyCheckUpdates->isChecked(); PREF[STR_GEN_UpdateCheckFrequency] = ui->updateCheckEvery->value(); PREF[STR_PREF_AllowEarlyUpdates] = ui->allowEarlyUpdates->isChecked(); - PREF[STR_PREF_AllowEventRenaming] = ui->allowEventRenaming->isChecked(); PREF["Fonts_Application_Name"] = ui->applicationFont->currentText(); @@ -1071,13 +1066,13 @@ void PreferencesDialog::on_okButton_clicked() void PreferencesDialog::on_scrollDampeningSlider_valueChanged(int value) { if (value > 0) { - ui->scrollDampDisplay->display(value * 10); - } else { ui->scrollDampDisplay->display(STR_TR_Off); } + ui->scrollDampDisplay->setText(QString("%1%2").arg(value * 10).arg(STR_UNIT_ms)); + } else { ui->scrollDampDisplay->setText(STR_TR_Off); } } void PreferencesDialog::on_tooltipTimeoutSlider_valueChanged(int value) { - ui->tooltipMS->display(value * 50); + ui->tooltipTimeoutDisplay->setText(QString("%1%2").arg(double(value)/1000.0,0,'f',1).arg(STR_UNIT_s)); } void PreferencesDialog::on_resetChannelDefaults_clicked() diff --git a/sleepyhead/preferencesdialog.ui b/sleepyhead/preferencesdialog.ui index 3c4a43ef..9b7b095f 100644 --- a/sleepyhead/preferencesdialog.ui +++ b/sleepyhead/preferencesdialog.ui @@ -57,7 +57,7 @@ - 4 + 6 @@ -1244,13 +1244,6 @@ Defaults to 60 minutes.. Highly recommend it's left at this value. - - - - Allow Event Renaming - - - @@ -2153,215 +2146,6 @@ p, li { white-space: pre-wrap; } Graph Settings - - - - - Bar Tops - - - - - Line Chart - - - - - - - - Overview Linecharts - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - <html><head/><body><p>This makes scrolling when zoomed in easier on sensitive bidirectional TouchPads</p><p>50ms is recommended value.</p></body></html> - - - 25 - - - 1 - - - 5 - - - Qt::Horizontal - - - false - - - QSlider::TicksBelow - - - 1 - - - - - - - milliseconds - - - QFrame::StyledPanel - - - 3 - - - QLCDNumber::Flat - - - - - - - - - - - How long you want the tooltips to stay visible. - - - 1 - - - 150 - - - 10 - - - 50 - - - 1 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 10 - - - - - - - QFrame::StyledPanel - - - 5 - - - QLCDNumber::Flat - - - - - - - - - Scroll Dampening - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Tooltip Timeout - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - Default display height of graphs in pixels - - - 50 - - - 600 - - - 10 - - - 180 - - - - - - - Graph Tooltips - - - - - - - - 0 - 0 - - - - The visual method of displaying waveform overlay flags. - - - - - Standard Bars - - - - - Top Markers - - - - @@ -2398,6 +2182,30 @@ p, li { white-space: pre-wrap; } + + + + + 0 + 0 + + + + The visual method of displaying waveform overlay flags. + + + + + Standard Bars + + + + + Top Markers + + + + @@ -2424,6 +2232,212 @@ p, li { white-space: pre-wrap; } + + + + Scroll Dampening + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + How long you want the tooltips to stay visible. + + + 1000 + + + 30000 + + + 100 + + + 500 + + + 5000 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 1000 + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + QFrame::Box + + + TextLabel + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + Tooltip Timeout + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + <html><head/><body><p>This makes scrolling when zoomed in easier on sensitive bidirectional TouchPads</p><p>50ms is recommended value.</p></body></html> + + + 25 + + + 1 + + + 5 + + + Qt::Horizontal + + + false + + + QSlider::TicksBelow + + + 1 + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + QFrame::Box + + + TextLabel + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + 0 + 0 + + + + Default display height of graphs in pixels + + + 50 + + + 600 + + + 10 + + + 180 + + + + + + + Graph Tooltips + + + + + + + + Bar Tops + + + + + Line Chart + + + + + + + + Overview Linecharts + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + +