|
|
@ -25,6 +25,7 @@ |
|
|
|
#include "notificator.h" |
|
|
|
#include "notificator.h" |
|
|
|
#include "guiutil.h" |
|
|
|
#include "guiutil.h" |
|
|
|
#include "rpcconsole.h" |
|
|
|
#include "rpcconsole.h" |
|
|
|
|
|
|
|
#include "ui_interface.h" |
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_OS_MAC |
|
|
|
#ifdef Q_OS_MAC |
|
|
|
#include "macdockiconhandler.h" |
|
|
|
#include "macdockiconhandler.h" |
|
|
@ -366,8 +367,8 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) |
|
|
|
setNumBlocks(clientModel->getNumBlocks(), clientModel->getNumBlocksOfPeers()); |
|
|
|
setNumBlocks(clientModel->getNumBlocks(), clientModel->getNumBlocksOfPeers()); |
|
|
|
connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int))); |
|
|
|
connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int))); |
|
|
|
|
|
|
|
|
|
|
|
// Report errors from network/worker thread
|
|
|
|
// Receive and report messages from network/worker thread
|
|
|
|
connect(clientModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool))); |
|
|
|
connect(clientModel, SIGNAL(message(QString,QString,bool,unsigned int)), this, SLOT(message(QString,QString,bool,unsigned int))); |
|
|
|
|
|
|
|
|
|
|
|
overviewPage->setClientModel(clientModel); |
|
|
|
overviewPage->setClientModel(clientModel); |
|
|
|
rpcConsole->setClientModel(clientModel); |
|
|
|
rpcConsole->setClientModel(clientModel); |
|
|
@ -381,8 +382,8 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel) |
|
|
|
this->walletModel = walletModel; |
|
|
|
this->walletModel = walletModel; |
|
|
|
if(walletModel) |
|
|
|
if(walletModel) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Report errors from wallet thread
|
|
|
|
// Receive and report messages from wallet thread
|
|
|
|
connect(walletModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool))); |
|
|
|
connect(walletModel, SIGNAL(message(QString,QString,bool,unsigned int)), this, SLOT(message(QString,QString,bool,unsigned int))); |
|
|
|
|
|
|
|
|
|
|
|
// Put transaction list in tabs
|
|
|
|
// Put transaction list in tabs
|
|
|
|
transactionView->setModel(walletModel); |
|
|
|
transactionView->setModel(walletModel); |
|
|
@ -592,15 +593,50 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) |
|
|
|
progressBar->setToolTip(tooltip); |
|
|
|
progressBar->setToolTip(tooltip); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void BitcoinGUI::error(const QString &title, const QString &message, bool modal) |
|
|
|
void BitcoinGUI::message(const QString &title, const QString &message, bool modal, unsigned int style) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Report errors from network/worker thread
|
|
|
|
QString strTitle = tr("Bitcoin") + " - "; |
|
|
|
if(modal) |
|
|
|
// Default to information icon
|
|
|
|
{ |
|
|
|
int nMBoxIcon = QMessageBox::Information; |
|
|
|
QMessageBox::critical(this, title, message, QMessageBox::Ok, QMessageBox::Ok); |
|
|
|
int nNotifyIcon = Notificator::Information; |
|
|
|
} else { |
|
|
|
|
|
|
|
notificator->notify(Notificator::Critical, title, message); |
|
|
|
// Check for usage of predefined title
|
|
|
|
|
|
|
|
switch (style) { |
|
|
|
|
|
|
|
case CClientUIInterface::MSG_ERROR: |
|
|
|
|
|
|
|
strTitle += tr("Error"); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case CClientUIInterface::MSG_WARNING: |
|
|
|
|
|
|
|
strTitle += tr("Warning"); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case CClientUIInterface::MSG_INFORMATION: |
|
|
|
|
|
|
|
strTitle += tr("Information"); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
strTitle += title; // Use supplied title
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check for error/warning icon
|
|
|
|
|
|
|
|
if (style & CClientUIInterface::ICON_ERROR) { |
|
|
|
|
|
|
|
nMBoxIcon = QMessageBox::Critical; |
|
|
|
|
|
|
|
nNotifyIcon = Notificator::Critical; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (style & CClientUIInterface::ICON_WARNING) { |
|
|
|
|
|
|
|
nMBoxIcon = QMessageBox::Warning; |
|
|
|
|
|
|
|
nNotifyIcon = Notificator::Warning; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Display message
|
|
|
|
|
|
|
|
if (modal) { |
|
|
|
|
|
|
|
// Check for buttons, use OK as default, if none was supplied
|
|
|
|
|
|
|
|
QMessageBox::StandardButton buttons; |
|
|
|
|
|
|
|
if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK))) |
|
|
|
|
|
|
|
buttons = QMessageBox::Ok; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons); |
|
|
|
|
|
|
|
mBox.exec(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
notificator->notify((Notificator::Class)nNotifyIcon, strTitle, message); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void BitcoinGUI::changeEvent(QEvent *e) |
|
|
|
void BitcoinGUI::changeEvent(QEvent *e) |
|
|
|