Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2593f7f
Merge #7506: Use CCoinControl selection in CWallet::FundTransaction
laanwj Mar 24, 2016
d600608
Merge #7732: [Qt] Debug window: replace "Build date" with "Datadir"
laanwj Mar 25, 2016
3d47117
Merge #7707: [RPC][QT] UI support for abandoned transactions
jonasschnelli Apr 4, 2016
b3f9740
Support themes for new transaction_abandoned icon
codablock Sep 4, 2017
632a593
Merge #7688: List solvability in listunspent output and improve help
laanwj Apr 25, 2016
c8d45d3
Merge #8006: Qt: Add option to disable the system tray icon
laanwj May 12, 2016
7582e6b
Merge #8073: qt: askpassphrasedialog: Clear pass fields on accept
laanwj May 26, 2016
eed5fe4
Merge #8231: [Qt] fix a bug where the SplashScreen will not be hidden…
laanwj Jun 22, 2016
8b410d3
Merge #8257: Do not ask a UI question from bitcoind
laanwj Jun 28, 2016
12dd80a
Merge #8463: [qt] Remove Priority from coincontrol dialog
jonasschnelli Aug 24, 2016
a4e2e93
Merge #8678: [Qt][CoinControl] fix UI bug that could result in paying…
jonasschnelli Sep 9, 2016
a7623c8
Merge #8672: Qt: Show transaction size in transaction details window
jonasschnelli Sep 20, 2016
e19bf62
Merge #8371: [Qt] Add out-of-sync modal info layer
jonasschnelli Sep 23, 2016
044df9d
Fix constructor call to COutput
codablock Sep 4, 2017
7ebed92
Merge #8805: Trivial: Grammar and capitalization
Sep 26, 2016
5a588b0
Merge #8885: gui: fix ban from qt console
jonasschnelli Oct 8, 2016
762474d
Merge #8821: [qt] sync-overlay: Don't block during reindex
jonasschnelli Oct 10, 2016
e726e19
Merge #8918: Qt: Add "Copy URI" to payment request context menu
laanwj Oct 18, 2016
3be6690
Merge #7842: RPC: do not print minping time in getpeerinfo when no pi…
laanwj Apr 14, 2016
ef05e74
Merge #8925: qt: Display minimum ping in debug window.
laanwj Oct 18, 2016
42bec4a
Merge #8972: [Qt] make warnings label selectable (jonasschnelli)
laanwj Oct 19, 2016
c33fd2c
Make background of warning icon transparent in modaloverlay
codablock Sep 8, 2017
ba6bf73
Merge #9088: Reduce ambiguity of warning message
laanwj Nov 8, 2016
f8f3b0e
Replace Bitcoin with Dash in modal overlay
codablock Sep 8, 2017
3cbc18d
Remove clicked signals from labelWalletStatus and labelTransactionsSt…
codablock Sep 8, 2017
c63bd8b
Pull out modaloverlay show/hide into it's own if/else block and switc…
codablock Sep 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ QT_FORMS_UI = \
qt/forms/editaddressdialog.ui \
qt/forms/helpmessagedialog.ui \
qt/forms/intro.ui \
qt/forms/modaloverlay.ui \
qt/forms/masternodelist.ui \
qt/forms/openuridialog.ui \
qt/forms/optionsdialog.ui \
Expand Down Expand Up @@ -59,6 +60,7 @@ QT_MOC_CPP = \
qt/moc_intro.cpp \
qt/moc_macdockiconhandler.cpp \
qt/moc_macnotificationhandler.cpp \
qt/moc_modaloverlay.cpp \
qt/moc_masternodelist.cpp \
qt/moc_notificator.cpp \
qt/moc_openuridialog.cpp \
Expand Down Expand Up @@ -128,6 +130,7 @@ BITCOIN_QT_H = \
qt/intro.h \
qt/macdockiconhandler.h \
qt/macnotificationhandler.h \
qt/modaloverlay.h \
qt/masternodelist.h \
qt/networkstyle.h \
qt/notificator.h \
Expand Down Expand Up @@ -168,6 +171,7 @@ RES_ICONS = \
qt/res/icons/bitcoin.ico \
qt/res/icons/bitcoin.png \
qt/res/icons/chevron.png \
qt/res/icons/warning.png \
qt/res/icons/drkblue/add.png \
qt/res/icons/drkblue/address-book.png \
qt/res/icons/drkblue/browse.png \
Expand Down Expand Up @@ -220,6 +224,7 @@ RES_ICONS = \
qt/res/icons/drkblue/verify.png \
qt/res/icons/drkblue/fontbigger.png \
qt/res/icons/drkblue/fontsmaller.png \
qt/res/icons/drkblue/transaction_abandoned.png \
qt/res/icons/crownium/add.png \
qt/res/icons/crownium/address-book.png \
qt/res/icons/crownium/browse.png \
Expand Down Expand Up @@ -272,6 +277,7 @@ RES_ICONS = \
qt/res/icons/crownium/verify.png \
qt/res/icons/crownium/fontbigger.png \
qt/res/icons/crownium/fontsmaller.png \
qt/res/icons/crownium/transaction_abandoned.png \
qt/res/icons/light/add.png \
qt/res/icons/light/address-book.png \
qt/res/icons/light/browse.png \
Expand Down Expand Up @@ -324,6 +330,7 @@ RES_ICONS = \
qt/res/icons/light/verify.png \
qt/res/icons/light/fontbigger.png \
qt/res/icons/light/fontsmaller.png \
qt/res/icons/light/transaction_abandoned.png \
qt/res/icons/trad/add.png \
qt/res/icons/trad/address-book.png \
qt/res/icons/trad/browse.png \
Expand Down Expand Up @@ -375,7 +382,8 @@ RES_ICONS = \
qt/res/icons/trad/about_qt.png \
qt/res/icons/trad/verify.png \
qt/res/icons/trad/fontbigger.png \
qt/res/icons/trad/fontsmaller.png
qt/res/icons/trad/fontsmaller.png \
qt/res/icons/trad/transaction_abandoned.png

