Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *
// Progress bar and label for blocks download
progressBarLabel = new QLabel();
progressBarLabel->setVisible(true);
progressBarLabel->setObjectName("lblStatusBarProgress");
progressBar = new GUIUtil::ProgressBar();
progressBar->setAlignment(Qt::AlignCenter);
progressBar->setVisible(true);
Expand Down
74 changes: 55 additions & 19 deletions src/qt/forms/overviewpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -475,37 +475,73 @@
<property name="text">
<string>n/a</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="VerticalLayout_PS">
<item>
<widget class="QLabel" name="labelPrivateSendLastMessage">
<property name="text">
<string>(Last Message)</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="topMargin">
<number>0</number>
</property>
</widget>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="togglePrivateSend">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Start/Stop Mixing</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="togglePrivateSend">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="text">
<string>Start/Stop Mixing</string>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</widget>
</spacer>
</item>
</layout>
</item>
Expand Down
36 changes: 19 additions & 17 deletions src/qt/forms/sendcoinsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,11 @@
<property name="spacing">
<number>6</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayoutFee13">
<layout class="QHBoxLayout" name="horizontalLayoutFee13" stretch="0,0,1">
<item>
<widget class="QLabel" name="labelCustomPerKilobyte">
<property name="toolTip">
Expand Down Expand Up @@ -855,6 +858,12 @@
</item>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayoutFee4" stretch="0,1">
<property name="topMargin">
<number>20</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QRadioButton" name="radioSmartFee">
<property name="text">
Expand Down Expand Up @@ -885,6 +894,9 @@
</item>
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayoutFee9" stretch="0,1">
<property name="topMargin">
<number>30</number>
</property>
<item>
<widget class="QRadioButton" name="radioCustomFee">
<property name="text">
Expand Down Expand Up @@ -916,7 +928,10 @@
<number>6</number>
</property>
<property name="topMargin">
<number>2</number>
<number>0</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayoutFee12">
Expand Down Expand Up @@ -976,19 +991,6 @@
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
Expand Down Expand Up @@ -1136,7 +1138,7 @@
<number>3</number>
</property>
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="labelBalanceText">
<property name="text">
<string>Balance:</string>
</property>
Expand All @@ -1145,7 +1147,7 @@
<item>
<widget class="QLabel" name="labelBalance">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
Expand Down
1 change: 1 addition & 0 deletions src/qt/intro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ bool Intro::pickDataDirectory()
/* Let the user choose one */
Intro intro;
GUIUtil::disableMacFocusRect(&intro);
GUIUtil::loadStyleSheet(&intro);
intro.setDataDirectory(dataDirDefaultCurrent);
intro.setWindowIcon(QIcon(":icons/bitcoin"));

Expand Down
8 changes: 5 additions & 3 deletions src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,11 @@ void OptionsDialog::setModel(OptionsModel *_model)
showRestartWarning(true);

QString strLabel = _model->getOverriddenByCommandLine();
if (strLabel.isEmpty())
strLabel = tr("none");
ui->overriddenByCommandLineLabel->setText(strLabel);
if (strLabel.isEmpty()) {
ui->frame->setHidden(true);
} else {
ui->overriddenByCommandLineLabel->setText(strLabel);
}

mapper->setModel(_model);
setMapper();
Expand Down
28 changes: 16 additions & 12 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ void OverviewPage::setWalletModel(WalletModel *model)
// explicitly update PS frame and transaction list to reflect actual settings
updateAdvancedPSUI(model->getOptionsModel()->getShowAdvancedPSUI());

// Initialize PS UI
privateSendStatus(true);

if(!privateSendClient.fEnablePrivateSend) return;

connect(model->getOptionsModel(), SIGNAL(privateSendRoundsChanged()), this, SLOT(updatePrivateSendProgress()));
Expand Down Expand Up @@ -467,15 +470,23 @@ void OverviewPage::updateAdvancedPSUI(bool fShowAdvancedPSUI) {
ui->privateSendProgress->setVisible(fShowAdvancedPSUI);
ui->labelSubmittedDenomText->setVisible(fShowAdvancedPSUI);
ui->labelSubmittedDenom->setVisible(fShowAdvancedPSUI);
ui->labelPrivateSendLastMessage->setVisible(fShowAdvancedPSUI);
}

