mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 03:30:44 +00:00
fix Statistics report date after import
This commit is contained in:
parent
ddda205e26
commit
7c1489a409
@ -551,11 +551,6 @@ bool MainWindow::OpenProfile(QString profileName, bool skippassword)
|
|||||||
// Should really create welcome and statistics here, but they need redoing later anyway to kill off webkit
|
// Should really create welcome and statistics here, but they need redoing later anyway to kill off webkit
|
||||||
ui->tabWidget->setCurrentIndex(AppSetting->openTabAtStart());
|
ui->tabWidget->setCurrentIndex(AppSetting->openTabAtStart());
|
||||||
|
|
||||||
QDate first = p_profile->FirstDay();
|
|
||||||
QDate last = p_profile->LastDay();
|
|
||||||
p_profile->general->setStatReportRangeStart(first);
|
|
||||||
p_profile->general->setStatReportRangeEnd(last);
|
|
||||||
p_profile->general->setStatReportDate(last);
|
|
||||||
p_profile->general->setStatReportMode(STAT_MODE_STANDARD);
|
p_profile->general->setStatReportMode(STAT_MODE_STANDARD);
|
||||||
GenerateStatistics();
|
GenerateStatistics();
|
||||||
PopulatePurgeMenu();
|
PopulatePurgeMenu();
|
||||||
@ -2431,6 +2426,7 @@ void MainWindow::init_reportModeUi()
|
|||||||
|
|
||||||
void MainWindow::reset_reportModeUi()
|
void MainWindow::reset_reportModeUi()
|
||||||
{
|
{
|
||||||
|
Statistics::updateReportDate();
|
||||||
int mode = STAT_MODE_STANDARD;
|
int mode = STAT_MODE_STANDARD;
|
||||||
ui->statStartDate->blockSignals(true);
|
ui->statStartDate->blockSignals(true);
|
||||||
ui->statEndDate->blockSignals(true);
|
ui->statEndDate->blockSignals(true);
|
||||||
@ -2443,9 +2439,6 @@ void MainWindow::reset_reportModeUi()
|
|||||||
ui->statStartDate->setMaximumDate(last);
|
ui->statStartDate->setMaximumDate(last);
|
||||||
ui->statEndDate->setMinimumDate(first);
|
ui->statEndDate->setMinimumDate(first);
|
||||||
ui->statEndDate->setMaximumDate(last);
|
ui->statEndDate->setMaximumDate(last);
|
||||||
if (!p_profile->general->statReportDate().isValid()) {
|
|
||||||
p_profile->general->setStatReportDate(last);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
default:
|
default:
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "cprogressbar.h"
|
#include "cprogressbar.h"
|
||||||
#include "SleepLib/common.h"
|
#include "SleepLib/common.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "SleepLib/profiles.h"
|
||||||
|
|
||||||
extern MainWindow *mainwin;
|
extern MainWindow *mainwin;
|
||||||
|
|
||||||
@ -1893,3 +1894,18 @@ QString StatisticsRow::value(QDate start, QDate end)
|
|||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDate lastdate;
|
||||||
|
QDate firstdate;
|
||||||
|
void Statistics::updateReportDate() {
|
||||||
|
if (p_profile) {
|
||||||
|
QDate last = p_profile->LastDay();
|
||||||
|
QDate first = p_profile->FirstDay();
|
||||||
|
if (last == lastdate && first == firstdate) return;
|
||||||
|
p_profile->general->setStatReportRangeStart(first);
|
||||||
|
p_profile->general->setStatReportRangeEnd(last);
|
||||||
|
p_profile->general->setStatReportDate(last);
|
||||||
|
lastdate = last;
|
||||||
|
firstdate = first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -211,6 +211,8 @@ class Statistics : public QObject
|
|||||||
|
|
||||||
void updateDisabledInfo();
|
void updateDisabledInfo();
|
||||||
|
|
||||||
|
static void updateReportDate();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void loadRXChanges();
|
void loadRXChanges();
|
||||||
void saveRXChanges();
|
void saveRXChanges();
|
||||||
|
@ -43,6 +43,8 @@ To turn off the the test macros.
|
|||||||
#define DEBUGL DEBUGQ <<QString("%1[%2]").arg(QFileInfo( __FILE__).baseName()).arg(__LINE__)
|
#define DEBUGL DEBUGQ <<QString("%1[%2]").arg(QFileInfo( __FILE__).baseName()).arg(__LINE__)
|
||||||
#define DEBUGF DEBUGQ <<QString("%1[%2]%3").arg(QFileInfo( __FILE__).baseName()).arg(__LINE__).arg(__func__)
|
#define DEBUGF DEBUGQ <<QString("%1[%2]%3").arg(QFileInfo( __FILE__).baseName()).arg(__LINE__).arg(__func__)
|
||||||
#define DEBUGFW DEBUGW <<QString("%1[%2]%3").arg(QFileInfo( __FILE__).baseName()).arg(__LINE__).arg(__func__)
|
#define DEBUGFW DEBUGW <<QString("%1[%2]%3").arg(QFileInfo( __FILE__).baseName()).arg(__LINE__).arg(__func__)
|
||||||
|
//#define DEBUGFW qCritical().noquote()<<QString("%1[%2]%3").arg(QFileInfo( __FILE__).baseName()).arg(__LINE__).arg(__func__)
|
||||||
|
#define DEBUGFC qCritical().noquote()<<QString("%1[%2]%3").arg(QFileInfo( __FILE__).baseName()).arg(__LINE__).arg(__func__)
|
||||||
#define DEBUGT DEBUGQ <<QString("%1 %2[%3]%4").arg(QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz")).arg(QFileInfo( __FILE__).baseName()).arg(__LINE__)
|
#define DEBUGT DEBUGQ <<QString("%1 %2[%3]%4").arg(QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz")).arg(QFileInfo( __FILE__).baseName()).arg(__LINE__)
|
||||||
#define DEBUGTF DEBUGQ <<QString("%1 %2[%3]%4").arg(QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz")).arg(QFileInfo( __FILE__).baseName()).arg(__LINE__).arg(__func__)
|
#define DEBUGTF DEBUGQ <<QString("%1 %2[%3]%4").arg(QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz")).arg(QFileInfo( __FILE__).baseName()).arg(__LINE__).arg(__func__)
|
||||||
#define DEBUGTFW DEBUGW <<QString("%1 %2[%3]%4").arg(QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz")).arg(QFileInfo( __FILE__).baseName()).arg(__LINE__).arg(__func__)
|
#define DEBUGTFW DEBUGW <<QString("%1 %2[%3]%4").arg(QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz")).arg(QFileInfo( __FILE__).baseName()).arg(__LINE__).arg(__func__)
|
||||||
@ -113,6 +115,7 @@ To turn off the the test macros.
|
|||||||
#define DEBUGT
|
#define DEBUGT
|
||||||
#define DEBUGTF
|
#define DEBUGTF
|
||||||
#define DEBUGTFW
|
#define DEBUGTFW
|
||||||
|
#define DEBUGFC
|
||||||
|
|
||||||
#define Z( XX )
|
#define Z( XX )
|
||||||
#define ZZ( XX , YY)
|
#define ZZ( XX , YY)
|
||||||
|
Loading…
Reference in New Issue
Block a user