1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Fixed Save Passwords saving in Preferences

This option is now properly saved.
Also updated Slovakia translation of desktop launcher.
This commit is contained in:
nowrep 2011-11-02 12:52:55 +01:00
parent b28e037ad1
commit c3971c2672
5 changed files with 44 additions and 36 deletions

View File

@ -14,8 +14,8 @@ or edit CA Certificates database with SSL Manager.
QupZilla's main aim is to be very fast and very stable QtWebKit browser available to everyone. QupZilla's main aim is to be very fast and very stable QtWebKit browser available to everyone.
There is already a lot of QtWebKit browsers available, but they are either bound to KDE There is already a lot of QtWebKit browsers available, but they are either bound to KDE
environment (rekonq), not actively developped (Arora) or very unstable and missing important environment (rekonq), not actively developed or very unstable and missing important
features, but there is missing multiplatform, modern and actively developped browser. QupZilla features. But there is missing multiplatform, modern and actively developped browser. QupZilla
is trying to fill this gap by providing very stable browsing experience. is trying to fill this gap by providing very stable browsing experience.
History History

View File

@ -3,7 +3,7 @@ Encoding=UTF-8
Name=QupZilla Name=QupZilla
Comment=A fast and secure web browser Comment=A fast and secure web browser
Comment[cs]=Rychlý a bezpečný webový prohlížeč Comment[cs]=Rychlý a bezpečný webový prohlížeč
Comment[sk]=Rychlý a bezpečný webový prehliadač Comment[sk]=Rýchly a bezpečný webový prehliadač
Comment[de]=Ein schneller und sicherer Web Browser Comment[de]=Ein schneller und sicherer Web Browser
Comment[nl]=Een snelle en veilige webbrowser Comment[nl]=Een snelle en veilige webbrowser
GenericName=Web Browser GenericName=Web Browser

View File

