mirror of
https://github.com/AskDavis/Casinotest.git
synced 2026-01-01 05:05:57 -08:00
Fixes #7
This commit is contained in:
@@ -139,8 +139,13 @@ OverviewPage::OverviewPage(QWidget *parent) :
|
|||||||
// start with displaying the "out of sync" warnings
|
// start with displaying the "out of sync" warnings
|
||||||
showOutOfSyncWarning(true);
|
showOutOfSyncWarning(true);
|
||||||
|
|
||||||
// get CoinInfo from the web
|
// get CoinInfo on startup
|
||||||
getCoinInfo();
|
getCoinInfo();
|
||||||
|
// start timer to get CoinInfo from the web every interval
|
||||||
|
coinInfoRefreshTimer.setSingleShot( false );
|
||||||
|
coinInfoRefreshTimer.setInterval( 1000 * 300 ); // every 5 minuts
|
||||||
|
connect( &coinInfoRefreshTimer, SIGNAL( timeout() ), this, SLOT(getCoinInfo()), Qt::UniqueConnection );
|
||||||
|
coinInfoRefreshTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverviewPage::handleTransactionClicked(const QModelIndex &index)
|
void OverviewPage::handleTransactionClicked(const QModelIndex &index)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class OverviewPage;
|
class OverviewPage;
|
||||||
@@ -56,8 +57,8 @@ private:
|
|||||||
/** Get the CoinInfo from REST service */
|
/** Get the CoinInfo from REST service */
|
||||||
CasinoCoinWebAPIParser* cscWebApiParser;
|
CasinoCoinWebAPIParser* cscWebApiParser;
|
||||||
CasinoCoinWebAPI* cscWebApi;
|
CasinoCoinWebAPI* cscWebApi;
|
||||||
void getCoinInfo();
|
|
||||||
QJsonObject coinInformation;
|
QJsonObject coinInformation;
|
||||||
|
QTimer coinInfoRefreshTimer;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateDisplayUnit();
|
void updateDisplayUnit();
|
||||||
@@ -66,6 +67,7 @@ private slots:
|
|||||||
void updateCoinInfoFromWeb( JsonCoinInfoParser* coinInfoParser );
|
void updateCoinInfoFromWeb( JsonCoinInfoParser* coinInfoParser );
|
||||||
void updateFiatBalance(int currency);
|
void updateFiatBalance(int currency);
|
||||||
void updateDisplayPromotions(bool checked);
|
void updateDisplayPromotions(bool checked);
|
||||||
|
void getCoinInfo();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // OVERVIEWPAGE_H
|
#endif // OVERVIEWPAGE_H
|
||||||
|
|||||||
Reference in New Issue
Block a user