2022-11-06 00:37:50 +00:00
|
|
|
#include "mainwindow.h"
|
2023-02-26 14:44:00 +00:00
|
|
|
#include "xapplication.h"
|
|
|
|
#include "contentpresenttest.h"
|
2023-02-26 16:22:44 +00:00
|
|
|
#include "default_textpresent.h"
|
|
|
|
#include "storychain_sourceeditor.h"
|
2022-11-06 00:37:50 +00:00
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QLocale>
|
2022-11-17 08:16:54 +00:00
|
|
|
#include <QStyleFactory>
|
2022-11-06 00:37:50 +00:00
|
|
|
#include <QTranslator>
|
2022-11-17 08:16:54 +00:00
|
|
|
#include <QDebug>
|
2023-02-26 14:44:00 +00:00
|
|
|
#include <QtTest/QTest>
|
2022-11-06 00:37:50 +00:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2023-02-26 14:44:00 +00:00
|
|
|
XApplication a(argc, argv);
|
2022-11-06 00:37:50 +00:00
|
|
|
|
2023-02-26 14:44:00 +00:00
|
|
|
#ifdef UNIT_TEST
|
|
|
|
|
|
|
|
MakeTools::ContentPresent *array[] = {
|
2023-02-26 16:22:44 +00:00
|
|
|
new Components::DefaultTextPresent(),
|
|
|
|
new Components::StorychainSourceEdit()
|
2023-02-26 14:44:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
for(auto &it : array){
|
|
|
|
TestCase::ContentPresentTest tx0(it);
|
|
|
|
QTest::qExec(&tx0, argc, argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
2022-11-06 00:37:50 +00:00
|
|
|
QTranslator translator;
|
|
|
|
const QStringList uiLanguages = QLocale::system().uiLanguages();
|
|
|
|
for (const QString &locale : uiLanguages) {
|
|
|
|
const QString baseName = "WordsIDE_" + QLocale(locale).name();
|
|
|
|
if (translator.load(":/i18n/" + baseName)) {
|
|
|
|
a.installTranslator(&translator);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MainWindow w;
|
|
|
|
w.show();
|
2023-02-26 14:44:00 +00:00
|
|
|
#endif
|
|
|
|
|
2022-11-06 00:37:50 +00:00
|
|
|
return a.exec();
|
|
|
|
}
|