2025-01-05 17:42:12 +01:00
|
|
|
#include <QCommandLineParser>
|
2025-01-05 16:29:31 +01:00
|
|
|
#include <QGuiApplication>
|
2025-01-05 17:42:12 +01:00
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
|
#include <QQmlContext>
|
|
|
|
|
|
2025-01-05 16:29:31 +01:00
|
|
|
#include "StatsData.h"
|
|
|
|
|
|
|
|
|
|
int main(int x, char **y) {
|
|
|
|
|
QGuiApplication app(x, y);
|
|
|
|
|
|
2025-01-05 17:42:12 +01:00
|
|
|
QCommandLineParser parser;
|
|
|
|
|
parser.setApplicationDescription("Translation Statistics");
|
|
|
|
|
parser.addHelpOption();
|
2025-01-06 12:13:27 +01:00
|
|
|
parser.addPositionalArgument("dir", "directory where the translations live");
|
2025-01-05 17:42:12 +01:00
|
|
|
parser.process(app);
|
|
|
|
|
const QStringList args = parser.positionalArguments();
|
|
|
|
|
if (args.size() != 1)
|
|
|
|
|
parser.showHelp(1);
|
|
|
|
|
|
|
|
|
|
StatsData data(args.at(0));
|
|
|
|
|
QQmlApplicationEngine engine;
|
|
|
|
|
engine.rootContext()->setContextProperty("Stats", &data);
|
|
|
|
|
engine.load(":/main.qml");
|
2025-01-05 16:29:31 +01:00
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
|
}
|