From 9b943eafc83653db3bedbd7d7f3fbfa77e0ec448 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 23 Feb 2017 14:24:39 +0100 Subject: Minor features First run check focusAddress and *toolbarMovable options --- src/browser.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/browser.cpp') 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 +#include 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() @@ -38,6 +42,20 @@ Browser::~Browser() delete m_downloadManager; } +/*! + * 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 %1 is empty. Using default values").arg(settings.staticFilePath())); + } +} + /*! * Anything that needs to run after the QCommandLineParser but before showing a main window */ -- cgit v1.2.1