BITCOIN_QT_CPP = \
qt/bantablemodel.cpp \
Expand All @@ -387,6 +395,7 @@ BITCOIN_QT_CPP = \
qt/csvmodelwriter.cpp \
qt/guiutil.cpp \
qt/intro.cpp \
qt/modaloverlay.cpp \
qt/networkstyle.cpp \
qt/notificator.cpp \
qt/optionsdialog.cpp \
Expand Down
5 changes: 2 additions & 3 deletions src/coincontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ class CCoinControl
return (setSelected.size() > 0);
}

bool IsSelected(const uint256& hash, unsigned int n) const
bool IsSelected(const COutPoint& output) const
{
COutPoint outpt(hash, n);
return (setSelected.count(outpt) > 0);
return (setSelected.count(output) > 0);
}

void Select(const COutPoint& output)
Expand Down
3 changes: 2 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1613,8 +1613,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if (!fLoaded) {
// first suggest a reindex
if (!fReset) {
bool fRet = uiInterface.ThreadSafeMessageBox(
bool fRet = uiInterface.ThreadSafeQuestion(
strLoadError + ".\n\n" + _("Do you want to rebuild the block database now?"),
strLoadError + ".\nPlease restart with -reindex or -reindex-chainstate to recover.",
"", CClientUIInterface::MSG_ERROR | CClientUIInterface::BTN_ABORT);
if (fRet) {
fReindex = true;
Expand Down
3 changes: 2 additions & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ void CNode::copyStats(CNodeStats &stats)
{
stats.nodeid = this->GetId();
X(nServices);
X(addr);
X(fRelayTxes);
X(nLastSend);
X(nLastRecv);
Expand Down Expand Up @@ -659,7 +660,7 @@ void CNode::copyStats(CNodeStats &stats)

// Raw ping time is in microseconds, but show it to user as whole seconds (Dash users should be well used to small numbers with many decimal places by now :)
stats.dPingTime = (((double)nPingUsecTime) / 1e6);
stats.dPingMin = (((double)nMinPingUsecTime) / 1e6);
stats.dMinPing = (((double)nMinPingUsecTime) / 1e6);
stats.dPingWait = (((double)nPingUsecWait) / 1e6);

// Leave string empty if addrLocal invalid (not filled in yet)
Expand Down
3 changes: 2 additions & 1 deletion src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,9 @@ class CNodeStats
bool fWhitelisted;
double dPingTime;
double dPingWait;
double dPingMin;
double dMinPing;
std::string addrLocal;
CAddress addr;
};


Expand Down
6 changes: 6 additions & 0 deletions src/noui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ static bool noui_ThreadSafeMessageBox(const std::string& message, const std::str
return false;
}

static bool noui_ThreadSafeQuestion(const std::string& /* ignored interactive message */, const std::string& message, const std::string& caption, unsigned int style)
{
return noui_ThreadSafeMessageBox(message, caption, style);
}

static void noui_InitMessage(const std::string& message)
{
LogPrintf("init message: %s\n", message);
Expand All @@ -49,5 +54,6 @@ void noui_connect()
{
// Connect dashd signal handlers
uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox);
uiInterface.ThreadSafeQuestion.connect(noui_ThreadSafeQuestion);
uiInterface.InitMessage.connect(noui_InitMessage);
}
5 changes: 5 additions & 0 deletions src/primitives/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ unsigned int CTransaction::CalculateModifiedSize(unsigned int nTxSize) const
return nTxSize;
}

unsigned int CTransaction::GetTotalSize() const
{
return ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION);
}

std::string CTransaction::ToString() const
{
std::string str;
Expand Down
7 changes: 7 additions & 0 deletions src/primitives/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,13 @@ class CTransaction

// Compute modified tx size for priority calculation (optionally given tx size)
unsigned int CalculateModifiedSize(unsigned int nTxSize=0) const;

/**
* Get the total transaction size in bytes, including witness data.
* "Total Size" defined in BIP141 and BIP144.
* @return Total transaction size in bytes
*/
unsigned int GetTotalSize() const;

bool IsCoinBase() const
{
Expand Down
21 changes: 17 additions & 4 deletions src/qt/askpassphrasedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :

AskPassphraseDialog::~AskPassphraseDialog()
{
// Attempt to overwrite text so that they do not linger around in memory
ui->passEdit1->setText(QString(" ").repeated(ui->passEdit1->text().size()));
ui->passEdit2->setText(QString(" ").repeated(ui->passEdit2->text().size()));
ui->passEdit3->setText(QString(" ").repeated(ui->passEdit3->text().size()));
secureClearPassFields();
delete ui;
}

Expand All @@ -103,6 +100,8 @@ void AskPassphraseDialog::accept()
newpass1.assign(ui->passEdit2->text().toStdString().c_str());
newpass2.assign(ui->passEdit3->text().toStdString().c_str());

secureClearPassFields();

switch(mode)
{
case Encrypt: {
Expand Down Expand Up @@ -262,3 +261,17 @@ bool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event)
}
return QDialog::eventFilter(object, event);
}

static void SecureClearQLineEdit(QLineEdit* edit)
{
// Attempt to overwrite text so that they do not linger around in memory
edit->setText(QString(" ").repeated(edit->text().size()));
edit->clear();
}

void AskPassphraseDialog::secureClearPassFields()
{
SecureClearQLineEdit(ui->passEdit1);
SecureClearQLineEdit(ui->passEdit2);
SecureClearQLineEdit(ui->passEdit3);
}
1 change: 1 addition & 0 deletions src/qt/askpassphrasedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class AskPassphraseDialog : public QDialog

private Q_SLOTS:
void textChanged();
void secureClearPassFields();

protected:
bool event(QEvent *event);
Expand Down
83 changes: 61 additions & 22 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "clientmodel.h"
#include "guiconstants.h"
#include "guiutil.h"
#include "modaloverlay.h"
#include "networkstyle.h"
#include "notificator.h"
#include "openuridialog.h"
Expand Down Expand Up @@ -116,6 +117,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
notificator(0),
rpcConsole(0),
helpMessageDialog(0),
modalOverlay(0),
prevBlocks(0),
spinnerFrame(0),
platformStyle(platformStyle)
Expand Down Expand Up @@ -253,6 +255,12 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n

// Subscribe to notifications from core
subscribeToCoreSignals();

modalOverlay = new ModalOverlay(this->centralWidget());
#ifdef ENABLE_WALLET
if(enableWallet)
connect(walletFrame, SIGNAL(requestedSyncWarningInfo()), this, SLOT(showModalOverlay()));
#endif
}

BitcoinGUI::~BitcoinGUI()
Expand Down Expand Up @@ -624,6 +632,18 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
}
#endif // ENABLE_WALLET
unitDisplayControl->setOptionsModel(clientModel->getOptionsModel());

OptionsModel* optionsModel = clientModel->getOptionsModel();
if(optionsModel)
{
// be aware of the tray icon disable state change reported by the OptionsModel object.
connect(optionsModel,SIGNAL(hideTrayIconChanged(bool)),this,SLOT(setTrayIconVisible(bool)));

// initialize the disable state of the tray icon with the current value in the model.
setTrayIconVisible(optionsModel->getHideTrayIcon());
}

modalOverlay->setKnownBestHeight(clientModel->getHeaderTipHeight(), QDateTime::fromTime_t(clientModel->getHeaderTipTime()));
} else {
// Disable possibility to show main window via action
toggleHideAction->setEnabled(false);
Expand Down Expand Up @@ -695,7 +715,7 @@ void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle)
QString toolTip = tr("Dash Core client") + " " + networkStyle->getTitleAddText();
trayIcon->setToolTip(toolTip);
trayIcon->setIcon(networkStyle->getTrayAndWindowIcon());
trayIcon->show();
trayIcon->hide();
notificator = new Notificator(QApplication::applicationName(), trayIcon, this);
}

