diff options
Diffstat (limited to 'src/browser.cpp')
-rw-r--r-- | src/browser.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/browser.cpp b/src/browser.cpp index 46af166..a1c097a 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -22,11 +22,15 @@ #include "mainwindow.h" #include "settings.h" #include <QtWebEngine> +#include <QMessageBox> Browser::Browser(int &argc, char *argv[]) : QApplication(argc, argv) { setApplicationName("smolbote"); + + // This lets the web view automatically scale on high-dpi displays. + setAttribute(Qt::AA_EnableHighDpiScaling); } Browser::~Browser() @@ -39,6 +43,20 @@ Browser::~Browser() } /*! + * Check if the settings are empty + */ +void Browser::firstRun() +{ + Settings settings; + if(settings.allKeys().isEmpty()) { + // There are no keys in the settings + QMessageBox::information(0, + tr("Configuration is empty"), + tr("The configuration file <i>%1</i> is empty. Using default values").arg(settings.staticFilePath())); + } +} + +/*! * Anything that needs to run after the QCommandLineParser but before showing a main window */ bool Browser::preLaunch(QStringList urls) |