forked from cryptonotefoundation/cryptonotewallet
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from aivve/feature/send_no_relay
Save raw tx without relay
- Loading branch information
Showing
23 changed files
with
1,670 additions
and
667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) 2016 The Karbowanec developers | ||
// Distributed under the MIT/X11 software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include "ExportRawTxDialog.h" | ||
#include "ui_exportrawtxdialog.h" | ||
#include <QClipboard> | ||
#include <QFileDialog> | ||
#include <QTextStream> | ||
#include <Common/StringTools.h> | ||
#include "CurrencyAdapter.h" | ||
#include "WalletAdapter.h" | ||
#include "MainWindow.h" | ||
#include <boost/utility/value_init.hpp> | ||
|
||
namespace WalletGui { | ||
|
||
ExportRawTransactionDialog::ExportRawTransactionDialog(QWidget* _parent) : QDialog(_parent), m_ui(new Ui::ExportRawTransactionDialog) { | ||
m_ui->setupUi(this); | ||
} | ||
|
||
ExportRawTransactionDialog::~ExportRawTransactionDialog() { | ||
m_ui->m_txEdit->clear(); | ||
} | ||
|
||
void ExportRawTransactionDialog::setTransaction(const QString& _transaction) { | ||
m_ui->m_txEdit->setText(_transaction); | ||
} | ||
|
||
void ExportRawTransactionDialog::copyTx() { | ||
QApplication::clipboard()->setText(m_ui->m_txEdit->toPlainText()); | ||
} | ||
|
||
void ExportRawTransactionDialog::saveTxToFile() { | ||
QString fileName = QFileDialog::getSaveFileName(&MainWindow::instance(), tr("Save transaction to..."), QDir::homePath(), tr("Raw hex transaction (*.txt)")); | ||
if (!fileName.isEmpty()) { | ||
QFile f(fileName); | ||
if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { | ||
QTextStream outputStream(&f); | ||
outputStream << m_ui->m_txEdit->toPlainText(); | ||
f.close(); | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2016-2017 The Karbowanec developers | ||
// Distributed under the MIT/X11 software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include <QDialog> | ||
|
||
namespace Ui { | ||
class ExportRawTransactionDialog; | ||
} | ||
|
||
namespace WalletGui { | ||
|
||
class ExportRawTransactionDialog : public QDialog { | ||
Q_OBJECT | ||
|
||
public: | ||
ExportRawTransactionDialog(QWidget * _parent); | ||
|
||
~ExportRawTransactionDialog(); | ||
|
||
void setTransaction(const QString& _transaction); | ||
|
||
private: | ||
Q_SLOT void copyTx(); | ||
Q_SLOT void saveTxToFile(); | ||
|
||
QScopedPointer<Ui::ExportRawTransactionDialog> m_ui; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>ExportRawTransactionDialog</class> | ||
<widget class="QDialog" name="ExportRawTransactionDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>626</width> | ||
<height>460</height> | ||
</rect> | ||
</property> | ||
<property name="minimumSize"> | ||
<size> | ||
<width>600</width> | ||
<height>150</height> | ||
</size> | ||
</property> | ||
<property name="maximumSize"> | ||
<size> | ||
<width>16777215</width> | ||
<height>16777215</height> | ||
</size> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Export raw transaction</string> | ||
</property> | ||
<property name="windowIcon"> | ||
<iconset resource="../../resources.qrc"> | ||
<normaloff>:/images/cryptonote</normaloff>:/images/cryptonote</iconset> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout_3"> | ||
<property name="topMargin"> | ||
<number>0</number> | ||
</property> | ||
<item> | ||
<widget class="QTextEdit" name="m_txEdit"> | ||
<property name="readOnly"> | ||
<bool>true</bool> | ||
</property> | ||
<property name="acceptRichText"> | ||
<bool>false</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>You can broadcast this transaction to the network e.g. via block explorer or RPC request to any public node.</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<spacer name="horizontalSpacer"> | ||
<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="m_saveTxButton"> | ||
<property name="text"> | ||
<string>Save to file</string> | ||
</property> | ||
<property name="icon"> | ||
<iconset resource="../../resources.qrc"> | ||
<normaloff>:/icons/save</normaloff>:/icons/save</iconset> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="m_copyTxButton"> | ||
<property name="text"> | ||
<string>Copy</string> | ||
</property> | ||
<property name="icon"> | ||
<iconset resource="../../resources.qrc"> | ||
<normaloff>:/icons/copy_white</normaloff>:/icons/copy_white</iconset> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="ClosePushButton"> | ||
<property name="text"> | ||
<string>Close</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources> | ||
<include location="../../resources.qrc"/> | ||
</resources> | ||
<connections> | ||
<connection> | ||
<sender>ClosePushButton</sender> | ||
<signal>clicked()</signal> | ||
<receiver>ExportRawTransactionDialog</receiver> | ||
<slot>accept()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>622</x> | ||
<y>274</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>333</x> | ||
<y>149</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>m_copyTxButton</sender> | ||
<signal>clicked()</signal> | ||
<receiver>ExportRawTransactionDialog</receiver> | ||
<slot>copyTx()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>711</x> | ||
<y>68</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>419</x> | ||
<y>44</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>m_saveTxButton</sender> | ||
<signal>clicked()</signal> | ||
<receiver>ExportRawTransactionDialog</receiver> | ||
<slot>saveTxToFile()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>412</x> | ||
<y>127</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>312</x> | ||
<y>74</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
</ui> |
Oops, something went wrong.