Expand Down Expand Up @@ -896,7 +916,17 @@ void BitcoinGUI::setNumConnections(int count)

void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool header)
{
if(!clientModel)
if (modalOverlay)
{
if (header) {
/* use clientmodels getHeaderTipHeight and getHeaderTipTime because the NotifyHeaderTip signal does not fire when updating the best header */
modalOverlay->setKnownBestHeight(clientModel->getHeaderTipHeight(), QDateTime::fromTime_t(clientModel->getHeaderTipTime()));
}
else {
modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);
}
}
if (!clientModel)
return;

// Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text)
Expand Down Expand Up @@ -940,32 +970,23 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
// Set icon state: spinning if catching up, tick otherwise
QString theme = GUIUtil::getThemeName();

if(!masternodeSync.IsBlockchainSynced())
#ifdef ENABLE_WALLET
if (walletFrame)
{
// Represent time from last generated block in human readable text
QString timeBehindText;
const int HOUR_IN_SECONDS = 60*60;
const int DAY_IN_SECONDS = 24*60*60;
const int WEEK_IN_SECONDS = 7*24*60*60;
const int YEAR_IN_SECONDS = 31556952; // Average length of year in Gregorian calendar
if(secs < 2*DAY_IN_SECONDS)
{
timeBehindText = tr("%n hour(s)","",secs/HOUR_IN_SECONDS);
}
else if(secs < 2*WEEK_IN_SECONDS)
if(secs < 25*60) // 90*60 in bitcoin
{
timeBehindText = tr("%n day(s)","",secs/DAY_IN_SECONDS);
}
else if(secs < YEAR_IN_SECONDS)
{
timeBehindText = tr("%n week(s)","",secs/WEEK_IN_SECONDS);
modalOverlay->showHide(true, true);
}
else
{
qint64 years = secs / YEAR_IN_SECONDS;
qint64 remainder = secs % YEAR_IN_SECONDS;
timeBehindText = tr("%1 and %2").arg(tr("%n year(s)", "", years)).arg(tr("%n week(s)","", remainder/WEEK_IN_SECONDS));
modalOverlay->showHide();
}
}
#endif // ENABLE_WALLET

