2018-09-24 22:25:14 +03:00
|
|
|
#include "mainwindow.h"
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
#include <QLayout>
|
2019-11-13 14:30:18 +02:00
|
|
|
#include <QFileInfo>
|
|
|
|
|
#include <QDir>
|
2018-10-05 18:20:40 +03:00
|
|
|
#include "settings.h"
|
|
|
|
|
#include "helper.h"
|
2018-09-24 22:25:14 +03:00
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
2021-06-05 18:22:07 +03:00
|
|
|
QApplication app(argc, argv);
|
2019-01-13 14:11:00 +03:00
|
|
|
helper::theme::applyCurrent(Settings::instance());
|
2018-09-24 22:25:14 +03:00
|
|
|
|
2022-05-29 10:50:15 +03:00
|
|
|
QFont f = app.font();
|
2021-06-05 18:22:07 +03:00
|
|
|
f.setFamily("Monaco");
|
|
|
|
|
f.setPointSize(16);
|
2022-05-29 10:50:15 +03:00
|
|
|
app.setFont(f);
|
2021-06-05 18:22:07 +03:00
|
|
|
|
2021-02-18 21:44:13 +02:00
|
|
|
// Path to database.
|
|
|
|
|
QString path = Settings::instance().getDatabasePath();
|
2019-08-17 22:03:17 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
QString folder = QFileInfo(path).absoluteDir().path();
|
|
|
|
|
Storage::instance().setPath(path);
|
|
|
|
|
|
2018-10-05 18:20:40 +03:00
|
|
|
MainWindow w;
|
|
|
|
|
w.layout()->invalidate();
|
2018-09-24 22:25:14 +03:00
|
|
|
|
2018-10-05 18:20:40 +03:00
|
|
|
w.setAttribute(Qt::WA_WState_ExplicitShowHide, false);
|
|
|
|
|
w.setAttribute(Qt::WA_WState_Hidden, true);
|
2022-05-29 10:50:15 +03:00
|
|
|
w.setWindowIcon(MainWindow::getAppIcon());
|
2018-10-05 18:20:40 +03:00
|
|
|
w.show();
|
|
|
|
|
|
2021-06-05 18:22:07 +03:00
|
|
|
return app.exec();
|
2018-09-24 22:25:14 +03:00
|
|
|
}
|