mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 03:42:05 +02:00
Merge pull request #1415
da93fc4
export/import key images (cryptochangements34)
This commit is contained in:
commit
1107daab98
@ -535,6 +535,30 @@ Rectangle {
|
|||||||
submitTxDialog.open();
|
submitTxDialog.open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StandardButton {
|
||||||
|
id: exportKeyImagesButton
|
||||||
|
text: qsTr("Export key images") + translationManager.emptyString
|
||||||
|
small: true
|
||||||
|
visible: !appWindow.viewOnly
|
||||||
|
enabled: pageRoot.enabled
|
||||||
|
onClicked: {
|
||||||
|
console.log("Transfer: export key images clicked")
|
||||||
|
exportKeyImagesDialog.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StandardButton {
|
||||||
|
id: importKeyImagesButton
|
||||||
|
text: qsTr("Import key images") + translationManager.emptyString
|
||||||
|
small: true
|
||||||
|
visible: appWindow.viewOnly && walletManager.isDaemonLocal(appWindow.currentDaemonAddress)
|
||||||
|
enabled: pageRoot.enabled
|
||||||
|
onClicked: {
|
||||||
|
console.log("Transfer: import key images clicked")
|
||||||
|
importKeyImagesDialog.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,6 +650,35 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ExportKeyImagesDialog
|
||||||
|
FileDialog {
|
||||||
|
id: exportKeyImagesDialog
|
||||||
|
selectMultiple: false
|
||||||
|
selectExisting: false
|
||||||
|
onAccepted: {
|
||||||
|
console.log(walletManager.urlToLocalPath(exportKeyImagesDialog.fileUrl))
|
||||||
|
currentWallet.exportKeyImages(walletManager.urlToLocalPath(exportKeyImagesDialog.fileUrl));
|
||||||
|
}
|
||||||
|
onRejected: {
|
||||||
|
console.log("Canceled");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//ImportKeyImagesDialog
|
||||||
|
FileDialog {
|
||||||
|
id: importKeyImagesDialog
|
||||||
|
selectMultiple: false
|
||||||
|
selectExisting: true
|
||||||
|
title: qsTr("Please choose a file") + translationManager.emptyString
|
||||||
|
onAccepted: {
|
||||||
|
console.log(walletManager.urlToLocalPath(importKeyImagesDialog.fileUrl))
|
||||||
|
currentWallet.importKeyImages(walletManager.urlToLocalPath(importKeyImagesDialog.fileUrl));
|
||||||
|
}
|
||||||
|
onRejected: {
|
||||||
|
console.log("Canceled");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -336,6 +336,16 @@ quint64 Wallet::daemonBlockChainTargetHeight() const
|
|||||||
return m_daemonBlockChainTargetHeight;
|
return m_daemonBlockChainTargetHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Wallet::exportKeyImages(const QString& path)
|
||||||
|
{
|
||||||
|
return m_walletImpl->exportKeyImages(path.toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Wallet::importKeyImages(const QString& path)
|
||||||
|
{
|
||||||
|
return m_walletImpl->importKeyImages(path.toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
bool Wallet::refresh()
|
bool Wallet::refresh()
|
||||||
{
|
{
|
||||||
bool result = m_walletImpl->refresh();
|
bool result = m_walletImpl->refresh();
|
||||||
|
@ -159,6 +159,10 @@ public:
|
|||||||
//! returns daemon's blockchain target height
|
//! returns daemon's blockchain target height
|
||||||
Q_INVOKABLE quint64 daemonBlockChainTargetHeight() const;
|
Q_INVOKABLE quint64 daemonBlockChainTargetHeight() const;
|
||||||
|
|
||||||
|
//! export/import key images
|
||||||
|
Q_INVOKABLE bool exportKeyImages(const QString& path);
|
||||||
|
Q_INVOKABLE bool importKeyImages(const QString& path);
|
||||||
|
|
||||||
//! refreshes the wallet
|
//! refreshes the wallet
|
||||||
Q_INVOKABLE bool refresh();
|
Q_INVOKABLE bool refresh();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user