diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-02-23 14:24:39 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-02-23 14:24:39 +0100 |
commit | 9b943eafc83653db3bedbd7d7f3fbfa77e0ec448 (patch) | |
tree | d7eeca80e2a398338830a0cbeed57d1a43440207 /src/browser.cpp | |
parent | Single instance (diff) | |
download | smolbote-9b943eafc83653db3bedbd7d7f3fbfa77e0ec448.tar.xz |
Minor features
First run check
focusAddress and *toolbarMovable 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) |