4 * W.J. van der Laan 2011
6 #include "bitcoingui.h"
7 #include "transactiontablemodel.h"
8 #include "addressbookpage.h"
9 #include "sendcoinsdialog.h"
10 #include "optionsdialog.h"
11 #include "aboutdialog.h"
12 #include "clientmodel.h"
13 #include "walletmodel.h"
14 #include "editaddressdialog.h"
15 #include "optionsmodel.h"
16 #include "transactiondescdialog.h"
17 #include "addresstablemodel.h"
18 #include "transactionview.h"
19 #include "overviewpage.h"
20 #include "bitcoinunits.h"
21 #include "guiconstants.h"
22 #include "askpassphrasedialog.h"
23 #include "notificator.h"
26 #include "macdockiconhandler.h"
29 #include <QApplication>
30 #include <QMainWindow>
35 #include <QVBoxLayout>
40 #include <QPushButton>
42 #include <QMessageBox>
43 #include <QProgressBar>
44 #include <QStackedWidget>
48 #include <QDragEnterEvent>
53 BitcoinGUI::BitcoinGUI(QWidget *parent):
57 encryptWalletAction(0),
58 changePassphraseAction(0),
64 setWindowTitle(tr("Bitcoin Wallet"));
66 setWindowIcon(QIcon(":icons/bitcoin"));
68 setUnifiedTitleAndToolBarOnMac(true);
69 QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
74 // Create actions for the toolbar, menu bar and tray/dock icon
77 // Create application menu bar
80 // Create the toolbars
83 // Create the tray icon (or setup the dock icon)
87 overviewPage = new OverviewPage();
89 transactionsPage = new QWidget(this);
90 QVBoxLayout *vbox = new QVBoxLayout();
91 transactionView = new TransactionView(this);
92 vbox->addWidget(transactionView);
93 transactionsPage->setLayout(vbox);
95 addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);
97 receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);
99 sendCoinsPage = new SendCoinsDialog(this);
101 centralWidget = new QStackedWidget(this);
102 centralWidget->addWidget(overviewPage);
103 centralWidget->addWidget(transactionsPage);
104 centralWidget->addWidget(addressBookPage);
105 centralWidget->addWidget(receiveCoinsPage);
106 centralWidget->addWidget(sendCoinsPage);
107 setCentralWidget(centralWidget);
112 // Status bar notification icons
113 QFrame *frameBlocks = new QFrame();
114 //frameBlocks->setFrameStyle(QFrame::Panel | QFrame::Sunken);
115 frameBlocks->setContentsMargins(0,0,0,0);
116 frameBlocks->setMinimumWidth(56);
117 frameBlocks->setMaximumWidth(56);
118 QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
119 frameBlocksLayout->setContentsMargins(3,0,3,0);
120 frameBlocksLayout->setSpacing(3);
121 labelEncryptionIcon = new QLabel();
122 labelConnectionsIcon = new QLabel();
123 labelBlocksIcon = new QLabel();
124 frameBlocksLayout->addStretch();
125 frameBlocksLayout->addWidget(labelEncryptionIcon);
126 frameBlocksLayout->addStretch();
127 frameBlocksLayout->addWidget(labelConnectionsIcon);
128 frameBlocksLayout->addStretch();
129 frameBlocksLayout->addWidget(labelBlocksIcon);
130 frameBlocksLayout->addStretch();
132 // Progress bar for blocks download
133 progressBarLabel = new QLabel(tr("Synchronizing with network..."));
134 progressBarLabel->setVisible(false);
135 progressBar = new QProgressBar();
136 progressBar->setToolTip(tr("Block chain synchronization in progress"));
137 progressBar->setVisible(false);
139 statusBar()->addWidget(progressBarLabel);
140 statusBar()->addWidget(progressBar);
141 statusBar()->addPermanentWidget(frameBlocks);
143 syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);
145 // Clicking on a transaction on the overview page simply sends you to transaction history page
146 connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
148 // Doubleclicking on a transaction on the transaction history page shows details
149 connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
154 BitcoinGUI::~BitcoinGUI()
161 void BitcoinGUI::createActions()
163 QActionGroup *tabGroup = new QActionGroup(this);
165 overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this);
166 overviewAction->setToolTip(tr("Show general overview of wallet"));
167 overviewAction->setCheckable(true);
168 overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
169 tabGroup->addAction(overviewAction);
171 historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this);
172 historyAction->setToolTip(tr("Browse transaction history"));
173 historyAction->setCheckable(true);
174 historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
175 tabGroup->addAction(historyAction);
177 addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this);
178 addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels"));
179 addressBookAction->setCheckable(true);
180 addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
181 tabGroup->addAction(addressBookAction);
183 receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this);
184 receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments"));
185 receiveCoinsAction->setCheckable(true);
186 receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
187 tabGroup->addAction(receiveCoinsAction);
189 sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this);
190 sendCoinsAction->setToolTip(tr("Send coins to a bitcoin address"));
191 sendCoinsAction->setCheckable(true);
192 sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
193 tabGroup->addAction(sendCoinsAction);
195 connect(overviewAction, SIGNAL(triggered()), this, SLOT(show()));
196 connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));
197 connect(historyAction, SIGNAL(triggered()), this, SLOT(show()));
198 connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
199 connect(addressBookAction, SIGNAL(triggered()), this, SLOT(show()));
200 connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
201 connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(show()));
202 connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
203 connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(show()));
204 connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
206 quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
207 quitAction->setToolTip(tr("Quit application"));
208 quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
209 quitAction->setMenuRole(QAction::QuitRole);
210 aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About %1").arg(qApp->applicationName()), this);
211 aboutAction->setToolTip(tr("Show information about Bitcoin"));
212 aboutAction->setMenuRole(QAction::AboutRole);
213 aboutQtAction = new QAction(tr("About &Qt"), this);
214 aboutQtAction->setToolTip(tr("Show information about Qt"));
215 aboutQtAction->setMenuRole(QAction::AboutQtRole);
216 optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);
217 optionsAction->setToolTip(tr("Modify configuration options for bitcoin"));
218 optionsAction->setMenuRole(QAction::PreferencesRole);
219 openBitcoinAction = new QAction(QIcon(":/icons/bitcoin"), tr("Open &Bitcoin"), this);
220 openBitcoinAction->setToolTip(tr("Show the Bitcoin window"));
221 exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this);
222 exportAction->setToolTip(tr("Export the current view to a file"));
223 encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet"), this);
224 encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet"));
225 encryptWalletAction->setCheckable(true);
226 changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase"), this);
227 changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption"));
229 connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
230 connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
231 connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
232 connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
233 connect(openBitcoinAction, SIGNAL(triggered()), this, SLOT(showNormal()));
234 connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool)));
235 connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase()));
238 void BitcoinGUI::createMenuBar()
241 // Create a decoupled menu bar on Mac which stays even if the window is closed
242 appMenuBar = new QMenuBar();
244 // Get the main window's menu bar on other platforms
245 appMenuBar = menuBar();
248 // Configure the menus
249 QMenu *file = appMenuBar->addMenu(tr("&File"));
250 file->addAction(quitAction);
252 QMenu *settings = appMenuBar->addMenu(tr("&Settings"));
253 settings->addAction(encryptWalletAction);
254 settings->addAction(changePassphraseAction);
255 settings->addSeparator();
256 settings->addAction(optionsAction);
258 QMenu *help = appMenuBar->addMenu(tr("&Help"));
259 help->addAction(aboutAction);
260 help->addAction(aboutQtAction);
263 void BitcoinGUI::createToolBars()
265 QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
266 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
267 toolbar->addAction(overviewAction);
268 toolbar->addAction(sendCoinsAction);
269 toolbar->addAction(receiveCoinsAction);
270 toolbar->addAction(historyAction);
271 toolbar->addAction(addressBookAction);
273 QToolBar *toolbar2 = addToolBar(tr("Actions toolbar"));
274 toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
275 toolbar2->addAction(exportAction);
278 void BitcoinGUI::setClientModel(ClientModel *clientModel)
280 this->clientModel = clientModel;
283 if(clientModel->isTestNet())
285 QString title_testnet = windowTitle() + QString(" ") + tr("[testnet]");
286 setWindowTitle(title_testnet);
288 setWindowIcon(QIcon(":icons/bitcoin_testnet"));
290 MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet"));
294 trayIcon->setToolTip(title_testnet);
295 trayIcon->setIcon(QIcon(":/icons/toolbar_testnet"));
299 // Keep up to date with client
300 setNumConnections(clientModel->getNumConnections());
301 connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
303 setNumBlocks(clientModel->getNumBlocks());
304 connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int)));
306 // Report errors from network/worker thread
307 connect(clientModel, SIGNAL(error(QString,QString)), this, SLOT(error(QString,QString)));
311 void BitcoinGUI::setWalletModel(WalletModel *walletModel)
313 this->walletModel = walletModel;
316 // Report errors from wallet thread
317 connect(walletModel, SIGNAL(error(QString,QString)), this, SLOT(error(QString,QString)));
319 // Put transaction list in tabs
320 transactionView->setModel(walletModel);
322 overviewPage->setModel(walletModel);
323 addressBookPage->setModel(walletModel->getAddressTableModel());
324 receiveCoinsPage->setModel(walletModel->getAddressTableModel());
325 sendCoinsPage->setModel(walletModel);
327 setEncryptionStatus(walletModel->getEncryptionStatus());
328 connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SLOT(setEncryptionStatus(int)));
330 // Balloon popup for new transaction
331 connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
332 this, SLOT(incomingTransaction(QModelIndex,int,int)));
334 // Ask for passphrase if needed
335 connect(walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet()));
339 void BitcoinGUI::createTrayIcon()
343 trayIcon = new QSystemTrayIcon(this);
344 trayIconMenu = new QMenu(this);
345 trayIcon->setContextMenu(trayIconMenu);
346 trayIcon->setToolTip("Bitcoin client");
347 trayIcon->setIcon(QIcon(":/icons/toolbar"));
348 connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
349 this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason)));
352 // Note: On Mac, the dock icon is used to provide the tray's functionality.
353 MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance();
354 connect(dockIconHandler, SIGNAL(dockIconClicked()), openBitcoinAction, SLOT(trigger()));
355 trayIconMenu = dockIconHandler->dockMenu();
358 // Configuration of the tray icon (or dock icon) icon menu
359 trayIconMenu->addAction(openBitcoinAction);
360 trayIconMenu->addSeparator();
361 trayIconMenu->addAction(receiveCoinsAction);
362 trayIconMenu->addAction(sendCoinsAction);
363 trayIconMenu->addSeparator();
364 trayIconMenu->addAction(optionsAction);
365 #ifndef Q_WS_MAC // This is built-in on Mac
366 trayIconMenu->addSeparator();
367 trayIconMenu->addAction(quitAction);
370 notificator = new Notificator(tr("bitcoin-qt"), trayIcon);
374 void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
376 if(reason == QSystemTrayIcon::Trigger)
378 // Click on system tray icon triggers "open bitcoin"
379 openBitcoinAction->trigger();
385 void BitcoinGUI::optionsClicked()
387 if(!clientModel || !clientModel->getOptionsModel())
390 dlg.setModel(clientModel->getOptionsModel());
394 void BitcoinGUI::aboutClicked()
397 dlg.setModel(clientModel);
401 void BitcoinGUI::setNumConnections(int count)
406 case 0: icon = ":/icons/connect_0"; break;
407 case 1: case 2: case 3: icon = ":/icons/connect_1"; break;
408 case 4: case 5: case 6: icon = ":/icons/connect_2"; break;
409 case 7: case 8: case 9: icon = ":/icons/connect_3"; break;
410 default: icon = ":/icons/connect_4"; break;
412 labelConnectionsIcon->setPixmap(QIcon(icon).pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
413 labelConnectionsIcon->setToolTip(tr("%n active connection(s) to Bitcoin network", "", count));
416 void BitcoinGUI::setNumBlocks(int count)
420 int initTotal = clientModel->getNumBlocksAtStartup();
421 int total = clientModel->getNumBlocksOfPeers();
426 progressBarLabel->setVisible(true);
427 progressBar->setVisible(true);
428 progressBar->setMaximum(total - initTotal);
429 progressBar->setValue(count - initTotal);
430 tooltip = tr("Downloaded %1 of %2 blocks of transaction history.").arg(count).arg(total);
434 progressBarLabel->setVisible(false);
435 progressBar->setVisible(false);
436 tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count);
439 QDateTime now = QDateTime::currentDateTime();
440 QDateTime lastBlockDate = clientModel->getLastBlockDate();
441 int secs = lastBlockDate.secsTo(now);
444 // Represent time from last generated block in human readable text
447 text = tr("%n second(s) ago","",secs);
449 else if(secs < 60*60)
451 text = tr("%n minute(s) ago","",secs/60);
453 else if(secs < 24*60*60)
455 text = tr("%n hour(s) ago","",secs/(60*60));
459 text = tr("%n day(s) ago","",secs/(60*60*24));
462 // Set icon state: spinning if catching up, tick otherwise
465 tooltip = tr("Up to date") + QString("\n") + tooltip;
466 labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
470 tooltip = tr("Catching up...") + QString("\n") + tooltip;
471 labelBlocksIcon->setMovie(syncIconMovie);
472 syncIconMovie->start();
475 tooltip += QString("\n");
476 tooltip += tr("Last received block was generated %1.").arg(text);
478 labelBlocksIcon->setToolTip(tooltip);
479 progressBarLabel->setToolTip(tooltip);
480 progressBar->setToolTip(tooltip);
483 void BitcoinGUI::error(const QString &title, const QString &message)
485 // Report errors from network/worker thread
486 notificator->notify(Notificator::Critical, title, message);
489 void BitcoinGUI::changeEvent(QEvent *e)
491 #ifndef Q_WS_MAC // Ignored on Mac
492 if(e->type() == QEvent::WindowStateChange)
494 if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray())
509 QMainWindow::changeEvent(e);
512 void BitcoinGUI::closeEvent(QCloseEvent *event)
516 #ifndef Q_WS_MAC // Ignored on Mac
517 if(!clientModel->getOptionsModel()->getMinimizeToTray() &&
518 !clientModel->getOptionsModel()->getMinimizeOnClose())
524 QMainWindow::closeEvent(event);
527 void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee)
530 tr("This transaction is over the size limit. You can still send it for a fee of %1, "
531 "which goes to the nodes that process your transaction and helps to support the network. "
532 "Do you want to pay the fee?").arg(
533 BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nFeeRequired));
534 QMessageBox::StandardButton retval = QMessageBox::question(
535 this, tr("Sending..."), strMessage,
536 QMessageBox::Yes|QMessageBox::Cancel, QMessageBox::Yes);
537 *payFee = (retval == QMessageBox::Yes);
540 void BitcoinGUI::incomingTransaction(const QModelIndex & parent, int start, int end)
542 if(!walletModel || !clientModel)
544 TransactionTableModel *ttm = walletModel->getTransactionTableModel();
545 qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent)
546 .data(Qt::EditRole).toULongLong();
547 if(!clientModel->inInitialBlockDownload())
549 // On new transaction, make an info balloon
550 // Unless the initial block download is in progress, to prevent balloon-spam
551 QString date = ttm->index(start, TransactionTableModel::Date, parent)
553 QString type = ttm->index(start, TransactionTableModel::Type, parent)
555 QString address = ttm->index(start, TransactionTableModel::ToAddress, parent)
557 QIcon icon = qvariant_cast<QIcon>(ttm->index(start,
558 TransactionTableModel::ToAddress, parent)
559 .data(Qt::DecorationRole));
561 notificator->notify(Notificator::Information,
562 (amount)<0 ? tr("Sent transaction") :
563 tr("Incoming transaction"),
569 .arg(BitcoinUnits::formatWithUnit(walletModel->getOptionsModel()->getDisplayUnit(), amount, true))
571 .arg(address), icon);
575 void BitcoinGUI::gotoOverviewPage()
577 overviewAction->setChecked(true);
578 centralWidget->setCurrentWidget(overviewPage);
580 exportAction->setEnabled(false);
581 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
584 void BitcoinGUI::gotoHistoryPage()
586 historyAction->setChecked(true);
587 centralWidget->setCurrentWidget(transactionsPage);
589 exportAction->setEnabled(true);
590 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
591 connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked()));
594 void BitcoinGUI::gotoAddressBookPage()
596 addressBookAction->setChecked(true);
597 centralWidget->setCurrentWidget(addressBookPage);
599 exportAction->setEnabled(true);
600 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
601 connect(exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked()));
604 void BitcoinGUI::gotoReceiveCoinsPage()
606 receiveCoinsAction->setChecked(true);
607 centralWidget->setCurrentWidget(receiveCoinsPage);
609 exportAction->setEnabled(true);
610 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
611 connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked()));
614 void BitcoinGUI::gotoSendCoinsPage()
616 sendCoinsAction->setChecked(true);
617 centralWidget->setCurrentWidget(sendCoinsPage);
619 exportAction->setEnabled(false);
620 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
623 void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)
626 if(event->mimeData()->hasUrls())
627 event->acceptProposedAction();
630 void BitcoinGUI::dropEvent(QDropEvent *event)
632 if(event->mimeData()->hasUrls())
635 QList<QUrl> urls = event->mimeData()->urls();
636 foreach(const QUrl &url, urls)
638 sendCoinsPage->handleURL(&url);
642 event->acceptProposedAction();
645 void BitcoinGUI::setEncryptionStatus(int status)
649 case WalletModel::Unencrypted:
650 labelEncryptionIcon->hide();
651 encryptWalletAction->setChecked(false);
652 changePassphraseAction->setEnabled(false);
653 encryptWalletAction->setEnabled(true);
655 case WalletModel::Unlocked:
656 labelEncryptionIcon->show();
657 labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
658 labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
659 encryptWalletAction->setChecked(true);
660 changePassphraseAction->setEnabled(true);
661 encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
663 case WalletModel::Locked:
664 labelEncryptionIcon->show();
665 labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_closed").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
666 labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>"));
667 encryptWalletAction->setChecked(true);
668 changePassphraseAction->setEnabled(true);
669 encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
674 void BitcoinGUI::encryptWallet(bool status)
678 AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt:
679 AskPassphraseDialog::Decrypt, this);
680 dlg.setModel(walletModel);
683 setEncryptionStatus(walletModel->getEncryptionStatus());
686 void BitcoinGUI::changePassphrase()
688 AskPassphraseDialog dlg(AskPassphraseDialog::ChangePass, this);
689 dlg.setModel(walletModel);
693 void BitcoinGUI::unlockWallet()
697 // Unlock wallet when requested by wallet model
698 if(walletModel->getEncryptionStatus() == WalletModel::Locked)
700 AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this);
701 dlg.setModel(walletModel);