2012-04-02 19:33:05 +02:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
|
|
|
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
|
|
|
|
*
|
|
|
|
* 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-04-13 13:26:32 +02:00
|
|
|
#include "websettings.h"
|
2012-01-24 19:58:20 +01:00
|
|
|
#include "settings.h"
|
|
|
|
|
2012-04-13 13:26:32 +02:00
|
|
|
int WebSettings::defaultZoom = 100;
|
|
|
|
bool WebSettings::loadTabsOnActivation = false;
|
2012-01-24 19:58:20 +01:00
|
|
|
|
2012-04-13 13:26:32 +02:00
|
|
|
QStringList WebSettings::autoOpenProtocols;
|
|
|
|
QStringList WebSettings::blockedProtocols;
|
2012-01-24 19:58:20 +01:00
|
|
|
|
2012-04-13 13:26:32 +02:00
|
|
|
void WebSettings::loadSettings()
|
2012-01-24 19:58:20 +01:00
|
|
|
{
|
|
|
|
Settings settings;
|
|
|
|
settings.beginGroup("Web-Browser-Settings");
|
2012-03-11 15:17:12 +01:00
|
|
|
|
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();
|
|
|
|
|
|
|
|
settings.endGroup();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WebSettings::saveSettings()
|
|
|
|
{
|
|
|
|
Settings settings;
|
|
|
|
settings.beginGroup("Web-Browser-Settings");
|
|
|
|
|
|
|
|
settings.setValue("AutomaticallyOpenProtocols", autoOpenProtocols);
|
|
|
|
settings.setValue("BlockOpeningProtocols", blockedProtocols);
|
|
|
|
|
2012-01-24 19:58:20 +01:00
|
|
|
settings.endGroup();
|
|
|
|
}
|