mirror of
https://github.com/AskDavis/Casinotest.git
synced 2026-01-04 12:29:46 -08:00
Adverts widget v0.2 added:
*Querying webAPI for adverts content; *Starting browsers new tab with url specified in json file *Basic QML items and models *Overview tab layout changes *Storing images on harddrive (temporary solution) *Sending queries to webAPI straight from widget (temporary solution) coming next: -store whole json file as url/desription need to be stored for further use -display images of adverts from QImage, not from file stored on harddrive -hide/show adverts button tweaking -proper webAPI base class for querying various servers for data (prypto for instance) *
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "transactionfilterproxy.h"
|
||||
#include "guiutil.h"
|
||||
#include "guiconstants.h"
|
||||
#include "qtquick_controls/cpp/guibannerwidget.h"
|
||||
|
||||
#include <QAbstractItemDelegate>
|
||||
#include <QPainter>
|
||||
@@ -100,9 +101,11 @@ OverviewPage::OverviewPage(QWidget *parent) :
|
||||
currentUnconfirmedBalance(-1),
|
||||
currentImmatureBalance(-1),
|
||||
txdelegate(new TxViewDelegate()),
|
||||
filter(0)
|
||||
filter(0),
|
||||
advertsWidget(0)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
createAdvertsWidget();
|
||||
|
||||
// Recent transactions
|
||||
ui->listTransactions->setItemDelegate(txdelegate);
|
||||
@@ -145,7 +148,16 @@ void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64
|
||||
// for the non-mining users
|
||||
bool showImmature = immatureBalance != 0;
|
||||
ui->labelImmature->setVisible(showImmature);
|
||||
ui->labelImmatureText->setVisible(showImmature);
|
||||
ui->labelImmatureText->setVisible(showImmature);
|
||||
}
|
||||
|
||||
void OverviewPage::createAdvertsWidget()
|
||||
{
|
||||
advertsWidget = new GUIBannerWidget( this );
|
||||
ui->verticalLayoutAdvertWidget->addWidget( advertsWidget->dockQmlToWidget(), Qt::AlignCenter );
|
||||
// first load from local files as its faster, than look for new ads in CasinoCoinAPI
|
||||
// advertsWidget->PopulateBannerLocally();
|
||||
advertsWidget->PopulateBannerFromWeb();
|
||||
}
|
||||
|
||||
void OverviewPage::setClientModel(ClientModel *model)
|
||||
@@ -211,3 +223,24 @@ void OverviewPage::showOutOfSyncWarning(bool fShow)
|
||||
ui->labelWalletStatus->setVisible(fShow);
|
||||
ui->labelTransactionsStatus->setVisible(fShow);
|
||||
}
|
||||
|
||||
|
||||
void OverviewPage::on_pushButtonToggleAdverts_clicked()
|
||||
{
|
||||
if ( ui->verticalLayoutAdvertWidget->itemAt( 0 ) )
|
||||
{
|
||||
QWidget* pAdvertWidget = ui->verticalLayoutAdvertWidget->itemAt( 0 )->widget();
|
||||
if ( pAdvertWidget )
|
||||
{
|
||||
pAdvertWidget->setVisible( !pAdvertWidget->isVisible() );
|
||||
if ( pAdvertWidget->isVisible() )
|
||||
{
|
||||
ui->pushButtonToggleAdverts->setText( tr( "Hide all advertisements" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->pushButtonToggleAdverts->setText( tr( "Show advertisements" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user