mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-11 16:20:46 +00:00
Added compliance preference settings (in General)
This commit is contained in:
parent
ee602a64d2
commit
06e892b53b
@ -340,6 +340,10 @@ void SummaryChart::paint(gGraph & w,int left, int top, int width, int height)
|
|||||||
}
|
}
|
||||||
lastY[i]=top+height-1-h;
|
lastY[i]=top+height-1-h;
|
||||||
}
|
}
|
||||||
|
float compliance_hours=0;
|
||||||
|
if (PROFILE.ExistsAndTrue("ShowCompliance")) {
|
||||||
|
compliance_hours=PROFILE["ComplianceHours"].toDouble();
|
||||||
|
}
|
||||||
|
|
||||||
Day * day;
|
Day * day;
|
||||||
EventDataType hours;
|
EventDataType hours;
|
||||||
@ -366,7 +370,7 @@ void SummaryChart::paint(gGraph & w,int left, int top, int width, int height)
|
|||||||
int j;
|
int j;
|
||||||
QHash<int,QHash<short,EventDataType> >::iterator times=m_times.find(zd);
|
QHash<int,QHash<short,EventDataType> >::iterator times=m_times.find(zd);
|
||||||
QColor col=m_colors[0];
|
QColor col=m_colors[0];
|
||||||
//if (hours<4) col=QColor("#f03030");
|
//if (hours<compliance_hours) col=QColor("#f03030");
|
||||||
|
|
||||||
if (zd==hl_day) {
|
if (zd==hl_day) {
|
||||||
col=QColor("gold");
|
col=QColor("gold");
|
||||||
@ -416,9 +420,7 @@ void SummaryChart::paint(gGraph & w,int left, int top, int width, int height)
|
|||||||
|
|
||||||
QColor col=m_colors[j];
|
QColor col=m_colors[j];
|
||||||
if (m_type[j]==ST_HOURS) {
|
if (m_type[j]==ST_HOURS) {
|
||||||
if (tmp<4) {
|
if (tmp<compliance_hours) col=QColor("#f04040");
|
||||||
col=QColor("#f04040");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zd==hl_day) {
|
if (zd==hl_day) {
|
||||||
|
@ -121,7 +121,7 @@ protected:
|
|||||||
QString p_path;
|
QString p_path;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum PrefType { PT_Checkbox, PT_Integer, PT_Number, PT_Date, PT_Time, PT_DateTime, PT_LineEdit, PT_TextEdit, PT_Dropdown };
|
enum PrefType { PT_Checkbox, PT_Spinbox, PT_Integer, PT_Number, PT_Date, PT_Time, PT_DateTime, PT_LineEdit, PT_TextEdit, PT_Dropdown };
|
||||||
|
|
||||||
/*! \class Preference
|
/*! \class Preference
|
||||||
\brief Holds a single preference
|
\brief Holds a single preference
|
||||||
|
@ -103,6 +103,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
|
|
||||||
// This next section is a mess..
|
// This next section is a mess..
|
||||||
// Preferences & Profile variables really need to initialize somewhere else
|
// Preferences & Profile variables really need to initialize somewhere else
|
||||||
|
// The General object in PreferencesDialog kinda defines where I want to go with the profile default stuff
|
||||||
|
|
||||||
if (!PROFILE.Exists("ShowDebug")) PROFILE["ShowDebug"]=false;
|
if (!PROFILE.Exists("ShowDebug")) PROFILE["ShowDebug"]=false;
|
||||||
ui->actionDebug->setChecked(PROFILE["ShowDebug"].toBool());
|
ui->actionDebug->setChecked(PROFILE["ShowDebug"].toBool());
|
||||||
@ -132,6 +133,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
if (!PROFILE.Exists("PulseChangeDuration")) PROFILE["PulseChangeDuration"]=8;
|
if (!PROFILE.Exists("PulseChangeDuration")) PROFILE["PulseChangeDuration"]=8;
|
||||||
if (!PROFILE.Exists("GraphHeight")) PROFILE["GraphHeight"]=180;
|
if (!PROFILE.Exists("GraphHeight")) PROFILE["GraphHeight"]=180;
|
||||||
if (!PROFILE.Exists("OxiDiscardThreshold")) PROFILE["OxiDiscardThreshold"]=10;
|
if (!PROFILE.Exists("OxiDiscardThreshold")) PROFILE["OxiDiscardThreshold"]=10;
|
||||||
|
if (!PROFILE.Exists("ComplianceHours")) PROFILE["ComplianceHours"]=4;
|
||||||
|
if (!PROFILE.Exists("ShowCompliance")) PROFILE["ShowCompliance"]=true;
|
||||||
|
|
||||||
//ui->actionUse_AntiAliasing->setChecked(PROFILE["UseAntiAliasing"].toBool());
|
//ui->actionUse_AntiAliasing->setChecked(PROFILE["UseAntiAliasing"].toBool());
|
||||||
ui->action_Link_Graph_Groups->setChecked(PROFILE["LinkGroups"].toBool());
|
ui->action_Link_Graph_Groups->setChecked(PROFILE["LinkGroups"].toBool());
|
||||||
|
@ -168,10 +168,12 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
|
|||||||
general["SkipEmptyDays"]=Preference(p_profile,"SkipEmptyDays",PT_Checkbox,tr("Skip Empty Days"),tr("Skip over calendar days that don't have any data"),true);
|
general["SkipEmptyDays"]=Preference(p_profile,"SkipEmptyDays",PT_Checkbox,tr("Skip Empty Days"),tr("Skip over calendar days that don't have any data"),true);
|
||||||
general["EnableMultithreading"]=Preference(p_profile,"EnableMultithreading",PT_Checkbox,tr("Enable Multithreading"),tr("Try to use extra processor cores where possible"),false);
|
general["EnableMultithreading"]=Preference(p_profile,"EnableMultithreading",PT_Checkbox,tr("Enable Multithreading"),tr("Try to use extra processor cores where possible"),false);
|
||||||
general["MemoryHog"]=Preference(p_profile,"MemoryHog",PT_Checkbox,tr("Cache Session Data"),tr("Keep session data in memory to improve load speed revisiting the date."),false);
|
general["MemoryHog"]=Preference(p_profile,"MemoryHog",PT_Checkbox,tr("Cache Session Data"),tr("Keep session data in memory to improve load speed revisiting the date."),false);
|
||||||
general["GraphHeight"]=Preference(p_profile,"GraphHeight",PT_Checkbox,tr("Graph Height"),tr("Default Graph Height"),160);
|
general["GraphHeight"]=Preference(p_profile,"GraphHeight",PT_Spinbox,tr("Graph Height"),tr("Default Graph Height"),160);
|
||||||
general["MaskDescription"]=Preference(p_profile,"MaskDescription",PT_Checkbox,tr("Mask Description"),tr("Whatever you want to record about your mask."),QString());
|
general["MaskDescription"]=Preference(p_profile,"MaskDescription",PT_LineEdit,tr("Mask Description"),tr("Whatever you want to record about your mask."),QString());
|
||||||
general["HighResPrinting"]=Preference(p_profile,"HighResPrinting",PT_Checkbox,tr("High Resolution Printing"),tr("Use much slower but better quality high resolution printing."),QString());
|
general["HighResPrinting"]=Preference(p_profile,"HighResPrinting",PT_Checkbox,tr("High Resolution Printing"),tr("Use much slower but better quality high resolution printing."),true);
|
||||||
general["EmptyGraphFun"]=Preference(p_profile,"EmptyGraphFun",PT_Checkbox,tr("Less Boring Empty Graph Pages"),tr("Make empty graph pages more attractive."),QString());
|
general["EmptyGraphFun"]=Preference(p_profile,"EmptyGraphFun",PT_Checkbox,tr("Less Boring Empty Graph Pages"),tr("Make empty graph pages more attractive."),false);
|
||||||
|
general["ShowCompliance"]=Preference(p_profile,"ShowCompliance",PT_Checkbox,tr("Show Compliance Information"),tr("Allow compliance information to be shown."),true);
|
||||||
|
general["ComplianceHours"]=Preference(p_profile,"ComplianceHours",PT_Spinbox,tr("Compliance Hours"),tr("Regard days over this combined session length as compliant."),4.0);
|
||||||
|
|
||||||
if (!(p_profile)->Exists("MaskStartDate")) {
|
if (!(p_profile)->Exists("MaskStartDate")) {
|
||||||
(PROFILE["MaskStartDate"]=PROFILE.FirstDay());
|
(PROFILE["MaskStartDate"]=PROFILE.FirstDay());
|
||||||
@ -200,6 +202,9 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
|
|||||||
ui->enableMultithreading->setChecked(general["EnableMultithreading"].value().toBool());
|
ui->enableMultithreading->setChecked(general["EnableMultithreading"].value().toBool());
|
||||||
ui->cacheSessionData->setChecked(general["MemoryHog"].value().toBool());
|
ui->cacheSessionData->setChecked(general["MemoryHog"].value().toBool());
|
||||||
ui->lessBoringEmptyGraphPages->setChecked(general["EmptyGraphFun"].value().toBool());
|
ui->lessBoringEmptyGraphPages->setChecked(general["EmptyGraphFun"].value().toBool());
|
||||||
|
ui->complianceGroupbox->setChecked(general["ShowCompliance"].value().toBool());
|
||||||
|
ui->complianceHours->setValue(general["ComplianceHours"].value().toDouble());
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
general["HighResPrinting"].setValue(true);
|
general["HighResPrinting"].setValue(true);
|
||||||
ui->highResolutionPrinting->setChecked(true);
|
ui->highResolutionPrinting->setChecked(true);
|
||||||
@ -329,6 +334,9 @@ void PreferencesDialog::Save()
|
|||||||
general["HighResPrinting"].setValue(ui->highResolutionPrinting->isChecked());
|
general["HighResPrinting"].setValue(ui->highResolutionPrinting->isChecked());
|
||||||
general["EmptyGraphFun"].setValue(ui->lessBoringEmptyGraphPages->isChecked());
|
general["EmptyGraphFun"].setValue(ui->lessBoringEmptyGraphPages->isChecked());
|
||||||
|
|
||||||
|
general["ShowCompliance"].setValue(ui->complianceGroupbox->isChecked());
|
||||||
|
general["ComplianceHours"].setValue(ui->complianceHours->value());
|
||||||
|
|
||||||
(*profile)["MaskStartDate"]=ui->startedUsingMask->date();
|
(*profile)["MaskStartDate"]=ui->startedUsingMask->date();
|
||||||
(*profile)["GraphHeight"]=ui->graphHeight->value();
|
(*profile)["GraphHeight"]=ui->graphHeight->value();
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>7</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="importTab">
|
<widget class="QWidget" name="importTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -1171,6 +1171,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string>General Settings</string>
|
<string>General Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_10">
|
<layout class="QGridLayout" name="gridLayout_10">
|
||||||
|
<property name="margin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="skipLoginScreen">
|
<widget class="QCheckBox" name="skipLoginScreen">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -1232,6 +1238,70 @@ this application to be unstable with this feature enabled.</string>
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="complianceGroupbox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Show Compliance</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_7">
|
||||||
|
<property name="margin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QDoubleSpinBox" name="complianceHours">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Regard days with under this usage as "incompliant".</string>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string> hours</string>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>8.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>4.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<spacer name="horizontalSpacer_7">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_39">
|
||||||
|
<property name="text">
|
||||||
|
<string>Define compliance as over</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QLabel" name="label_40">
|
||||||
|
<property name="text">
|
||||||
|
<string>of usage per night</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_3">
|
<spacer name="verticalSpacer_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -1428,6 +1498,12 @@ this application to be unstable with this feature enabled.</string>
|
|||||||
<string>&Appearance</string>
|
<string>&Appearance</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||||
<item>
|
<item>
|
||||||
@ -1435,23 +1511,6 @@ this application to be unstable with this feature enabled.</string>
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>General Settings</string>
|
<string>General Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_7">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<layout class="QGridLayout" name="gridLayout_5">
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_18">
|
<widget class="QLabel" name="label_18">
|
||||||
@ -1518,9 +1577,7 @@ this application to be unstable with this feature enabled.</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item row="2" column="0" colspan="2">
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -1589,9 +1646,15 @@ this application to be unstable with this feature enabled.</string>
|
|||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
|
Loading…
Reference in New Issue
Block a user