2022-04-20 00:54:10 +02:00
|
|
|
#include <thread>
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QTranslator>
|
2022-03-01 01:28:30 +01:00
|
|
|
|
2022-03-06 01:00:19 +01:00
|
|
|
#include <Log.h>
|
2022-03-01 22:16:02 +01:00
|
|
|
|
2022-04-20 00:54:10 +02:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "lolautoaccept.h"
|
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
2022-03-01 01:28:30 +01:00
|
|
|
Log::init();
|
2022-04-24 21:05:10 +02:00
|
|
|
Log::setConsoleLogLevel(Log::Level::INFO);
|
|
|
|
// Log::addLogfile("log.txt", Log::Level::TRACE);
|
2022-03-01 01:28:30 +01:00
|
|
|
#if __unix__
|
|
|
|
Log::setColoredOutput(true);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
Log::info << "Hello, World!";
|
2022-04-20 00:54:10 +02:00
|
|
|
Log::note << "Using Locale: " << QLocale().name().toStdString();
|
2022-03-01 01:28:30 +01:00
|
|
|
|
2022-03-06 01:00:19 +01:00
|
|
|
LolAutoAccept lolaa;
|
2022-04-20 00:54:10 +02:00
|
|
|
QApplication app(argc, argv);
|
|
|
|
QTranslator translator;
|
|
|
|
if(translator.load(QLocale().name(), QLatin1String("ts"))) {
|
|
|
|
app.installTranslator(&translator);
|
|
|
|
} else {
|
|
|
|
Log::warn << "translation not found";
|
|
|
|
}
|
2022-04-21 00:47:57 +02:00
|
|
|
MainWindow win(lolaa);
|
2022-04-24 21:05:10 +02:00
|
|
|
|
2022-04-20 00:54:10 +02:00
|
|
|
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();
|
2022-03-08 00:04:56 +01:00
|
|
|
|
2022-03-01 01:28:30 +01:00
|
|
|
Log::stop();
|
2022-04-20 00:54:10 +02:00
|
|
|
return ret;
|
2022-03-01 01:28:30 +01:00
|
|
|
}
|