diff options
| author | Ilya Kitaev <mbg033@gmail.com> | 2016-02-08 10:58:01 +0300 |
|---|---|---|
| committer | Ilya Kitaev <mbg033@gmail.com> | 2016-02-08 10:58:01 +0300 |
| commit | e555631b40972b0264962f5bbd780ddd3aef5a7c (patch) | |
| tree | a599d05bd276e54af04f242fa1fd9b717a129c36 /main.cpp | |
| parent | 16020ae2a896633bc197cb3aca624c72329dd994 (diff) | |
| download | monzero-gui-e555631b40972b0264962f5bbd780ddd3aef5a7c.tar.gz monzero-gui-e555631b40972b0264962f5bbd780ddd3aef5a7c.tar.xz monzero-gui-e555631b40972b0264962f5bbd780ddd3aef5a7c.zip | |
wallet directrory in "Documents" for Windows and in "home" for *nix
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -29,6 +29,7 @@ #include <QApplication> #include <QQmlApplicationEngine> #include <QtQml> +#include <QStandardPaths> #include "clipboardAdapter.h" #include "filter.h" #include "oscursor.h" @@ -46,6 +47,20 @@ int main(int argc, char *argv[]) OSCursor cursor; engine.rootContext()->setContextProperty("globalCursor", &cursor); +// export to QML monero accounts root directory +// wizard is talking about where +// to save the wallet file (.keys, .bin), they have to be user-accessible for +// backups - I reckon we save that in My Documents\Monero Accounts\ on +// Windows, ~/Monero Accounts/ on nix / osx +#ifdef Q_OS_WIN + QStringList moneroAccountsRootDir = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation); +#elif defined(Q_OS_UNIX) + QStringList moneroAccountsRootDir = QStandardPaths::standardLocations(QStandardPaths::HomeLocation); +#endif + if (!moneroAccountsRootDir.empty()) { + engine.rootContext()->setContextProperty("moneroAccountsDir", moneroAccountsRootDir.at(0) + "/Monero Accounts"); + } + engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath()); engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); QObject *rootObject = engine.rootObjects().first(); |
