Start in normal mode if wallet exists. Resolves #9

This commit is contained in:
Ilya Kitaev
2016-06-07 16:26:25 +03:00
parent 493e290956
commit da1b74a707
6 changed files with 120 additions and 245 deletions

View File

@@ -3,13 +3,18 @@
#include <QObject>
struct WalletImpl;
namespace Bitmonero {
class Wallet; // forward declaration
}
class Wallet : public QObject
{
Q_OBJECT
Q_PROPERTY(QString seed READ getSeed)
public:
explicit Wallet(QObject *parent = 0);
enum Status {
Status_Ok = 0,
Status_Error = 1
};
//! returns mnemonic seed
Q_INVOKABLE QString getSeed() const;
@@ -17,28 +22,31 @@ public:
//! returns seed language
Q_INVOKABLE QString getSeedLanguage() const;
//! returns last operation's status
Q_INVOKABLE int status() const;
//! returns last operation's error message
Q_INVOKABLE QString errorString() const;
//! changes the password using existing parameters (path, seed, seed lang)
Q_INVOKABLE bool setPassword(const QString &password);
//! returns curret wallet password
Q_INVOKABLE QString getPassword() const;
//! renames/moves wallet files
Q_INVOKABLE bool rename(const QString &name);
//! returns wallet's public address
Q_INVOKABLE QString address() const;
//! saves wallet to the file by given path
Q_INVOKABLE bool store(const QString &path);
//! returns current wallet name (basename, as wallet consists of several files)
Q_INVOKABLE QString getBasename() const;
Q_INVOKABLE int error() const;
Q_INVOKABLE QString errorString() const;
private:
Wallet(const QString &path, const QString &password, const QString &language);
Wallet(Bitmonero::Wallet *w, QObject * parent = 0);
~Wallet();
private:
friend class WalletManager;
//! pimpl wrapper for libwallet;
WalletImpl * m_pimpl;
//! libwallet's
Bitmonero::Wallet * m_walletImpl;
};
#endif // WALLET_H