Copy txid from status bar
This commit is contained in:
@@ -5,9 +5,10 @@
|
||||
#include "rpc.h"
|
||||
#include "balancestablemodel.h"
|
||||
#include "settings.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "ui_about.h"
|
||||
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
@@ -28,6 +29,20 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
ui->statusBar->addPermanentWidget(loadingLabel);
|
||||
loadingLabel->setVisible(false);
|
||||
|
||||
ui->statusBar->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
QObject::connect(ui->statusBar, &QStatusBar::customContextMenuRequested, [=](QPoint pos) {
|
||||
auto msg = ui->statusBar->currentMessage();
|
||||
if (!msg.isEmpty() && msg.startsWith(Utils::txidStatusMessage)) {
|
||||
QMenu menu(this);
|
||||
menu.addAction("Copy txid", [=]() {
|
||||
QGuiApplication::clipboard()->setText(msg.split(":")[1].trimmed());
|
||||
});
|
||||
QPoint gpos(mapToGlobal(pos).x(), mapToGlobal(pos).y() + this->height() - ui->statusBar->height());
|
||||
menu.exec(gpos);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
statusLabel = new QLabel();
|
||||
ui->statusBar->addPermanentWidget(statusLabel);
|
||||
|
||||
@@ -316,7 +331,6 @@ MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
delete rpc;
|
||||
delete settings;
|
||||
|
||||
delete loadingMovie;
|
||||
}
|
||||
|
||||
@@ -273,8 +273,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>823</width>
|
||||
<height>226</height>
|
||||
<width>825</width>
|
||||
<height>284</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="sendToLayout">
|
||||
@@ -637,7 +637,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>889</width>
|
||||
<height>22</height>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuBalance">
|
||||
@@ -645,7 +645,6 @@
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="actionImport_Private_Keys"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionSettings"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionExit"/>
|
||||
@@ -685,6 +684,9 @@
|
||||
<property name="text">
|
||||
<string>Import Private Keys</string>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "rpc.h"
|
||||
#include "utils.h"
|
||||
#include "transactionitem.h"
|
||||
#include "settings.h"
|
||||
|
||||
@@ -443,9 +444,8 @@ void RPC::refreshTxStatus(const QString& newOpid) {
|
||||
QString status = QString::fromStdString(it["status"]);
|
||||
if (status == "success") {
|
||||
auto txid = QString::fromStdString(it["result"]["txid"]);
|
||||
qDebug() << "Tx complete. txid " << txid;
|
||||
QGuiApplication::clipboard()->setText(txid);
|
||||
main->ui->statusBar->showMessage("Tx completed! Txid copied to clipboard (" + txid + ")");
|
||||
qDebug() << "Tx completed: " << txid;
|
||||
main->ui->statusBar->showMessage(Utils::txidStatusMessage + " " + txid);
|
||||
main->loadingLabel->setVisible(false);
|
||||
|
||||
watchingOps.remove(id);
|
||||
|
||||
@@ -26,4 +26,12 @@ Copy-Item README.md release/$target | Out-Null
|
||||
echo "Zipping"
|
||||
Compress-Archive -LiteralPath release/$target -DestinationPath "release/Windows-$target.zip"
|
||||
|
||||
echo "Package Contents"
|
||||
[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem')
|
||||
foreach($sourceFile in (Get-ChildItem "release/Windows-$target.zip"))
|
||||
{
|
||||
[IO.Compression.ZipFile]::OpenRead($sourceFile.FullName).Entries.FullName |
|
||||
%{ "$sourcefile`:$_" }
|
||||
}
|
||||
|
||||
echo "Done"
|
||||
@@ -152,6 +152,7 @@ public:
|
||||
actionDonate->setObjectName(QStringLiteral("actionDonate"));
|
||||
actionImport_Private_Keys = new QAction(MainWindow);
|
||||
actionImport_Private_Keys->setObjectName(QStringLiteral("actionImport_Private_Keys"));
|
||||
actionImport_Private_Keys->setVisible(false);
|
||||
centralWidget = new QWidget(MainWindow);
|
||||
centralWidget->setObjectName(QStringLiteral("centralWidget"));
|
||||
gridLayout_3 = new QGridLayout(centralWidget);
|
||||
@@ -348,7 +349,7 @@ public:
|
||||
sendToScrollArea->setWidgetResizable(true);
|
||||
sendToWidgets = new QWidget();
|
||||
sendToWidgets->setObjectName(QStringLiteral("sendToWidgets"));
|
||||
sendToWidgets->setGeometry(QRect(0, 0, 823, 226));
|
||||
sendToWidgets->setGeometry(QRect(0, 0, 825, 284));
|
||||
sendToLayout = new QVBoxLayout(sendToWidgets);
|
||||
sendToLayout->setSpacing(6);
|
||||
sendToLayout->setContentsMargins(11, 11, 11, 11);
|
||||
@@ -604,7 +605,7 @@ public:
|
||||
MainWindow->setCentralWidget(centralWidget);
|
||||
menuBar = new QMenuBar(MainWindow);
|
||||
menuBar->setObjectName(QStringLiteral("menuBar"));
|
||||
menuBar->setGeometry(QRect(0, 0, 889, 22));
|
||||
menuBar->setGeometry(QRect(0, 0, 889, 21));
|
||||
menuBalance = new QMenu(menuBar);
|
||||
menuBalance->setObjectName(QStringLiteral("menuBalance"));
|
||||
menuHelp = new QMenu(menuBar);
|
||||
@@ -634,7 +635,6 @@ public:
|
||||
menuBar->addAction(menuBalance->menuAction());
|
||||
menuBar->addAction(menuHelp->menuAction());
|
||||
menuBalance->addAction(actionImport_Private_Keys);
|
||||
menuBalance->addSeparator();
|
||||
menuBalance->addAction(actionSettings);
|
||||
menuBalance->addSeparator();
|
||||
menuBalance->addAction(actionExit);
|
||||
|
||||
Reference in New Issue
Block a user