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),
65 setWindowTitle(tr("Bitcoin Wallet"));
67 setWindowIcon(QIcon(":icons/bitcoin"));
69 setUnifiedTitleAndToolBarOnMac(true);
70 QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
75 // Create actions for the toolbar, menu bar and tray/dock icon
78 // Create application menu bar
81 // Create the toolbars
84 // Create the tray icon (or setup the dock icon)
88 overviewPage = new OverviewPage();
90 transactionsPage = new QWidget(this);
91 QVBoxLayout *vbox = new QVBoxLayout();
92 transactionView = new TransactionView(this);
93 vbox->addWidget(transactionView);
94 transactionsPage->setLayout(vbox);
96 addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);
98 receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);
100 sendCoinsPage = new SendCoinsDialog(this);
102 centralWidget = new QStackedWidget(this);
103 centralWidget->addWidget(overviewPage);
104 centralWidget->addWidget(transactionsPage);
105 centralWidget->addWidget(addressBookPage);
106 centralWidget->addWidget(receiveCoinsPage);
107 centralWidget->addWidget(sendCoinsPage);
108 setCentralWidget(centralWidget);
113 // Status bar notification icons
114 QFrame *frameBlocks = new QFrame();
115 //frameBlocks->setFrameStyle(QFrame::Panel | QFrame::Sunken);
116 frameBlocks->setContentsMargins(0,0,0,0);
117 frameBlocks->setMinimumWidth(56);
118 frameBlocks->setMaximumWidth(56);
119 QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);
120 frameBlocksLayout->setContentsMargins(3,0,3,0);
121 frameBlocksLayout->setSpacing(3);
122 labelEncryptionIcon = new QLabel();
123 labelConnectionsIcon = new QLabel();
124 labelBlocksIcon = new QLabel();
125 frameBlocksLayout->addStretch();
126 frameBlocksLayout->addWidget(labelEncryptionIcon);
127 frameBlocksLayout->addStretch();
128 frameBlocksLayout->addWidget(labelConnectionsIcon);
129 frameBlocksLayout->addStretch();
130 frameBlocksLayout->addWidget(labelBlocksIcon);
131 frameBlocksLayout->addStretch();
133 // Progress bar for blocks download
134 progressBarLabel = new QLabel(tr("Synchronizing with network..."));
135 progressBarLabel->setVisible(false);
136 progressBar = new QProgressBar();
137 progressBar->setToolTip(tr("Block chain synchronization in progress"));
138 progressBar->setVisible(false);
140 statusBar()->addWidget(progressBarLabel);
141 statusBar()->addWidget(progressBar);
142 statusBar()->addPermanentWidget(frameBlocks);
144 syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);
146 // Clicking on a transaction on the overview page simply sends you to transaction history page
147 connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
149 // Doubleclicking on a transaction on the transaction history page shows details
150 connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));
155 BitcoinGUI::~BitcoinGUI()
162 void BitcoinGUI::createActions()
164 QActionGroup *tabGroup = new QActionGroup(this);
166 overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this);
167 overviewAction->setToolTip(tr("Show general overview of wallet"));
168 overviewAction->setCheckable(true);
169 overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));
170 tabGroup->addAction(overviewAction);
172 historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this);
173 historyAction->setToolTip(tr("Browse transaction history"));
174 historyAction->setCheckable(true);
175 historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
176 tabGroup->addAction(historyAction);
178 addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this);
179 addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels"));
180 addressBookAction->setCheckable(true);
181 addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
182 tabGroup->addAction(addressBookAction);
184 receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this);
185 receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments"));
186 receiveCoinsAction->setCheckable(true);
187 receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
188 tabGroup->addAction(receiveCoinsAction);
190 sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this);
191 sendCoinsAction->setToolTip(tr("Send coins to a bitcoin address"));
192 sendCoinsAction->setCheckable(true);
193 sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
194 tabGroup->addAction(sendCoinsAction);
196 connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));
197 connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
198 connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
199 connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
200 connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
202 quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
203 quitAction->setToolTip(tr("Quit application"));
204 quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
205 quitAction->setMenuRole(QAction::QuitRole);
206 aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About %1").arg(qApp->applicationName()), this);
207 aboutAction->setToolTip(tr("Show information about Bitcoin"));
208 aboutAction->setMenuRole(QAction::AboutRole);
209 aboutQtAction = new QAction(tr("About &Qt"), this);
210 aboutQtAction->setToolTip(tr("Show information about Qt"));
211 aboutQtAction->setMenuRole(QAction::AboutQtRole);
212 optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);
213 optionsAction->setToolTip(tr("Modify configuration options for bitcoin"));
214 optionsAction->setMenuRole(QAction::PreferencesRole);
215 openBitcoinAction = new QAction(QIcon(":/icons/bitcoin"), tr("Open &Bitcoin"), this);
216 openBitcoinAction->setToolTip(tr("Show the Bitcoin window"));
217 exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this);
218 exportAction->setToolTip(tr("Export the current view to a file"));
219 encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet"), this);
220 encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet"));
221 encryptWalletAction->setCheckable(true);
222 changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase"), this);
223 changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption"));
225 connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
226 connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
227 connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
228 connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
229 connect(openBitcoinAction, SIGNAL(triggered()), this, SLOT(showNormal()));
230 connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool)));
231 connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase()));
234 void BitcoinGUI::createMenuBar()
237 // Create a decoupled menu bar on Mac which stays even if the window is closed
238 appMenuBar = new QMenuBar();
240 // Get the main window's menu bar on other platforms
241 appMenuBar = menuBar();
244 // Configure the menus
245 QMenu *file = appMenuBar->addMenu(tr("&File"));
246 file->addAction(quitAction);
248 QMenu *settings = appMenuBar->addMenu(tr("&Settings"));
249 settings->addAction(encryptWalletAction);
250 settings->addAction(changePassphraseAction);
251 settings->addSeparator();
252 settings->addAction(optionsAction);
254 QMenu *help = appMenuBar->addMenu(tr("&Help"));
255 help->addAction(aboutAction);
256 help->addAction(aboutQtAction);
259 void BitcoinGUI::createToolBars()
261 QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
262 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
263 toolbar->addAction(overviewAction);
264 toolbar->addAction(sendCoinsAction);
265 toolbar->addAction(receiveCoinsAction);
266 toolbar->addAction(historyAction);
267 toolbar->addAction(addressBookAction);
269 QToolBar *toolbar2 = addToolBar(tr("Actions toolbar"));
270 toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
271 toolbar2->addAction(exportAction);
274 void BitcoinGUI::setClientModel(ClientModel *clientModel)
276 this->clientModel = clientModel;
279 if(clientModel->isTestNet())
281 QString title_testnet = windowTitle() + QString(" ") + tr("[testnet]");
282 setWindowTitle(title_testnet);
284 setWindowIcon(QIcon(":icons/bitcoin_testnet"));
286 MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet"));
290 trayIcon->setToolTip(title_testnet);
291 trayIcon->setIcon(QIcon(":/icons/toolbar_testnet"));
295 // Keep up to date with client
296 setNumConnections(clientModel->getNumConnections());
297 connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
299 setNumBlocks(clientModel->getNumBlocks());
300 connect(clientModel, SIGNAL(numBlocksChanged(int)), this, SLOT(setNumBlocks(int)));
302 // Report errors from network/worker thread
303 connect(clientModel, SIGNAL(error(QString,QString)), this, SLOT(error(QString,QString)));
307 void BitcoinGUI::setWalletModel(WalletModel *walletModel)
309 this->walletModel = walletModel;
312 // Report errors from wallet thread
313 connect(walletModel, SIGNAL(error(QString,QString)), this, SLOT(error(QString,QString)));
315 // Put transaction list in tabs
316 transactionView->setModel(walletModel);
318 overviewPage->setModel(walletModel);
319 addressBookPage->setModel(walletModel->getAddressTableModel());
320 receiveCoinsPage->setModel(walletModel->getAddressTableModel());
321 sendCoinsPage->setModel(walletModel);
323 setEncryptionStatus(walletModel->getEncryptionStatus());
324 connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SLOT(setEncryptionStatus(int)));
326 // Balloon popup for new transaction
327 connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
328 this, SLOT(incomingTransaction(QModelIndex,int,int)));
330 // Ask for passphrase if needed
331 connect(walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet()));
335 void BitcoinGUI::createTrayIcon()
339 trayIcon = new QSystemTrayIcon(this);
340 trayIconMenu = new QMenu(this);
341 trayIcon->setContextMenu(trayIconMenu);
342 trayIcon->setToolTip("Bitcoin client");
343 trayIcon->setIcon(QIcon(":/icons/toolbar"));
344 connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
345 this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason)));
348 // Note: On Mac, the dock icon is used to provide the tray's functionality.
349 MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance();
350 connect(dockIconHandler, SIGNAL(dockIconClicked()), openBitcoinAction, SLOT(trigger()));
351 trayIconMenu = dockIconHandler->dockMenu();
354 // Configuration of the tray icon (or dock icon) icon menu
355 trayIconMenu->addAction(openBitcoinAction);
356 trayIconMenu->addSeparator();
357 trayIconMenu->addAction(receiveCoinsAction);
358 trayIconMenu->addAction(sendCoinsAction);
359 trayIconMenu->addSeparator();
360 trayIconMenu->addAction(optionsAction);
361 #ifndef Q_WS_MAC // This is built-in on Mac
362 trayIconMenu->addSeparator();
363 trayIconMenu->addAction(quitAction);
366 notificator = new Notificator(tr("bitcoin-qt"), trayIcon);
370 void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
372 if(reason == QSystemTrayIcon::Trigger)
374 // Click on system tray icon triggers "open bitcoin"
375 openBitcoinAction->trigger();
381 void BitcoinGUI::optionsClicked()
383 if(!clientModel || !clientModel->getOptionsModel())
386 dlg.setModel(clientModel->getOptionsModel());
390 void BitcoinGUI::aboutClicked()
393 dlg.setModel(clientModel);
397 void BitcoinGUI::setNumConnections(int count)
402 case 0: icon = ":/icons/connect_0"; break;
403 case 1: case 2: case 3: icon = ":/icons/connect_1"; break;
404 case 4: case 5: case 6: icon = ":/icons/connect_2"; break;
405 case 7: case 8: case 9: icon = ":/icons/connect_3"; break;
406 default: icon = ":/icons/connect_4"; break;
408 labelConnectionsIcon->setPixmap(QIcon(icon).pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
409 labelConnectionsIcon->setToolTip(tr("%n active connection(s) to Bitcoin network", "", count));
412 void BitcoinGUI::setNumBlocks(int count)
416 int initTotal = clientModel->getNumBlocksAtStartup();
417 int total = clientModel->getNumBlocksOfPeers();
422 if (clientModel->getStatusBarWarnings() == "")
424 progressBarLabel->setVisible(true);
425 progressBarLabel->setText(tr("Synchronizing with network..."));
426 progressBar->setVisible(true);
427 progressBar->setMaximum(total - initTotal);
428 progressBar->setValue(count - initTotal);
432 progressBarLabel->setText(clientModel->getStatusBarWarnings());
433 progressBarLabel->setVisible(true);
434 progressBar->setVisible(false);
436 tooltip = tr("Downloaded %1 of %2 blocks of transaction history.").arg(count).arg(total);
440 if (clientModel->getStatusBarWarnings() == "")
441 progressBarLabel->setVisible(false);
444 progressBarLabel->setText(clientModel->getStatusBarWarnings());
445 progressBarLabel->setVisible(true);
447 progressBar->setVisible(false);
448 tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count);
451 QDateTime now = QDateTime::currentDateTime();
452 QDateTime lastBlockDate = clientModel->getLastBlockDate();
453 int secs = lastBlockDate.secsTo(now);
456 // Represent time from last generated block in human readable text
459 text = tr("%n second(s) ago","",secs);
461 else if(secs < 60*60)
463 text = tr("%n minute(s) ago","",secs/60);
465 else if(secs < 24*60*60)
467 text = tr("%n hour(s) ago","",secs/(60*60));
471 text = tr("%n day(s) ago","",secs/(60*60*24));
474 // Set icon state: spinning if catching up, tick otherwise
477 tooltip = tr("Up to date") + QString("\n") + tooltip;
478 labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
482 tooltip = tr("Catching up...") + QString("\n") + tooltip;
483 labelBlocksIcon->setMovie(syncIconMovie);
484 syncIconMovie->start();
487 tooltip += QString("\n");
488 tooltip += tr("Last received block was generated %1.").arg(text);
490 labelBlocksIcon->setToolTip(tooltip);
491 progressBarLabel->setToolTip(tooltip);
492 progressBar->setToolTip(tooltip);
495 void BitcoinGUI::refreshStatusBar()
497 /* Might display multiple times in the case of multiple alerts
498 static QString prevStatusBar;
499 QString newStatusBar = clientModel->getStatusBarWarnings();
500 if (prevStatusBar != newStatusBar)
502 prevStatusBar = newStatusBar;
503 error(tr("Network Alert"), newStatusBar);
505 setNumBlocks(clientModel->getNumBlocks());
508 void BitcoinGUI::error(const QString &title, const QString &message)
510 // Report errors from network/worker thread
511 notificator->notify(Notificator::Critical, title, message);
514 void BitcoinGUI::changeEvent(QEvent *e)
516 #ifndef Q_WS_MAC // Ignored on Mac
517 if(e->type() == QEvent::WindowStateChange)
519 if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray())
534 QMainWindow::changeEvent(e);
537 void BitcoinGUI::closeEvent(QCloseEvent *event)
541 #ifndef Q_WS_MAC // Ignored on Mac
542 if(!clientModel->getOptionsModel()->getMinimizeToTray() &&
543 !clientModel->getOptionsModel()->getMinimizeOnClose())
549 QMainWindow::closeEvent(event);
552 void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee)
555 tr("This transaction is over the size limit. You can still send it for a fee of %1, "
556 "which goes to the nodes that process your transaction and helps to support the network. "
557 "Do you want to pay the fee?").arg(
558 BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nFeeRequired));
559 QMessageBox::StandardButton retval = QMessageBox::question(
560 this, tr("Sending..."), strMessage,
561 QMessageBox::Yes|QMessageBox::Cancel, QMessageBox::Yes);
562 *payFee = (retval == QMessageBox::Yes);
565 void BitcoinGUI::incomingTransaction(const QModelIndex & parent, int start, int end)
567 if(!walletModel || !clientModel)
569 TransactionTableModel *ttm = walletModel->getTransactionTableModel();
570 qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent)
571 .data(Qt::EditRole).toULongLong();
572 if(!clientModel->inInitialBlockDownload())
574 // On new transaction, make an info balloon
575 // Unless the initial block download is in progress, to prevent balloon-spam
576 QString date = ttm->index(start, TransactionTableModel::Date, parent)
578 QString type = ttm->index(start, TransactionTableModel::Type, parent)
580 QString address = ttm->index(start, TransactionTableModel::ToAddress, parent)
582 QIcon icon = qvariant_cast<QIcon>(ttm->index(start,
583 TransactionTableModel::ToAddress, parent)
584 .data(Qt::DecorationRole));
586 notificator->notify(Notificator::Information,
587 (amount)<0 ? tr("Sent transaction") :
588 tr("Incoming transaction"),
594 .arg(BitcoinUnits::formatWithUnit(walletModel->getOptionsModel()->getDisplayUnit(), amount, true))
596 .arg(address), icon);
600 void BitcoinGUI::gotoOverviewPage()
603 overviewAction->setChecked(true);
604 centralWidget->setCurrentWidget(overviewPage);
606 exportAction->setEnabled(false);
607 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
610 void BitcoinGUI::gotoHistoryPage()
613 historyAction->setChecked(true);
614 centralWidget->setCurrentWidget(transactionsPage);
616 exportAction->setEnabled(true);
617 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
618 connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked()));
621 void BitcoinGUI::gotoAddressBookPage()
624 addressBookAction->setChecked(true);
625 centralWidget->setCurrentWidget(addressBookPage);
627 exportAction->setEnabled(true);
628 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
629 connect(exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked()));
632 void BitcoinGUI::gotoReceiveCoinsPage()
635 receiveCoinsAction->setChecked(true);
636 centralWidget->setCurrentWidget(receiveCoinsPage);
638 exportAction->setEnabled(true);
639 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
640 connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked()));
643 void BitcoinGUI::gotoSendCoinsPage()
646 sendCoinsAction->setChecked(true);
647 centralWidget->setCurrentWidget(sendCoinsPage);
649 exportAction->setEnabled(false);
650 disconnect(exportAction, SIGNAL(triggered()), 0, 0);
653 void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)
656 if(event->mimeData()->hasUrls())
657 event->acceptProposedAction();
660 void BitcoinGUI::dropEvent(QDropEvent *event)
662 if(event->mimeData()->hasUrls())
665 QList<QUrl> urls = event->mimeData()->urls();
666 foreach(const QUrl &url, urls)
668 sendCoinsPage->handleURL(&url);
672 event->acceptProposedAction();
675 void BitcoinGUI::setEncryptionStatus(int status)
679 case WalletModel::Unencrypted:
680 labelEncryptionIcon->hide();
681 encryptWalletAction->setChecked(false);
682 changePassphraseAction->setEnabled(false);
683 encryptWalletAction->setEnabled(true);
685 case WalletModel::Unlocked:
686 labelEncryptionIcon->show();
687 labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
688 labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
689 encryptWalletAction->setChecked(true);
690 changePassphraseAction->setEnabled(true);
691 encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
693 case WalletModel::Locked:
694 labelEncryptionIcon->show();
695 labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_closed").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
696 labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>"));
697 encryptWalletAction->setChecked(true);
698 changePassphraseAction->setEnabled(true);
699 encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
704 void BitcoinGUI::encryptWallet(bool status)
708 AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt:
709 AskPassphraseDialog::Decrypt, this);
710 dlg.setModel(walletModel);
713 setEncryptionStatus(walletModel->getEncryptionStatus());
716 void BitcoinGUI::changePassphrase()
718 AskPassphraseDialog dlg(AskPassphraseDialog::ChangePass, this);
719 dlg.setModel(walletModel);
723 void BitcoinGUI::unlockWallet()
727 // Unlock wallet when requested by wallet model
728 if(walletModel->getEncryptionStatus() == WalletModel::Locked)
730 AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this);
731 dlg.setModel(walletModel);