Browse Source

TxConfAdvDialog: export tx key

beta-9
tobtoht 4 months ago
parent
commit
f09e973e56
  1. 9
      src/dialog/TxConfAdvDialog.cpp
  2. 3
      src/dialog/TxConfAdvDialog.h
  3. 51
      src/dialog/TxConfAdvDialog.ui

9
src/dialog/TxConfAdvDialog.cpp

@ -19,6 +19,7 @@ TxConfAdvDialog::TxConfAdvDialog(QSharedPointer<AppContext> ctx, const QString &
, m_ctx(std::move(ctx))
, m_exportUnsignedMenu(new QMenu(this))
, m_exportSignedMenu(new QMenu(this))
, m_exportTxKeyMenu(new QMenu(this))
{
ui->setupUi(this);
@ -31,6 +32,9 @@ TxConfAdvDialog::TxConfAdvDialog(QSharedPointer<AppContext> ctx, const QString &
m_exportSignedMenu->addAction("Save to file", this, &TxConfAdvDialog::signedSaveFile);
ui->btn_exportSigned->setMenu(m_exportSignedMenu);
m_exportTxKeyMenu->addAction("Copy to clipboard", this, &TxConfAdvDialog::txKeyCopy);
ui->btn_exportTxKey->setMenu(m_exportTxKeyMenu);
if (m_ctx->wallet->viewOnly()) {
ui->btn_exportSigned->hide();
ui->btn_send->hide();
@ -80,6 +84,7 @@ void TxConfAdvDialog::setUnsignedTransaction(UnsignedTransaction *utx) {
ui->btn_exportUnsigned->hide();
ui->btn_exportSigned->hide();
ui->btn_exportTxKey->hide();
ui->btn_sign->show();
ui->btn_send->hide();
@ -166,6 +171,10 @@ void TxConfAdvDialog::signedCopy() {
Utils::copyToClipboard(m_tx->signedTxToHex(0));
}
void TxConfAdvDialog::txKeyCopy() {
Utils::copyToClipboard(m_tx->transaction(0)->txKey());
}
void TxConfAdvDialog::signedQrCode() {
}

3
src/dialog/TxConfAdvDialog.h

@ -41,12 +41,15 @@ private:
void signedQrCode();
void signedSaveFile();
void txKeyCopy();
QScopedPointer<Ui::TxConfAdvDialog> ui;
QSharedPointer<AppContext> m_ctx;
PendingTransaction *m_tx = nullptr;
UnsignedTransaction *m_utx = nullptr;
QMenu *m_exportUnsignedMenu;
QMenu *m_exportSignedMenu;
QMenu *m_exportTxKeyMenu;
};
#endif //FEATHER_TXCONFADVDIALOG_H

51
src/dialog/TxConfAdvDialog.ui

@ -21,19 +21,30 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Transaction ID:</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Transaction ID:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="txid">
<property name="text">
<string>txid</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLineEdit" name="txid">
<property name="text">
<string>txid</string>
</property>
<property name="readOnly">
<bool>true</bool>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
@ -251,6 +262,16 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btn_exportTxKey">
<property name="text">
<string>Export tx key</string>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@ -272,16 +293,16 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_send">
<widget class="QPushButton" name="btn_close">
<property name="text">
<string>Send</string>
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_close">
<widget class="QPushButton" name="btn_send">
<property name="text">
<string>Close</string>
<string>Send</string>
</property>
</widget>
</item>

Loading…
Cancel
Save