comparison src/qt/sendcoinsdialog.cpp @ 1271:052a2a34f756 draft

Wallet encryption part 2: ask passphrase when needed, add menu options
author Wladimir J. van der Laan <laanwj@gmail.com>
date Wed, 24 Aug 2011 22:07:26 +0200
parents d0d7e33253e5
children 310e1e69448b
comparison
equal deleted inserted replaced
1270:5785ebf92396 1271:052a2a34f756
4 #include "bitcoinunits.h" 4 #include "bitcoinunits.h"
5 #include "addressbookpage.h" 5 #include "addressbookpage.h"
6 #include "optionsmodel.h" 6 #include "optionsmodel.h"
7 #include "sendcoinsentry.h" 7 #include "sendcoinsentry.h"
8 #include "guiutil.h" 8 #include "guiutil.h"
9 #include "askpassphrasedialog.h"
9 10
10 #include <QMessageBox> 11 #include <QMessageBox>
11 #include <QLocale> 12 #include <QLocale>
12 #include <QTextDocument> 13 #include <QTextDocument>
13 14
82 if(retval != QMessageBox::Yes) 83 if(retval != QMessageBox::Yes)
83 { 84 {
84 return; 85 return;
85 } 86 }
86 87
88 WalletModel::UnlockContext ctx(model->requestUnlock());
89 if(!ctx.isValid())
90 {
91 // Unlock wallet was cancelled
92 return;
93 }
94
87 WalletModel::SendCoinsReturn sendstatus = model->sendCoins(recipients); 95 WalletModel::SendCoinsReturn sendstatus = model->sendCoins(recipients);
88 switch(sendstatus.status) 96 switch(sendstatus.status)
89 { 97 {
90 case WalletModel::InvalidAddress: 98 case WalletModel::InvalidAddress:
91 QMessageBox::warning(this, tr("Send Coins"), 99 QMessageBox::warning(this, tr("Send Coins"),
115 break; 123 break;
116 case WalletModel::TransactionCreationFailed: 124 case WalletModel::TransactionCreationFailed:
117 QMessageBox::warning(this, tr("Send Coins"), 125 QMessageBox::warning(this, tr("Send Coins"),
118 tr("Error: Transaction creation failed "), 126 tr("Error: Transaction creation failed "),
119 QMessageBox::Ok, QMessageBox::Ok); 127 QMessageBox::Ok, QMessageBox::Ok);
120 break;
121 break; 128 break;
122 case WalletModel::TransactionCommitFailed: 129 case WalletModel::TransactionCommitFailed:
123 QMessageBox::warning(this, tr("Send Coins"), 130 QMessageBox::warning(this, tr("Send Coins"),
124 tr("Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."), 131 tr("Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."),
125 QMessageBox::Ok, QMessageBox::Ok); 132 QMessageBox::Ok, QMessageBox::Ok);