mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-18 16:32:33 +02:00
Clean up main.cpp
This commit is contained in:
parent
448132d621
commit
f28214fc2c
@ -40,16 +40,17 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
|
|
||||||
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
QGuiApplication::setOrganizationName("Aimber");
|
||||||
|
QGuiApplication::setOrganizationDomain("screen-play.app");
|
||||||
|
QGuiApplication::setApplicationName("ScreenPlay");
|
||||||
|
QGuiApplication::setApplicationVersion("0.2.0");
|
||||||
|
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
app.setQuitOnLastWindowClosed(false);
|
app.setQuitOnLastWindowClosed(false);
|
||||||
qSetMessagePattern("%{if-category}%{category}: %{endif}%{message}\n Loc: [%{file}:%{line}]");
|
app.setWindowIcon(QIcon(":/assets/icons/favicon.ico"));
|
||||||
|
|
||||||
QTranslator trsl;
|
qSetMessagePattern("%{if-category}%{category}: %{endif}%{message}\n Loc: [%{file}:%{line}]");
|
||||||
QString locale = QLocale::system().name();
|
qDebug() << QThread::currentThreadId();
|
||||||
qDebug() << locale;
|
|
||||||
trsl.load(":/translations/ScreenPlay_de.qm");
|
|
||||||
app.installTranslator(&trsl);
|
|
||||||
|
|
||||||
QtWebEngine::initialize();
|
QtWebEngine::initialize();
|
||||||
|
|
||||||
@ -60,27 +61,20 @@ int main(int argc, char* argv[])
|
|||||||
QFontDatabase::addApplicationFont(":/assets/fonts/RobotoMono-Light.ttf");
|
QFontDatabase::addApplicationFont(":/assets/fonts/RobotoMono-Light.ttf");
|
||||||
QFontDatabase::addApplicationFont(":/assets/fonts/RobotoMono-Thin.ttf");
|
QFontDatabase::addApplicationFont(":/assets/fonts/RobotoMono-Thin.ttf");
|
||||||
|
|
||||||
QCoreApplication::setOrganizationName("Aimber");
|
|
||||||
QCoreApplication::setOrganizationDomain("screen-play.app");
|
|
||||||
QCoreApplication::setApplicationName("ScreenPlay");
|
|
||||||
QCoreApplication::setApplicationVersion("0.1.0");
|
|
||||||
|
|
||||||
app.setWindowIcon(QIcon(":/assets/icons/favicon.ico"));
|
|
||||||
|
|
||||||
QMLUtilities qmlUtil;
|
QMLUtilities qmlUtil;
|
||||||
InstalledListModel installedListModel;
|
InstalledListModel installedListModel;
|
||||||
|
InstalledListFilter installedListFilter(&installedListModel);
|
||||||
MonitorListModel monitorListModel(&app);
|
MonitorListModel monitorListModel(&app);
|
||||||
|
|
||||||
ProfileListModel profileListModel;
|
ProfileListModel profileListModel;
|
||||||
SDKConnector sdkConnector;
|
SDKConnector sdkConnector;
|
||||||
|
|
||||||
InstalledListFilter installedListFilter(&installedListModel);
|
|
||||||
|
|
||||||
// Create settings in the end because for now it depends on
|
// Create settings in the end because for now it depends on
|
||||||
// such things as the profile list model to complete
|
// such things as the profile list model to complete
|
||||||
// It will also set the m_absoluteStoragePath in profileListModel and installedListModel
|
// It will also set the m_absoluteStoragePath in profileListModel and installedListModel
|
||||||
Settings settings(&profileListModel, &monitorListModel, &installedListModel, &sdkConnector, &app);
|
Settings settings(&profileListModel, &monitorListModel, &installedListModel, &sdkConnector, &app);
|
||||||
ScreenPlay screenPlay(&installedListModel, &settings, &monitorListModel, &app, &sdkConnector);
|
ScreenPlay screenPlay(&installedListModel, &settings, &monitorListModel, &app, &sdkConnector);
|
||||||
|
Create create(&settings, &qmlUtil);
|
||||||
|
|
||||||
QDir SPWorkingDir(QDir::currentPath());
|
QDir SPWorkingDir(QDir::currentPath());
|
||||||
QDir SPBaseDir(QDir::currentPath());
|
QDir SPBaseDir(QDir::currentPath());
|
||||||
|
|
||||||
@ -134,7 +128,6 @@ int main(int argc, char* argv[])
|
|||||||
settings.setScreenPlayWidgetPath(QUrl("ScreenPlayWidget.exe"));
|
settings.setScreenPlayWidgetPath(QUrl("ScreenPlayWidget.exe"));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Create create(&settings, &qmlUtil);
|
|
||||||
|
|
||||||
// All the list need the default path from the settings
|
// All the list need the default path from the settings
|
||||||
// to know where to look for the files
|
// to know where to look for the files
|
||||||
@ -165,7 +158,6 @@ int main(int argc, char* argv[])
|
|||||||
if (!argumentList.contains("-silent")) {
|
if (!argumentList.contains("-silent")) {
|
||||||
settings.setMainWindowVisible(true);
|
settings.setMainWindowVisible(true);
|
||||||
}
|
}
|
||||||
int status = app.exec();
|
|
||||||
|
|
||||||
return status;
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ ApplicationWindow {
|
|||||||
// Set visible if the -silent parameter was not set
|
// Set visible if the -silent parameter was not set
|
||||||
visible: false
|
visible: false
|
||||||
width: 1400
|
width: 1400
|
||||||
title: "ScreenPlay Alpha"
|
title: "ScreenPlay 0.2"
|
||||||
minimumHeight: 788
|
minimumHeight: 788
|
||||||
minimumWidth: 1050
|
minimumWidth: 1050
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user