Browse Source

Merge pull request #2066 from Diapolo/small_uiint_changes

UI interface changes
miguelfreitas
Wladimir J. van der Laan 12 years ago
parent
commit
25fd38090a
  1. 2
      src/noui.cpp
  2. 3
      src/qt/bitcoin.cpp
  3. 2
      src/qt/walletmodel.cpp
  4. 4
      src/ui_interface.h
  5. 2
      src/wallet.cpp

2
src/noui.cpp

@ -32,7 +32,7 @@ static int noui_ThreadSafeMessageBox(const std::string& message, const std::stri
return 4; return 4;
} }
static bool noui_ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption) static bool noui_ThreadSafeAskFee(int64 /*nFeeRequired*/)
{ {
return true; return true;
} }

3
src/qt/bitcoin.cpp

@ -54,12 +54,13 @@ static void ThreadSafeMessageBox(const std::string& message, const std::string&
} }
} }
static bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption) static bool ThreadSafeAskFee(int64 nFeeRequired)
{ {
if(!guiref) if(!guiref)
return false; return false;
if(nFeeRequired < MIN_TX_FEE || nFeeRequired <= nTransactionFee || fDaemon) if(nFeeRequired < MIN_TX_FEE || nFeeRequired <= nTransactionFee || fDaemon)
return true; return true;
bool payFee = false; bool payFee = false;
QMetaObject::invokeMethod(guiref, "askFee", GUIUtil::blockingGUIThreadConnection(), QMetaObject::invokeMethod(guiref, "askFee", GUIUtil::blockingGUIThreadConnection(),

2
src/qt/walletmodel.cpp

@ -189,7 +189,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QList<SendCoinsRecipie
} }
return TransactionCreationFailed; return TransactionCreationFailed;
} }
if(!uiInterface.ThreadSafeAskFee(nFeeRequired, tr("Sending...").toStdString())) if(!uiInterface.ThreadSafeAskFee(nFeeRequired))
{ {
return Aborted; return Aborted;
} }

4
src/ui_interface.h

@ -62,7 +62,7 @@ public:
MODAL = 0x10000000U, MODAL = 0x10000000U,
/** Predefined combinations for certain default usage cases */ /** Predefined combinations for certain default usage cases */
MSG_INFORMATION = (ICON_INFORMATION | BTN_OK), MSG_INFORMATION = ICON_INFORMATION,
MSG_WARNING = (ICON_WARNING | BTN_OK | MODAL), MSG_WARNING = (ICON_WARNING | BTN_OK | MODAL),
MSG_ERROR = (ICON_ERROR | BTN_OK | MODAL) MSG_ERROR = (ICON_ERROR | BTN_OK | MODAL)
}; };
@ -71,7 +71,7 @@ public:
boost::signals2::signal<void (const std::string& message, const std::string& caption, unsigned int style)> ThreadSafeMessageBox; boost::signals2::signal<void (const std::string& message, const std::string& caption, unsigned int style)> ThreadSafeMessageBox;
/** Ask the user whether they want to pay a fee or not. */ /** Ask the user whether they want to pay a fee or not. */
boost::signals2::signal<bool (int64 nFeeRequired, const std::string& strCaption), boost::signals2::last_value<bool> > ThreadSafeAskFee; boost::signals2::signal<bool (int64 nFeeRequired), boost::signals2::last_value<bool> > ThreadSafeAskFee;
/** Handle a URL passed at the command line. */ /** Handle a URL passed at the command line. */
boost::signals2::signal<void (const std::string& strURI)> ThreadSafeHandleURI; boost::signals2::signal<void (const std::string& strURI)> ThreadSafeHandleURI;

2
src/wallet.cpp

@ -1310,7 +1310,7 @@ string CWallet::SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew,
return strError; return strError;
} }
if (fAskFee && !uiInterface.ThreadSafeAskFee(nFeeRequired, _("Sending..."))) if (fAskFee && !uiInterface.ThreadSafeAskFee(nFeeRequired))
return "ABORTED"; return "ABORTED";
if (!CommitTransaction(wtxNew, reservekey)) if (!CommitTransaction(wtxNew, reservekey))

Loading…
Cancel
Save