24#include "MainWindow.h"
26#include <QApplication>
30#include <QSharedPointer>
31#if defined(Q_OS_ANDROID)
35#include "RabbitCommonTools.h"
36#include "RabbitCommonDir.h"
38#include "FrmUpdater/FrmUpdater.h"
41 #include "QUIWidget/QUIWidget.h"
44#include <QLoggingCategory>
46Q_LOGGING_CATEGORY(App,
"App")
48int main(
int argc,
char *argv[])
51 QApplication::setApplicationVersion(RabbitRemoteControl_VERSION);
52 QApplication::setApplicationName(
"RabbitRemoteControlService");
53#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
54 QApplication::setDesktopFileName(QLatin1String(
"RabbitRemoteControlServiceConfigure.desktop"));
57 QApplication a(argc, argv);
59 RabbitCommon::CTools::Instance()->Init();
62 QString szFile = RabbitCommon::CDir::Instance()->GetDirTranslations()
63 + QDir::separator() +
"RabbitRemoteControlServiceConfigure_"
64 + QLocale::system().name() +
".qm";
66 if(a.installTranslator(&tApp))
67 qInfo(App) <<
"Language:" << QLocale::system() <<
"File:" << szFile;
69 qCritical(App) <<
"Language:" << QLocale::system() <<
"File:" << szFile;
71 a.setApplicationDisplayName(QObject::tr(
"Rabbit remote control service configure"));
72 a.setOrganizationName(QObject::tr(
"Kang Lin studio"));
75 w->setWindowTitle(a.applicationDisplayName());
81 QSharedPointer<QUIWidget> quiwidget(
new QUIWidget(
nullptr,
true));
82 bool check = quiwidget->connect(w, SIGNAL(sigFullScreen()),
83 SLOT(showFullScreen()));
85 check = quiwidget->connect(w, SIGNAL(sigShowNormal()),
90 quiwidget->setMainWidget(w);
97 }
catch (std::exception &e) {
98 qCritical(App) <<
"exception:" << e.what();
100 qCritical(App) <<
"exception";
103#ifndef BUILD_QUIWidget
107 RabbitCommon::CTools::Instance()->Clean();
108 a.removeTranslator(&tApp);