1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #include "mainwindow.h"
- #include <QApplication>
- #include <QProcess>
- #include <QSettings>
- int main(int argc, char *argv[])
- {
- QCoreApplication::setOrganizationName("openPilotLog");
- QCoreApplication::setOrganizationDomain("https://github.com/fiffty-50/openpilotlog");
- QCoreApplication::setApplicationName("openPilotLog");
- QSettings::setPath(QSettings::IniFormat,QSettings::UserScope,"data");
- QSettings::setDefaultFormat(QSettings::IniFormat);
- QSettings settings;
- QApplication openPilotLog(argc, argv);
- //Theming
- int selectedtheme = settings.value("main/theme").toInt();
- QDir::setCurrent("/themes");
- switch (selectedtheme) {
- case 1:
- {
- qDebug() << "main :: Loading light theme";
- QFile file(":light.qss");
- file.open(QFile::ReadOnly | QFile::Text);
- QTextStream stream(&file);
- openPilotLog.setStyleSheet(stream.readAll());
- break;
- }
- case 2:
- qDebug() << "Loading dark theme";
- QFile file(":dark.qss");
- file.open(QFile::ReadOnly | QFile::Text);
- QTextStream stream(&file);
- openPilotLog.setStyleSheet(stream.readAll());
- break;
- }
- MainWindow w;
- w.show();
- return openPilotLog.exec();
- }
|