2012-04-02 19:33:05 +02:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2013-02-06 18:17:50 +01:00
|
|
|
* Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
|
2012-04-02 19:33:05 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2012-08-10 21:16:43 +02:00
|
|
|
#include "qzsettings.h"
|
2012-01-24 19:58:20 +01:00
|
|
|
#include "settings.h"
|
|
|
|
|
2012-08-10 21:16:43 +02:00
|
|
|
QzSettings::QzSettings()
|
|
|
|
{
|
|
|
|
loadSettings();
|
|
|
|
}
|
2012-01-24 19:58:20 +01:00
|
|
|
|
2012-08-10 21:16:43 +02:00
|
|
|
void QzSettings::loadSettings()
|
2012-01-24 19:58:20 +01:00
|
|
|
{
|
|
|
|
Settings settings;
|
2012-08-10 21:16:43 +02:00
|
|
|
settings.beginGroup("AddressBar");
|
|
|
|
selectAllOnDoubleClick = settings.value("SelectAllTextOnDoubleClick", true).toBool();
|
|
|
|
selectAllOnClick = settings.value("SelectAllTextOnClick", false).toBool();
|
|
|
|
addCountryWithAlt = settings.value("AddCountryDomainWithAltKey", true).toBool();
|
2012-08-24 20:53:53 +02:00
|
|
|
showLoadingProgress = settings.value("ShowLoadingProgress", false).toBool();
|
2012-08-10 21:16:43 +02:00
|
|
|
showLocationSuggestions = settings.value("showSuggestions", 0).toInt();
|
2012-12-04 16:16:45 +01:00
|
|
|
showSwitchTab = settings.value("showSwitchTab", true).toBool();
|
2013-06-05 00:02:43 +02:00
|
|
|
alwaysShowGoIcon = settings.value("alwaysShowGoIcon", false).toBool();
|
2012-08-10 21:16:43 +02:00
|
|
|
settings.endGroup();
|
|
|
|
|
|
|
|
settings.beginGroup("SearchEngines");
|
|
|
|
showSearchSuggestions = settings.value("showSuggestions", true).toBool();
|
2012-09-26 15:06:05 +02:00
|
|
|
searchOnEngineChange = settings.value("SearchOnEngineChange", true).toBool();
|
2012-09-27 11:59:09 +02:00
|
|
|
searchWithDefaultEngine = settings.value("SearchWithDefaultEngine", false).toBool();
|
2012-08-10 21:16:43 +02:00
|
|
|
settings.endGroup();
|
2012-03-11 15:17:12 +01:00
|
|
|
|
2012-08-10 21:16:43 +02:00
|
|
|
settings.beginGroup("Web-Browser-Settings");
|
2012-01-24 19:58:20 +01:00
|
|
|
defaultZoom = settings.value("DefaultZoom", 100).toInt();
|
2012-03-11 15:17:12 +01:00
|
|
|
loadTabsOnActivation = settings.value("LoadTabsOnActivation", false).toBool();
|
2012-04-13 13:26:32 +02:00
|
|
|
autoOpenProtocols = settings.value("AutomaticallyOpenProtocols", QStringList()).toStringList();
|
|
|
|
blockedProtocols = settings.value("BlockOpeningProtocols", QStringList()).toStringList();
|
2012-12-29 13:58:30 +01:00
|
|
|
allowJsGeometryChange = settings.value("allowJavaScriptGeometryChange", true).toBool();
|
|
|
|
allowJsHideMenuBar = settings.value("allowJavaScriptHideMenuBar", true).toBool();
|
|
|
|
allowJsHideStatusBar = settings.value("allowJavaScriptHideStatusBar", true).toBool();
|
|
|
|
allowJsHideToolBar = settings.value("allowJavaScriptHideToolBar", true).toBool();
|
2012-04-13 13:26:32 +02:00
|
|
|
settings.endGroup();
|
2012-06-26 23:39:23 +02:00
|
|
|
|
|
|
|
settings.beginGroup("Browser-Tabs-Settings");
|
|
|
|
newTabPosition = settings.value("OpenNewTabsSelected", false).toBool() ? Qz::NT_SelectedTab : Qz::NT_NotSelectedTab;
|
2013-02-09 15:44:17 +01:00
|
|
|
tabsOnTop = settings.value("TabsOnTop", false).toBool();
|
2012-06-26 23:39:23 +02:00
|
|
|
settings.endGroup();
|
2012-04-13 13:26:32 +02:00
|
|
|
}
|
|
|
|
|
2012-08-10 21:16:43 +02:00
|
|
|
void QzSettings::saveSettings()
|
2012-04-13 13:26:32 +02:00
|
|
|
{
|
|
|
|
Settings settings;
|
|
|
|
settings.beginGroup("Web-Browser-Settings");
|
|
|
|
settings.setValue("AutomaticallyOpenProtocols", autoOpenProtocols);
|
|
|
|
settings.setValue("BlockOpeningProtocols", blockedProtocols);
|
2013-02-09 13:00:45 +01:00
|
|
|
settings.endGroup();
|
2012-01-24 19:58:20 +01:00
|
|
|
}
|
2012-08-10 21:16:43 +02:00
|
|
|
|
|
|
|
|