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

@@ -4,6 +4,9 @@
#include <QObject>
class Wallet;
namespace Bitmonero {
class WalletManager;
}
class WalletManager : public QObject
{
@@ -12,37 +15,43 @@ public:
static WalletManager * instance();
// wizard: createWallet path;
Q_INVOKABLE Wallet * createWallet(const QString &path, const QString &password,
const QString &language);
const QString &language, bool testnet = false);
// just for future use
Q_INVOKABLE Wallet * openWallet(const QString &path, const QString &language,
const QString &password);
Q_INVOKABLE Wallet * openWallet(const QString &path, const QString &password, bool testnet = false);
// wizard: recoveryWallet path; hint: internally it recorvers wallet and set password = ""
Q_INVOKABLE Wallet * recoveryWallet(const QString &path, const QString &memo,
const QString &language);
// wizard: both "create" and "recovery" paths.
// TODO: probably move it to "Wallet" interface
Q_INVOKABLE bool moveWallet(const QString &src, const QString &dst);
bool testnet = false);
//! utils: close wallet to free memory
Q_INVOKABLE void closeWallet(Wallet * wallet);
//! returns libwallet language name for given locale
Q_INVOKABLE QString walletLanguage(const QString &locale);
//! checks is given filename is a wallet;
Q_INVOKABLE bool walletExists(const QString &path) const;
//! returns last error happened in WalletManager
Q_INVOKABLE int error() const;
//! returns list with wallet's filenames, if found by given path
Q_INVOKABLE QStringList findWallets(const QString &path);
//! returns error description in human language
Q_INVOKABLE QString errorString() const;
// wizard: both "create" and "recovery" paths.
// TODO: probably move it to "Wallet" interface
Q_INVOKABLE bool moveWallet(const QString &src, const QString &dst);
//! returns libwallet language name for given locale
Q_INVOKABLE QString walletLanguage(const QString &locale);
signals:
public slots:
private:
explicit WalletManager(QObject *parent = 0);
static WalletManager * m_instance;
Bitmonero::WalletManager * m_pimpl;
};
#endif // WALLETMANAGER_H