void OverviewPage::privateSendStatus()
void OverviewPage::privateSendStatus(bool fForce)
{
if(!masternodeSync.IsBlockchainSynced() || ShutdownRequested()) return;
if (!fForce && (!masternodeSync.IsBlockchainSynced() || ShutdownRequested())) return;

if(!walletModel) return;

auto tempWidgets = {ui->labelSubmittedDenomText,
ui->labelSubmittedDenom};

auto setWidgetsVisible = [&](bool fVisible) {
for (const auto& it : tempWidgets) {
it->setVisible(fVisible);
}
};

static int64_t nLastDSProgressBlockTime = 0;
int nBestHeight = clientModel->getNumBlocks();

Expand All @@ -495,7 +506,7 @@ void OverviewPage::privateSendStatus()
updatePrivateSendProgress();
}

ui->labelPrivateSendLastMessage->setText("");
setWidgetsVisible(false);
ui->togglePrivateSend->setText(tr("Start Mixing"));

QString strEnabled = tr("Disabled");
Expand Down Expand Up @@ -574,14 +585,7 @@ void OverviewPage::privateSendStatus()
updatePrivateSendProgress();
}

QString strStatus = QString(privateSendClient.GetStatuses().c_str());

QString s = tr("Last PrivateSend message:\n") + strStatus;

if(s != ui->labelPrivateSendLastMessage->text())
LogPrint(BCLog::PRIVATESEND, "OverviewPage::privateSendStatus -- Last PrivateSend message: %s\n", strStatus.toStdString());

ui->labelPrivateSendLastMessage->setText(s);
setWidgetsVisible(true);

ui->labelSubmittedDenom->setText(QString(privateSendClient.GetSessionDenoms().c_str()));
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/overviewpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class OverviewPage : public QWidget
void showOutOfSyncWarning(bool fShow);

public Q_SLOTS:
void privateSendStatus();
void privateSendStatus(bool fForce = false);
void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& anonymizedBalance,
const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);

Expand Down
31 changes: 18 additions & 13 deletions src/qt/receiverequestdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void ReceiveRequestDialog::update()
ui->btnSaveAs->setEnabled(false);
QString html;
html += "<html>";
html += "<b>"+tr("Payment information")+"</b><br>";
html += "<b>" + tr("Payment information") + "</b><br><br>";
html += "<b>"+tr("URI")+"</b>: ";
html += QString("<a style=\"%1\"href=\"").arg(GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_COMMAND)) +
uri + "\">" + GUIUtil::HtmlEscape(uri) + "</a><br>";
Expand Down Expand Up @@ -165,34 +165,39 @@ void ReceiveRequestDialog::update()
ui->lblQRCode->setText(tr("Error encoding URI into QR Code."));
return;
}
QImage qrImage = QImage(code->width + 8, code->width + 8, QImage::Format_RGB32);
QImage qrImage = QImage(code->width + 6, code->width + 6, QImage::Format_RGB32);
qrImage.fill(GUIUtil::getThemedQColor(GUIUtil::ThemedColor::BACKGROUND_WIDGET));
unsigned char *p = code->data;
for (int y = 0; y < code->width; y++)
{
for (int x = 0; x < code->width; x++)
{
qrImage.setPixel(x + 4, y + 4, ((*p & 1) ? GUIUtil::getThemedQColor(GUIUtil::ThemedColor::QR_PIXEL).rgb() : GUIUtil::getThemedQColor(GUIUtil::ThemedColor::BACKGROUND_WIDGET).rgb()));
qrImage.setPixel(x + 3, y + 3, ((*p & 1) ? GUIUtil::getThemedQColor(GUIUtil::ThemedColor::QR_PIXEL).rgb() : GUIUtil::getThemedQColor(GUIUtil::ThemedColor::BACKGROUND_WIDGET).rgb()));
p++;
}
}
QRcode_free(code);

QImage qrAddrImage = QImage(QR_IMAGE_SIZE, QR_IMAGE_SIZE+20, QImage::Format_RGB32);
qrAddrImage.fill(GUIUtil::getThemedQColor(GUIUtil::ThemedColor::BORDER_WIDGET));
// Create the image with respect to the device pixel ratio
int qrAddrImageWidth = QR_IMAGE_SIZE;
int qrAddrImageHeight = QR_IMAGE_SIZE + 20;
qreal scale = qApp->devicePixelRatio();
QImage qrAddrImage = QImage(qrAddrImageWidth * scale, qrAddrImageHeight * scale, QImage::Format_RGB32);
qrAddrImage.setDevicePixelRatio(scale);
QPainter painter(&qrAddrImage);
QRect paddedRect = qrAddrImage.rect().adjusted(1, 1, -1, -1);
// Fill the whole image with border color
qrAddrImage.fill(GUIUtil::getThemedQColor(GUIUtil::ThemedColor::BORDER_WIDGET));
// Create a 2px/2px smaller rect and fill it with background color to keep the 1px border with the border color
QRect paddedRect = QRect(1, 1, qrAddrImageWidth - 2, qrAddrImageHeight - 2);
painter.fillRect(paddedRect, GUIUtil::getThemedQColor(GUIUtil::ThemedColor::BACKGROUND_WIDGET));
painter.drawImage(1, 1, qrImage.scaled(QR_IMAGE_SIZE - 2, QR_IMAGE_SIZE - 2));
QFont font = GUIUtil::fixedPitchFont();

