Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | : QMainWindow(parent), enableWallet(false), clientModel(0), walletFrame(0), | ||||
unitDisplayControl(0), labelWalletEncryptionIcon(0), | unitDisplayControl(0), labelWalletEncryptionIcon(0), | ||||
labelWalletHDStatusIcon(0), connectionsControl(0), labelBlocksIcon(0), | labelWalletHDStatusIcon(0), connectionsControl(0), labelBlocksIcon(0), | ||||
progressBarLabel(0), progressBar(0), progressDialog(0), appMenuBar(0), | progressBarLabel(0), progressBar(0), progressDialog(0), appMenuBar(0), | ||||
overviewAction(0), historyAction(0), quitAction(0), sendCoinsAction(0), | overviewAction(0), historyAction(0), quitAction(0), sendCoinsAction(0), | ||||
sendCoinsMenuAction(0), usedSendingAddressesAction(0), | sendCoinsMenuAction(0), usedSendingAddressesAction(0), | ||||
usedReceivingAddressesAction(0), signMessageAction(0), | usedReceivingAddressesAction(0), signMessageAction(0), | ||||
verifyMessageAction(0), aboutAction(0), receiveCoinsAction(0), | verifyMessageAction(0), aboutAction(0), receiveCoinsAction(0), | ||||
receiveCoinsMenuAction(0), optionsAction(0), toggleHideAction(0), | receiveCoinsMenuAction(0), optionsAction(0), toggleHideAction(0), | ||||
encryptWalletAction(0), backupWalletAction(0), changePassphraseAction(0), | encryptWalletAction(0), encryptWalletAdvancedAction(0), | ||||
aboutQtAction(0), openRPCConsoleAction(0), openAction(0), | backupWalletAction(0), changePassphraseAction(0), aboutQtAction(0), | ||||
showHelpMessageAction(0), trayIcon(0), trayIconMenu(0), notificator(0), | openRPCConsoleAction(0), openAction(0), showHelpMessageAction(0), | ||||
rpcConsole(0), helpMessageDialog(0), modalOverlay(0), prevBlocks(0), | trayIcon(0), trayIconMenu(0), notificator(0), rpcConsole(0), | ||||
spinnerFrame(0), platformStyle(_platformStyle), cfg(cfg) { | helpMessageDialog(0), modalOverlay(0), prevBlocks(0), spinnerFrame(0), | ||||
platformStyle(_platformStyle), cfg(cfg) { | |||||
GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); | GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); | ||||
QString windowTitle = tr(PACKAGE_NAME) + " - "; | QString windowTitle = tr(PACKAGE_NAME) + " - "; | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
enableWallet = WalletModel::isWalletEnabled(); | enableWallet = WalletModel::isWalletEnabled(); | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
if (enableWallet) { | if (enableWallet) { | ||||
windowTitle += tr("Wallet"); | windowTitle += tr("Wallet"); | ||||
▲ Show 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | #endif // ENABLE_WALLET | ||||
toggleHideAction->setStatusTip(tr("Show or hide the main Window")); | toggleHideAction->setStatusTip(tr("Show or hide the main Window")); | ||||
encryptWalletAction = | encryptWalletAction = | ||||
new QAction(platformStyle->TextColorIcon(":/icons/lock_closed"), | new QAction(platformStyle->TextColorIcon(":/icons/lock_closed"), | ||||
tr("&Encrypt Wallet..."), this); | tr("&Encrypt Wallet..."), this); | ||||
encryptWalletAction->setStatusTip( | encryptWalletAction->setStatusTip( | ||||
tr("Encrypt the private keys that belong to your wallet")); | tr("Encrypt the private keys that belong to your wallet")); | ||||
encryptWalletAction->setCheckable(true); | encryptWalletAction->setCheckable(true); | ||||
encryptWalletAdvancedAction = | |||||
new QAction(platformStyle->TextColorIcon(":/icons/lock_closed"), | |||||
tr("&Encrypt Wallet Advanced..."), this); | |||||
encryptWalletAdvancedAction->setStatusTip( | |||||
tr("Encrypt and Recover or Manually Generate your wallet's HD key")); | |||||
encryptWalletAdvancedAction->setCheckable(true); | |||||
backupWalletAction = | backupWalletAction = | ||||
new QAction(platformStyle->TextColorIcon(":/icons/filesave"), | new QAction(platformStyle->TextColorIcon(":/icons/filesave"), | ||||
tr("&Backup Wallet..."), this); | tr("&Backup Wallet..."), this); | ||||
backupWalletAction->setStatusTip(tr("Backup wallet to another location")); | backupWalletAction->setStatusTip(tr("Backup wallet to another location")); | ||||
changePassphraseAction = | changePassphraseAction = | ||||
new QAction(platformStyle->TextColorIcon(":/icons/key"), | new QAction(platformStyle->TextColorIcon(":/icons/key"), | ||||
tr("&Change Passphrase..."), this); | tr("&Change Passphrase..."), this); | ||||
changePassphraseAction->setStatusTip( | changePassphraseAction->setStatusTip( | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | #endif // ENABLE_WALLET | ||||
// prevents an open debug window from becoming stuck/unusable on client | // prevents an open debug window from becoming stuck/unusable on client | ||||
// shutdown | // shutdown | ||||
connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide())); | connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide())); | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
if (walletFrame) { | if (walletFrame) { | ||||
connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, | connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, | ||||
SLOT(encryptWallet(bool))); | SLOT(encryptWallet(bool))); | ||||
connect(encryptWalletAdvancedAction, SIGNAL(triggered(bool)), | |||||
walletFrame, SLOT(encryptWalletAdvanced(bool))); | |||||
connect(backupWalletAction, SIGNAL(triggered()), walletFrame, | connect(backupWalletAction, SIGNAL(triggered()), walletFrame, | ||||
SLOT(backupWallet())); | SLOT(backupWallet())); | ||||
connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, | connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, | ||||
SLOT(changePassphrase())); | SLOT(changePassphrase())); | ||||
connect(signMessageAction, SIGNAL(triggered()), this, | connect(signMessageAction, SIGNAL(triggered()), this, | ||||
SLOT(gotoSignMessageTab())); | SLOT(gotoSignMessageTab())); | ||||
connect(verifyMessageAction, SIGNAL(triggered()), this, | connect(verifyMessageAction, SIGNAL(triggered()), this, | ||||
SLOT(gotoVerifyMessageTab())); | SLOT(gotoVerifyMessageTab())); | ||||
Show All 33 Lines | if (walletFrame) { | ||||
file->addAction(usedReceivingAddressesAction); | file->addAction(usedReceivingAddressesAction); | ||||
file->addSeparator(); | file->addSeparator(); | ||||
} | } | ||||
file->addAction(quitAction); | file->addAction(quitAction); | ||||
QMenu *settings = appMenuBar->addMenu(tr("&Settings")); | QMenu *settings = appMenuBar->addMenu(tr("&Settings")); | ||||
if (walletFrame) { | if (walletFrame) { | ||||
settings->addAction(encryptWalletAction); | settings->addAction(encryptWalletAction); | ||||
settings->addAction(encryptWalletAdvancedAction); | |||||
settings->addAction(changePassphraseAction); | settings->addAction(changePassphraseAction); | ||||
settings->addSeparator(); | settings->addSeparator(); | ||||
} | } | ||||
settings->addAction(optionsAction); | settings->addAction(optionsAction); | ||||
QMenu *help = appMenuBar->addMenu(tr("&Help")); | QMenu *help = appMenuBar->addMenu(tr("&Help")); | ||||
if (walletFrame) { | if (walletFrame) { | ||||
help->addAction(openRPCConsoleAction); | help->addAction(openRPCConsoleAction); | ||||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | |||||
void BitcoinGUI::setWalletActionsEnabled(bool enabled) { | void BitcoinGUI::setWalletActionsEnabled(bool enabled) { | ||||
overviewAction->setEnabled(enabled); | overviewAction->setEnabled(enabled); | ||||
sendCoinsAction->setEnabled(enabled); | sendCoinsAction->setEnabled(enabled); | ||||
sendCoinsMenuAction->setEnabled(enabled); | sendCoinsMenuAction->setEnabled(enabled); | ||||
receiveCoinsAction->setEnabled(enabled); | receiveCoinsAction->setEnabled(enabled); | ||||
receiveCoinsMenuAction->setEnabled(enabled); | receiveCoinsMenuAction->setEnabled(enabled); | ||||
historyAction->setEnabled(enabled); | historyAction->setEnabled(enabled); | ||||
encryptWalletAction->setEnabled(enabled); | encryptWalletAction->setEnabled(enabled); | ||||
encryptWalletAdvancedAction->setEnabled(enabled); | |||||
backupWalletAction->setEnabled(enabled); | backupWalletAction->setEnabled(enabled); | ||||
changePassphraseAction->setEnabled(enabled); | changePassphraseAction->setEnabled(enabled); | ||||
signMessageAction->setEnabled(enabled); | signMessageAction->setEnabled(enabled); | ||||
verifyMessageAction->setEnabled(enabled); | verifyMessageAction->setEnabled(enabled); | ||||
usedSendingAddressesAction->setEnabled(enabled); | usedSendingAddressesAction->setEnabled(enabled); | ||||
usedReceivingAddressesAction->setEnabled(enabled); | usedReceivingAddressesAction->setEnabled(enabled); | ||||
openAction->setEnabled(enabled); | openAction->setEnabled(enabled); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 469 Lines • ▼ Show 20 Lines | void BitcoinGUI::setHDStatus(int hdEnabled) { | ||||
labelWalletHDStatusIcon->setEnabled(hdEnabled); | labelWalletHDStatusIcon->setEnabled(hdEnabled); | ||||
} | } | ||||
void BitcoinGUI::setEncryptionStatus(int status) { | void BitcoinGUI::setEncryptionStatus(int status) { | ||||
switch (status) { | switch (status) { | ||||
case WalletModel::Unencrypted: | case WalletModel::Unencrypted: | ||||
labelWalletEncryptionIcon->hide(); | labelWalletEncryptionIcon->hide(); | ||||
encryptWalletAction->setChecked(false); | encryptWalletAction->setChecked(false); | ||||
encryptWalletAdvancedAction->setChecked(false); | |||||
changePassphraseAction->setEnabled(false); | changePassphraseAction->setEnabled(false); | ||||
encryptWalletAction->setEnabled(true); | encryptWalletAction->setEnabled(true); | ||||
encryptWalletAdvancedAction->setEnabled(true); | |||||
break; | break; | ||||
case WalletModel::Unlocked: | case WalletModel::Unlocked: | ||||
labelWalletEncryptionIcon->show(); | labelWalletEncryptionIcon->show(); | ||||
labelWalletEncryptionIcon->setPixmap( | labelWalletEncryptionIcon->setPixmap( | ||||
platformStyle->SingleColorIcon(":/icons/lock_open") | platformStyle->SingleColorIcon(":/icons/lock_open") | ||||
.pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); | .pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); | ||||
labelWalletEncryptionIcon->setToolTip( | labelWalletEncryptionIcon->setToolTip( | ||||
tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>")); | tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>")); | ||||
encryptWalletAction->setChecked(true); | encryptWalletAction->setChecked(true); | ||||
encryptWalletAdvancedAction->setChecked(true); | |||||
changePassphraseAction->setEnabled(true); | changePassphraseAction->setEnabled(true); | ||||
encryptWalletAction->setEnabled( | encryptWalletAction->setEnabled( | ||||
false); // TODO: decrypt currently not supported | false); // TODO: decrypt currently not supported | ||||
encryptWalletAdvancedAction->setEnabled( | |||||
false); // TODO: decrypt currently not supported | |||||
break; | break; | ||||
case WalletModel::Locked: | case WalletModel::Locked: | ||||
labelWalletEncryptionIcon->show(); | labelWalletEncryptionIcon->show(); | ||||
labelWalletEncryptionIcon->setPixmap( | labelWalletEncryptionIcon->setPixmap( | ||||
platformStyle->SingleColorIcon(":/icons/lock_closed") | platformStyle->SingleColorIcon(":/icons/lock_closed") | ||||
.pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); | .pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); | ||||
labelWalletEncryptionIcon->setToolTip( | labelWalletEncryptionIcon->setToolTip( | ||||
tr("Wallet is <b>encrypted</b> and currently <b>locked</b>")); | tr("Wallet is <b>encrypted</b> and currently <b>locked</b>")); | ||||
encryptWalletAction->setChecked(true); | encryptWalletAction->setChecked(true); | ||||
encryptWalletAdvancedAction->setChecked(true); | |||||
changePassphraseAction->setEnabled(true); | changePassphraseAction->setEnabled(true); | ||||
encryptWalletAction->setEnabled( | encryptWalletAction->setEnabled( | ||||
false); // TODO: decrypt currently not supported | false); // TODO: decrypt currently not supported | ||||
encryptWalletAdvancedAction->setEnabled( | |||||
false); // TODO: decrypt currently not supported | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { | void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { | ||||
if (!clientModel) return; | if (!clientModel) return; | ||||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |