Browse Source

Bitcoin-Qt: remove obsolete modal flag from GUI APIs

- as we (can) supply the CClientUIInterface::MODAL flag via the style
  parameter, we don't need a separate bool for checking the modality
0.8
Philip Kaufmann 12 years ago
parent
commit
3675588a30
  1. 1
      src/qt/bitcoin.cpp
  2. 8
      src/qt/bitcoingui.cpp
  3. 5
      src/qt/bitcoingui.h
  4. 2
      src/qt/clientmodel.cpp
  5. 2
      src/qt/clientmodel.h
  6. 2
      src/qt/walletmodel.h

1
src/qt/bitcoin.cpp

@ -45,7 +45,6 @@ static void ThreadSafeMessageBox(const std::string& message, const std::string&
modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection, modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection,
Q_ARG(QString, QString::fromStdString(caption)), Q_ARG(QString, QString::fromStdString(caption)),
Q_ARG(QString, QString::fromStdString(message)), Q_ARG(QString, QString::fromStdString(message)),
Q_ARG(bool, modal),
Q_ARG(unsigned int, style)); Q_ARG(unsigned int, style));
} }
else else

8
src/qt/bitcoingui.cpp

@ -373,7 +373,7 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int))); connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));
// Receive and report messages from network/worker thread // Receive and report messages from network/worker thread
connect(clientModel, SIGNAL(message(QString,QString,bool,unsigned int)), this, SLOT(message(QString,QString,bool,unsigned int))); connect(clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int)));
overviewPage->setClientModel(clientModel); overviewPage->setClientModel(clientModel);
rpcConsole->setClientModel(clientModel); rpcConsole->setClientModel(clientModel);
@ -388,7 +388,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel)
if(walletModel) if(walletModel)
{ {
// Receive and report messages from wallet thread // Receive and report messages from wallet thread
connect(walletModel, SIGNAL(message(QString,QString,bool,unsigned int)), this, SLOT(message(QString,QString,bool,unsigned int))); connect(walletModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int)));
// Put transaction list in tabs // Put transaction list in tabs
transactionView->setModel(walletModel); transactionView->setModel(walletModel);
@ -606,7 +606,7 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
progressBar->setToolTip(tooltip); progressBar->setToolTip(tooltip);
} }
void BitcoinGUI::message(const QString &title, const QString &message, bool modal, unsigned int style) void BitcoinGUI::message(const QString &title, const QString &message, unsigned int style)
{ {
QString strTitle = tr("Bitcoin") + " - "; QString strTitle = tr("Bitcoin") + " - ";
// Default to information icon // Default to information icon
@ -639,7 +639,7 @@ void BitcoinGUI::message(const QString &title, const QString &message, bool moda
} }
// Display message // Display message
if (modal) { if (style & CClientUIInterface::MODAL) {
// Check for buttons, use OK as default, if none was supplied // Check for buttons, use OK as default, if none was supplied
QMessageBox::StandardButton buttons; QMessageBox::StandardButton buttons;
if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK))) if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))

5
src/qt/bitcoingui.h

@ -124,11 +124,10 @@ public slots:
/** Notify the user of an event from the core network or transaction handling code. /** Notify the user of an event from the core network or transaction handling code.
@param[in] title the message box / notification title @param[in] title the message box / notification title
@param[in] message the displayed text @param[in] message the displayed text
@param[in] modal true to use a message box, false to use a notification @param[in] style modality and style definitions (icon and used buttons - buttons only for message boxes)
@param[in] style style definitions (icon and used buttons - buttons only for message boxes)
@see CClientUIInterface::MessageBoxFlags @see CClientUIInterface::MessageBoxFlags
*/ */
void message(const QString &title, const QString &message, bool modal, unsigned int style); void message(const QString &title, const QString &message, unsigned int style);
/** Asks the user whether to pay the transaction fee or to cancel the transaction. /** Asks the user whether to pay the transaction fee or to cancel the transaction.
It is currently not possible to pass a return value to another thread through It is currently not possible to pass a return value to another thread through
BlockingQueuedConnection, so an indirected pointer is used. BlockingQueuedConnection, so an indirected pointer is used.

2
src/qt/clientmodel.cpp

@ -84,7 +84,7 @@ void ClientModel::updateAlert(const QString &hash, int status)
CAlert alert = CAlert::getAlertByHash(hash_256); CAlert alert = CAlert::getAlertByHash(hash_256);
if(!alert.IsNull()) if(!alert.IsNull())
{ {
emit message(tr("Network Alert"), QString::fromStdString(alert.strStatusBar), false, CClientUIInterface::ICON_ERROR); emit message(tr("Network Alert"), QString::fromStdString(alert.strStatusBar), CClientUIInterface::ICON_ERROR);
} }
} }

2
src/qt/clientmodel.h

@ -71,7 +71,7 @@ signals:
void alertsChanged(const QString &warnings); void alertsChanged(const QString &warnings);
//! Asynchronous message notification //! Asynchronous message notification
void message(const QString &title, const QString &message, bool modal, unsigned int style); void message(const QString &title, const QString &message, unsigned int style);
public slots: public slots:
void updateTimer(); void updateTimer();

2
src/qt/walletmodel.h

@ -148,7 +148,7 @@ signals:
void requireUnlock(); void requireUnlock();
// Asynchronous message notification // Asynchronous message notification
void message(const QString &title, const QString &message, bool modal, unsigned int style); void message(const QString &title, const QString &message, unsigned int style);
public slots: public slots:
/* Wallet status might have changed */ /* Wallet status might have changed */

Loading…
Cancel
Save