if(!masternodeSync.IsBlockchainSynced())
{
QString timeBehindText = GUIUtil::formateNiceTimeOffset(secs);

progressBarLabel->setVisible(true);
progressBar->setFormat(tr("%1 behind").arg(timeBehindText));
Expand All @@ -985,7 +1006,9 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer

#ifdef ENABLE_WALLET
if(walletFrame)
{
walletFrame->showOutOfSyncWarning(true);
}
#endif // ENABLE_WALLET

tooltip += QString("<br>");
Expand Down Expand Up @@ -1342,6 +1365,20 @@ void BitcoinGUI::showProgress(const QString &title, int nProgress)
progressDialog->setValue(nProgress);
}

void BitcoinGUI::setTrayIconVisible(bool fHideTrayIcon)
{
if (trayIcon)
{
trayIcon->setVisible(!fHideTrayIcon);
}
}

void BitcoinGUI::showModalOverlay()
{
if (modalOverlay)
modalOverlay->showHide(false, true);
}

static bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string& message, const std::string& caption, unsigned int style)
{
bool modal = (style & CClientUIInterface::MODAL);
Expand All @@ -1363,12 +1400,14 @@ void BitcoinGUI::subscribeToCoreSignals()
{
// Connect signals to client
uiInterface.ThreadSafeMessageBox.connect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3));
uiInterface.ThreadSafeQuestion.connect(boost::bind(ThreadSafeMessageBox, this, _1, _3, _4));
}

void BitcoinGUI::unsubscribeFromCoreSignals()
{
// Disconnect signals from client
uiInterface.ThreadSafeMessageBox.disconnect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3));
uiInterface.ThreadSafeQuestion.disconnect(boost::bind(ThreadSafeMessageBox, this, _1, _3, _4));
}

/** Get restart command-line parameters and request restart */
Expand Down
Loading