diff options
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/bitcoin.cpp | 22 | ||||
-rw-r--r-- | src/qt/bitcoinamountfield.cpp | 2 | ||||
-rw-r--r-- | src/qt/bitcoingui.cpp | 32 | ||||
-rw-r--r-- | src/qt/bitcoingui.h | 16 | ||||
-rw-r--r-- | src/qt/bitcoinstrings.cpp | 10 | ||||
-rw-r--r-- | src/qt/guiutil.cpp | 11 | ||||
-rw-r--r-- | src/qt/locale/bitcoin_en.ts | 373 | ||||
-rw-r--r-- | src/qt/optionsmodel.cpp | 5 | ||||
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 2 | ||||
-rw-r--r-- | src/qt/walletview.cpp | 136 | ||||
-rw-r--r-- | src/qt/walletview.h | 30 |
11 files changed, 335 insertions, 304 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 346128c0c4..f079f3b0e9 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -11,6 +11,7 @@ #include "guiutil.h" #include "guiconstants.h" #include "init.h" +#include "util.h" #include "ui_interface.h" #include "paymentserver.h" @@ -82,16 +83,11 @@ static void InitMessage(const std::string &message) if(splashref) { splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(255,255,200)); - QApplication::instance()->processEvents(); + qApp->processEvents(); } printf("init message: %s\n", message.c_str()); } -static void QueueShutdown() -{ - QMetaObject::invokeMethod(QCoreApplication::instance(), "quit", Qt::QueuedConnection); -} - /* Translate string to current locale using Qt. */ @@ -185,7 +181,6 @@ int main(int argc, char *argv[]) uiInterface.ThreadSafeMessageBox.connect(ThreadSafeMessageBox); uiInterface.ThreadSafeAskFee.connect(ThreadSafeAskFee); uiInterface.InitMessage.connect(InitMessage); - uiInterface.QueueShutdown.connect(QueueShutdown); uiInterface.Translate.connect(Translate); // Show help message immediately after parsing command-line options (for "-lang") and setting locale, @@ -215,9 +210,16 @@ int main(int argc, char *argv[]) if (GUIUtil::GetStartOnSystemStartup()) GUIUtil::SetStartOnSystemStartup(true); + boost::thread_group threadGroup; + BitcoinGUI window; guiref = &window; - if(AppInit2()) + + QTimer* pollShutdownTimer = new QTimer(guiref); + QObject::connect(pollShutdownTimer, SIGNAL(timeout()), guiref, SLOT(detectShutdown())); + pollShutdownTimer->start(200); + + if(AppInit2(threadGroup)) { { // Put this in a block, so that the Model objects are cleaned up before @@ -258,7 +260,9 @@ int main(int argc, char *argv[]) guiref = 0; } // Shutdown the core and its threads, but don't exit Bitcoin-Qt here - Shutdown(NULL); + threadGroup.interrupt_all(); + threadGroup.join_all(); + Shutdown(); } else { diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index 4fa2ca508b..b12e296f99 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -98,7 +98,7 @@ bool BitcoinAmountField::eventFilter(QObject *object, QEvent *event) { // Translate a comma into a period QKeyEvent periodKeyEvent(event->type(), Qt::Key_Period, keyEvent->modifiers(), ".", keyEvent->isAutoRepeat(), keyEvent->count()); - qApp->sendEvent(object, &periodKeyEvent); + QApplication::sendEvent(object, &periodKeyEvent); return true; } } diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index e41ce96082..9da5b85006 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -24,6 +24,7 @@ #include "rpcconsole.h" #include "ui_interface.h" #include "wallet.h" +#include "init.h" #ifdef Q_OS_MAC #include "macdockiconhandler.h" @@ -56,7 +57,7 @@ const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; -BitcoinGUI::BitcoinGUI(QWidget *parent): +BitcoinGUI::BitcoinGUI(QWidget *parent) : QMainWindow(parent), clientModel(0), encryptWalletAction(0), @@ -70,7 +71,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): restoreWindowGeometry(); setWindowTitle(tr("Bitcoin") + " - " + tr("Wallet")); #ifndef Q_OS_MAC - qApp->setWindowIcon(QIcon(":icons/bitcoin")); + QApplication::setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); @@ -94,7 +95,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): // Create wallet frame and make it the central widget walletFrame = new WalletFrame(this); setCentralWidget(walletFrame); - + // Create status bar statusBar(); @@ -127,7 +128,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html - QString curStyle = qApp->style()->metaObject()->className(); + QString curStyle = QApplication::style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }"); @@ -167,14 +168,14 @@ void BitcoinGUI::createActions() overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); - sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); + sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send"), this); sendCoinsAction->setStatusTip(tr("Send coins to a Bitcoin address")); sendCoinsAction->setToolTip(sendCoinsAction->statusTip()); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); - receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this); + receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive"), this); receiveCoinsAction->setStatusTip(tr("Show the list of addresses for receiving payments")); receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip()); receiveCoinsAction->setCheckable(true); @@ -188,7 +189,7 @@ void BitcoinGUI::createActions() historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); - addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this); + addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Addresses"), this); addressBookAction->setStatusTip(tr("Edit the list of stored addresses and labels")); addressBookAction->setToolTip(addressBookAction->statusTip()); addressBookAction->setCheckable(true); @@ -221,6 +222,7 @@ void BitcoinGUI::createActions() optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); + encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet")); encryptWalletAction->setCheckable(true); @@ -308,7 +310,7 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) { setWindowTitle(windowTitle() + QString(" ") + tr("[testnet]")); #ifndef Q_OS_MAC - qApp->setWindowIcon(QIcon(":icons/bitcoin_testnet")); + QApplication::setWindowIcon(QIcon(":icons/bitcoin_testnet")); setWindowIcon(QIcon(":icons/bitcoin_testnet")); #else MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet")); @@ -368,7 +370,7 @@ void BitcoinGUI::createTrayIcon() trayIcon->show(); #endif - notificator = new Notificator(qApp->applicationName(), trayIcon); + notificator = new Notificator(QApplication::applicationName(), trayIcon); } void BitcoinGUI::createTrayIconMenu() @@ -432,7 +434,7 @@ void BitcoinGUI::restoreWindowGeometry() QSize size = settings.value("nWindowSize", QSize(850, 550)).toSize(); if (!pos.x() && !pos.y()) { - QRect screen = qApp->desktop()->screenGeometry(); + QRect screen = QApplication::desktop()->screenGeometry(); pos.setX((screen.width()-size.width())/2); pos.setY((screen.height()-size.height())/2); } @@ -488,7 +490,7 @@ void BitcoinGUI::gotoSignMessageTab(QString addr) void BitcoinGUI::gotoVerifyMessageTab(QString addr) { - if (walletFrame) walletFrame->gotoSignMessageTab(addr); + if (walletFrame) walletFrame->gotoVerifyMessageTab(addr); } void BitcoinGUI::setNumConnections(int count) @@ -681,7 +683,7 @@ void BitcoinGUI::closeEvent(QCloseEvent *event) if(!clientModel->getOptionsModel()->getMinimizeToTray() && !clientModel->getOptionsModel()->getMinimizeOnClose()) { - qApp->quit(); + QApplication::quit(); } #endif } @@ -838,3 +840,9 @@ void BitcoinGUI::toggleHidden() { showNormalIfMinimized(true); } + +void BitcoinGUI::detectShutdown() +{ + if (ShutdownRequested()) + QMetaObject::invokeMethod(QCoreApplication::instance(), "quit", Qt::QueuedConnection); +} diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index c0cde97b6a..aba81cb3bc 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -29,6 +29,7 @@ class QStackedWidget; class QUrl; class QListWidget; class QPushButton; +class QAction; QT_END_NAMESPACE /** @@ -41,7 +42,7 @@ class BitcoinGUI : public QMainWindow public: static const QString DEFAULT_WALLET; - + explicit BitcoinGUI(QWidget *parent = 0); ~BitcoinGUI(); @@ -56,9 +57,17 @@ public: bool addWallet(const QString& name, WalletModel *walletModel); bool setCurrentWallet(const QString& name); - + void removeAllWallets(); + /** Used by WalletView to allow access to needed QActions */ + QAction * getOverviewAction() { return overviewAction; } + QAction * getHistoryAction() { return historyAction; } + QAction * getAddressBookAction() { return addressBookAction; } + QAction * getReceiveCoinsAction() { return receiveCoinsAction; } + QAction * getSendCoinsAction() { return sendCoinsAction; } + QAction * getExportAction() { return exportAction; } + protected: void changeEvent(QEvent *e); void closeEvent(QCloseEvent *event); @@ -190,6 +199,9 @@ private slots: void showNormalIfMinimized(bool fToggleHidden = false); /** Simply calls showNormalIfMinimized(true) for use in SLOT() macro */ void toggleHidden(); + + /** called by a timer to check if fRequestShutdown has been set **/ + void detectShutdown(); }; #endif // BITCOINGUI_H diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 328e3af9ef..2c500f4fe1 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -8,14 +8,16 @@ static const char UNUSED *bitcoin_strings[] = { QT_TRANSLATE_NOOP("bitcoin-core", "" "%s, you must set a rpcpassword in the configuration file:\n" -" %s\n" +"%s\n" "It is recommended you use the following random password:\n" "rpcuser=bitcoinrpc\n" "rpcpassword=%s\n" "(you do not need to remember this password)\n" "The username and password MUST NOT be the same.\n" "If the file does not exist, create it with owner-readable-only file " -"permissions.\n"), +"permissions.\n" +"It is also recommended to set alertnotify so you are notified of problems;\n" +"for example: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com\n"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:" "@STRENGTH)"), @@ -41,6 +43,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Error: This transaction requires a transaction fee of at least %s because of " "its amount, complexity, or use of recently received funds!"), QT_TRANSLATE_NOOP("bitcoin-core", "" +"Execute command when a relevant alert is received (%s in cmd is replaced by " +"message)"), +QT_TRANSLATE_NOOP("bitcoin-core", "" "Execute command when a wallet transaction changes (%s in cmd is replaced by " "TxID)"), QT_TRANSLATE_NOOP("bitcoin-core", "" @@ -129,7 +134,6 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write transaction index"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write undo data"), QT_TRANSLATE_NOOP("bitcoin-core", "Fee per KB to add to transactions you send"), QT_TRANSLATE_NOOP("bitcoin-core", "Find peers using DNS lookup (default: 1 unless -connect)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Find peers using internet relay chat (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins"), QT_TRANSLATE_NOOP("bitcoin-core", "Get help for a command"), QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 288, 0 = all)"), diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 06ccde3782..2105f0730e 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -160,8 +160,10 @@ void copyEntryData(QAbstractItemView *view, int column, int role) if(!selection.isEmpty()) { - // Copy first item - QApplication::clipboard()->setText(selection.at(0).data(role).toString(),QClipboard::Selection); + // Copy first item (global clipboard) + QApplication::clipboard()->setText(selection.at(0).data(role).toString(), QClipboard::Clipboard); + // Copy first item (global mouse selection for e.g. X11 - NOP on Windows) + QApplication::clipboard()->setText(selection.at(0).data(role).toString(), QClipboard::Selection); } } @@ -213,7 +215,7 @@ QString getSaveFileName(QWidget *parent, const QString &caption, Qt::ConnectionType blockingGUIThreadConnection() { - if(QThread::currentThread() != QCoreApplication::instance()->thread()) + if(QThread::currentThread() != qApp->thread()) { return Qt::BlockingQueuedConnection; } @@ -225,7 +227,7 @@ Qt::ConnectionType blockingGUIThreadConnection() bool checkPoint(const QPoint &p, const QWidget *w) { - QWidget *atW = qApp->widgetAt(w->mapToGlobal(p)); + QWidget *atW = QApplication::widgetAt(w->mapToGlobal(p)); if (!atW) return false; return atW->topLevelWidget() == w; } @@ -457,4 +459,3 @@ void HelpMessageBox::showOrPrint() } } // namespace GUIUtil - diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 806a72655e..c74b11d3d6 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -310,17 +310,17 @@ This product includes software developed by the OpenSSL Project for use in the O <context> <name>BitcoinGUI</name> <message> - <location filename="../bitcoingui.cpp" line="+269"/> + <location filename="../bitcoingui.cpp" line="+231"/> <source>Sign &message...</source> <translation>Sign &message...</translation> </message> <message> - <location line="+254"/> + <location line="+299"/> <source>Synchronizing with network...</source> <translation>Synchronizing with network...</translation> </message> <message> - <location line="-322"/> + <location line="-367"/> <source>&Overview</source> <translation>&Overview</translation> </message> @@ -340,32 +340,17 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Browse transaction history</translation> </message> <message> - <location line="+6"/> - <source>&Address Book</source> - <translation>&Address Book</translation> - </message> - <message> - <location line="+1"/> + <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Edit the list of stored addresses and labels</translation> </message> <message> - <location line="-15"/> - <source>&Receive coins</source> - <translation>&Receive coins</translation> - </message> - <message> - <location line="+1"/> + <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Show the list of addresses for receiving payments</translation> </message> <message> - <location line="-8"/> - <source>&Send coins</source> - <translation>&Send coins</translation> - </message> - <message> - <location line="+39"/> + <location line="+31"/> <source>E&xit</source> <translation>E&xit</translation> </message> @@ -410,7 +395,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Change Passphrase...</translation> </message> <message> - <location line="+259"/> + <location line="+304"/> <source>Importing blocks from disk...</source> <translation>Importing blocks from disk...</translation> </message> @@ -420,7 +405,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Reindexing blocks on disk...</translation> </message> <message> - <location line="-255"/> + <location line="-300"/> <source>&Export...</source> <translation>&Export...</translation> </message> @@ -465,18 +450,33 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Verify message...</translation> </message> <message> - <location line="-198"/> - <location line="+531"/> + <location line="-162"/> + <location line="+540"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> - <location line="-531"/> + <location line="-540"/> <source>Wallet</source> <translation>Wallet</translation> </message> <message> - <location line="+178"/> + <location line="+99"/> + <source>&Send</source> + <translation>&Send</translation> + </message> + <message> + <location line="+7"/> + <source>&Receive</source> + <translation>&Receive</translation> + </message> + <message> + <location line="+14"/> + <source>&Addresses</source> + <translation>&Addresses</translation> + </message> + <message> + <location line="+22"/> <source>&About Bitcoin</source> <translation>&About Bitcoin</translation> </message> @@ -537,12 +537,12 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>[testnet]</translation> </message> <message> - <location line="+63"/> + <location line="+47"/> <source>Bitcoin client</source> <translation>Bitcoin client</translation> </message> <message numerus="yes"> - <location line="+79"/> + <location line="+140"/> <source>%n active connection(s) to Bitcoin network</source> <translation> <numerusform>%n active connection to Bitcoin network</numerusform> @@ -619,17 +619,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</translation> </message> <message> - <location line="+213"/> - <source>Backup Successful</source> - <translation>Backup Successful</translation> - </message> - <message> - <location line="+0"/> - <source>The wallet data was successfully saved to the new location.</source> - <translation>The wallet data was successfully saved to the new location.</translation> - </message> - <message> - <location line="-351"/> + <location line="-138"/> <source>Up to date</source> <translation>Up to date</translation> </message> @@ -644,7 +634,7 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>Confirm transaction fee</translation> </message> <message> - <location line="+23"/> + <location line="+8"/> <source>Sent transaction</source> <translation>Sent transaction</translation> </message> @@ -667,14 +657,14 @@ Address: %4 </translation> </message> <message> - <location line="+102"/> - <location line="+28"/> + <location line="+33"/> + <location line="+23"/> <source>URI handling</source> <translation>URI handling</translation> </message> <message> - <location line="-28"/> - <location line="+28"/> + <location line="-23"/> + <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source> <translation>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</translation> </message> @@ -689,26 +679,6 @@ Address: %4 <translation>Wallet is <b>encrypted</b> and currently <b>locked</b></translation> </message> <message> - <location line="+23"/> - <source>Backup Wallet</source> - <translation>Backup Wallet</translation> - </message> - <message> - <location line="+0"/> - <source>Wallet Data (*.dat)</source> - <translation>Wallet Data (*.dat)</translation> - </message> - <message> - <location line="+3"/> - <source>Backup Failed</source> - <translation>Backup Failed</translation> - </message> - <message> - <location line="+0"/> - <source>There was an error trying to save the wallet data to the new location.</source> - <translation>There was an error trying to save the wallet data to the new location.</translation> - </message> - <message> <location filename="../bitcoin.cpp" line="+108"/> <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source> <translation>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</translation> @@ -1052,23 +1022,18 @@ Address: %4 <translation>Form</translation> </message> <message> - <location line="+51"/> - <location line="+183"/> + <location line="+50"/> + <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source> <translation>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</translation> </message> <message> - <location line="-141"/> + <location line="-124"/> <source>Balance:</source> <translation>Balance:</translation> </message> <message> - <location line="+58"/> - <source>Number of transactions:</source> - <translation>Number of transactions:</translation> - </message> - <message> - <location line="-29"/> + <location line="+29"/> <source>Unconfirmed:</source> <translation>Unconfirmed:</translation> </message> @@ -1078,7 +1043,7 @@ Address: %4 <translation>Wallet</translation> </message> <message> - <location line="+124"/> + <location line="+107"/> <source>Immature:</source> <translation>Immature:</translation> </message> @@ -1093,7 +1058,7 @@ Address: %4 <translation><b>Recent transactions</b></translation> </message> <message> - <location line="-118"/> + <location line="-101"/> <source>Your current balance</source> <translation>Your current balance</translation> </message> @@ -1103,11 +1068,6 @@ Address: %4 <translation>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</translation> </message> <message> - <location line="+20"/> - <source>Total number of transactions in wallet</source> - <translation>Total number of transactions in wallet</translation> - </message> - <message> <location filename="../overviewpage.cpp" line="+115"/> <location line="+1"/> <source>out of sync</source> @@ -2104,6 +2064,11 @@ Address: %4 </message> <message> <location line="+1"/> + <source>Copy transaction ID</source> + <translation>Copy transaction ID</translation> + </message> + <message> + <location line="+1"/> <source>Edit label</source> <translation>Edit label</translation> </message> @@ -2113,7 +2078,7 @@ Address: %4 <translation>Show transaction details</translation> </message> <message> - <location line="+137"/> + <location line="+139"/> <source>Export Transaction Data</source> <translation>Export Transaction Data</translation> </message> @@ -2168,7 +2133,7 @@ Address: %4 <translation>Could not write to file %1.</translation> </message> <message> - <location line="+95"/> + <location line="+100"/> <source>Range:</source> <translation>Range:</translation> </message> @@ -2179,14 +2144,157 @@ Address: %4 </message> </context> <context> + <name>WalletView</name> + <message> + <location filename="../walletview.cpp" line="+95"/> + <source>&Overview</source> + <translation>&Overview</translation> + </message> + <message> + <location line="+1"/> + <source>Show general overview of wallet</source> + <translation>Show general overview of wallet</translation> + </message> + <message> + <location line="+6"/> + <source>&Send coins</source> + <translation>&Send coins</translation> + </message> + <message> + <location line="+1"/> + <source>Send coins to a Bitcoin address</source> + <translation>Send coins to a Bitcoin address</translation> + </message> + <message> + <location line="+6"/> + <source>&Receive coins</source> + <translation>&Receive coins</translation> + </message> + <message> + <location line="+1"/> + <source>Show the list of addresses for receiving payments</source> + <translation>Show the list of addresses for receiving payments</translation> + </message> + <message> + <location line="+6"/> + <source>&Transactions</source> + <translation>&Transactions</translation> + </message> + <message> + <location line="+1"/> + <source>Browse transaction history</source> + <translation>Browse transaction history</translation> + </message> + <message> + <location line="+6"/> + <source>&Address Book</source> + <translation>&Address Book</translation> + </message> + <message> + <location line="+1"/> + <source>Edit the list of stored addresses and labels</source> + <translation>Edit the list of stored addresses and labels</translation> + </message> + <message> + <location line="+12"/> + <source>&Encrypt Wallet...</source> + <translation>&Encrypt Wallet...</translation> + </message> + <message> + <location line="+1"/> + <source>Encrypt the private keys that belong to your wallet</source> + <translation>Encrypt the private keys that belong to your wallet</translation> + </message> + <message> + <location line="+2"/> + <source>&Backup Wallet...</source> + <translation>&Backup Wallet...</translation> + </message> + <message> + <location line="+1"/> + <source>Backup wallet to another location</source> + <translation>Backup wallet to another location</translation> + </message> + <message> + <location line="+1"/> + <source>&Change Passphrase...</source> + <translation>&Change Passphrase...</translation> + </message> + <message> + <location line="+1"/> + <source>Change the passphrase used for wallet encryption</source> + <translation>Change the passphrase used for wallet encryption</translation> + </message> + <message> + <location line="+1"/> + <source>Sign &message...</source> + <translation>Sign &message...</translation> + </message> + <message> + <location line="+1"/> + <source>Sign messages with your Bitcoin addresses to prove you own them</source> + <translation>Sign messages with your Bitcoin addresses to prove you own them</translation> + </message> + <message> + <location line="+1"/> + <source>&Verify message...</source> + <translation>&Verify message...</translation> + </message> + <message> + <location line="+1"/> + <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source> + <translation>Verify messages to ensure they were signed with specified Bitcoin addresses</translation> + </message> + <message> + <location line="+2"/> + <source>&Export...</source> + <translation>&Export...</translation> + </message> + <message> + <location line="+1"/> + <source>Export the data in the current tab to a file</source> + <translation>Export the data in the current tab to a file</translation> + </message> + <message> + <location line="+180"/> + <source>Backup Wallet</source> + <translation>Backup Wallet</translation> + </message> + <message> + <location line="+0"/> + <source>Wallet Data (*.dat)</source> + <translation>Wallet Data (*.dat)</translation> + </message> + <message> + <location line="+3"/> + <source>Backup Failed</source> + <translation>Backup Failed</translation> + </message> + <message> + <location line="+0"/> + <source>There was an error trying to save the wallet data to the new location.</source> + <translation>There was an error trying to save the wallet data to the new location.</translation> + </message> + <message> + <location line="+4"/> + <source>Backup Successful</source> + <translation>Backup Successful</translation> + </message> + <message> + <location line="+0"/> + <source>The wallet data was successfully saved to the new location.</source> + <translation>The wallet data was successfully saved to the new location.</translation> + </message> +</context> +<context> <name>bitcoin-core</name> <message> - <location filename="../bitcoinstrings.cpp" line="+91"/> + <location filename="../bitcoinstrings.cpp" line="+96"/> <source>Bitcoin version</source> <translation>Bitcoin version</translation> </message> <message> - <location line="+99"/> + <location line="+98"/> <source>Usage:</source> <translation>Usage:</translation> </message> @@ -2226,12 +2334,12 @@ Address: %4 <translation>Generate coins</translation> </message> <message> - <location line="-29"/> + <location line="-28"/> <source>Don't generate coins</source> <translation>Don't generate coins</translation> </message> <message> - <location line="+75"/> + <location line="+74"/> <source>Specify data directory</source> <translation>Specify data directory</translation> </message> @@ -2251,12 +2359,12 @@ Address: %4 <translation>Maintain at most <n> connections to peers (default: 125)</translation> </message> <message> - <location line="-50"/> + <location line="-49"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Connect to a node to retrieve peer addresses, and disconnect</translation> </message> <message> - <location line="+81"/> + <location line="+80"/> <source>Specify your own public address</source> <translation>Specify your own public address</translation> </message> @@ -2266,17 +2374,17 @@ Address: %4 <translation>Threshold for disconnecting misbehaving peers (default: 100)</translation> </message> <message> - <location line="-133"/> + <location line="-132"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</translation> </message> <message> - <location line="-29"/> + <location line="-32"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>An error occurred while setting up the RPC port %u for listening on IPv4: %s</translation> </message> <message> - <location line="+27"/> + <location line="+30"/> <source>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</source> <translation>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</translation> </message> @@ -2286,7 +2394,7 @@ Address: %4 <translation>Accept command line and JSON-RPC commands</translation> </message> <message> - <location line="+78"/> + <location line="+77"/> <source>Run in the background as a daemon and accept commands</source> <translation>Run in the background as a daemon and accept commands</translation> </message> @@ -2296,32 +2404,37 @@ Address: %4 <translation>Use the test network</translation> </message> <message> - <location line="-109"/> + <location line="-108"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Accept connections from outside (default: 1 if no -proxy or -connect)</translation> </message> <message> - <location line="-77"/> + <location line="-82"/> <source>%s, you must set a rpcpassword in the configuration file: - %s +%s It is recommended you use the following random password: rpcuser=bitcoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. +It is also recommended to set alertnotify so you are notified of problems; +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com </source> <translation>%s, you must set a rpcpassword in the configuration file: - %s +%s It is recommended you use the following random password: rpcuser=bitcoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. -If the file does not exist, create it with owner-readable-only file permissions.</translation> +If the file does not exist, create it with owner-readable-only file permissions. +It is also recommended to set alertnotify so you are notified of problems; +for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com +</translation> </message> <message> - <location line="+15"/> + <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</translation> </message> @@ -2352,6 +2465,11 @@ If the file does not exist, create it with owner-readable-only file permissions. </message> <message> <location line="+3"/> + <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> + <translation>Execute command when a relevant alert is received (%s in cmd is replaced by message)</translation> + </message> + <message> + <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</translation> </message> @@ -2526,7 +2644,7 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Find peers using DNS lookup (default: 1 unless -connect)</translation> </message> <message> - <location line="+4"/> + <location line="+3"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>How many blocks to check at startup (default: 288, 0 = all)</translation> </message> @@ -2538,7 +2656,7 @@ If the file does not exist, create it with owner-readable-only file permissions. <message> <location line="+24"/> <source>Rebuild block chain index from current blk000??.dat files</source> - <translation type="unfinished"></translation> + <translation>Rebuild block chain index from current blk000??.dat files</translation> </message> <message> <location line="+37"/> @@ -2696,22 +2814,22 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Password for JSON-RPC connections</translation> </message> <message> - <location line="-69"/> + <location line="-68"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Allow JSON-RPC connections from specified IP address</translation> </message> <message> - <location line="+78"/> + <location line="+77"/> <source>Send commands to node running on <ip> (default: 127.0.0.1)</source> <translation>Send commands to node running on <ip> (default: 127.0.0.1)</translation> </message> <message> - <location line="-121"/> + <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation> </message> <message> - <location line="+143"/> + <location line="+142"/> <source>Upgrade wallet to latest format</source> <translation>Upgrade wallet to latest format</translation> </message> @@ -2741,12 +2859,12 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Server private key (default: server.pem)</translation> </message> <message> - <location line="-152"/> + <location line="-154"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> - <location line="+164"/> + <location line="+166"/> <source>This help message</source> <translation>This help message</translation> </message> @@ -2756,7 +2874,7 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Unable to bind to %s on this computer (bind returned error %d, %s)</translation> </message> <message> - <location line="-87"/> + <location line="-86"/> <source>Connect through socks proxy</source> <translation>Connect through socks proxy</translation> </message> @@ -2766,12 +2884,12 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Allow DNS lookups for -addnode, -seednode and -connect</translation> </message> <message> - <location line="+58"/> + <location line="+57"/> <source>Loading addresses...</source> <translation>Loading addresses...</translation> </message> <message> - <location line="-36"/> + <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Error loading wallet.dat: Wallet corrupted</translation> </message> @@ -2781,17 +2899,17 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Error loading wallet.dat: Wallet requires newer version of Bitcoin</translation> </message> <message> - <location line="+88"/> + <location line="+87"/> <source>Wallet needed to be rewritten: restart Bitcoin to complete</source> <translation>Wallet needed to be rewritten: restart Bitcoin to complete</translation> </message> <message> - <location line="-90"/> + <location line="-89"/> <source>Error loading wallet.dat</source> <translation>Error loading wallet.dat</translation> </message> <message> - <location line="+31"/> + <location line="+30"/> <source>Invalid -proxy address: '%s'</source> <translation>Invalid -proxy address: '%s'</translation> </message> @@ -2806,7 +2924,7 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Unknown -socks proxy version requested: %i</translation> </message> <message> - <location line="-92"/> + <location line="-91"/> <source>Cannot resolve -bind address: '%s'</source> <translation>Cannot resolve -bind address: '%s'</translation> </message> @@ -2816,17 +2934,17 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Cannot resolve -externalip address: '%s'</translation> </message> <message> - <location line="+46"/> + <location line="+45"/> <source>Invalid amount for -paytxfee=<amount>: '%s'</source> <translation>Invalid amount for -paytxfee=<amount>: '%s'</translation> </message> <message> - <location line="-25"/> + <location line="-24"/> <source>Error: could not start node</source> <translation>Error: could not start node</translation> </message> <message> - <location line="+26"/> + <location line="+25"/> <source>Invalid amount</source> <translation>Invalid amount</translation> </message> @@ -2841,7 +2959,7 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Loading block index...</translation> </message> <message> - <location line="-60"/> + <location line="-59"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Add a node to connect to and attempt to keep the connection open</translation> </message> @@ -2851,22 +2969,17 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Unable to bind to %s on this computer. Bitcoin is probably already running.</translation> </message> <message> - <location line="+70"/> - <source>Find peers using internet relay chat (default: 0)</source> - <translation>Find peers using internet relay chat (default: 0)</translation> - </message> - <message> - <location line="-2"/> + <location line="+68"/> <source>Fee per KB to add to transactions you send</source> <translation>Fee per KB to add to transactions you send</translation> </message> <message> - <location line="+18"/> + <location line="+17"/> <source>Loading wallet...</source> <translation>Loading wallet...</translation> </message> <message> - <location line="-55"/> + <location line="-54"/> <source>Cannot downgrade wallet</source> <translation>Cannot downgrade wallet</translation> </message> @@ -2881,22 +2994,22 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Cannot write default address</translation> </message> <message> - <location line="+65"/> + <location line="+64"/> <source>Rescanning...</source> <translation>Rescanning...</translation> </message> <message> - <location line="-57"/> + <location line="-56"/> <source>Done loading</source> <translation>Done loading</translation> </message> <message> - <location line="+80"/> + <location line="+79"/> <source>To use the %s option</source> <translation>To use the %s option</translation> </message> <message> - <location line="-72"/> + <location line="-71"/> <source>Error</source> <translation>Error</translation> </message> diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index cd3170a306..6b1b4e3d8e 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -219,9 +219,8 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in settings.setValue("fMinimizeToTray", fMinimizeToTray); break; case MapPortUPnP: - fUseUPnP = value.toBool(); - settings.setValue("fUseUPnP", fUseUPnP); - MapPort(); + settings.setValue("fUseUPnP", value.toBool()); + MapPort(value.toBool()); break; case MinimizeOnClose: fMinimizeOnClose = value.toBool(); diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 2133a5e729..eb3ce48a6e 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -202,7 +202,7 @@ SendCoinsEntry *SendCoinsDialog::addEntry() entry->clear(); entry->setFocus(); ui->scrollAreaWidgetContents->resize(ui->scrollAreaWidgetContents->sizeHint()); - QCoreApplication::instance()->processEvents(); + qApp->processEvents(); QScrollBar* bar = ui->scrollArea->verticalScrollBar(); if(bar) bar->setSliderPosition(bar->maximum()); diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 6be34e5ff4..1d02b81fb6 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -10,26 +10,17 @@ #include "addressbookpage.h" #include "sendcoinsdialog.h" #include "signverifymessagedialog.h" -#include "optionsdialog.h" -#include "aboutdialog.h" #include "clientmodel.h" #include "walletmodel.h" -#include "editaddressdialog.h" #include "optionsmodel.h" -#include "transactiondescdialog.h" -#include "addresstablemodel.h" #include "transactionview.h" #include "overviewpage.h" -#include "bitcoinunits.h" -#include "guiconstants.h" #include "askpassphrasedialog.h" -#include "guiutil.h" #include "ui_interface.h" #include <QVBoxLayout> #include <QActionGroup> #include <QAction> -#include <QLabel> #include <QDesktopServices> #include <QFileDialog> @@ -37,13 +28,8 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): QStackedWidget(parent), gui(_gui), clientModel(0), - walletModel(0), - encryptWalletAction(0), - changePassphraseAction(0) + walletModel(0) { - // Create actions for the toolbar, menu bar and tray/dock icon - createActions(); - // Create tabs overviewPage = new OverviewPage(); @@ -88,74 +74,6 @@ WalletView::~WalletView() { } -void WalletView::createActions() -{ - QActionGroup *tabGroup = new QActionGroup(this); - - overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this); - overviewAction->setStatusTip(tr("Show general overview of wallet")); - overviewAction->setToolTip(overviewAction->statusTip()); - overviewAction->setCheckable(true); - overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); - tabGroup->addAction(overviewAction); - - sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); - sendCoinsAction->setStatusTip(tr("Send coins to a Bitcoin address")); - sendCoinsAction->setToolTip(sendCoinsAction->statusTip()); - sendCoinsAction->setCheckable(true); - sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); - tabGroup->addAction(sendCoinsAction); - - receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this); - receiveCoinsAction->setStatusTip(tr("Show the list of addresses for receiving payments")); - receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip()); - receiveCoinsAction->setCheckable(true); - receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); - tabGroup->addAction(receiveCoinsAction); - - historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); - historyAction->setStatusTip(tr("Browse transaction history")); - historyAction->setToolTip(historyAction->statusTip()); - historyAction->setCheckable(true); - historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); - tabGroup->addAction(historyAction); - - addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this); - addressBookAction->setStatusTip(tr("Edit the list of stored addresses and labels")); - addressBookAction->setToolTip(addressBookAction->statusTip()); - addressBookAction->setCheckable(true); - addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); - tabGroup->addAction(addressBookAction); - - connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); - connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); - connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); - connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); - connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); - - encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); - encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet")); - encryptWalletAction->setCheckable(true); - backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); - backupWalletAction->setStatusTip(tr("Backup wallet to another location")); - changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); - changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption")); - signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); - signMessageAction->setStatusTip(tr("Sign messages with your Bitcoin addresses to prove you own them")); - verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); - verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Bitcoin addresses")); - - exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); - exportAction->setStatusTip(tr("Export the data in the current tab to a file")); - exportAction->setToolTip(exportAction->statusTip()); - - connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); - connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); - connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); - connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); - connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); -} - void WalletView::setBitcoinGUI(BitcoinGUI *gui) { this->gui = gui; @@ -164,7 +82,7 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui) void WalletView::setClientModel(ClientModel *clientModel) { this->clientModel = clientModel; - if(clientModel) + if (clientModel) { overviewPage->setClientModel(clientModel); addressBookPage->setOptionsModel(clientModel->getOptionsModel()); @@ -175,7 +93,7 @@ void WalletView::setClientModel(ClientModel *clientModel) void WalletView::setWalletModel(WalletModel *walletModel) { this->walletModel = walletModel; - if(walletModel) + if (walletModel) { // Receive and report messages from wallet thread connect(walletModel, SIGNAL(message(QString,QString,unsigned int)), gui, SLOT(message(QString,QString,unsigned int))); @@ -222,52 +140,52 @@ void WalletView::incomingTransaction(const QModelIndex& parent, int start, int / void WalletView::gotoOverviewPage() { - overviewAction->setChecked(true); + gui->getOverviewAction()->setChecked(true); setCurrentWidget(overviewPage); - exportAction->setEnabled(false); - disconnect(exportAction, SIGNAL(triggered()), 0, 0); + gui->getExportAction()->setEnabled(false); + disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); } void WalletView::gotoHistoryPage() { - historyAction->setChecked(true); + gui->getHistoryAction()->setChecked(true); setCurrentWidget(transactionsPage); - exportAction->setEnabled(true); - disconnect(exportAction, SIGNAL(triggered()), 0, 0); - connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked())); + gui->getExportAction()->setEnabled(true); + disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); + connect(gui->getExportAction(), SIGNAL(triggered()), transactionView, SLOT(exportClicked())); } void WalletView::gotoAddressBookPage() { - addressBookAction->setChecked(true); + gui->getAddressBookAction()->setChecked(true); setCurrentWidget(addressBookPage); - exportAction->setEnabled(true); - disconnect(exportAction, SIGNAL(triggered()), 0, 0); - connect(exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked())); + gui->getExportAction()->setEnabled(true); + disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); + connect(gui->getExportAction(), SIGNAL(triggered()), addressBookPage, SLOT(exportClicked())); } void WalletView::gotoReceiveCoinsPage() { - receiveCoinsAction->setChecked(true); + gui->getReceiveCoinsAction()->setChecked(true); setCurrentWidget(receiveCoinsPage); - exportAction->setEnabled(true); - disconnect(exportAction, SIGNAL(triggered()), 0, 0); - connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked())); + gui->getExportAction()->setEnabled(true); + disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); + connect(gui->getExportAction(), SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked())); } void WalletView::gotoSendCoinsPage(QString addr) { - sendCoinsAction->setChecked(true); + gui->getSendCoinsAction()->setChecked(true); setCurrentWidget(sendCoinsPage); - exportAction->setEnabled(false); - disconnect(exportAction, SIGNAL(triggered()), 0, 0); + gui->getExportAction()->setEnabled(false); + disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); - if(!addr.isEmpty()) + if (!addr.isEmpty()) sendCoinsPage->setAddress(addr); } @@ -276,7 +194,7 @@ void WalletView::gotoSignMessageTab(QString addr) // call show() in showTab_SM() signVerifyMessageDialog->showTab_SM(true); - if(!addr.isEmpty()) + if (!addr.isEmpty()) signVerifyMessageDialog->setAddress_SM(addr); } @@ -285,7 +203,7 @@ void WalletView::gotoVerifyMessageTab(QString addr) // call show() in showTab_VM() signVerifyMessageDialog->showTab_VM(true); - if(!addr.isEmpty()) + if (!addr.isEmpty()) signVerifyMessageDialog->setAddress_VM(addr); } @@ -327,8 +245,8 @@ void WalletView::backupWallet() { QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)")); - if(!filename.isEmpty()) { - if(!walletModel->backupWallet(filename)) { + if (!filename.isEmpty()) { + if (!walletModel->backupWallet(filename)) { gui->message(tr("Backup Failed"), tr("There was an error trying to save the wallet data to the new location."), CClientUIInterface::MSG_ERROR); } @@ -350,7 +268,7 @@ void WalletView::unlockWallet() if(!walletModel) return; // Unlock wallet when requested by wallet model - if(walletModel->getEncryptionStatus() == WalletModel::Locked) + if (walletModel->getEncryptionStatus() == WalletModel::Locked) { AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this); dlg.setModel(walletModel); diff --git a/src/qt/walletview.h b/src/qt/walletview.h index caa51d7c3a..6bcd70baf9 100644 --- a/src/qt/walletview.h +++ b/src/qt/walletview.h @@ -10,7 +10,6 @@ #include <QStackedWidget> class BitcoinGUI; -class TransactionTableModel; class ClientModel; class WalletModel; class TransactionView; @@ -18,7 +17,6 @@ class OverviewPage; class AddressBookPage; class SendCoinsDialog; class SignVerifyMessageDialog; -class Notificator; class RPCConsole; QT_BEGIN_NAMESPACE @@ -35,6 +33,7 @@ QT_END_NAMESPACE class WalletView : public QStackedWidget { Q_OBJECT + public: explicit WalletView(QWidget *parent, BitcoinGUI *_gui); ~WalletView(); @@ -66,35 +65,8 @@ private: SendCoinsDialog *sendCoinsPage; SignVerifyMessageDialog *signVerifyMessageDialog; - QLabel *labelEncryptionIcon; - QLabel *labelConnectionsIcon; - QLabel *labelBlocksIcon; - QLabel *progressBarLabel; - - QAction *overviewAction; - QAction *historyAction; - QAction *quitAction; - QAction *sendCoinsAction; - QAction *addressBookAction; - QAction *signMessageAction; - QAction *verifyMessageAction; - QAction *aboutAction; - QAction *receiveCoinsAction; - QAction *optionsAction; - QAction *toggleHideAction; - QAction *exportAction; - QAction *encryptWalletAction; - QAction *backupWalletAction; - QAction *changePassphraseAction; - QAction *aboutQtAction; - QAction *openRPCConsoleAction; - TransactionView *transactionView; - /** Create the main UI actions. */ - void createActions(); - /** Create the menu bar and sub-menus. */ - public slots: /** Switch to overview (home) page */ void gotoOverviewPage(); |