54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
#include <thread>
|
|
|
|
#include <QApplication>
|
|
#include <QMessageBox>
|
|
#include <QTranslator>
|
|
|
|
#include <Log.h>
|
|
|
|
#include "mainwindow.h"
|
|
#include "lolautoaccept.h"
|
|
|
|
int main(int argc, char** argv) {
|
|
Log::init();
|
|
Log::setConsoleLogLevel(Log::Level::TRACE);
|
|
Log::addLogfile("log.txt", Log::Level::TRACE);
|
|
#if __unix__
|
|
Log::setColoredOutput(true);
|
|
#endif
|
|
|
|
Log::info << "Hello, World!";
|
|
Log::note << "Using Locale: " << QLocale().name().toStdString();
|
|
|
|
LolAutoAccept lolaa;
|
|
QApplication app(argc, argv);
|
|
QTranslator translator;
|
|
if(translator.load(QLocale().name(), QLatin1String("ts"))) {
|
|
app.installTranslator(&translator);
|
|
} else {
|
|
Log::warn << "translation not found";
|
|
}
|
|
MainWindow win(lolaa);
|
|
/*
|
|
while(!lolaa.init()) {
|
|
QMessageBox warn;
|
|
warn.setWindowTitle(MainWindow::tr("LoL-Auto-Accept"));
|
|
warn.setText(QMessageBox::tr("League of Legends Client not found!"));
|
|
warn.setInformativeText(QMessageBox::tr("Open the client and retry or close."));
|
|
warn.setStandardButtons(QMessageBox::Retry | QMessageBox::Close);
|
|
warn.setDefaultButton(QMessageBox::Retry);
|
|
warn.setIcon(QMessageBox::Warning);
|
|
if(warn.exec() == QMessageBox::Close) {
|
|
Log::stop();
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
*/
|
|
|
|
win.show();
|
|
int ret = app.exec();
|
|
|
|
Log::stop();
|
|
return ret;
|
|
} |