mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-22 02:34:36 +00:00
Merge pull request #1153
c853888
WalletManager: add logging API from QML
This commit is contained in:
commit
56f6c0a48b
3 changed files with 26 additions and 1 deletions
2
main.cpp
2
main.cpp
|
@ -67,7 +67,7 @@
|
||||||
void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||||
{
|
{
|
||||||
// Send all message types to logger
|
// Send all message types to logger
|
||||||
Monero::Wallet::debug(msg.toStdString());
|
Monero::Wallet::debug("qml", msg.toStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
|
|
@ -377,6 +377,26 @@ bool WalletManager::clearWalletCache(const QString &wallet_path) const
|
||||||
return walletCache.rename(newFileName);
|
return walletCache.rename(newFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WalletManager::debug(const QString &s)
|
||||||
|
{
|
||||||
|
Monero::Wallet::debug("qml", s.toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
|
void WalletManager::info(const QString &s)
|
||||||
|
{
|
||||||
|
Monero::Wallet::info("qml", s.toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
|
void WalletManager::warning(const QString &s)
|
||||||
|
{
|
||||||
|
Monero::Wallet::warning("qml", s.toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
|
void WalletManager::error(const QString &s)
|
||||||
|
{
|
||||||
|
Monero::Wallet::error("qml", s.toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
WalletManager::WalletManager(QObject *parent) : QObject(parent)
|
WalletManager::WalletManager(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
m_pimpl = Monero::WalletManagerFactory::getWalletManager();
|
m_pimpl = Monero::WalletManagerFactory::getWalletManager();
|
||||||
|
|
|
@ -142,6 +142,11 @@ public:
|
||||||
// clear/rename wallet cache
|
// clear/rename wallet cache
|
||||||
Q_INVOKABLE bool clearWalletCache(const QString &fileName) const;
|
Q_INVOKABLE bool clearWalletCache(const QString &fileName) const;
|
||||||
|
|
||||||
|
Q_INVOKABLE void debug(const QString &s);
|
||||||
|
Q_INVOKABLE void info(const QString &s);
|
||||||
|
Q_INVOKABLE void warning(const QString &s);
|
||||||
|
Q_INVOKABLE void error(const QString &s);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void walletOpened(Wallet * wallet);
|
void walletOpened(Wallet * wallet);
|
||||||
|
|
Loading…
Reference in a new issue