painter.drawImage(2, 2, qrImage.scaled(QR_IMAGE_SIZE - 4, QR_IMAGE_SIZE - 4));
// calculate ideal font size
qreal font_size = GUIUtil::calculateIdealFontSize(paddedRect.width() - 20, info.address, font);
QFont font = GUIUtil::fixedPitchFont();
qreal font_size = GUIUtil::calculateIdealFontSize((paddedRect.width() - 20), info.address, font);
font.setPointSizeF(font_size);

// paint the address
painter.setFont(font);
paddedRect.setHeight(QR_IMAGE_SIZE);
painter.setPen(GUIUtil::getThemedQColor(GUIUtil::ThemedColor::QR_PIXEL));
paddedRect.setHeight(QR_IMAGE_SIZE + 3);
painter.drawText(paddedRect, Qt::AlignBottom|Qt::AlignCenter, info.address);
painter.end();

Expand Down
6 changes: 0 additions & 6 deletions src/qt/res/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -1487,12 +1487,6 @@ QWidget .QFrame#framePrivateSend .QWidget#layoutWidgetLastMessageAndButtons {
max-width: 451px;
}

QWidget .QFrame#framePrivateSend .QLabel#labelPrivateSendLastMessage { /* PrivateSend Status Notifications */
qproperty-alignment: 'AlignVCenter | AlignLeft';
min-width: 288px;
min-height: 50px;
}

QWidget .QFrame#framePrivateSend .QPushButton#togglePrivateSend { /* Start PrivateSend Mixing */
margin-top: 5px;
}
Expand Down
4 changes: 4 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <QTime>
#include <QTimer>
#include <QStringList>
#include <QStyledItemDelegate>

// TODO: add a scrollback limit, as there is currently none
// TODO: make it possible to filter out categories (esp debug messages when implemented)
Expand Down Expand Up @@ -717,6 +718,9 @@ void RPCConsole::setClientModel(ClientModel *model)
wordList << "help-console";
wordList.sort();
autoCompleter = new QCompleter(wordList, this);
autoCompleter->popup()->setItemDelegate(new QStyledItemDelegate(this));
autoCompleter->popup()->setObjectName("rpcAutoCompleter");
GUIUtil::loadStyleSheet(autoCompleter->popup());
autoCompleter->setModelSorting(QCompleter::CaseSensitivelySortedModel);
ui->lineEdit->setCompleter(autoCompleter);
autoCompleter->popup()->installEventFilter(this);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ SendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, QWidget *p
}, GUIUtil::FontWeight::Bold);

GUIUtil::setFont({ui->labelBalance,
ui->label
ui->labelBalanceText
}, GUIUtil::FontWeight::Bold, 14);

GUIUtil::setFont({ui->labelCoinControlFeatures
Expand Down
10 changes: 5 additions & 5 deletions src/qt/test/wallettests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ void TestGUI()
QString paymentText = rlist->toPlainText();
QStringList paymentTextList = paymentText.split('\n');
QCOMPARE(paymentTextList.at(0), QString("Payment information"));
QVERIFY(paymentTextList.at(1).indexOf(QString("URI: dash:")) != -1);
QVERIFY(paymentTextList.at(2).indexOf(QString("Address:")) != -1);
QCOMPARE(paymentTextList.at(3), QString("Amount: 0.00000001 ") + BitcoinUnits::name(unit));
QCOMPARE(paymentTextList.at(4), QString("Label: TEST_LABEL_1"));
QCOMPARE(paymentTextList.at(5), QString("Message: TEST_MESSAGE_1"));
QVERIFY(paymentTextList.at(2).indexOf(QString("URI: dash:")) != -1);
QVERIFY(paymentTextList.at(3).indexOf(QString("Address:")) != -1);
QCOMPARE(paymentTextList.at(4), QString("Amount: 0.00000001 ") + BitcoinUnits::name(unit));
QCOMPARE(paymentTextList.at(5), QString("Label: TEST_LABEL_1"));
QCOMPARE(paymentTextList.at(6), QString("Message: TEST_MESSAGE_1"));
}
}

Expand Down
Loading