aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/bitcoin.cpp5
-rw-r--r--src/qt/bitcoin.qrc2
-rw-r--r--src/qt/bitcoingui.cpp48
-rw-r--r--src/qt/bitcoingui.h2
-rw-r--r--src/qt/clientmodel.cpp1
-rw-r--r--src/qt/forms/overviewpage.ui6
-rw-r--r--src/qt/guiutil.cpp15
-rw-r--r--src/qt/guiutil.h9
-rw-r--r--src/qt/optionsdialog.cpp1
-rw-r--r--src/qt/paymentserver.cpp1
-rw-r--r--src/qt/res/icons/toolbar.pngbin815 -> 0 bytes
-rw-r--r--src/qt/res/icons/toolbar_testnet.pngbin678 -> 0 bytes
-rw-r--r--src/qt/transactiondesc.cpp1
-rw-r--r--src/qt/utilitydialog.cpp5
-rw-r--r--src/qt/walletmodel.cpp20
-rw-r--r--src/qt/walletmodel.h5
16 files changed, 66 insertions, 55 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index a43e7cb756..6cc6b99ceb 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -33,6 +33,7 @@
#include <stdint.h>
#include <boost/filesystem/operations.hpp>
+#include <boost/thread.hpp>
#include <QApplication>
#include <QDebug>
#include <QLibraryInfo>
@@ -414,8 +415,8 @@ void BitcoinApplication::initializeResult(int retval)
{
walletModel = new WalletModel(pwalletMain, optionsModel);
- window->addWallet("~Default", walletModel);
- window->setCurrentWallet("~Default");
+ window->addWallet(BitcoinGUI::DEFAULT_WALLET, walletModel);
+ window->setCurrentWallet(BitcoinGUI::DEFAULT_WALLET);
connect(walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)),
paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray)));
diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc
index 9a7003938b..42bb091e25 100644
--- a/src/qt/bitcoin.qrc
+++ b/src/qt/bitcoin.qrc
@@ -4,7 +4,6 @@
<file alias="address-book">res/icons/address-book.png</file>
<file alias="quit">res/icons/quit.png</file>
<file alias="send">res/icons/send.png</file>
- <file alias="toolbar">res/icons/toolbar.png</file>
<file alias="connect_0">res/icons/connect0_16.png</file>
<file alias="connect_1">res/icons/connect1_16.png</file>
<file alias="connect_2">res/icons/connect2_16.png</file>
@@ -27,7 +26,6 @@
<file alias="editcopy">res/icons/editcopy.png</file>
<file alias="add">res/icons/add.png</file>
<file alias="bitcoin_testnet">res/icons/bitcoin_testnet.png</file>
- <file alias="toolbar_testnet">res/icons/toolbar_testnet.png</file>
<file alias="edit">res/icons/edit.png</file>
<file alias="history">res/icons/history.png</file>
<file alias="overview">res/icons/overview.png</file>
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index e3257e859c..68d42ce64b 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -24,6 +24,7 @@
#endif
#include "init.h"
+#include "util.h"
#include "ui_interface.h"
#include <iostream>
@@ -61,10 +62,35 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) :
QMainWindow(parent),
clientModel(0),
walletFrame(0),
+ unitDisplayControl(0),
+ labelEncryptionIcon(0),
+ labelConnectionsIcon(0),
+ labelBlocksIcon(0),
+ progressBarLabel(0),
+ progressBar(0),
+ progressDialog(0),
+ appMenuBar(0),
+ overviewAction(0),
+ historyAction(0),
+ quitAction(0),
+ sendCoinsAction(0),
+ usedSendingAddressesAction(0),
+ usedReceivingAddressesAction(0),
+ signMessageAction(0),
+ verifyMessageAction(0),
+ aboutAction(0),
+ receiveCoinsAction(0),
+ optionsAction(0),
+ toggleHideAction(0),
encryptWalletAction(0),
+ backupWalletAction(0),
changePassphraseAction(0),
aboutQtAction(0),
+ openRPCConsoleAction(0),
+ openAction(0),
+ showHelpMessageAction(0),
trayIcon(0),
+ trayIconMenu(0),
notificator(0),
rpcConsole(0),
prevBlocks(0),
@@ -425,8 +451,12 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
walletFrame->setClientModel(clientModel);
}
#endif
-
- this->unitDisplayControl->setOptionsModel(clientModel->getOptionsModel());
+ unitDisplayControl->setOptionsModel(clientModel->getOptionsModel());
+ } else {
+ // Disable possibility to show main window via action
+ toggleHideAction->setEnabled(false);
+ // Disable context menu on tray icon
+ trayIconMenu->clear();
}
}
@@ -479,12 +509,12 @@ void BitcoinGUI::createTrayIcon(bool fIsTestnet)
if (!fIsTestnet)
{
trayIcon->setToolTip(tr("Bitcoin Core client"));
- trayIcon->setIcon(QIcon(":/icons/toolbar"));
+ trayIcon->setIcon(QIcon(":/icons/bitcoin"));
}
else
{
trayIcon->setToolTip(tr("Bitcoin Core client") + " " + tr("[testnet]"));
- trayIcon->setIcon(QIcon(":/icons/toolbar_testnet"));
+ trayIcon->setIcon(QIcon(":/icons/bitcoin_testnet"));
}
trayIcon->show();
@@ -495,7 +525,6 @@ void BitcoinGUI::createTrayIcon(bool fIsTestnet)
void BitcoinGUI::createTrayIconMenu()
{
- QMenu *trayIconMenu;
#ifndef Q_OS_MAC
// return if trayIcon is unset (only on non-Mac OSes)
if (!trayIcon)
@@ -536,7 +565,7 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
if(reason == QSystemTrayIcon::Trigger)
{
// Click on system tray icon triggers show/hide of the main window
- toggleHideAction->trigger();
+ toggleHidden();
}
}
#endif
@@ -922,6 +951,7 @@ void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
{
if(!clientModel)
return;
+
// activateWindow() (sometimes) helps with keyboard focus on Windows
if (isHidden())
{
@@ -1006,9 +1036,10 @@ void BitcoinGUI::unsubscribeFromCoreSignals()
uiInterface.ThreadSafeMessageBox.disconnect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3));
}
-UnitDisplayStatusBarControl::UnitDisplayStatusBarControl():QLabel()
+UnitDisplayStatusBarControl::UnitDisplayStatusBarControl() :
+ optionsModel(0),
+ menu(0)
{
- optionsModel = 0;
createContextMenu();
setToolTip(tr("Unit to show amounts in. Click to select another unit."));
}
@@ -1068,4 +1099,3 @@ void UnitDisplayStatusBarControl::onMenuSelection(QAction* action)
optionsModel->setDisplayUnit(action->data());
}
}
-
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 30dd7ae317..30b05cb7d9 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -103,6 +103,7 @@ private:
QAction *showHelpMessageAction;
QSystemTrayIcon *trayIcon;
+ QMenu *trayIconMenu;
Notificator *notificator;
RPCConsole *rpcConsole;
@@ -219,6 +220,7 @@ protected:
private:
OptionsModel *optionsModel;
QMenu* menu;
+
/** Shows context menu with Display Unit options by the mouse coordinates */
void onDisplayUnitsClicked(const QPoint& point);
/** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 4c21eb5594..9c9ff5b3a1 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -13,6 +13,7 @@
#include "main.h"
#include "net.h"
#include "ui_interface.h"
+#include "util.h"
#include <stdint.h>
diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui
index 7784a862d7..53d416ef38 100644
--- a/src/qt/forms/overviewpage.ui
+++ b/src/qt/forms/overviewpage.ui
@@ -13,8 +13,8 @@
<property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QFormLayout" name="formLayout_3">
- <item row="0" column="0" colspan="2">
+ <layout class="QVBoxLayout" name="topLayout">
+ <item>
<widget class="QLabel" name="labelAlerts">
<property name="visible">
<bool>false</bool>
@@ -30,7 +30,7 @@
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 7837e4229e..304177ee11 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -381,12 +381,6 @@ void openDebugLogfile()
QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathDebug)));
}
-ToolTipToRichTextFilter::ToolTipToRichTextFilter(int size_threshold, QObject *parent) :
- QObject(parent), size_threshold(size_threshold)
-{
-
-}
-
void SubstituteFonts()
{
#if defined(Q_OS_MAC)
@@ -407,6 +401,13 @@ void SubstituteFonts()
#endif
}
+ToolTipToRichTextFilter::ToolTipToRichTextFilter(int size_threshold, QObject *parent) :
+ QObject(parent),
+ size_threshold(size_threshold)
+{
+
+}
+
bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt)
{
if(evt->type() == QEvent::ToolTipChange)
@@ -809,7 +810,7 @@ QString formatDurationStr(int secs)
return strList.join(" ");
}
-QString formatServicesStr(uint64_t mask)
+QString formatServicesStr(quint64 mask)
{
QStringList strList;
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h
index 83739a5f13..67e11e59a0 100644
--- a/src/qt/guiutil.h
+++ b/src/qt/guiutil.h
@@ -102,14 +102,13 @@ namespace GUIUtil
// Open debug.log
void openDebugLogfile();
+ // Replace invalid default fonts with known good ones
+ void SubstituteFonts();
+
/** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text
representation if needed. This assures that Qt can word-wrap long tooltip messages.
Tooltips longer than the provided size threshold (in characters) are wrapped.
*/
-
- // Replace invalid default fonts with known good ones
- void SubstituteFonts();
-
class ToolTipToRichTextFilter : public QObject
{
Q_OBJECT
@@ -181,7 +180,7 @@ namespace GUIUtil
QString formatDurationStr(int secs);
/* Format CNodeStats.nServices bitmask into a user-readable string */
- QString formatServicesStr(uint64_t mask);
+ QString formatServicesStr(quint64 mask);
/* Format a CNodeCombinedStats.dPingTime into a user-readable string or display N/A, if 0*/
QString formatPingTime(double dPingTime);
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index fd1d446f9b..c775a7f8d6 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -21,6 +21,7 @@
#include "wallet.h" // for CWallet::minTxFee
#endif
+#include <boost/thread.hpp>
#include <QDir>
#include <QIntValidator>
#include <QLocale>
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp
index a9f1566d62..f6a4b599de 100644
--- a/src/qt/paymentserver.cpp
+++ b/src/qt/paymentserver.cpp
@@ -11,6 +11,7 @@
#include "base58.h"
#include "ui_interface.h"
+#include "util.h"
#include "wallet.h"
#include <cstdlib>
diff --git a/src/qt/res/icons/toolbar.png b/src/qt/res/icons/toolbar.png
deleted file mode 100644
index c82d96519c..0000000000
--- a/src/qt/res/icons/toolbar.png
+++ /dev/null
Binary files differ
diff --git a/src/qt/res/icons/toolbar_testnet.png b/src/qt/res/icons/toolbar_testnet.png
deleted file mode 100644
index 5995bc0667..0000000000
--- a/src/qt/res/icons/toolbar_testnet.png
+++ /dev/null
Binary files differ
diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp
index 4f6e3169f5..8258e719a3 100644
--- a/src/qt/transactiondesc.cpp
+++ b/src/qt/transactiondesc.cpp
@@ -15,6 +15,7 @@
#include "transactionrecord.h"
#include "timedata.h"
#include "ui_interface.h"
+#include "util.h"
#include "wallet.h"
#include <stdint.h>
diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp
index 5fb0da145d..7df9d1bc2d 100644
--- a/src/qt/utilitydialog.cpp
+++ b/src/qt/utilitydialog.cpp
@@ -10,9 +10,10 @@
#include "clientmodel.h"
#include "guiutil.h"
-#include "clientversion.h"
#include "init.h"
-#include "util.h"
+#include "version.h"
+
+#include <stdio.h>
#include <QLabel>
#include <QRegExp>
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 30c9ecc96b..92c22f5692 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -31,7 +31,6 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p
transactionTableModel(0),
recentRequestsTableModel(0),
cachedBalance(0), cachedUnconfirmedBalance(0), cachedImmatureBalance(0),
- cachedNumTransactions(0),
cachedEncryptionStatus(Unencrypted),
cachedNumBlocks(0)
{
@@ -102,18 +101,6 @@ qint64 WalletModel::getWatchImmatureBalance() const
return wallet->GetImmatureWatchOnlyBalance();
}
-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;
-}
-
void WalletModel::updateStatus()
{
EncryptionStatus newEncryptionStatus = getEncryptionStatus();
@@ -181,13 +168,6 @@ void WalletModel::updateTransaction(const QString &hash, int status)
// Balance and number of transactions might have changed
checkBalanceChanged();
-
- int newNumTransactions = getNumTransactions();
- if(cachedNumTransactions != newNumTransactions)
- {
- cachedNumTransactions = newNumTransactions;
- emit numTransactionsChanged(newNumTransactions);
- }
}
void WalletModel::updateAddressBook(const QString &address, const QString &label,
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index 1dad716061..b3a401e4cc 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -132,7 +132,6 @@ public:
qint64 getWatchBalance() const;
qint64 getWatchUnconfirmedBalance() const;
qint64 getWatchImmatureBalance() const;
- int getNumTransactions() const;
EncryptionStatus getEncryptionStatus() const;
bool processingQueuedTransactions() { return fProcessingQueuedTransactions; }
@@ -216,7 +215,6 @@ private:
qint64 cachedWatchOnlyBalance;
qint64 cachedWatchUnconfBalance;
qint64 cachedWatchImmatureBalance;
- qint64 cachedNumTransactions;
EncryptionStatus cachedEncryptionStatus;
int cachedNumBlocks;
@@ -231,9 +229,6 @@ signals:
void balanceChanged(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance,
qint64 watchOnlyBalance, qint64 watchUnconfBalance, qint64 watchImmatureBalance);
- // Number of transactions in wallet changed
- void numTransactionsChanged(int count);
-
// Encryption status of wallet changed
void encryptionStatusChanged(int status);