@ -33,12 +33,15 @@ void AutoFillModel::loadSettings()
{ {
QSettings settings(mApp->getActiveProfilPath()+"settings.ini", QSettings::IniFormat); QSettings settings(mApp->getActiveProfilPath()+"settings.ini", QSettings::IniFormat);
settings.beginGroup("Web-Browser-Settings"); settings.beginGroup("Web-Browser-Settings");
m_isStoring = settings.value("AutoFillForms",true).toBool(); m_isStoring = settings.value("SavePasswordsOnSites", true).toBool();
settings.endGroup(); settings.endGroup();
} }
bool AutoFillModel::isStored(const QUrl &url) bool AutoFillModel::isStored(const QUrl &url)
{ {
if (!isStoringEnabled(url))
return false;
QString server = url.host(); QString server = url.host();
QSqlQuery query; QSqlQuery query;
query.exec("SELECT count(id) FROM autofill WHERE server='"+server+"'"); query.exec("SELECT count(id) FROM autofill WHERE server='"+server+"'");
@ -52,6 +55,7 @@ bool AutoFillModel::isStoringEnabled(const QUrl &url)
{ {
if (!m_isStoring) if (!m_isStoring)
return false; return false;
QString server = url.host(); QString server = url.host();
QSqlQuery query; QSqlQuery query;
query.exec("SELECT count(id) FROM autofill_exceptions WHERE server='"+server+"'"); query.exec("SELECT count(id) FROM autofill_exceptions WHERE server='"+server+"'");

View File

@ -38,6 +38,7 @@
#include "thememanager.h" #include "thememanager.h"
#include "acceptlanguage.h" #include "acceptlanguage.h"
#include "globalfunctions.h" #include "globalfunctions.h"
#include "autofillmodel.h"
bool removeFile(const QString &fullFileName) bool removeFile(const QString &fullFileName)
{ {
@ -67,15 +68,14 @@ void removeDir(const QString &d)
} }
} }
Preferences::Preferences(QupZilla* mainClass, QWidget* parent) : Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
QDialog(parent) : QDialog(parent)
,ui(new Ui::Preferences) , ui(new Ui::Preferences)
,p_QupZilla(mainClass) , p_QupZilla(mainClass)
,m_pluginsList(0) , m_pluginsList(0)
{ {
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
ui->setupUi(this); ui->setupUi(this);
m_bgLabelSize = this->sizeHint();
QSettings settings(mApp->getActiveProfilPath()+"settings.ini", QSettings::IniFormat); QSettings settings(mApp->getActiveProfilPath()+"settings.ini", QSettings::IniFormat);
//GENERAL URLs //GENERAL URLs
@ -145,18 +145,18 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent) :
settings.endGroup(); settings.endGroup();
//AddressBar //AddressBar
settings.beginGroup("AddressBar"); settings.beginGroup("AddressBar");
ui->selectAllOnFocus->setChecked( settings.value("SelectAllTextOnDoubleClick",true).toBool() ); ui->selectAllOnFocus->setChecked( settings.value("SelectAllTextOnDoubleClick", true).toBool() );
ui->addComWithCtrl->setChecked( settings.value("AddComDomainWithCtrlKey",false).toBool() ); ui->addComWithCtrl->setChecked( settings.value("AddComDomainWithCtrlKey", false).toBool() );
ui->addCountryWithAlt->setChecked( settings.value("AddCountryDomainWithAltKey",true).toBool() ); ui->addCountryWithAlt->setChecked( settings.value("AddCountryDomainWithAltKey", true).toBool() );
settings.endGroup(); settings.endGroup();
//BROWSING //BROWSING
settings.beginGroup("Web-Browser-Settings"); settings.beginGroup("Web-Browser-Settings");
ui->allowPlugins->setChecked( settings.value("allowFlash",true).toBool() ); ui->allowPlugins->setChecked( settings.value("allowFlash", true).toBool() );
ui->allowJavaScript->setChecked( settings.value("allowJavaScript",true).toBool() ); ui->allowJavaScript->setChecked( settings.value("allowJavaScript", true).toBool() );
ui->blockPopup->setChecked( !settings.value("allowJavaScriptOpenWindow", false).toBool() ); ui->blockPopup->setChecked( !settings.value("allowJavaScriptOpenWindow", false).toBool() );
ui->allowJava->setChecked( settings.value("allowJava",true).toBool() ); ui->allowJava->setChecked( settings.value("allowJava", true).toBool() );
ui->loadImages->setChecked( settings.value("autoLoadImages",true).toBool() ); ui->loadImages->setChecked( settings.value("autoLoadImages", true).toBool() );
ui->allowDNSPrefetch->setChecked( settings.value("DNS-Prefetch", false).toBool() ); ui->allowDNSPrefetch->setChecked( settings.value("DNS-Prefetch", false).toBool() );
ui->jscanAccessClipboard->setChecked( settings.value("JavaScriptCanAccessClipboard", true).toBool() ); ui->jscanAccessClipboard->setChecked( settings.value("JavaScriptCanAccessClipboard", true).toBool() );
ui->linksInFocusChain->setChecked( settings.value("IncludeLinkInFocusChain", false).toBool() ); ui->linksInFocusChain->setChecked( settings.value("IncludeLinkInFocusChain", false).toBool() );
@ -174,7 +174,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent) :
connect(ui->pagesInCache, SIGNAL(valueChanged(int)), this, SLOT(pageCacheValueChanged(int))); connect(ui->pagesInCache, SIGNAL(valueChanged(int)), this, SLOT(pageCacheValueChanged(int)));
ui->pageCacheLabel->setText(QString::number(ui->pagesInCache->value())); ui->pageCacheLabel->setText(QString::number(ui->pagesInCache->value()));
ui->allowCache->setChecked( settings.value("AllowLocalCache",true).toBool() ); ui->allowCache->setChecked( settings.value("AllowLocalCache", true).toBool() );
ui->cacheMB->setValue( settings.value("LocalCacheSize", 50).toInt() ); ui->cacheMB->setValue( settings.value("LocalCacheSize", 50).toInt() );
ui->MBlabel->setText( settings.value("LocalCacheSize", 50).toString() + " MB"); ui->MBlabel->setText( settings.value("LocalCacheSize", 50).toString() + " MB");
connect(ui->allowCache, SIGNAL(clicked(bool)), this, SLOT(allowCacheChanged(bool))); connect(ui->allowCache, SIGNAL(clicked(bool)), this, SLOT(allowCacheChanged(bool)));
@ -182,28 +182,29 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent) :
allowCacheChanged(ui->allowCache->isChecked()); allowCacheChanged(ui->allowCache->isChecked());
//PASSWORD MANAGER //PASSWORD MANAGER
ui->allowPassManager->setChecked(settings.value("AutoFillForms",true).toBool()); ui->allowPassManager->setChecked(settings.value("SavePasswordsOnSites", true).toBool());
connect(ui->allowPassManager, SIGNAL(toggled(bool)), this, SLOT(showPassManager(bool))); connect(ui->allowPassManager, SIGNAL(toggled(bool)), this, SLOT(showPassManager(bool)));
m_autoFillManager = new AutoFillManager(this); m_autoFillManager = new AutoFillManager(this);
ui->autoFillFrame->addWidget(m_autoFillManager); ui->autoFillFrame->addWidget(m_autoFillManager);
showPassManager(ui->allowPassManager->isChecked());
//PRIVACY //PRIVACY
//Web storage //Web storage
ui->storeIcons->setChecked( settings.value("allowPersistentStorage",true).toBool() ); ui->storeIcons->setChecked( settings.value("allowPersistentStorage", true).toBool() );
ui->saveHistory->setChecked( mApp->history()->isSaving() ); ui->saveHistory->setChecked( mApp->history()->isSaving() );
ui->deleteHistoryOnClose->setChecked( settings.value("deleteHistoryOnClose",false).toBool() ); ui->deleteHistoryOnClose->setChecked( settings.value("deleteHistoryOnClose", false).toBool() );
if (!ui->saveHistory->isChecked()) if (!ui->saveHistory->isChecked())
ui->deleteHistoryOnClose->setEnabled(false); ui->deleteHistoryOnClose->setEnabled(false);
connect(ui->saveHistory, SIGNAL(toggled(bool)), this, SLOT(saveHistoryChanged(bool))); connect(ui->saveHistory, SIGNAL(toggled(bool)), this, SLOT(saveHistoryChanged(bool)));
//Cookies //Cookies
ui->saveCookies->setChecked( settings.value("allowCookies",true).toBool() ); ui->saveCookies->setChecked( settings.value("allowCookies", true).toBool() );
if (!ui->saveCookies->isChecked()) if (!ui->saveCookies->isChecked())
ui->deleteCookiesOnClose->setEnabled(false); ui->deleteCookiesOnClose->setEnabled(false);
connect(ui->saveCookies, SIGNAL(toggled(bool)), this, SLOT(saveCookiesChanged(bool))); connect(ui->saveCookies, SIGNAL(toggled(bool)), this, SLOT(saveCookiesChanged(bool)));
ui->deleteCookiesOnClose->setChecked( settings.value("deleteCookiesOnClose", false).toBool() ); ui->deleteCookiesOnClose->setChecked( settings.value("deleteCookiesOnClose", false).toBool() );
ui->matchExactly->setChecked( settings.value("allowCookiesFromVisitedDomainOnly",false).toBool() ); ui->matchExactly->setChecked( settings.value("allowCookiesFromVisitedDomainOnly", false).toBool() );
ui->filterTracking->setChecked( settings.value("filterTrackingCookie",false).toBool() ); ui->filterTracking->setChecked( settings.value("filterTrackingCookie", false).toBool() );
//CSS Style //CSS Style
ui->userStyleSheet->setText( settings.value("userStyleSheet", "").toString() ); ui->userStyleSheet->setText( settings.value("userStyleSheet", "").toString() );
@ -566,7 +567,6 @@ void Preferences::saveSettings()
settings.setValue("showHomeButton", ui->showHome->isChecked()); settings.setValue("showHomeButton", ui->showHome->isChecked());
settings.setValue("showBackForwardButtons",ui->showBackForward->isChecked()); settings.setValue("showBackForwardButtons",ui->showBackForward->isChecked());
settings.setValue("useTransparentBackground", ui->useTransparentBg->isChecked()); settings.setValue("useTransparentBackground", ui->useTransparentBg->isChecked());
settings.setValue("menuTextColor", m_menuTextColor);
settings.setValue("showAddTabButton", ui->showAddTabButton->isChecked()); settings.setValue("showAddTabButton", ui->showAddTabButton->isChecked());
settings.endGroup(); settings.endGroup();
@ -596,18 +596,18 @@ void Preferences::saveSettings()
settings.setValue("FixedFont", ui->fontFixed->currentFont().family()); settings.setValue("FixedFont", ui->fontFixed->currentFont().family());
settings.setValue("SansSerifFont", ui->fontSansSerif->currentFont().family()); settings.setValue("SansSerifFont", ui->fontSansSerif->currentFont().family());
settings.setValue("SerifFont", ui->fontSerif->currentFont().family()); settings.setValue("SerifFont", ui->fontSerif->currentFont().family());
settings.setValue("DefaultFontSize", ui->sizeDefault->value()); settings.setValue("DefaultFontSize", ui->sizeDefault->value());
settings.setValue("FixedFontSize", ui->sizeFixed->value()); settings.setValue("FixedFontSize", ui->sizeFixed->value());
settings.endGroup(); settings.endGroup();
//BROWSING //BROWSING
settings.beginGroup("Web-Browser-Settings"); settings.beginGroup("Web-Browser-Settings");
settings.setValue("allowFlash",ui->allowPlugins->isChecked()); settings.setValue("allowFlash", ui->allowPlugins->isChecked());
settings.setValue("allowJavaScript",ui->allowJavaScript->isChecked()); settings.setValue("allowJavaScript", ui->allowJavaScript->isChecked());
settings.setValue("allowJavaScriptOpenWindow", !ui->blockPopup->isChecked()); settings.setValue("allowJavaScriptOpenWindow", !ui->blockPopup->isChecked());
settings.setValue("allowJava",ui->allowJava->isChecked()); settings.setValue("allowJava", ui->allowJava->isChecked());
settings.setValue("autoLoadImages",ui->loadImages->isChecked()); settings.setValue("autoLoadImages", ui->loadImages->isChecked());
settings.setValue("maximumCachedPages",ui->pagesInCache->value());
settings.setValue("DNS-Prefetch", ui->allowDNSPrefetch->isChecked()); settings.setValue("DNS-Prefetch", ui->allowDNSPrefetch->isChecked());
settings.setValue("JavaScriptCanAccessClipboard", ui->jscanAccessClipboard->isChecked()); settings.setValue("JavaScriptCanAccessClipboard", ui->jscanAccessClipboard->isChecked());
settings.setValue("IncludeLinkInFocusChain", ui->linksInFocusChain->isChecked()); settings.setValue("IncludeLinkInFocusChain", ui->linksInFocusChain->isChecked());
@ -618,22 +618,25 @@ void Preferences::saveSettings()
settings.setValue("CheckUpdates", ui->checkUpdates->isChecked()); settings.setValue("CheckUpdates", ui->checkUpdates->isChecked());
settings.setValue("DefaultZoom", ui->defaultZoom->value()); settings.setValue("DefaultZoom", ui->defaultZoom->value());
//Cache //Cache
settings.setValue("maximumCachedPages", ui->pagesInCache->value());
settings.setValue("AllowLocalCache", ui->allowCache->isChecked()); settings.setValue("AllowLocalCache", ui->allowCache->isChecked());
settings.setValue("LocalCacheSize", ui->cacheMB->value()); settings.setValue("LocalCacheSize", ui->cacheMB->value());
//CSS Style //CSS Style
settings.setValue("userStyleSheet", ui->userStyleSheet->text()); settings.setValue("userStyleSheet", ui->userStyleSheet->text());
//PASSWORD MANAGER
settings.setValue("SavePasswordsOnSites", ui->allowPassManager->isChecked());
//PRIVACY //PRIVACY
//Web storage //Web storage
settings.setValue("allowPersistentStorage", ui->storeIcons->isChecked()); settings.setValue("allowPersistentStorage", ui->storeIcons->isChecked());
//ui->saveHistory->setChecked( p_QupZilla->history->isSaving() );
settings.setValue("deleteHistoryOnClose",ui->deleteHistoryOnClose->isChecked()); settings.setValue("deleteHistoryOnClose",ui->deleteHistoryOnClose->isChecked());
//Cookies //Cookies
settings.setValue("allowCookies",ui->saveCookies->isChecked()); settings.setValue("allowCookies", ui->saveCookies->isChecked());
settings.setValue("deleteCookiesOnClose", ui->deleteCookiesOnClose->isChecked()); settings.setValue("deleteCookiesOnClose", ui->deleteCookiesOnClose->isChecked());
settings.setValue("allowCookiesFromVisitedDomainOnly",ui->matchExactly->isChecked() ); settings.setValue("allowCookiesFromVisitedDomainOnly", ui->matchExactly->isChecked() );
settings.setValue("filterTrackingCookie",ui->filterTracking->isChecked() ); settings.setValue("filterTrackingCookie", ui->filterTracking->isChecked() );
settings.endGroup(); settings.endGroup();
//NOTIFICATIONS //NOTIFICATIONS
@ -651,10 +654,12 @@ void Preferences::saveSettings()
settings.setValue("AddComDomainWithCtrlKey",ui->addComWithCtrl->isChecked() ); settings.setValue("AddComDomainWithCtrlKey",ui->addComWithCtrl->isChecked() );
settings.setValue("AddCountryDomainWithAltKey", ui->addCountryWithAlt->isChecked() ); settings.setValue("AddCountryDomainWithAltKey", ui->addCountryWithAlt->isChecked() );
settings.endGroup(); settings.endGroup();
//Languages //Languages
settings.beginGroup("Language"); settings.beginGroup("Language");
settings.setValue("language",ui->languages->itemData(ui->languages->currentIndex()).toString()); settings.setValue("language",ui->languages->itemData(ui->languages->currentIndex()).toString());
settings.endGroup(); settings.endGroup();
//Proxy Configuration //Proxy Configuration
NetworkProxyFactory::ProxyPreference proxyPreference; NetworkProxyFactory::ProxyPreference proxyPreference;
if (ui->systemProxy->isChecked()) if (ui->systemProxy->isChecked())
@ -694,6 +699,7 @@ void Preferences::saveSettings()
mApp->plugins()->c2f_saveSettings(); mApp->plugins()->c2f_saveSettings();
mApp->networkManager()->loadSettings(); mApp->networkManager()->loadSettings();
mApp->desktopNotifications()->loadSettings(); mApp->desktopNotifications()->loadSettings();
mApp->autoFill()->loadSettings();
} }
Preferences::~Preferences() Preferences::~Preferences()

View File

@ -78,13 +78,11 @@ private:
ThemeManager* m_themesManager; ThemeManager* m_themesManager;
QPointer<DesktopNotification> m_notification; QPointer<DesktopNotification> m_notification;
QColor m_menuTextColor;
QString m_homepage; QString m_homepage;
QString m_newTabUrl; QString m_newTabUrl;
QString m_actProfileName; QString m_actProfileName;
int m_afterLaunch; int m_afterLaunch;
int m_onNewTab; int m_onNewTab;
QSize m_bgLabelSize;
QPoint m_notifPosition; QPoint m_notifPosition;
}; };