mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-22 05:30:44 +00:00
Cleanup to the previous stuff, allow longer ignore value
This commit is contained in:
parent
cb0ef8225c
commit
2fcc2de524
@ -366,10 +366,6 @@ Day *Machine::AddSession(Session *s,Profile *p)
|
|||||||
|
|
||||||
sessionlist[s->session()]=s; // To make sure it get's saved later even if it's not wanted.
|
sessionlist[s->session()]=s; // To make sure it get's saved later even if it's not wanted.
|
||||||
|
|
||||||
if (session_length<ignore_sessions) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDateTime d1,d2=QDateTime::fromMSecsSinceEpoch(s->first());
|
QDateTime d1,d2=QDateTime::fromMSecsSinceEpoch(s->first());
|
||||||
|
|
||||||
QDate date=d2.date();
|
QDate date=d2.date();
|
||||||
@ -379,7 +375,7 @@ Day *Machine::AddSession(Session *s,Profile *p)
|
|||||||
|
|
||||||
|
|
||||||
bool combine_next_day=false;
|
bool combine_next_day=false;
|
||||||
int closest_session=-1;
|
int closest_session=0;
|
||||||
|
|
||||||
if (time<split_time) {
|
if (time<split_time) {
|
||||||
date=date.addDays(-1);
|
date=date.addDays(-1);
|
||||||
@ -404,6 +400,11 @@ Day *Machine::AddSession(Session *s,Profile *p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (session_length<ignore_sessions) {
|
||||||
|
//if (!closest_session || (closest_session>=60))
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!firstsession) {
|
if (!firstsession) {
|
||||||
if (firstday>date) firstday=date;
|
if (firstday>date) firstday=date;
|
||||||
if (lastday<date) lastday=date;
|
if (lastday<date) lastday=date;
|
||||||
|
@ -15,23 +15,39 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) :
|
|||||||
QTime t=pref["DaySplitTime"].toTime();
|
QTime t=pref["DaySplitTime"].toTime();
|
||||||
ui->timeEdit->setTime(t);
|
ui->timeEdit->setTime(t);
|
||||||
}
|
}
|
||||||
|
int val;
|
||||||
|
|
||||||
if (pref.Exists("CombineCloserSessions")) {
|
if (pref.Exists("CombineCloserSessions")) {
|
||||||
int i=pref["CombineCloserSessions"].toInt();
|
val=pref["CombineCloserSessions"].toInt();
|
||||||
ui->combineSlider->setValue(i);
|
ui->combineSlider->setValue(val);
|
||||||
if (i>0) {
|
} else {
|
||||||
ui->combineLCD->display(i);
|
ui->combineSlider->setValue(val=0);
|
||||||
|
pref["CombineCloserSessions"]=val;
|
||||||
|
}
|
||||||
|
if (val>0) {
|
||||||
|
ui->combineLCD->display(val);
|
||||||
} else ui->combineLCD->display(tr("OFF"));
|
} else ui->combineLCD->display(tr("OFF"));
|
||||||
}
|
|
||||||
|
|
||||||
if (pref.Exists("IgnoreShorterSessions")) {
|
if (pref.Exists("IgnoreShorterSessions")) {
|
||||||
int i=pref["IgnoreShorterSessions"].toInt();
|
val=pref["IgnoreShorterSessions"].toInt();
|
||||||
ui->IgnoreSlider->setValue(i);
|
ui->IgnoreSlider->setValue(val);
|
||||||
if (i>0) {
|
} else {
|
||||||
ui->IgnoreLCD->display(i);
|
ui->IgnoreSlider->setValue(val=0);
|
||||||
|
pref["IgnoreShorterSessions"]=val;
|
||||||
|
}
|
||||||
|
if (val>0) {
|
||||||
|
ui->IgnoreLCD->display(val);
|
||||||
} else ui->IgnoreLCD->display(tr("OFF"));
|
} else ui->IgnoreLCD->display(tr("OFF"));
|
||||||
}
|
|
||||||
|
|
||||||
|
bool b;
|
||||||
if (pref.Exists("MemoryHog")) {
|
if (pref.Exists("MemoryHog")) {
|
||||||
ui->memoryHogCheckbox->setChecked(pref["MemoryHog"].toBool());
|
b=pref["MemoryHog"].toBool();
|
||||||
|
} else {
|
||||||
|
pref["MemoryHog"]=b=false;
|
||||||
}
|
}
|
||||||
|
ui->memoryHogCheckbox->setChecked(b);
|
||||||
|
|
||||||
ui->eventTable->setColumnWidth(0,40);
|
ui->eventTable->setColumnWidth(0,40);
|
||||||
ui->eventTable->setColumnWidth(1,55);
|
ui->eventTable->setColumnWidth(1,55);
|
||||||
|
@ -210,7 +210,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-style:italic;"></p></body></html></string>
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-style:italic;"></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>60</number>
|
<number>90</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="pageStep">
|
<property name="pageStep">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
|
Loading…
Reference in New Issue
Block a user