diff options
-rw-r--r-- | src/bitcoinrpc.cpp | 3 | ||||
-rw-r--r-- | src/init.cpp | 5 | ||||
-rw-r--r-- | src/main.cpp | 26 | ||||
-rw-r--r-- | src/net.cpp | 20 | ||||
-rw-r--r-- | src/qt/bitcoin.cpp | 4 | ||||
-rw-r--r-- | src/qt/bitcoinamountfield.cpp | 2 | ||||
-rw-r--r-- | src/qt/bitcoingui.cpp | 34 | ||||
-rw-r--r-- | src/qt/bitcoingui.h | 17 | ||||
-rw-r--r-- | src/qt/bitcoinstrings.cpp | 18 | ||||
-rw-r--r-- | src/qt/forms/overviewpage.ui | 17 | ||||
-rw-r--r-- | src/qt/guiutil.cpp | 11 | ||||
-rw-r--r-- | src/qt/locale/bitcoin_en.ts | 424 | ||||
-rw-r--r-- | src/qt/overviewpage.cpp | 8 | ||||
-rw-r--r-- | src/qt/overviewpage.h | 1 | ||||
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 2 | ||||
-rw-r--r-- | src/qt/walletframe.cpp | 4 | ||||
-rw-r--r-- | src/qt/walletframe.h | 4 | ||||
-rw-r--r-- | src/qt/walletmodel.cpp | 2 | ||||
-rw-r--r-- | src/qt/walletstack.cpp | 4 | ||||
-rw-r--r-- | src/qt/walletstack.h | 10 | ||||
-rw-r--r-- | src/qt/walletview.cpp | 145 | ||||
-rw-r--r-- | src/qt/walletview.h | 38 |
22 files changed, 422 insertions, 377 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index b6d8de4a18..84478398cc 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -763,7 +763,8 @@ void ThreadRPCServer2(void* parg) else if (mapArgs.count("-daemon")) strWhatAmI = strprintf(_("To use the %s option"), "\"-daemon\""); uiInterface.ThreadSafeMessageBox(strprintf( - _("%s, you must set a rpcpassword in the configuration file:\n %s\n" + _("%s, you must set a rpcpassword in the configuration file:\n" + "%s\n" "It is recommended you use the following random password:\n" "rpcuser=bitcoinrpc\n" "rpcpassword=%s\n" diff --git a/src/init.cpp b/src/init.cpp index 1bf76631dc..aac46d489d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -309,7 +309,7 @@ std::string HelpMessage() " -checklevel=<n> " + _("How thorough the block verification is (0-4, default: 3)") + "\n" + " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n" + " -loadblock=<file> " + _("Imports blocks from external blk000??.dat file") + "\n" + - " -reindex " + _("Rebuild blockchain index from current blk000??.dat files") + "\n" + + " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + "\n" + " -par=N " + _("Set the number of script verification threads (1-16, 0=auto, default: 0)") + "\n" + "\n" + _("Block creation options:") + "\n" + @@ -1027,6 +1027,9 @@ bool AppInit2() if (fServer) NewThread(ThreadRPCServer, NULL); + // Generate coins in the background + GenerateBitcoins(GetBoolArg("-gen", false), pwalletMain); + // ********************************************************* Step 12: finished uiInterface.InitMessage(_("Done loading")); diff --git a/src/main.cpp b/src/main.cpp index 7474580a6f..52bf3faa64 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4765,3 +4765,29 @@ uint64 CTxOutCompressor::DecompressAmount(uint64 x) } return n; } + + +class CMainCleanup +{ +public: + CMainCleanup() {} + ~CMainCleanup() { + // block headers + std::map<uint256, CBlockIndex*>::iterator it1 = mapBlockIndex.begin(); + for (; it1 != mapBlockIndex.end(); it1++) + delete (*it1).second; + mapBlockIndex.clear(); + + // orphan blocks + std::map<uint256, CBlock*>::iterator it2 = mapOrphanBlocks.begin(); + for (; it2 != mapOrphanBlocks.end(); it2++) + delete (*it2).second; + mapOrphanBlocks.clear(); + + // orphan transactions + std::map<uint256, CDataStream*>::iterator it3 = mapOrphanTransactions.begin(); + for (; it3 != mapOrphanTransactions.end(); it3++) + delete (*it3).second; + mapOrphanTransactions.clear(); + } +} instance_of_cmaincleanup; diff --git a/src/net.cpp b/src/net.cpp index 9ee6cb423c..669f44b639 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -775,12 +775,12 @@ void ThreadSocketHandler(void* parg) printf("ThreadSocketHandler exited\n"); } +static list<CNode*> vNodesDisconnected; + void ThreadSocketHandler2(void* parg) { printf("ThreadSocketHandler started\n"); - list<CNode*> vNodesDisconnected; unsigned int nPrevNodeCount = 0; - loop { // @@ -2047,9 +2047,6 @@ void StartNode(void* parg) // Dump network addresses if (!NewThread(ThreadDumpAddress, NULL)) printf("Error; NewThread(ThreadDumpAddress) failed\n"); - - // Generate coins in the background - GenerateBitcoins(GetBoolArg("-gen", false), pwalletMain); } bool StopNode() @@ -2088,6 +2085,7 @@ bool StopNode() Sleep(20); Sleep(50); DumpAddresses(); + return true; } @@ -2108,6 +2106,18 @@ public: if (closesocket(hListenSocket) == SOCKET_ERROR) printf("closesocket(hListenSocket) failed with error %d\n", WSAGetLastError()); + // clean up some globals (to help leak detection) + BOOST_FOREACH(CNode *pnode, vNodes) + delete pnode; + BOOST_FOREACH(CNode *pnode, vNodesDisconnected) + delete pnode; + vNodes.clear(); + vNodesDisconnected.clear(); + delete semOutbound; + semOutbound = NULL; + delete pnodeLocalHost; + pnodeLocalHost = NULL; + #ifdef WIN32 // Shutdown Windows Sockets WSACleanup(); diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 346128c0c4..2c47f30e92 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -82,14 +82,14 @@ 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); + QMetaObject::invokeMethod(qApp, "quit", Qt::QueuedConnection); } /* 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 a48581c6ab..adc6cd4742 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -56,7 +56,7 @@ const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; -BitcoinGUI::BitcoinGUI(QWidget *parent): +BitcoinGUI::BitcoinGUI(QWidget *parent) : QMainWindow(parent), clientModel(0), encryptWalletAction(0), @@ -70,7 +70,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 +94,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 +127,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 +167,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 +188,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); @@ -205,7 +205,7 @@ void BitcoinGUI::createActions() connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); - + quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); @@ -221,6 +221,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 +309,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")); @@ -338,6 +339,7 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) // Receive and report messages from network/worker thread connect(clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int))); + rpcConsole->setClientModel(clientModel); walletFrame->setClientModel(clientModel); } } @@ -367,7 +369,7 @@ void BitcoinGUI::createTrayIcon() trayIcon->show(); #endif - notificator = new Notificator(qApp->applicationName(), trayIcon); + notificator = new Notificator(QApplication::applicationName(), trayIcon); } void BitcoinGUI::createTrayIconMenu() @@ -431,7 +433,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); } @@ -475,9 +477,9 @@ void BitcoinGUI::gotoReceiveCoinsPage() if (walletFrame) walletFrame->gotoReceiveCoinsPage(); } -void BitcoinGUI::gotoSendCoinsPage() +void BitcoinGUI::gotoSendCoinsPage(QString addr) { - if (walletFrame) walletFrame->gotoSendCoinsPage(); + if (walletFrame) walletFrame->gotoSendCoinsPage(addr); } void BitcoinGUI::gotoSignMessageTab(QString addr) @@ -487,7 +489,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) @@ -680,7 +682,7 @@ void BitcoinGUI::closeEvent(QCloseEvent *event) if(!clientModel->getOptionsModel()->getMinimizeToTray() && !clientModel->getOptionsModel()->getMinimizeOnClose()) { - qApp->quit(); + QApplication::quit(); } #endif } @@ -700,7 +702,7 @@ void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee) void BitcoinGUI::incomingTransaction(const QString& date, int unit, qint64 amount, const QString& type, const QString& address) { - // On new transaction, make an info balloon + // On new transaction, make an info balloon message((amount)<0 ? tr("Sent transaction") : tr("Incoming transaction"), tr("Date: %1\n" "Amount: %2\n" diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 750e97104c..8f44389fd2 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); @@ -94,7 +103,7 @@ private: QAction *changePassphraseAction; QAction *aboutQtAction; QAction *openRPCConsoleAction; - + QSystemTrayIcon *trayIcon; Notificator *notificator; TransactionView *transactionView; @@ -162,7 +171,7 @@ private slots: /** Switch to receive coins page */ void gotoReceiveCoinsPage(); /** Switch to send coins page */ - void gotoSendCoinsPage(); + void gotoSendCoinsPage(QString addr = ""); /** Show Sign/Verify Message dialog and switch to sign message tab */ void gotoSignMessageTab(QString addr = ""); diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index dc506f0497..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", "" @@ -104,6 +109,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Do you want to rebuild the block database now QT_TRANSLATE_NOOP("bitcoin-core", "Don't generate coins"), QT_TRANSLATE_NOOP("bitcoin-core", "Done loading"), QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing block database"), +QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing wallet database environment %s!"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading block database"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet corrupted"), @@ -128,12 +134,10 @@ 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)"), QT_TRANSLATE_NOOP("bitcoin-core", "How thorough the block verification is (0-4, default: 3)"), -QT_TRANSLATE_NOOP("bitcoin-core", "Importing blocks from block database..."), QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000??.dat file"), QT_TRANSLATE_NOOP("bitcoin-core", "Information"), QT_TRANSLATE_NOOP("bitcoin-core", "Insufficient funds"), @@ -157,7 +161,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Output extra debugging information. Implies a QT_TRANSLATE_NOOP("bitcoin-core", "Output extra network debugging information"), QT_TRANSLATE_NOOP("bitcoin-core", "Password for JSON-RPC connections"), QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp"), -QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild blockchain index from current blk000??.dat files"), +QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild block chain index from current blk000??.dat files"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."), QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"), @@ -194,8 +198,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: QT_TRANSLATE_NOOP("bitcoin-core", "Use proxy to reach tor hidden services (default: same as -proxy)"), QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network"), QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"), -QT_TRANSLATE_NOOP("bitcoin-core", "Verifying database..."), -QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet integrity..."), +QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."), +QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet..."), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart Bitcoin to complete"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"), diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index e4470bcdde..57aa624cc2 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -158,23 +158,6 @@ </property> </widget> </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Number of transactions:</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QLabel" name="labelNumTransactions"> - <property name="toolTip"> - <string>Total number of transactions in wallet</string> - </property> - <property name="text"> - <string notr="true">0</string> - </property> - </widget> - </item> <item row="2" column="0"> <widget class="QLabel" name="labelImmatureText"> <property name="text"> 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 e05c018c27..c74b11d3d6 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -123,7 +123,12 @@ This product includes software developed by the OpenSSL Project for use in the O <translation>&Edit</translation> </message> <message> - <location line="+248"/> + <location line="+1"/> + <source>Send &Coins</source> + <translation>Send &Coins</translation> + </message> + <message> + <location line="+263"/> <source>Export Address Book Data</source> <translation>Export Address Book Data</translation> </message> @@ -305,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="+267"/> + <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> @@ -335,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> @@ -405,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> @@ -415,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> @@ -460,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="-196"/> - <location line="+529"/> + <location line="-162"/> + <location line="+540"/> <source>Bitcoin</source> <translation>Bitcoin</translation> </message> <message> - <location line="-529"/> + <location line="-540"/> <source>Wallet</source> <translation>Wallet</translation> </message> <message> - <location line="+176"/> + <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> @@ -532,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> @@ -614,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="+210"/> - <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="-348"/> + <location line="-138"/> <source>Up to date</source> <translation>Up to date</translation> </message> @@ -639,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> @@ -662,14 +657,14 @@ Address: %4 </translation> </message> <message> - <location line="+99"/> - <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> @@ -684,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> @@ -1047,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> @@ -1073,7 +1043,7 @@ Address: %4 <translation>Wallet</translation> </message> <message> - <location line="+124"/> + <location line="+107"/> <source>Immature:</source> <translation>Immature:</translation> </message> @@ -1088,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> @@ -1098,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> @@ -2099,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> @@ -2108,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> @@ -2163,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> @@ -2174,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> @@ -2196,12 +2309,12 @@ Address: %4 <translation>List commands</translation> </message> <message> - <location line="-11"/> + <location line="-10"/> <source>Get help for a command</source> <translation>Get help for a command</translation> </message> <message> - <location line="+22"/> + <location line="+21"/> <source>Options:</source> <translation>Options:</translation> </message> @@ -2216,7 +2329,7 @@ Address: %4 <translation>Specify pid file (default: bitcoind.pid)</translation> </message> <message> - <location line="-48"/> + <location line="-47"/> <source>Generate coins</source> <translation>Generate coins</translation> </message> @@ -2226,7 +2339,7 @@ Address: %4 <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> @@ -2246,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> @@ -2261,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> @@ -2281,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> @@ -2291,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> @@ -2347,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> @@ -2427,6 +2550,11 @@ If the file does not exist, create it with owner-readable-only file permissions. </message> <message> <location line="+1"/> + <source>Error initializing wallet database environment %s!</source> + <translation>Error initializing wallet database environment %s!</translation> + </message> + <message> + <location line="+1"/> <source>Error loading block database</source> <translation>Error loading block database</translation> </message> @@ -2516,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> @@ -2526,12 +2654,22 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>How thorough the block verification is (0-4, default: 3)</translation> </message> <message> - <location line="+1"/> - <source>Importing blocks from block database...</source> - <translation>Importing blocks from block database...</translation> + <location line="+24"/> + <source>Rebuild block chain index from current blk000??.dat files</source> + <translation>Rebuild block chain index from current blk000??.dat files</translation> + </message> + <message> + <location line="+37"/> + <source>Verifying blocks...</source> + <translation>Verifying blocks...</translation> </message> <message> <location line="+1"/> + <source>Verifying wallet...</source> + <translation>Verifying wallet...</translation> + </message> + <message> + <location line="-61"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Imports blocks from external blk000??.dat file</translation> </message> @@ -2586,12 +2724,7 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Prepend debug output with timestamp</translation> </message> <message> - <location line="+1"/> - <source>Rebuild blockchain index from current blk000??.dat files</source> - <translation>Rebuild blockchain index from current blk000??.dat files</translation> - </message> - <message> - <location line="+4"/> + <location line="+5"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</translation> </message> @@ -2656,12 +2789,7 @@ If the file does not exist, create it with owner-readable-only file permissions. <translation>Username for JSON-RPC connections</translation> </message> <message> - <location line="+1"/> - <source>Verifying database...</source> - <translation>Verifying database...</translation> - </message> - <message> - <location line="+3"/> + <location line="+4"/> <source>Warning</source> <translation>Warning</translation> </message> @@ -2686,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> @@ -2731,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> @@ -2746,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> @@ -2756,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="-37"/> + <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Error loading wallet.dat: Wallet corrupted</translation> </message> @@ -2771,22 +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"/> - <source>Verifying wallet integrity...</source> - <translation>Verifying wallet integrity...</translation> - </message> - <message> - <location line="+1"/> + <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="-91"/> + <location line="-89"/> <source>Error loading wallet.dat</source> <translation>Error loading wallet.dat</translation> </message> <message> - <location line="+32"/> + <location line="+30"/> <source>Invalid -proxy address: '%s'</source> <translation>Invalid -proxy address: '%s'</translation> </message> @@ -2801,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> @@ -2811,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="-26"/> + <location line="-24"/> <source>Error: could not start node</source> <translation>Error: could not start node</translation> </message> <message> - <location line="+27"/> + <location line="+25"/> <source>Invalid amount</source> <translation>Invalid amount</translation> </message> @@ -2836,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> @@ -2846,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="+69"/> - <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="+19"/> + <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> @@ -2876,27 +2994,27 @@ 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="-73"/> + <location line="-71"/> <source>Error</source> <translation>Error</translation> </message> <message> - <location line="-32"/> + <location line="-33"/> <source>You must set rpcpassword=<password> in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 8f1ff5325e..528c93bdc1 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -147,11 +147,6 @@ void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 ui->labelImmatureText->setVisible(showImmature); } -void OverviewPage::setNumTransactions(int count) -{ - ui->labelNumTransactions->setText(QLocale::system().toString(count)); -} - void OverviewPage::setClientModel(ClientModel *model) { this->clientModel = model; @@ -183,9 +178,6 @@ void OverviewPage::setWalletModel(WalletModel *model) setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance()); connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64))); - setNumTransactions(model->getNumTransactions()); - connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int))); - connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); } diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index b287f479f8..59ba3c66bb 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -30,7 +30,6 @@ public: public slots: void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance); - void setNumTransactions(int count); signals: void transactionClicked(const QModelIndex &index); 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/walletframe.cpp b/src/qt/walletframe.cpp index a53aa65466..b5947caf3a 100644 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -88,9 +88,9 @@ void WalletFrame::gotoReceiveCoinsPage() walletStack->gotoReceiveCoinsPage(); } -void WalletFrame::gotoSendCoinsPage() +void WalletFrame::gotoSendCoinsPage(QString addr) { - walletStack->gotoSendCoinsPage(); + walletStack->gotoSendCoinsPage(addr); } void WalletFrame::gotoSignMessageTab(QString addr) diff --git a/src/qt/walletframe.h b/src/qt/walletframe.h index 5b4baf7255..3649185e8a 100644 --- a/src/qt/walletframe.h +++ b/src/qt/walletframe.h @@ -25,7 +25,7 @@ public: bool addWallet(const QString& name, WalletModel *walletModel); bool setCurrentWallet(const QString& name); - + void removeAllWallets(); bool handleURI(const QString &uri); @@ -47,7 +47,7 @@ public slots: /** Switch to receive coins page */ void gotoReceiveCoinsPage(); /** Switch to send coins page */ - void gotoSendCoinsPage(); + void gotoSendCoinsPage(QString addr = ""); /** Show Sign/Verify Message dialog and switch to sign message tab */ void gotoSignMessageTab(QString addr = ""); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 9d5a2c04ff..20535a451d 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -56,6 +56,8 @@ int WalletModel::getNumTransactions() const int numTransactions = 0; { LOCK(wallet->cs_wallet); + // the size of mapWallet contains the number of unique transaction IDs + // (e.g. payments to yourself generate 2 transactions, but both share the same transaction ID) numTransactions = wallet->mapWallet.size(); } return numTransactions; diff --git a/src/qt/walletstack.cpp b/src/qt/walletstack.cpp index 271d1c7924..42d86956be 100644 --- a/src/qt/walletstack.cpp +++ b/src/qt/walletstack.cpp @@ -97,11 +97,11 @@ void WalletStack::gotoReceiveCoinsPage() i.value()->gotoReceiveCoinsPage(); } -void WalletStack::gotoSendCoinsPage() +void WalletStack::gotoSendCoinsPage(QString addr) { QMap<QString, WalletView*>::const_iterator i; for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i) - i.value()->gotoSendCoinsPage(); + i.value()->gotoSendCoinsPage(addr); } void WalletStack::gotoSignMessageTab(QString addr) diff --git a/src/qt/walletstack.h b/src/qt/walletstack.h index f3485816e9..ea4cc121d1 100644 --- a/src/qt/walletstack.h +++ b/src/qt/walletstack.h @@ -45,16 +45,16 @@ public: ~WalletStack(); void setBitcoinGUI(BitcoinGUI *gui) { this->gui = gui; } - + void setClientModel(ClientModel *clientModel) { this->clientModel = clientModel; } - + bool addWallet(const QString& name, WalletModel *walletModel); bool removeWallet(const QString& name); - + void removeAllWallets(); bool handleURI(const QString &uri); - + void showOutOfSyncWarning(bool fShow); private: @@ -76,7 +76,7 @@ public slots: /** Switch to receive coins page */ void gotoReceiveCoinsPage(); /** Switch to send coins page */ - void gotoSendCoinsPage(); + void gotoSendCoinsPage(QString addr = ""); /** Show Sign/Verify Message dialog and switch to sign message tab */ void gotoSignMessageTab(QString addr = ""); diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 7dd36234c9..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(); @@ -74,9 +60,11 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); - // Clicking on "Verify Message" in the address book sends you to the verify message tab + // Clicking on "Send Coins" in the address book sends you to the send coins tab + connect(addressBookPage, SIGNAL(sendCoins(QString)), this, SLOT(gotoSendCoinsPage(QString))); + // Clicking on "Verify Message" in the address book opens the verify message tab in the Sign/Verify Message dialog connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); - // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab + // Clicking on "Sign Message" in the receive coins page opens the sign message tab in the Sign/Verify Message dialog connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); @@ -86,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; @@ -162,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()); @@ -173,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))); @@ -220,50 +140,53 @@ 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() +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()) + sendCoinsPage->setAddress(addr); } void WalletView::gotoSignMessageTab(QString addr) @@ -271,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); } @@ -280,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); } @@ -322,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); } @@ -345,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 38eb0227af..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(); @@ -49,9 +48,9 @@ public: functionality. */ void setWalletModel(WalletModel *walletModel); - + bool handleURI(const QString &uri); - + void showOutOfSyncWarning(bool fShow); private: @@ -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(); @@ -105,7 +77,7 @@ public slots: /** Switch to receive coins page */ void gotoReceiveCoinsPage(); /** Switch to send coins page */ - void gotoSendCoinsPage(); + void gotoSendCoinsPage(QString addr = ""); /** Show Sign/Verify Message dialog and switch to sign message tab */ void gotoSignMessageTab(QString addr = ""); @@ -125,7 +97,7 @@ public slots: void changePassphrase(); /** Ask for passphrase to unlock wallet temporarily */ void unlockWallet(); - + void setEncryptionStatus(); }; |