Hush full node GUI wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.6 KiB

6 years ago
#include "mainwindow.h"
#include "settings.h"
#include "turnstile.h"
#include "version.h"
6 years ago
int main(int argc, char *argv[])
{
6 years ago
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
6 years ago
QApplication a(argc, argv);
QCoreApplication::setOrganizationName("zec-qt-wallet-org");
QCoreApplication::setApplicationName("zec-qt-wallet");
QString locale = QLocale::system().name();
locale.truncate(locale.lastIndexOf('_')); // Get the language code
qDebug() << "Loading locale " << locale;
QTranslator translator;
translator.load(QString(":/translations/res/zec_qt_wallet_") + locale);
a.installTranslator(&translator);
6 years ago
QIcon icon(":/icons/res/icon.ico");
QApplication::setWindowIcon(icon);
#ifdef Q_OS_LINUX
QFontDatabase::addApplicationFont(":/fonts/res/Ubuntu-R.ttf");
qApp->setFont(QFont("Ubuntu", 11, QFont::Normal, false));
#endif
// QRandomGenerator generates a secure random number, which we use to seed.
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
unsigned int seed = QRandomGenerator::securelySeeded().generate();
#else
// This will be used only during debugging for compatibility reasons
unsigned int seed = std::time(0);
#endif
std::srand(seed);
6 years ago
Settings::init();
if (argc >= 2 && QString::fromStdString(argv[1]) == "--no-embedded") {
Settings::getInstance()->setUseEmbedded(false);
} else {
Settings::getInstance()->setUseEmbedded(true);
}
6 years ago
MainWindow w;
w.setWindowTitle("zec-qt-wallet v" + QString(APP_VERSION));
6 years ago
w.show();
return QApplication::exec();
}