diff options
| author | Victor Tran <vicr12345@gmail.com> | 2018-07-12 18:12:14 +1000 |
|---|---|---|
| committer | Victor Tran <vicr12345@gmail.com> | 2018-07-12 18:12:14 +1000 |
| commit | 2adcd4f24eca2fa529c42fc1165319bcc4ea179e (patch) | |
| tree | 1c1c8292e9e864640b19c7ff1ae4acaeb90244be /installer/main.cpp | |
| download | theInstaller-2adcd4f24eca2fa529c42fc1165319bcc4ea179e.tar.gz theInstaller-2adcd4f24eca2fa529c42fc1165319bcc4ea179e.tar.bz2 theInstaller-2adcd4f24eca2fa529c42fc1165319bcc4ea179e.zip | |
Initial commit
Diffstat (limited to 'installer/main.cpp')
| -rw-r--r-- | installer/main.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/installer/main.cpp b/installer/main.cpp new file mode 100644 index 0000000..4b62834 --- /dev/null +++ b/installer/main.cpp @@ -0,0 +1,35 @@ +#include "mainwindow.h" +#include "process/installworker.h" +#include <QApplication> +#include <QTranslator> +#include <QLibraryInfo> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + + QTranslator qtTranslator; + qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + a.installTranslator(&qtTranslator); + + QTranslator myappTranslator; + myappTranslator.load(QLocale::system().name(), ":/translations/"); + //myappTranslator.load("vi_VN", ":/translations/"); + a.installTranslator(&myappTranslator); + + qsrand(QDateTime::currentMSecsSinceEpoch()); + + if (a.arguments().contains("--install")) { + //Installer mode + InstallWorker worker; + if (!worker.startWork()) return 1; + + a.setQuitOnLastWindowClosed(false); + return a.exec(); + } + + MainWindow w; + w.show(); + + return a.exec(); +} |
