mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-02-02 11:16:25 +00:00
generate default account name from env username
This commit is contained in:
parent
a3c6c40832
commit
b795c4b0d7
1 changed files with 11 additions and 0 deletions
11
main.cpp
11
main.cpp
|
@ -120,6 +120,17 @@ int main(int argc, char *argv[])
|
||||||
engine.rootContext()->setContextProperty("moneroAccountsDir", moneroAccountsDir);
|
engine.rootContext()->setContextProperty("moneroAccountsDir", moneroAccountsDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Get default account name
|
||||||
|
QString accountName = qgetenv("USER"); // mac/linux
|
||||||
|
if (accountName.isEmpty()){
|
||||||
|
accountName = qgetenv("USERNAME"); // Windows
|
||||||
|
}
|
||||||
|
if (accountName.isEmpty()) {
|
||||||
|
accountName = "My monero Account";
|
||||||
|
}
|
||||||
|
|
||||||
|
engine.rootContext()->setContextProperty("defaultAccountName", accountName);
|
||||||
engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath());
|
engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath());
|
||||||
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
||||||
QObject *rootObject = engine.rootObjects().first();
|
QObject *rootObject = engine.rootObjects().first();
|
||||||
|
|
Loading…
Reference in a new issue