mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-16 15:58:11 +00:00
fix: Wallet storage path creation broken (#49)
This commit is contained in:
parent
c87eed558f
commit
3280fe389a
4 changed files with 21 additions and 2 deletions
|
@ -41,7 +41,8 @@ lupdate_only {
|
|||
SOURCES = *.qml \
|
||||
components/*.qml \
|
||||
pages/*.qml \
|
||||
wizard/*.qml
|
||||
wizard/*.qml \
|
||||
wizard/*js
|
||||
}
|
||||
|
||||
LIBS += -L$$WALLET_ROOT/lib \
|
||||
|
|
|
@ -132,6 +132,8 @@ QString WalletManager::maximumAllowedAmountAsSting() const
|
|||
return WalletManager::displayAmount(WalletManager::maximumAllowedAmount());
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString WalletManager::displayAmount(quint64 amount) const
|
||||
{
|
||||
return QString::fromStdString(Bitmonero::Wallet::displayAmount(amount));
|
||||
|
@ -152,6 +154,16 @@ void WalletManager::setLogLevel(int logLevel)
|
|||
Bitmonero::WalletManagerFactory::setLogLevel(logLevel);
|
||||
}
|
||||
|
||||
QString WalletManager::urlToLocalPath(const QUrl &url) const
|
||||
{
|
||||
return QDir::toNativeSeparators(url.toLocalFile());
|
||||
}
|
||||
|
||||
QUrl WalletManager::localPathToUrl(const QString &path) const
|
||||
{
|
||||
return QUrl::fromLocalFile(path);
|
||||
}
|
||||
|
||||
WalletManager::WalletManager(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_pimpl = Bitmonero::WalletManagerFactory::getWalletManager();
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define WALLETMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
#include <wallet/wallet2_api.h>
|
||||
|
||||
class Wallet;
|
||||
|
@ -88,6 +89,10 @@ public:
|
|||
// QML JS engine doesn't support unsigned integers
|
||||
Q_INVOKABLE QString maximumAllowedAmountAsSting() const;
|
||||
|
||||
// QML missing such functionality, implementing these helpers here
|
||||
Q_INVOKABLE QString urlToLocalPath(const QUrl &url) const;
|
||||
Q_INVOKABLE QUrl localPathToUrl(const QString &path) const;
|
||||
|
||||
void setLogLevel(int logLevel);
|
||||
|
||||
signals:
|
||||
|
|
|
@ -186,7 +186,7 @@ Item {
|
|||
selectFolder: true
|
||||
title: qsTr("Please choose a directory") + translationManager.emptyString
|
||||
onAccepted: {
|
||||
fileUrlInput.text = fileDialog.folder
|
||||
fileUrlInput.text = walletManager.urlToLocalPath(fileDialog.folder)
|
||||
fileDialog.visible = false
|
||||
}
|
||||
onRejected: {
|
||||
|
@ -213,6 +213,7 @@ Item {
|
|||
fileDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
Loading…
Reference in a new issue