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
4 changes: 2 additions & 2 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#include <QJsonDocument>
#include <QJsonObject>
#include <QtGlobal>
#include <QScreen>

const std::string BitcoinGUI::DEFAULT_UIPLATFORM =
#if defined(Q_OS_MAC)
Expand All @@ -86,8 +87,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node &node, const Config *configIn,
QSettings settings;
if (!restoreGeometry(settings.value("MainWindowGeometry").toByteArray())) {
// Restore failed (perhaps missing setting), center the window
move(QApplication::desktop()->availableGeometry().center() -
frameGeometry().center());
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
}

if (DVTUI::customThemeIsSet()) {
Expand Down
6 changes: 2 additions & 4 deletions src/qt/receivecoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,8 @@ void ReceiveCoinsDialog::copyColumnToClipboard(int column) {
if (!firstIndex.isValid()) {
return;
}
GUIUtil::setClipboard(
model->getRecentRequestsTableModel()
->data(firstIndex.child(firstIndex.row(), column), Qt::EditRole)
.toString());
GUIUtil::setClipboard(
model->getRecentRequestsTableModel()->data(firstIndex.sibling(firstIndex.row(), column), Qt::EditRole).toString());
}

// context menu
Expand Down
21 changes: 7 additions & 14 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <QThread>
#include <QTime>
#include <QTimer>
#include <QScreen>

// TODO: add a scrollback limit, as there is currently none
// TODO: make it possible to filter out categories (esp debug messages when
Expand Down Expand Up @@ -521,8 +522,7 @@ RPCConsole::RPCConsole(interfaces::Node &node,
if (!restoreGeometry(
settings.value("RPCConsoleWindowGeometry").toByteArray())) {
// Restore failed (perhaps missing setting), center the window
move(QApplication::desktop()->availableGeometry().center() -
frameGeometry().center());
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
}
if(DVTUI::customThemeIsSet()) {
QString appstyle = "fusion";
Expand Down Expand Up @@ -705,18 +705,11 @@ void RPCConsole::setClientModel(ClientModel *model) {
// to use int (instead of int64_t), because signal mapper only supports
// int or objects, which is okay because max bantime (1 year) is <
// int_max.
QSignalMapper *signalMapper = new QSignalMapper(this);
signalMapper->setMapping(banAction1h, 60 * 60);
signalMapper->setMapping(banAction24h, 60 * 60 * 24);
signalMapper->setMapping(banAction7d, 60 * 60 * 24 * 7);
signalMapper->setMapping(banAction365d, 60 * 60 * 24 * 365);
connect(banAction1h, SIGNAL(triggered()), signalMapper, SLOT(map()));
connect(banAction24h, SIGNAL(triggered()), signalMapper, SLOT(map()));
connect(banAction7d, SIGNAL(triggered()), signalMapper, SLOT(map()));
connect(banAction365d, SIGNAL(triggered()), signalMapper, SLOT(map()));
connect(signalMapper, SIGNAL(mapped(int)), this,
SLOT(banSelectedNode(int)));

connect(banAction1h, &QAction::triggered, [this]() { banSelectedNode(60*60); });
connect(banAction24h, &QAction::triggered, [this]() { banSelectedNode(24*60*60); });
connect(banAction7d, &QAction::triggered, [this]() { banSelectedNode(7*24*60*60); });
connect(banAction365d, &QAction::triggered, [this]() { banSelectedNode(365*24*60*60); });

// peer table context menu signals
connect(ui->peerWidget,
SIGNAL(customContextMenuRequested(const QPoint &)), this,
Expand Down
3 changes: 2 additions & 1 deletion src/qt/splashscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <QDesktopWidget>
#include <QPainter>
#include <QRadialGradient>
#include <QScreen>

SplashScreen::SplashScreen(interfaces::Node &node, Qt::WindowFlags f,
const NetworkStyle *networkStyle)
Expand Down Expand Up @@ -123,7 +124,7 @@ SplashScreen::SplashScreen(interfaces::Node &node, Qt::WindowFlags f,
pixmap.size().height() / devicePixelRatio));
resize(r.size());
setFixedSize(r.size());
move(QApplication::desktop()->screenGeometry().center() - r.center());
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());

subscribeToCoreSignals();
installEventFilter(this);
Expand Down
12 changes: 2 additions & 10 deletions src/qt/transactionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <QMenu>
#include <QPoint>
#include <QScrollBar>
#include <QSignalMapper>
#include <QTableView>
#include <QUrl>
#include <QVBoxLayout>
Expand Down Expand Up @@ -173,12 +172,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle,
contextMenu->addAction(abandonAction);
contextMenu->addAction(editLabelAction);

mapperThirdPartyTxUrls = new QSignalMapper(this);

// Connect actions
connect(mapperThirdPartyTxUrls, SIGNAL(mapped(QString)), this,
SLOT(openThirdPartyTxUrl(QString)));

connect(amountWidget, &QLineEdit::textChanged, this, &TransactionView::changedAmount);

connect(dateWidget,
Expand Down Expand Up @@ -260,10 +254,8 @@ void TransactionView::setModel(WalletModel *_model) {
contextMenu->addSeparator();
}
contextMenu->addAction(thirdPartyTxUrlAction);
connect(thirdPartyTxUrlAction, SIGNAL(triggered()),
mapperThirdPartyTxUrls, SLOT(map()));
mapperThirdPartyTxUrls->setMapping(thirdPartyTxUrlAction,
listUrls[i].trimmed());
auto l = listUrls[i];
connect(thirdPartyTxUrlAction, &QAction::triggered, [this,l]() {openThirdPartyTxUrl(l.trimmed());});
}
}
}
Expand Down