diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-17 19:41:05 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-17 19:41:05 -0300 |
commit | 240cfa74be5b6bc25053947c632084ad347b46b0 (patch) | |
tree | a615054d27c59b5e68fe82aa7cb817085dc3ef77 | |
parent | ae68ae38bbbc981aab4b8eaf1e84a15b8ab05bf4 (diff) | |
download | subsurface-240cfa74be5b6bc25053947c632084ad347b46b0.tar.gz |
Started to do the Yearly Statistics
This is the fisrt bunch of compilable code for the new Yearly Statistics
there's nothing to see here, move along...
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
-rw-r--r-- | qt-ui/models.cpp | 33 | ||||
-rw-r--r-- | qt-ui/models.h | 11 |
2 files changed, 43 insertions, 1 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 4d1fb9d41..e94446fa0 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -1274,3 +1274,36 @@ void DiveComputerModel::remove(const QModelIndex& i) remove_dive_computer(model.data(), deviceid); update(); } + +/*################################################################# + * # + * # Yearly Statistics Model + * # + * ################################################################ + */ + +YearlyStatisticsModel::YearlyStatisticsModel(QObject* parent) +{ +} + +QVariant YearlyStatisticsModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + QVariant val; + switch(section){ + case YEAR: val = tr("Year \n > Month"); break; + case DIVES: val = tr("#"); break; + case TOTAL_TIME: val = tr("Duration \n Total"); break; + case AVERAGE_TIME: val = tr("Average"); break; + case SHORTEST_TIME: val = tr("Shortest"); break; + case LONGEST_TIME: val = tr("Longest"); break; + case AVG_DEPTH: val = tr("Depth \n Average"); break; + case MIN_DEPTH: val = tr("Minimum"); break; + case MAX_DEPTH: val = tr("Maximum"); break; + case AVG_SAC: val = tr("SAC \n Average"); break; + case MIN_SAC: val = tr("Minimum"); break; + case MAX_SAC: val = tr("Maximum"); break; + case AVG_TEMP: val = tr("Temperature \n Average"); break; + case MIN_TEMP: val = tr("Minimum"); break; + case MAX_TEMP: val = tr("Maximum"); break; + } +} diff --git a/qt-ui/models.h b/qt-ui/models.h index 67e7e3b98..4e84aa9b2 100644 --- a/qt-ui/models.h +++ b/qt-ui/models.h @@ -156,6 +156,7 @@ protected: }; class DiveTripModel : public TreeModel { + Q_OBJECT public: enum Column {NR, DATE, RATING, DEPTH, DURATION, TEMPERATURE, TOTALWEIGHT, SUIT, CYLINDER, NITROX, SAC, OTU, MAXCNS, LOCATION, COLUMNS }; @@ -193,7 +194,15 @@ public slots: void remove(const QModelIndex& index); private: int numRows; - }; +class YearlyStatisticsModel : public TreeModel { + Q_OBJECT +public: + enum { YEAR,DIVES,TOTAL_TIME,AVERAGE_TIME,SHORTEST_TIME,LONGEST_TIME,AVG_DEPTH,MIN_DEPTH, + MAX_DEPTH,AVG_SAC,MIN_SAC,MAX_SAC,AVG_TEMP,MIN_TEMP,MAX_TEMP,COLUMNS}; + + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + YearlyStatisticsModel(QObject* parent = 0); +}; #endif |