2021-01-07 14:12:25 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef STATSMANAGER_H
|
|
|
|
#define STATSMANAGER_H
|
|
|
|
|
|
|
|
#include "stats/statsview.h"
|
|
|
|
#include "stats/statsstate.h"
|
|
|
|
|
2021-01-04 14:47:33 +00:00
|
|
|
#include <QStringList>
|
|
|
|
|
2021-01-12 18:28:04 +00:00
|
|
|
class ChartListModel;
|
|
|
|
|
2021-01-07 14:12:25 +00:00
|
|
|
class StatsManager : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-01-04 14:47:33 +00:00
|
|
|
Q_PROPERTY(QStringList var1List MEMBER var1List NOTIFY var1ListChanged)
|
|
|
|
Q_PROPERTY(QStringList binner1List MEMBER binner1List NOTIFY binner1ListChanged)
|
|
|
|
Q_PROPERTY(QStringList var2List MEMBER var2List NOTIFY var2ListChanged)
|
|
|
|
Q_PROPERTY(QStringList binner2List MEMBER binner2List NOTIFY binner2ListChanged)
|
2021-01-10 17:28:20 +00:00
|
|
|
Q_PROPERTY(QStringList operation2List MEMBER operation2List NOTIFY operation2ListChanged)
|
2021-12-31 20:13:50 +00:00
|
|
|
Q_PROPERTY(QStringList sortMode1List MEMBER sortMode1List NOTIFY sortMode1ListChanged)
|
2021-01-10 17:00:19 +00:00
|
|
|
Q_PROPERTY(int var1Index MEMBER var1Index NOTIFY var1IndexChanged)
|
|
|
|
Q_PROPERTY(int binner1Index MEMBER binner1Index NOTIFY binner1IndexChanged)
|
|
|
|
Q_PROPERTY(int var2Index MEMBER var2Index NOTIFY var2IndexChanged)
|
|
|
|
Q_PROPERTY(int binner2Index MEMBER binner2Index NOTIFY binner2IndexChanged)
|
2021-01-10 17:28:20 +00:00
|
|
|
Q_PROPERTY(int operation2Index MEMBER operation2Index NOTIFY operation2IndexChanged)
|
2021-12-31 20:13:50 +00:00
|
|
|
Q_PROPERTY(int sortMode1Index MEMBER sortMode1Index NOTIFY sortMode1IndexChanged)
|
2021-01-04 14:47:33 +00:00
|
|
|
|
2021-01-07 14:12:25 +00:00
|
|
|
StatsManager();
|
|
|
|
~StatsManager();
|
2021-01-12 18:28:04 +00:00
|
|
|
Q_INVOKABLE void init(StatsView *v, ChartListModel *charts);
|
2021-01-07 14:12:25 +00:00
|
|
|
Q_INVOKABLE void doit();
|
2021-01-04 14:47:33 +00:00
|
|
|
Q_INVOKABLE void var1Changed(int idx);
|
|
|
|
Q_INVOKABLE void var1BinnerChanged(int idx);
|
|
|
|
Q_INVOKABLE void var2Changed(int idx);
|
|
|
|
Q_INVOKABLE void var2BinnerChanged(int idx);
|
2021-01-10 17:28:20 +00:00
|
|
|
Q_INVOKABLE void var2OperationChanged(int idx);
|
2021-12-31 20:13:50 +00:00
|
|
|
Q_INVOKABLE void sortMode1Changed(int idx);
|
2021-01-12 18:28:04 +00:00
|
|
|
Q_INVOKABLE void setChart(int idx);
|
2021-01-04 14:47:33 +00:00
|
|
|
signals:
|
|
|
|
void var1ListChanged();
|
|
|
|
void binner1ListChanged();
|
|
|
|
void var2ListChanged();
|
|
|
|
void binner2ListChanged();
|
2021-01-10 17:28:20 +00:00
|
|
|
void operation2ListChanged();
|
2021-12-31 20:13:50 +00:00
|
|
|
void sortMode1ListChanged();
|
2021-01-10 17:00:19 +00:00
|
|
|
void var1IndexChanged();
|
|
|
|
void binner1IndexChanged();
|
|
|
|
void var2IndexChanged();
|
|
|
|
void binner2IndexChanged();
|
2021-01-10 17:28:20 +00:00
|
|
|
void operation2IndexChanged();
|
2021-12-31 20:13:50 +00:00
|
|
|
void sortMode1IndexChanged();
|
2022-01-07 16:28:09 +00:00
|
|
|
private slots:
|
|
|
|
void themeChanged();
|
2021-01-07 14:12:25 +00:00
|
|
|
private:
|
|
|
|
StatsView *view;
|
2021-01-12 18:28:04 +00:00
|
|
|
ChartListModel *charts;
|
2021-01-07 14:12:25 +00:00
|
|
|
StatsState state;
|
2021-01-04 14:47:33 +00:00
|
|
|
QStringList var1List;
|
|
|
|
QStringList binner1List;
|
|
|
|
QStringList var2List;
|
|
|
|
QStringList binner2List;
|
2021-01-10 17:28:20 +00:00
|
|
|
QStringList operation2List;
|
2021-12-31 20:13:50 +00:00
|
|
|
QStringList sortMode1List;
|
2021-01-10 17:00:19 +00:00
|
|
|
int var1Index;
|
|
|
|
int binner1Index;
|
|
|
|
int var2Index;
|
|
|
|
int binner2Index;
|
2021-01-10 17:28:20 +00:00
|
|
|
int operation2Index;
|
2021-12-31 20:13:50 +00:00
|
|
|
int sortMode1Index;
|
2021-01-04 14:47:33 +00:00
|
|
|
StatsState::UIState uiState; // Remember UI state so that we can interpret indexes
|
2022-01-07 16:28:09 +00:00
|
|
|
bool themeInitialized; // setTheme() crashes if called in init()
|
2021-01-04 14:47:33 +00:00
|
|
|
void updateUi();
|
2021-01-07 14:12:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|