4 * W.J. van der Laan 2011
5 * The Bitcoin Developers 2011
7 #include "bitcoingui.h"
8 #include "transactiontablemodel.h"
9 #include "addressbookpage.h"
10 #include "sendcoinsdialog.h"
11 #include "optionsdialog.h"
12 #include "aboutdialog.h"
13 #include "clientmodel.h"
14 #include "walletmodel.h"
15 #include "editaddressdialog.h"
16 #include "optionsmodel.h"
17 #include "transactiondescdialog.h"
18 #include "addresstablemodel.h"
19 #include "transactionview.h"
20 #include "overviewpage.h"
21 #include "bitcoinunits.h"
22 #include "guiconstants.h"
23 #include "askpassphrasedialog.h"
24 #include "notificator.h"
27 #include "macdockiconhandler.h"
30 #include <QApplication>
31 #include <QMainWindow>
36 #include <QVBoxLayout>
41 #include <QPushButton>
43 #include <QMessageBox>
44 #include <QProgressBar>
45 #include <QStackedWidget>
49 #include <QDragEnterEvent>
54 BitcoinGUI::BitcoinGUI(QWidget *parent):
58 encryptWalletAction(0),
59 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(gotoOverviewPage()));
196 connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
197 connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
198 connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
199 connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
201 quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
202 quitAction->setToolTip(tr("Quit application"));
203 quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
204 quitAction->setMenuRole(QAction::QuitRole);
205 aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About %1").arg(qApp->applicationName()), this);
206 aboutAction->setToolTip(tr("Show information about Bitcoin"));
207 aboutAction->setMenuRole(QAction::AboutQtRole);
208 optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);
209 optionsAction->setToolTip(tr("Modify configuration options for bitcoin"));
210 optionsAction->setMenuRole(QAction::PreferencesRole);
211 openBitcoinAction = new QAction(QIcon(":/icons/bitcoin"), tr("Open &Bitcoin"), this);
212 openBitcoinAction->setToolTip(tr("Show the Bitcoin window"));
213 exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this);
214 exportAction->setToolTip(tr("Export the current view to a file"));
215 encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet"), this);
216 encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet"));
217 encryptWalletAction->setCheckable(true);
218 changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase"), this);
219 changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption"));
221 connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
222 connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
223 connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
224 connect(openBitcoinAction, SIGNAL(triggered()), this, SLOT(showNormal()));
225 connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool)));
226 connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase()));
229 void BitcoinGUI::createMenuBar()
232 // Create a decoupled menu bar on Mac which stays even if the window is closed
233 appMenuBar = new QMenuBar();
235 // Get the main window's menu bar on other platforms
236 appMenuBar = menuBar();
239 // Configure the menus
240 QMenu *file = appMenuBar->addMenu(tr("&File"));
241 file->addAction(quitAction);
243 QMenu *settings = appMenuBar->addMenu(tr("&Settings"));
244 settings->addAction(encryptWalletAction);
245 settings->addAction(changePassphraseAction);
246 settings->addSeparator();
247 settings->addAction(optionsAction);
249 QMenu *help = appMenuBar->addMenu(tr("&Help"));
250 help->addAction(aboutAction);
253 void BitcoinGUI::createToolBars()
255 QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
256 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
257 toolbar->addAction(overviewAction);
258 toolbar->addAction(sendCoinsAction);
259 toolbar->addAction(receiveCoinsAction);
260 toolbar->addAction(historyAction);
261 toolbar->addAction(addressBookAction);
263 QToolBar *toolbar2 = addToolBar(tr("Actions toolbar"));
264 toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
265 toolbar2->addAction(exportAction);
268 void BitcoinGUI::setClientModel(ClientModel *clientModel)
270 this->clientModel = clientModel;
273 if(clientModel->isTestNet())
275 QString title_testnet = windowTitle() + QString(" ") + tr("[testnet]");
276 setWindowTitle(title_testnet);
278 setWindowIcon(QIcon(":icons/bitcoin_testnet"));
280 MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet"));
284 trayIcon->setToolTip(title_testnet);
285 trayIcon->setIcon(QIcon(":/icons/toolbar_testnet"));
289 // Keep up to date with client
290 setNumConnections(clientModel->getNumConnections());
291 connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
293 setNumBlocks(clientModel->getNumBlocks());
294 connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int)));
296 // Report errors from network/worker thread
297 connect(clientModel, SIGNAL(error(QString,QString)), this, SLOT(error(QString,QString)));
301 void BitcoinGUI::setWalletModel(WalletModel *walletModel)
303 this->walletModel = walletModel;
306 // Report errors from wallet thread
307 connect(walletModel, SIGNAL(error(QString,QString)), this, SLOT(error(QString,QString)));
309 // Put transaction list in tabs
310 transactionView->setModel(walletModel);
312 overviewPage->setModel(walletModel);
313 addressBookPage->setModel(walletModel->getAddressTableModel());
314 receiveCoinsPage->setModel(walletModel->getAddressTableModel());
315 sendCoinsPage->setModel(walletModel);
317 setEncryptionStatus(walletModel->getEncryptionStatus());
318 connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SLOT(setEncryptionStatus(int)));
320 // Balloon popup for new transaction
321 connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
322 this, SLOT(incomingTransaction(QModelIndex,int,int)));
324 // Ask for passphrase if needed
325 connect(walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet()));
329 void BitcoinGUI::createTrayIcon()
333 trayIcon = new QSystemTrayIcon(this);
334 trayIconMenu = new QMenu(this);
335 trayIcon->setContextMenu(trayIconMenu);
336 trayIcon->setToolTip("Bitcoin client");
337 trayIcon->setIcon(QIcon(":/icons/toolbar"));
338 connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
339 this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason)));
342 // Note: On Mac, the dock icon is used to provide the tray's functionality.
343 MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance();
344 connect(dockIconHandler, SIGNAL(dockIconClicked()), openBitcoinAction, SLOT(trigger()));
345 trayIconMenu = dockIconHandler->dockMenu();
348 // Configuration of the tray icon (or dock icon) icon menu
349 trayIconMenu->addAction(openBitcoinAction);
350 trayIconMenu->addSeparator();
351 trayIconMenu->addAction(receiveCoinsAction);
352 trayIconMenu->addAction(sendCoinsAction);
353 trayIconMenu->addSeparator();
354 trayIconMenu->addAction(optionsAction);
355 #ifndef Q_WS_MAC // This is built-in on Mac
356 trayIconMenu->addSeparator();
357 trayIconMenu->addAction(quitAction);
360 notificator = new Notificator(tr("bitcoin-qt"), trayIcon);
364 void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
366 if(reason == QSystemTrayIcon::Trigger)
368 // Click on system tray icon triggers "open bitcoin"
369 openBitcoinAction->trigger();
375 void BitcoinGUI::optionsClicked()
377 if(!clientModel || !clientModel->getOptionsModel())
380 dlg.setModel(clientModel->getOptionsModel());
384 void BitcoinGUI::aboutClicked()
387 dlg.setModel(clientModel);
391 void BitcoinGUI::setNumConnections(int count)
396 case 0: icon = ":/icons/connect_0"; break;
397 case 1: case 2: case 3: icon = ":/icons/connect_1"; break;
398 case 4: case 5: case 6: icon = ":/icons/connect_2"; break;
399 case 7: case 8: case 9: icon = ":/icons/connect_3"; break;
400 default: icon = ":/icons/connect_4"; break;
402 labelConnectionsIcon->setPixmap(QIcon(icon).pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
403 labelConnectionsIcon->setToolTip(tr("%n active connection(s) to Bitcoin network", "", count));
406 void BitcoinGUI::setNumBlocks(int count)
410 int initTotal = clientModel->getNumBlocksAtStartup();
411 int total = clientModel->getNumBlocksOfPeers();
416 if (clientModel->getStatusBarWarnings() == "")
418 progressBarLabel->setVisible(true);
419 progressBarLabel->setText(tr("Synchronizing with network..."));
420 progressBar->setVisible(true);
421 progressBar->setMaximum(total - initTotal);
422 progressBar->setValue(count - initTotal);
426 progressBarLabel->setText(clientModel->getStatusBarWarnings());
427 progressBarLabel->setVisible(true);
428 progressBar->setVisible(false);
430 tooltip = tr("Downloaded %1 of %2 blocks of transaction history.").arg(count).arg(total);
434 if (clientModel->getStatusBarWarnings() == "")
435 progressBarLabel->setVisible(false);
438 progressBarLabel->setText(clientModel->getStatusBarWarnings());
439 progressBarLabel->setVisible(true);
441 progressBar->setVisible(false);
442 tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count);
445 QDateTime now = QDateTime::currentDateTime();
446 QDateTime lastBlockDate = clientModel->getLastBlockDate();
447 int secs = lastBlockDate.secsTo(now);
450 // Represent time from last generated block in human readable text
453 text = tr("%n second(s) ago","",secs);
455 else if(secs < 60*60)
457 text = tr("%n minute(s) ago","",secs/60);
459 else if(secs < 24*60*60)
461 text = tr("%n hour(s) ago","",secs/(60*60));
465 text = tr("%n day(s) ago","",secs/(60*60*24));
468 // Set icon state: spinning if catching up, tick otherwise
471 tooltip = tr("Up to date") + QString("\n") + tooltip;
472 labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
476 tooltip = tr("Catching up...") + QString("\n") + tooltip;
477 labelBlocksIcon->setMovie(syncIconMovie);
478 syncIconMovie->start();
481 tooltip += QString("\n");
482 tooltip += tr("Last received block was generated %1.").arg(text);
484 labelBlocksIcon->setToolTip(tooltip);
485 progressBarLabel->setToolTip(tooltip);
486 progressBar->setToolTip(tooltip);
489 void BitcoinGUI::refreshStatusBar()
491 /* Might display multiple times in the case of multiple alerts
492 static QString prevStatusBar;
493 QString newStatusBar = clientModel->getStatusBarWarnings();
494 if (prevStatusBar != newStatusBar)
496 prevStatusBar = newStatusBar;
497 error(tr("Network Alert"), newStatusBar);
499 setNumBlocks(clientModel->getNumBlocks());
502 void BitcoinGUI::error(const QString &title, const QString &message)
504 // Report errors from network/worker thread
505 notificator->notify(Notificator::Critical, title, message);
508 void BitcoinGUI::changeEvent(QEvent *e)
510 #ifndef Q_WS_MAC // Ignored on Mac
511 if(e->type() == QEvent::WindowStateChange)
513 if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray())
528 QMainWindow::changeEvent(e);
531 void BitcoinGUI::closeEvent(QCloseEvent *event)
535 #ifndef Q_WS_MAC // Ignored on Mac
536 if(!clientModel->getOptionsModel()->getMinimizeToTray() &&
537 !clientModel->getOptionsModel()->getMinimizeOnClose())
543 QMainWindow::closeEvent(event);
546 void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee)
549 tr("This transaction is over the size limit. You can still send it for a fee of %1, "
550 "which goes to the nodes that process your transaction and helps to support the network. "
551 "Do you want to pay the fee?").arg(
552 BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nFeeRequired));
553 QMessageBox::StandardButton retval = QMessageBox::question(
554 this, tr("Sending..."), strMessage,
555 QMessageBox::Yes|QMessageBox::Cancel, QMessageBox::Yes);
556 *payFee = (retval == QMessageBox::Yes);
559 void BitcoinGUI::incomingTransaction(const QModelIndex & parent, int start, int end)
561 if(!walletModel || !clientModel)
563 TransactionTableModel *ttm = walletModel->getTransactionTableModel();
564 qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent)
565 .data(Qt::EditRole).toULongLong();
566 if(!clientModel->inInitialBlockDownload())
568 // On new transaction, make an info balloon
569 // Unless the initial block download is in progress, to prevent balloon-spam
570 QString date = ttm->index(start, TransactionTableModel::Date, parent)
572 QString type = ttm->index(start, TransactionTableModel::Type, parent)
574 QString address = ttm->index(start, TransactionTableModel::ToAddress, parent)
576 QIcon icon = qvariant_cast<QIcon>(ttm->index(start,
577 TransactionTableModel::ToAddress, parent)
578 .data(Qt::DecorationRole));
580 notificator->notify(Notificator::Information,
581 (amount)<0 ? tr("Sent transaction") :
582 tr("Incoming transaction"),
588 .arg(BitcoinUnits::formatWithUnit(walletModel->getOptionsModel()->getDisplayUnit(), amount, true))
590 .arg(address), icon);
594 void BitcoinGUI::gotoOverviewPage()
597 overviewAction->setChecked(true);
598 centralWidget->setCurrentWidget(overviewPage);
600 exportAction->setEnabled(false);
601 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
604 void BitcoinGUI::gotoHistoryPage()
607 historyAction->setChecked(true);
608 centralWidget->setCurrentWidget(transactionsPage);
610 exportAction->setEnabled(true);
611 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
612 connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked()));
615 void BitcoinGUI::gotoAddressBookPage()
618 addressBookAction->setChecked(true);
619 centralWidget->setCurrentWidget(addressBookPage);
621 exportAction->setEnabled(true);
622 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
623 connect(exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked()));
626 void BitcoinGUI::gotoReceiveCoinsPage()
629 receiveCoinsAction->setChecked(true);
630 centralWidget->setCurrentWidget(receiveCoinsPage);
632 exportAction->setEnabled(true);
633 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
634 connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked()));
637 void BitcoinGUI::gotoSendCoinsPage()
640 sendCoinsAction->setChecked(true);
641 centralWidget->setCurrentWidget(sendCoinsPage);
643 exportAction->setEnabled(false);
644 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
647 void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)
650 if(event->mimeData()->hasUrls())
651 event->acceptProposedAction();
654 void BitcoinGUI::dropEvent(QDropEvent *event)
656 if(event->mimeData()->hasUrls())
659 QList<QUrl> urls = event->mimeData()->urls();
660 foreach(const QUrl &url, urls)
662 sendCoinsPage->handleURL(&url);
666 event->acceptProposedAction();
669 void BitcoinGUI::setEncryptionStatus(int status)
673 case WalletModel::Unencrypted:
674 labelEncryptionIcon->hide();
675 encryptWalletAction->setChecked(false);
676 changePassphraseAction->setEnabled(false);
677 encryptWalletAction->setEnabled(true);
679 case WalletModel::Unlocked:
680 labelEncryptionIcon->show();
681 labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
682 labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
683 encryptWalletAction->setChecked(true);
684 changePassphraseAction->setEnabled(true);
685 encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
687 case WalletModel::Locked:
688 labelEncryptionIcon->show();
689 labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_closed").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
690 labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>"));
691 encryptWalletAction->setChecked(true);
692 changePassphraseAction->setEnabled(true);
693 encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
698 void BitcoinGUI::encryptWallet(bool status)
702 AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt:
703 AskPassphraseDialog::Decrypt, this);
704 dlg.setModel(walletModel);
707 setEncryptionStatus(walletModel->getEncryptionStatus());
710 void BitcoinGUI::changePassphrase()
712 AskPassphraseDialog dlg(AskPassphraseDialog::ChangePass, this);
713 dlg.setModel(walletModel);
717 void BitcoinGUI::unlockWallet()
721 // Unlock wallet when requested by wallet model
722 if(walletModel->getEncryptionStatus() == WalletModel::Locked)
724 AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this);
725 dlg.setModel(walletModel);