diff options
-rw-r--r-- | src/CMakeLists.txt | 9 | ||||
-rw-r--r-- | src/browserapplication.cpp | 46 | ||||
-rw-r--r-- | src/browserapplication.h | 2 | ||||
-rw-r--r-- | src/findbar.cpp | 2 | ||||
-rw-r--r-- | src/mainview.cpp | 5 | ||||
-rw-r--r-- | src/mainwindow.cpp | 105 | ||||
-rw-r--r-- | src/mainwindow.h | 4 | ||||
-rw-r--r-- | src/rekonq.kcfg | 73 | ||||
-rw-r--r-- | src/rekonq.kcfgc | 5 | ||||
-rw-r--r-- | src/rekonqui.rc | 14 | ||||
-rw-r--r-- | src/settings.cpp | 472 | ||||
-rw-r--r-- | src/settings.h | 14 | ||||
-rw-r--r-- | src/settings_appearance.ui | 98 | ||||
-rw-r--r-- | src/settings_fonts.ui | 64 | ||||
-rw-r--r-- | src/settings_general.ui | 39 | ||||
-rw-r--r-- | src/settings_privacy.ui | 23 | ||||
-rw-r--r-- | src/settings_proxy.ui | 15 | ||||
-rw-r--r-- | src/webview.cpp | 4 |
18 files changed, 539 insertions, 455 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 83297551..25c8e3cb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,12 +30,14 @@ KDE4_ADD_UI_FILES( rekonq_SRCS passworddialog.ui proxy.ui settings_general.ui - settings_appearance.ui + settings_fonts.ui settings_privacy.ui settings_proxy.ui ) -# include(${QT_USE_FILE}) +KDE4_ADD_KCFG_FILES( rekonq_SRCS rekonq.kcfgc ) + +### ------------------------------------------ ADD_DEFINITIONS( ${KDE4_DEFINITIONS} ) @@ -47,12 +49,11 @@ TARGET_LINK_LIBRARIES( rekonq ${QT_QTWEBKIT_LIBRARY} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} -# ${QT_QTUITOOLS_LIBRARY} ) INSTALL( TARGETS rekonq ${INSTALL_TARGETS_DEFAULT_ARGS} ) ########### install files ############### -#INSTALL( FILES rekonq.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) +INSTALL( FILES rekonq.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) INSTALL( FILES rekonqui.rc DESTINATION ${DATA_INSTALL_DIR}/rekonq ) diff --git a/src/browserapplication.cpp b/src/browserapplication.cpp index bb8c76b1..bbd4b8b1 100644 --- a/src/browserapplication.cpp +++ b/src/browserapplication.cpp @@ -127,8 +127,6 @@ void BrowserApplication::postLaunch() } QWebSettings::setIconDatabasePath(directory); - loadSettings(); - // newMainWindow() needs to be called in main() for this to happen if (m_mainWindows.count() > 0) { @@ -148,36 +146,6 @@ void BrowserApplication::postLaunch() } - -void BrowserApplication::loadSettings() -{ - KConfig config("rekonqrc"); - KConfigGroup group = config.group("Appearance Settings"); - - QWebSettings *defaultSettings = QWebSettings::globalSettings(); - QString standardFontFamily = defaultSettings->fontFamily(QWebSettings::StandardFont); - int standardFontSize = defaultSettings->fontSize(QWebSettings::DefaultFontSize); - QFont standardFont = QFont(standardFontFamily, standardFontSize); - standardFont = qVariantValue<QFont>( group.readEntry( QString("standardFont"), standardFont ) ); - - defaultSettings->setFontFamily(QWebSettings::StandardFont, standardFont.family()); - defaultSettings->setFontSize(QWebSettings::DefaultFontSize, standardFont.pointSize()); - - QString fixedFontFamily = defaultSettings->fontFamily(QWebSettings::FixedFont); - int fixedFontSize = defaultSettings->fontSize(QWebSettings::DefaultFixedFontSize); - QFont fixedFont = QFont(fixedFontFamily, fixedFontSize); - fixedFont = qVariantValue<QFont>(group.readEntry( QString("fixedFont"), fixedFont ) ); - - defaultSettings->setFontFamily(QWebSettings::FixedFont, fixedFont.family()); - defaultSettings->setFontSize(QWebSettings::DefaultFixedFontSize, fixedFont.pointSize()); - - defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, group.readEntry( QString("enableJavascript"), true ) ); - defaultSettings->setAttribute(QWebSettings::PluginsEnabled, group.readEntry( QString("enablePlugins"), true ) ); -} - - - - QList<MainWindow*> BrowserApplication::mainWindows() { clean(); @@ -190,8 +158,6 @@ QList<MainWindow*> BrowserApplication::mainWindows() } - - void BrowserApplication::clean() { // cleanup any deleted main windows first @@ -311,17 +277,7 @@ void BrowserApplication::newLocalSocketConnection() stream >> url; if (!url.isEmpty()) { - KConfig config("rekonqrc"); - KConfigGroup group = config.group("Global Settings"); - int openLinksIn = group.readEntry( QString("openLinksIn"), QString().toInt() ); - if (openLinksIn == 1) - { - newMainWindow(); - } - else - { - mainWindow()->tabWidget()->newTab(); - } + mainWindow()->tabWidget()->newTab(); openUrl(url); } delete socket; diff --git a/src/browserapplication.h b/src/browserapplication.h index 8d33883e..4ec2cca6 100644 --- a/src/browserapplication.h +++ b/src/browserapplication.h @@ -49,7 +49,7 @@ public: BrowserApplication(KCmdLineArgs*, const QString &); ~BrowserApplication(); static BrowserApplication *instance(); - void loadSettings(); +// void loadSettings(); bool isTheOnlyBrowser() const; MainWindow *mainWindow(); diff --git a/src/findbar.cpp b/src/findbar.cpp index a1c867c2..6ba310ca 100644 --- a/src/findbar.cpp +++ b/src/findbar.cpp @@ -34,7 +34,7 @@ FindBar::FindBar(KXmlGuiWindow *parent) - : KToolBar( "Find Bar" , parent, Qt::BottomToolBarArea, true, false, false) + : KToolBar( "findBar" , parent, Qt::BottomToolBarArea, true, false, false) , m_lineEdit(0) { KAction *close = new KAction(KIcon("dialog-close") , "close" , this); diff --git a/src/mainview.cpp b/src/mainview.cpp index 4236d5d0..328d3dd1 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -175,7 +175,7 @@ void MainView::slotWebSelectAll() { WebView *webView = currentWebView(); QWebPage *currentParent = webView->webPage(); - // FIXME + // TODO } @@ -618,6 +618,3 @@ void MainView::previousTab() next = count() - 1; setCurrentIndex(next); } - - -// ---------------------------------------------------------------------------------------------------------------------------- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d1f60b5d..6c177103 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -23,11 +23,14 @@ #include "mainwindow.h" #include "mainwindow.moc" +// Auto Includes +#include "rekonq.h" + // Local Includes #include "browserapplication.h" #include "downloadmanager.h" -#include "history.h" #include "settings.h" +#include "history.h" #include "bookmarks.h" #include "webview.h" @@ -62,17 +65,21 @@ MainWindow::MainWindow() // accept dnd setAcceptDrops(true); + // updating rekonq configuration + updateConfiguration(); + + // creating a new tab m_tabWidget->newTab(); // tell the KXmlGuiWindow that this is indeed the main widget setCentralWidget(m_tabWidget); + // connect signals and slots connect(m_tabWidget, SIGNAL( loadUrlPage(const KUrl &) ), this, SLOT( loadUrl(const KUrl &) ) ); connect(m_tabWidget, SIGNAL( setCurrentTitle(const QString &)), this, SLOT( slotUpdateWindowTitle(const QString &) ) ); connect(m_tabWidget, SIGNAL( showStatusBarMessage(const QString&)), statusBar(), SLOT( showMessage(const QString&) ) ); connect(m_tabWidget, SIGNAL( linkHovered(const QString&)), statusBar(), SLOT( showMessage(const QString&) ) ); connect(m_tabWidget, SIGNAL( loadProgress(int)), this, SLOT( slotLoadProgress(int) ) ); -// connect(m_tabWidget, SIGNAL( tabsChanged()), m_autoSaver, SLOT( changeOccurred() ) ); connect(m_tabWidget, SIGNAL( geometryChangeRequested(const QRect &)), this, SLOT( geometryChangeRequested(const QRect &) ) ); connect(m_tabWidget, SIGNAL( printRequested(QWebFrame *)), this, SLOT( printRequested(QWebFrame *) ) ); connect(m_tabWidget, SIGNAL( menuBarVisibilityChangeRequested(bool)), menuBar(), SLOT( setVisible(bool) ) ); @@ -80,8 +87,6 @@ MainWindow::MainWindow() connect(m_tabWidget, SIGNAL( lastTabClosed() ), m_tabWidget, SLOT(newTab() ) ); slotUpdateWindowTitle(); -// -------------------------------------------------------------------------------------------------------------------------------- - // then, setup our actions setupActions(); @@ -276,6 +281,93 @@ void MainWindow::setupCustomMenu() } +// TODO FIXME +void MainWindow::updateConfiguration() +{ + // ============== General ================== + m_homePage = ReKonfig::homePage(); + +// int historyExpire = ReKonfig::expireHistory(); +// int days; +// switch (historyExpire) +// { +// case 0: days = 1; break; +// case 1: days = 7; break; +// case 2: days = 14; break; +// case 3: days = 30; break; +// case 4: days = 365; break; +// case 5: days = -1; break; +// default: days = -1; +// } +// m_historyExpire = days; +// +// m_downloadDir = ReKonfig::downloadDir(); + + + // =========== Fonts ============== + QFont standardFont = ReKonfig::standardFont(); + QFont fixedFont = ReKonfig::fixedFont(); + + QWebSettings *defaultSettings = QWebSettings::globalSettings(); + defaultSettings->setFontFamily(QWebSettings::StandardFont, standardFont.family()); + defaultSettings->setFontSize(QWebSettings::DefaultFontSize, standardFont.pointSize()); + defaultSettings->setFontFamily(QWebSettings::FixedFont, fixedFont.family()); + defaultSettings->setFontSize(QWebSettings::DefaultFixedFontSize, fixedFont.pointSize()); + + + // =========== Privacy ============== + + bool arePluginsEnabled = ReKonfig::enablePlugins(); + bool isJavascriptEnabled = ReKonfig::enableJavascript(); + + defaultSettings->setAttribute(QWebSettings::PluginsEnabled, arePluginsEnabled); + defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, isJavascriptEnabled); + +// int canAcceptCookies = ReKonfig::acceptCookies(); +// int canKeepCookiesUntil = ReKonfig::keepCookiesUntil(); +// +// CookieJar::KeepPolicy keepCookies; +// switch(canAcceptCookies) +// { +// default: +// case 0: +// keepCookies = CookieJar::KeepUntilExpire; +// break; +// case 1: +// keepCookies = CookieJar::KeepUntilExit; +// break; +// case 2: +// keepCookies = CookieJar::KeepUntilTimeLimit; +// break; +// } +// CookieJar *jar = BrowserApplication::cookieJar(); +// QMetaEnum acceptPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("AcceptPolicy")); +// +// CookieJar::KeepPolicy keepPolicy; +// switch(canKeepCookiesUntil) +// { +// default: +// case 0: +// keepPolicy = CookieJar::KeepUntilExpire; +// break; +// case 1: +// keepPolicy = CookieJar::KeepUntilExit; +// break; +// case 2: +// keepPolicy = CookieJar::KeepUntilTimeLimit; +// break; +// } +// +// QMetaEnum keepPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("KeepPolicy")); +// // --- +// BrowserApplication::instance()->loadSettings(); +// BrowserApplication::networkAccessManager()->loadSettings(); +// BrowserApplication::cookieJar()->loadSettings(); +// BrowserApplication::historyManager()->loadSettings(); + +} + + KUrl MainWindow::guessUrlFromString(const QString &string) { QString urlStr = string.trimmed(); @@ -576,10 +668,7 @@ void MainWindow::slotViewPageSource() void MainWindow::slotHome() { - KConfig config("rekonqrc"); - KConfigGroup group = config.group("Global Settings"); - QString home = group.readEntry( QString("home"), QString("http://www.kde.org/") ); - loadUrl( KUrl(home) ); + loadUrl( KUrl(m_homePage) ); } diff --git a/src/mainwindow.h b/src/mainwindow.h index fd7f13d6..e666e405 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -65,6 +65,8 @@ private: void setupTabBar(); public slots: + void updateConfiguration(); + void slotHome(); void loadUrl(const KUrl &url); @@ -126,6 +128,8 @@ private: QString m_lastSearch; MainView *m_tabWidget; + + QString m_homePage; }; #endif // MAINWINDOW_H diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg new file mode 100644 index 00000000..4e91847b --- /dev/null +++ b/src/rekonq.kcfg @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8"?> +<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 + http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > + <kcfgfile name="rekonqrc"/> + +<!-- Includes --> +<include>QtWebKit</include> +<include>KUrl</include> + +<!-- General Settings --> + <group name="General"> + <entry name="homePage" type="Path"> + <default>http://www.kde.org/</default> + </entry> + <entry name="downloadDir" type="Path"> + <default>$HOME</default> + </entry> + <entry name="expireHistory" type="Int"> + <default>1</default> + </entry> + </group> + +<!-- Fonts Settings --> + <group name="Fonts"> + <entry name="standardFont" type="Font"> + <default code="true">QFont( QWebSettings::globalSettings()->fontFamily(QWebSettings::StandardFont) )</default> + </entry> + <entry name="fixedFont" type="Font"> + <default code="true">QFont( QWebSettings::globalSettings()->fontFamily(QWebSettings::FixedFont) )</default> + </entry> + </group> + +<!-- Privacy Settings --> + <group name="Privacy"> + <entry name="enablePlugins" type="Bool"> + <default>true</default> + </entry> + <entry name="enableJavascript" type="Bool"> + <default>true</default> + </entry> + <entry name="acceptCookies" type="Int"> + <default>0</default> + </entry> + <entry name="keepCookiesUntil" type="Int"> + <default>0</default> + </entry> + </group> + +<!-- Proxy Settings --> + <group name="Proxy"> + <entry name="enableProxy" type="Bool"> + <default>false</default> + </entry> + <entry name="proxyType" type="String"> + <default>Socks5</default> + </entry> + <entry name="proxyHostName" type="String"> + <default></default> + </entry> + <entry name="proxyPort" type="Int"> + <default>1080</default> + </entry> + <entry name="proxyUserName" type="String"> + <default></default> + </entry> + <entry name="proxyPassword" type="Password"> + <default></default> + </entry> + </group> + +</kcfg> diff --git a/src/rekonq.kcfgc b/src/rekonq.kcfgc new file mode 100644 index 00000000..50a9817d --- /dev/null +++ b/src/rekonq.kcfgc @@ -0,0 +1,5 @@ +File=rekonq.kcfg +ClassName=ReKonfig +Singleton=true +Mutators=true +UseEnumTypes=true diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 323e775b..3a9ab682 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -1,5 +1,5 @@ <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> -<kpartgui name="rekonq" version="12"> +<kpartgui name="rekonq" version="13"> <MenuBar> <!-- ============ FILE menu =========== --> <Menu name="file" noMerge="1"><text>&File</text> @@ -57,13 +57,17 @@ <Action name="web inspector" /> </Menu> <!-- ============ SETTINGS menu =========== --> -<Menu name="settings" noMerge="1"><text>&Settings</text> - <Action name="options_show_statusbar" /> - <Separator/> +<Menu name="settings" noMerge="1"> + <text>&Settings</text> + <!-- + Disable merging because we do not want the "fullscreen" action to appear + here, since it is already in the "view" menu. + --> + <Action name="options_show_menubar"/> <Action name="options_configure_keybinding"/> <Action name="options_configure_toolbars"/> <Action name="options_configure"/> -</Menu> +</Menu> </MenuBar> <!-- ============ Main ToolBar =========== --> diff --git a/src/settings.cpp b/src/settings.cpp index 23b04c83..c06cbc85 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -19,10 +19,14 @@ * ============================================================ */ -// Local Includes +// Self Includes #include "settings.h" #include "settings.moc" +// Auto Includes +#include "rekonq.h" + +// Local Includes #include "browserapplication.h" #include "mainwindow.h" #include "cookiejar.h" @@ -32,7 +36,7 @@ //Ui Includes #include "ui_settings_general.h" -#include "ui_settings_appearance.h" +#include "ui_settings_fonts.h" #include "ui_settings_privacy.h" #include "ui_settings_proxy.h" @@ -52,7 +56,7 @@ class Private { private: Ui::general generalUi; - Ui::appearance appearanceUi; + Ui::fonts fontsUi; Ui::privacy privacyUi; Ui::proxy proxyUi; @@ -72,10 +76,10 @@ Private::Private(SettingsDialog *parent) widget->layout()->setMargin(0); pageItem = parent->addPage( widget , i18n("General") ); pageItem->setIcon( KIcon("rekonq") ); - generalUi.kurlrequester->setMode( KFile::Directory ); + generalUi.kcfg_downloadDir->setMode( KFile::Directory ); widget = new QWidget; - appearanceUi.setupUi( widget ); + fontsUi.setupUi( widget ); widget->layout()->setMargin(0); pageItem = parent->addPage( widget , i18n("Fonts") ); pageItem->setIcon( KIcon("preferences-desktop-font") ); @@ -96,7 +100,7 @@ Private::Private(SettingsDialog *parent) // ----------------------------------------------------------------------------------------------------- SettingsDialog::SettingsDialog(QWidget *parent) - : KConfigDialog(parent, "Settings", new KConfigSkeleton("rekonqrc") ) + : KConfigDialog(parent, "settings", ReKonfig::self() ) , d(new Private(this) ) { setFaceType(KPageDialog::List); @@ -106,223 +110,221 @@ SettingsDialog::SettingsDialog(QWidget *parent) setWindowTitle( i18n("rekonfig..") ); setModal(true); - connect(this, SIGNAL( okClicked() ), this, SLOT( slotOk() ) ); - connect(this, SIGNAL( closeClicked() ), this, SLOT( close() ) ); - connect(this, SIGNAL( applyClicked() ), this, SLOT( slotApply() ) ); + connect(this, SIGNAL(settingsChanged(const QString&)), parent, SLOT(updateConfiguration())); +// connect(this, SIGNAL(settingsChanged(const QString&)), this, SLOT(loadFromSettings())); + connect( d->generalUi.setHomeToCurrentPageButton, SIGNAL(clicked()), this, SLOT( setHomeToCurrentPage() ) ); connect( d->privacyUi.exceptionsButton, SIGNAL(clicked()), this, SLOT( showExceptions() ) ); connect( d->privacyUi.cookiesButton, SIGNAL(clicked()), this, SLOT( showCookies() ) ); - connect( d->appearanceUi.standardFontButton, SIGNAL(clicked()), this, SLOT( chooseFont() ) ); - connect( d->appearanceUi.fixedFontButton, SIGNAL(clicked()), this, SLOT( chooseFixedFont() ) ); - - loadDefaults(); - loadFromSettings(); } + SettingsDialog::~SettingsDialog() { delete d; } -void SettingsDialog::loadDefaults() -{ - QWebSettings *defaultSettings = QWebSettings::globalSettings(); - QString standardFontFamily = defaultSettings->fontFamily(QWebSettings::StandardFont); - int standardFontSize = defaultSettings->fontSize(QWebSettings::DefaultFontSize); - m_standardFont = QFont(standardFontFamily, standardFontSize); - d->appearanceUi.standardLabel->setText(QString(QLatin1String("%1 %2")).arg( m_standardFont.family() ).arg( m_standardFont.pointSize() )); - - QString fixedFontFamily = defaultSettings->fontFamily(QWebSettings::FixedFont); - int fixedFontSize = defaultSettings->fontSize(QWebSettings::DefaultFixedFontSize); - m_fixedFont = QFont(fixedFontFamily, fixedFontSize); - d->appearanceUi.fixedLabel->setText(QString(QLatin1String("%1 %2")).arg( m_fixedFont.family() ).arg( m_fixedFont.pointSize() )); - - d->generalUi.kurlrequester->setUrl( KUrl( "~" ) ); // QDesktopServices::storageLocation(QDesktopServices::DesktopLocation) ); - - d->privacyUi.enableJavascript->setChecked(defaultSettings->testAttribute(QWebSettings::JavascriptEnabled)); - d->privacyUi.enablePlugins->setChecked(defaultSettings->testAttribute(QWebSettings::PluginsEnabled)); -} - - -void SettingsDialog::loadFromSettings() -{ - KConfig config("rekonqrc"); - KConfigGroup group1 = config.group("Global Settings"); - - QString defaultHome = QString("http://www.kde.org"); - d->generalUi.homeLineEdit->setText( group1.readEntry(QString("home"), defaultHome) ); - - int historyExpire = group1.readEntry( QString("historyExpire"), QString().toInt() ); - int idx = 0; - switch (historyExpire) - { - case 1: idx = 0; break; - case 7: idx = 1; break; - case 14: idx = 2; break; - case 30: idx = 3; break; - case 365: idx = 4; break; - case -1: idx = 5; break; - default: idx = 5; - } - d->generalUi.expireHistory->setCurrentIndex(idx); - - QString downloadDirectory = group1.readEntry( QString("downloadDirectory") , QString() ); - d->generalUi.kurlrequester->setUrl( KUrl(downloadDirectory) ); - - d->generalUi.openLinksIn->setCurrentIndex( group1.readEntry( QString("openLinksIn"), d->generalUi.openLinksIn->currentIndex() ) ); - - - // Appearance - KConfigGroup group2 = config.group("Fonts Settings"); - - m_fixedFont = group2.readEntry( QString("fixedFont"), m_fixedFont ); - m_standardFont = group2.readEntry( QString("standardFont"), m_standardFont ); - - d->appearanceUi.standardLabel->setText(QString(QLatin1String("%1 %2")).arg( m_standardFont.family() ).arg( m_standardFont.pointSize() ) ); - d->appearanceUi.fixedLabel->setText(QString(QLatin1String("%1 %2")).arg( m_fixedFont.family() ).arg( m_fixedFont.pointSize() ) ); - - // Privacy - KConfigGroup group3 = config.group("Privacy Settings"); - - d->privacyUi.enableJavascript->setChecked( group3.readEntry( QString("enableJavascript"), d->privacyUi.enableJavascript->isChecked() ) ); - d->privacyUi.enablePlugins->setChecked( group3.readEntry( QString("enablePlugins"), d->privacyUi.enablePlugins->isChecked() ) ); - - CookieJar *jar = BrowserApplication::cookieJar(); - QString value = group3.readEntry( QString("acceptCookies"), QString("AcceptOnlyFromSitesNavigatedTo") ) ; - QMetaEnum acceptPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("AcceptPolicy")); - CookieJar::AcceptPolicy acceptCookies = acceptPolicyEnum.keyToValue( value.toLocal8Bit() ) == -1 ? - CookieJar::AcceptOnlyFromSitesNavigatedTo : - static_cast<CookieJar::AcceptPolicy>(acceptPolicyEnum.keyToValue( value.toLocal8Bit() ) ); - switch(acceptCookies) - { - case CookieJar::AcceptAlways: - d->privacyUi.acceptCombo->setCurrentIndex(0); - break; - case CookieJar::AcceptNever: - d->privacyUi.acceptCombo->setCurrentIndex(1); - break; - case CookieJar::AcceptOnlyFromSitesNavigatedTo: - d->privacyUi.acceptCombo->setCurrentIndex(2); - break; - } - - value = group3.readEntry( QString("keepCookiesUntil"), QString("Expire") ); - QMetaEnum keepPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("KeepPolicy")); - CookieJar::KeepPolicy keepCookies = keepPolicyEnum.keyToValue( value.toLocal8Bit() ) == -1 ? - CookieJar::KeepUntilExpire : - static_cast<CookieJar::KeepPolicy>(keepPolicyEnum.keyToValue( value.toLocal8Bit() ) ); - switch(keepCookies) - { - case CookieJar::KeepUntilExpire: - d->privacyUi.keepUntilCombo->setCurrentIndex(0); - break; - case CookieJar::KeepUntilExit: - d->privacyUi.keepUntilCombo->setCurrentIndex(1); - break; - case CookieJar::KeepUntilTimeLimit: - d->privacyUi.keepUntilCombo->setCurrentIndex(2); - break; - } - - // Proxy - KConfigGroup group4 = config.group("Proxy Settings"); - - d->proxyUi.proxySupport->setChecked( group4.readEntry( QString("enabled"), false ) ); - d->proxyUi.proxyType->setCurrentIndex( group4.readEntry( QString("type"), 0) ); - d->proxyUi.proxyHostName->setText( group4.readEntry( QString("hostName"), QString() ) ); - d->proxyUi.proxyPort->setValue( group4.readEntry( QString("port"), QString().toInt() ) ); - d->proxyUi.proxyUserName->setText( group4.readEntry( QString("userName") , QString() ) ); - d->proxyUi.proxyPassword->setText( group4.readEntry( QString("password") , QString() ) ); - -} - - -void SettingsDialog::saveToSettings() +//void SettingsDialog::loadDefaults() +//{ +// QWebSettings *defaultSettings = QWebSettings::globalSettings(); +// QString standardFontFamily = defaultSettings->fontFamily(QWebSettings::StandardFont); +// int standardFontSize = defaultSettings->fontSize(QWebSettings::DefaultFontSize); +// m_standardFont = QFont(standardFontFamily, standardFontSize); +// d->fontsUi.standardLabel->setText(QString(QLatin1String("%1 %2")).arg( m_standardFont.family() ).arg( m_standardFont.pointSize() )); +// +// QString fixedFontFamily = defaultSettings->fontFamily(QWebSettings::FixedFont); +// int fixedFontSize = defaultSettings->fontSize(QWebSettings::DefaultFixedFontSize); +// m_fixedFont = QFont(fixedFontFamily, fixedFontSize); +// d->fontsUi.fixedLabel->setText(QString(QLatin1String("%1 %2")).arg( m_fixedFont.family() ).arg( m_fixedFont.pointSize() )); +// +// d->generalUi.kurlrequester->setUrl( KUrl( "~" ) ); // QDesktopServices::storageLocation(QDesktopServices::DesktopLocation) ); +// +// d->privacyUi.enableJavascript->setChecked(defaultSettings->testAttribute(QWebSettings::JavascriptEnabled)); +// d->privacyUi.enablePlugins->setChecked(defaultSettings->testAttribute(QWebSettings::PluginsEnabled)); +// } +// +// + +/*void SettingsDialog::loadFromSettings() { - KConfig config("rekonqrc"); - KConfigGroup group1 = config.group("Global Settings"); - - group1.writeEntry(QString("home"), d->generalUi.homeLineEdit->text() ); - group1.writeEntry(QString("openLinksIn"), d->generalUi.openLinksIn->currentIndex() ); - group1.writeEntry(QString("downloadDirectory"), d->generalUi.kurlrequester->url().path() ); - - int historyExpire = d->generalUi.expireHistory->currentIndex(); - int idx = -1; - switch (historyExpire) - { - case 0: idx = 1; break; - case 1: idx = 7; break; - case 2: idx = 14; break; - case 3: idx = 30; break; - case 4: idx = 365; break; - case 5: idx = -1; break; - } - group1.writeEntry(QString("historyExpire"), idx ); - - KConfigGroup group2 = config.group("Fonts Settings"); - group2.writeEntry(QString("fixedFont"), m_fixedFont); - group2.writeEntry(QString("standardFont"), m_standardFont); - - KConfigGroup group3 = config.group("Privacy Settings"); - group3.writeEntry(QString("enableJavascript"), d->privacyUi.enableJavascript->isChecked() ); - group3.writeEntry(QString("enablePlugins"), d->privacyUi.enablePlugins->isChecked() ); - - CookieJar::KeepPolicy keepCookies; - switch( d->privacyUi.acceptCombo->currentIndex() ) - { - default: - case 0: - keepCookies = CookieJar::KeepUntilExpire; - break; - case 1: - keepCookies = CookieJar::KeepUntilExit; - break; - case 2: - keepCookies = CookieJar::KeepUntilTimeLimit; - break; - } - CookieJar *jar = BrowserApplication::cookieJar(); - QMetaEnum acceptPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("AcceptPolicy")); - group3.writeEntry(QString("acceptCookies"), QString(acceptPolicyEnum.valueToKey(keepCookies) ) ); - - CookieJar::KeepPolicy keepPolicy; - switch( d->privacyUi.keepUntilCombo->currentIndex() ) - { - default: - case 0: - keepPolicy = CookieJar::KeepUntilExpire; - break; - case 1: - keepPolicy = CookieJar::KeepUntilExit; - break; - case 2: - keepPolicy = CookieJar::KeepUntilTimeLimit; - break; - } - - QMetaEnum keepPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("KeepPolicy")); - group3.writeEntry(QString("keepCookiesUntil"), QString(keepPolicyEnum.valueToKey(keepPolicy) ) ); - - - KConfigGroup group4 = config.group("Proxy Settings"); - group4.writeEntry(QString("enabled"), d->proxyUi.proxySupport->isChecked() ); - group4.writeEntry(QString("type"), d->proxyUi.proxyType->currentIndex() ); - group4.writeEntry(QString("hostName"), d->proxyUi.proxyHostName->text() ); - group4.writeEntry(QString("port"), d->proxyUi.proxyPort->text() ); - group4.writeEntry(QString("userName"), d->proxyUi.proxyUserName->text() ); - group4.writeEntry(QString("password"), d->proxyUi.proxyPassword->text() ); - - config.sync(); - - // --- - BrowserApplication::instance()->loadSettings(); - BrowserApplication::networkAccessManager()->loadSettings(); - BrowserApplication::cookieJar()->loadSettings(); - BrowserApplication::historyManager()->loadSettings(); -} + KConfig config("rekonqrc"); +// KConfigGroup group1 = config.group("Global Settings"); +// +// QString defaultHome = QString("http://www.kde.org"); +// d->generalUi.homeLineEdit->setText( group1.readEntry(QString("home"), defaultHome) ); +// +// int historyExpire = group1.readEntry( QString("historyExpire"), QString().toInt() ); +// int idx = 0; +// switch (historyExpire) +// { +// case 1: idx = 0; break; +// case 7: idx = 1; break; +// case 14: idx = 2; break; +// case 30: idx = 3; break; +// case 365: idx = 4; break; +// case -1: idx = 5; break; +// default: idx = 5; +// } +// d->generalUi.expireHistory->setCurrentIndex(idx); +// +// QString downloadDirectory = group1.readEntry( QString("downloadDirectory") , QString() ); +// d->generalUi.kurlrequester->setUrl( KUrl(downloadDirectory) ); +// +// d->generalUi.openLinksIn->setCurrentIndex( group1.readEntry( QString("openLinksIn"), d->generalUi.openLinksIn->currentIndex() ) ); +// +// + + // ===== Fonts + KConfigGroup fontsGroup = config.group("Fonts Settings"); + + m_standardFont = fontsGroup.readEntry( QString("standardFont"), m_standardFont ); + d->fontsUi.kcfg_standardFont->setText(QString(QLatin1String("%1 %2")).arg( m_standardFont.family() ).arg( m_standardFont.pointSize() ) ); + + m_fixedFont = fontsGroup.readEntry( QString("fixedFont"), m_fixedFont ); + d->fontsUi.kcfg_fixedFont->setText(QString(QLatin1String("%1 %2")).arg( m_fixedFont.family() ).arg( m_fixedFont.pointSize() ) ); +// +// // Privacy +// KConfigGroup group3 = config.group("Privacy Settings"); +// +// d->privacyUi.enableJavascript->setChecked( group3.readEntry( QString("enableJavascript"), d->privacyUi.enableJavascript->isChecked() ) ); +// d->privacyUi.enablePlugins->setChecked( group3.readEntry( QString("enablePlugins"), d->privacyUi.enablePlugins->isChecked() ) ); +// +// CookieJar *jar = BrowserApplication::cookieJar(); +// QString value = group3.readEntry( QString("acceptCookies"), QString("AcceptOnlyFromSitesNavigatedTo") ) ; +// QMetaEnum acceptPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("AcceptPolicy")); +// CookieJar::AcceptPolicy acceptCookies = acceptPolicyEnum.keyToValue( value.toLocal8Bit() ) == -1 ? +// CookieJar::AcceptOnlyFromSitesNavigatedTo : +// static_cast<CookieJar::AcceptPolicy>(acceptPolicyEnum.keyToValue( value.toLocal8Bit() ) ); +// switch(acceptCookies) +// { +// case CookieJar::AcceptAlways: +// d->privacyUi.acceptCombo->setCurrentIndex(0); +// break; +// case CookieJar::AcceptNever: +// d->privacyUi.acceptCombo->setCurrentIndex(1); +// break; +// case CookieJar::AcceptOnlyFromSitesNavigatedTo: +// d->privacyUi.acceptCombo->setCurrentIndex(2); +// break; +// } +// +// value = group3.readEntry( QString("keepCookiesUntil"), QString("Expire") ); +// QMetaEnum keepPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("KeepPolicy")); +// CookieJar::KeepPolicy keepCookies = keepPolicyEnum.keyToValue( value.toLocal8Bit() ) == -1 ? +// CookieJar::KeepUntilExpire : +// static_cast<CookieJar::KeepPolicy>(keepPolicyEnum.keyToValue( value.toLocal8Bit() ) ); +// switch(keepCookies) +// { +// case CookieJar::KeepUntilExpire: +// d->privacyUi.keepUntilCombo->setCurrentIndex(0); +// break; +// case CookieJar::KeepUntilExit: +// d->privacyUi.keepUntilCombo->setCurrentIndex(1); +// break; +// case CookieJar::KeepUntilTimeLimit: +// d->privacyUi.keepUntilCombo->setCurrentIndex(2); +// break; +// } +// +// // Proxy +// KConfigGroup group4 = config.group("Proxy Settings"); +// +// d->proxyUi.proxySupport->setChecked( group4.readEntry( QString("enabled"), false ) ); +// d->proxyUi.proxyType->setCurrentIndex( group4.readEntry( QString("type"), 0) ); +// d->proxyUi.proxyHostName->setText( group4.readEntry( QString("hostName"), QString() ) ); +// d->proxyUi.proxyPort->setValue( group4.readEntry( QString("port"), QString().toInt() ) ); +// d->proxyUi.proxyUserName->setText( group4.readEntry( QString("userName") , QString() ) ); +// d->proxyUi.proxyPassword->setText( group4.readEntry( QString("password") , QString() ) ); +// +}*/ +// +// +// void SettingsDialog::saveToSettings() +// { +// KConfig config("rekonqrc"); +// KConfigGroup group1 = config.group("Global Settings"); +// +// group1.writeEntry(QString("home"), d->generalUi.homeLineEdit->text() ); +// group1.writeEntry(QString("openLinksIn"), d->generalUi.openLinksIn->currentIndex() ); +// group1.writeEntry(QString("downloadDirectory"), d->generalUi.kurlrequester->url().path() ); +// +// int historyExpire = d->generalUi.expireHistory->currentIndex(); +// int idx = -1; +// switch (historyExpire) +// { +// case 0: idx = 1; break; +// case 1: idx = 7; break; +// case 2: idx = 14; break; +// case 3: idx = 30; break; +// case 4: idx = 365; break; +// case 5: idx = -1; break; +// } +// group1.writeEntry(QString("historyExpire"), idx ); +// +// KConfigGroup group2 = config.group("Fonts Settings"); +// group2.writeEntry(QString("fixedFont"), m_fixedFont); +// group2.writeEntry(QString("standardFont"), m_standardFont); +// +// KConfigGroup group3 = config.group("Privacy Settings"); +// group3.writeEntry(QString("enableJavascript"), d->privacyUi.enableJavascript->isChecked() ); +// group3.writeEntry(QString("enablePlugins"), d->privacyUi.enablePlugins->isChecked() ); +// +// CookieJar::KeepPolicy keepCookies; +// switch( d->privacyUi.acceptCombo->currentIndex() ) +// { +// default: +// case 0: +// keepCookies = CookieJar::KeepUntilExpire; +// break; +// case 1: +// keepCookies = CookieJar::KeepUntilExit; +// break; +// case 2: +// keepCookies = CookieJar::KeepUntilTimeLimit; +// break; +// } +// CookieJar *jar = BrowserApplication::cookieJar(); +// QMetaEnum acceptPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("AcceptPolicy")); +// group3.writeEntry(QString("acceptCookies"), QString(acceptPolicyEnum.valueToKey(keepCookies) ) ); +// +// CookieJar::KeepPolicy keepPolicy; +// switch( d->privacyUi.keepUntilCombo->currentIndex() ) +// { +// default: +// case 0: +// keepPolicy = CookieJar::KeepUntilExpire; +// break; +// case 1: +// keepPolicy = CookieJar::KeepUntilExit; +// break; +// case 2: +// keepPolicy = CookieJar::KeepUntilTimeLimit; +// break; +// } +// +// QMetaEnum keepPolicyEnum = jar->staticMetaObject.enumerator(jar->staticMetaObject.indexOfEnumerator("KeepPolicy")); +// group3.writeEntry(QString("keepCookiesUntil"), QString(keepPolicyEnum.valueToKey(keepPolicy) ) ); +// +// +// KConfigGroup group4 = config.group("Proxy Settings"); +// group4.writeEntry(QString("enabled"), d->proxyUi.proxySupport->isChecked() ); +// group4.writeEntry(QString("type"), d->proxyUi.proxyType->currentIndex() ); +// group4.writeEntry(QString("hostName"), d->proxyUi.proxyHostName->text() ); +// group4.writeEntry(QString("port"), d->proxyUi.proxyPort->text() ); +// group4.writeEntry(QString("userName"), d->proxyUi.proxyUserName->text() ); +// group4.writeEntry(QString("password"), d->proxyUi.proxyPassword->text() ); +// +// config.sync(); +// +// // --- +// BrowserApplication::instance()->loadSettings(); +// BrowserApplication::networkAccessManager()->loadSettings(); +// BrowserApplication::cookieJar()->loadSettings(); +// BrowserApplication::historyManager()->loadSettings(); +// } void SettingsDialog::showCookies() @@ -339,29 +341,29 @@ void SettingsDialog::showExceptions() } -void SettingsDialog::chooseFont() -{ - QFont myFont( m_standardFont ); - int result = KFontDialog::getFont( myFont ); - if ( result == KFontDialog::Accepted ) - { - m_standardFont = myFont; - d->appearanceUi.standardLabel->setText(QString(QLatin1String("%1 %2")).arg( m_standardFont.family() ).arg( m_standardFont.pointSize() ) ); - } -} - - -void SettingsDialog::chooseFixedFont() -{ - - QFont myFont( m_fixedFont ); - int result = KFontDialog::getFont( myFont , KFontChooser::FixedFontsOnly ); - if ( result == KFontDialog::Accepted ) - { - m_fixedFont = myFont; - d->appearanceUi.fixedLabel->setText(QString(QLatin1String("%1 %2")).arg( m_fixedFont.family() ).arg( m_fixedFont.pointSize() ) ); - } -} +// void SettingsDialog::chooseStandardFont() +// { +// QFont myFont( m_standardFont ); +// int result = KFontDialog::getFont( myFont ); +// if ( result == KFontDialog::Accepted ) +// { +// m_standardFont = myFont; +// d->fontsUi.kcfg_standardFont->setText(QString(QLatin1String("%1 %2")).arg( m_standardFont.family() ).arg( m_standardFont.pointSize() ) ); +// } +// } +// +// +// void SettingsDialog::chooseFixedFont() +// { +// +// QFont myFont( m_fixedFont ); +// int result = KFontDialog::getFont( myFont , KFontChooser::FixedFontsOnly ); +// if ( result == KFontDialog::Accepted ) +// { +// m_fixedFont = myFont; +// d->fontsUi.kcfg_fixedFont->setText(QString(QLatin1String("%1 %2")).arg( m_fixedFont.family() ).arg( m_fixedFont.pointSize() ) ); +// } +// } void SettingsDialog::setHomeToCurrentPage() @@ -370,10 +372,10 @@ void SettingsDialog::setHomeToCurrentPage() WebView *webView = mw->currentTab(); if (webView) { - d->generalUi.homeLineEdit->setText( webView->url().prettyUrl() ); + d->generalUi.kcfg_homePage->setText( webView->url().prettyUrl() ); } } - +/* void SettingsDialog::slotOk() { @@ -384,4 +386,4 @@ void SettingsDialog::slotOk() void SettingsDialog::slotApply() { saveToSettings(); -} +}*/ diff --git a/src/settings.h b/src/settings.h index 79059ed6..f9ae6828 100644 --- a/src/settings.h +++ b/src/settings.h @@ -41,23 +41,17 @@ private: Private* const d; private slots: - void loadDefaults(); - void loadFromSettings(); - void saveToSettings(); - +// void loadFromSettings(); void setHomeToCurrentPage(); void showCookies(); void showExceptions(); - - void chooseFont(); +/* + void chooseStandardFont(); void chooseFixedFont(); - void slotOk(); - void slotApply(); - private: QFont m_standardFont; - QFont m_fixedFont; + QFont m_fixedFont;*/ }; #endif // SETTINGS_H diff --git a/src/settings_appearance.ui b/src/settings_appearance.ui deleted file mode 100644 index ec82297c..00000000 --- a/src/settings_appearance.ui +++ /dev/null @@ -1,98 +0,0 @@ -<ui version="4.0" > - <class>appearance</class> - <widget class="QWidget" name="appearance" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>445</width> - <height>92</height> - </rect> - </property> - <property name="windowTitle" > - <string>Appearance</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QLabel" name="label_5" > - <property name="text" > - <string>Standard font:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_6" > - <property name="text" > - <string>Fixed-width font:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2" > - <item> - <widget class="QLabel" name="standardLabel" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> - <property name="text" > - <string>Times 16</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="fixedLabel" > - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> - <property name="text" > - <string>Courier 13</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_3" > - <item> - <widget class="QPushButton" name="standardFontButton" > - <property name="text" > - <string>Select...</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="fixedFontButton" > - <property name="text" > - <string>Select...</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/src/settings_fonts.ui b/src/settings_fonts.ui new file mode 100644 index 00000000..beaa3afe --- /dev/null +++ b/src/settings_fonts.ui @@ -0,0 +1,64 @@ +<ui version="4.0" > + <class>fonts</class> + <widget class="QWidget" name="fonts" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>391</width> + <height>179</height> + </rect> + </property> + <property name="windowTitle" > + <string>Appearance</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QGroupBox" name="groupBox" > + <property name="title" > + <string>Standard Font</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <widget class="KFontRequester" name="kcfg_standardFont" /> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_2" > + <property name="title" > + <string>Fixed Font</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <widget class="KFontRequester" name="kcfg_fixedFont" /> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer" > + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KFontRequester</class> + <extends>QWidget</extends> + <header>kfontrequester.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/src/settings_general.ui b/src/settings_general.ui index 4857488a..47dbad81 100644 --- a/src/settings_general.ui +++ b/src/settings_general.ui @@ -5,7 +5,7 @@ <rect> <x>0</x> <y>0</y> - <width>575</width> + <width>500</width> <height>209</height> </rect> </property> @@ -24,7 +24,14 @@ </widget> </item> <item row="0" column="1" colspan="2" > - <widget class="KLineEdit" name="homeLineEdit" /> + <widget class="KLineEdit" name="kcfg_homePage" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> </item> <item row="1" column="1" > <widget class="QPushButton" name="setHomeToCurrentPageButton" > @@ -57,7 +64,7 @@ </widget> </item> <item row="2" column="1" colspan="2" > - <widget class="QComboBox" name="expireHistory" > + <widget class="QComboBox" name="kcfg_expireHistory" > <item> <property name="text" > <string>After one day</string> @@ -101,33 +108,9 @@ </widget> </item> <item row="3" column="1" colspan="2" > - <widget class="KUrlRequester" name="kurlrequester" /> - </item> - <item row="4" column="0" > - <widget class="QLabel" name="label_8" > - <property name="text" > - <string>Open links from applications:</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> + <widget class="KUrlRequester" name="kcfg_downloadDir" /> </item> <item row="4" column="1" colspan="2" > - <widget class="QComboBox" name="openLinksIn" > - <item> - <property name="text" > - <string>In a tab in the current window</string> - </property> - </item> - <item> - <property name="text" > - <string>In a new window</string> - </property> - </item> - </widget> - </item> - <item row="5" column="1" colspan="2" > <spacer name="spacer" > <property name="orientation" > <enum>Qt::Vertical</enum> diff --git a/src/settings_privacy.ui b/src/settings_privacy.ui index dfa61998..19e7f088 100644 --- a/src/settings_privacy.ui +++ b/src/settings_privacy.ui @@ -6,7 +6,7 @@ <x>0</x> <y>0</y> <width>461</width> - <height>212</height> + <height>313</height> </rect> </property> <property name="windowTitle" > @@ -20,7 +20,7 @@ </property> <layout class="QVBoxLayout" name="verticalLayout_2" > <item> - <widget class="QCheckBox" name="enablePlugins" > + <widget class="QCheckBox" name="kcfg_enablePlugins" > <property name="text" > <string>Enable Plugins</string> </property> @@ -30,7 +30,7 @@ </widget> </item> <item> - <widget class="QCheckBox" name="enableJavascript" > + <widget class="QCheckBox" name="kcfg_enableJavascript" > <property name="text" > <string>Enable Javascript</string> </property> @@ -59,7 +59,7 @@ </widget> </item> <item row="0" column="1" > - <widget class="QComboBox" name="acceptCombo" > + <widget class="QComboBox" name="kcfg_acceptCookies" > <item> <property name="text" > <string>Always</string> @@ -95,7 +95,7 @@ </widget> </item> <item row="1" column="1" > - <widget class="QComboBox" name="keepUntilCombo" > + <widget class="QComboBox" name="kcfg_keepCookiesUntil" > <item> <property name="text" > <string>They expire</string> @@ -123,6 +123,19 @@ </layout> </widget> </item> + <item> + <spacer name="verticalSpacer" > + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> </layout> </widget> <resources/> diff --git a/src/settings_proxy.ui b/src/settings_proxy.ui index c02dad27..a7dd6073 100644 --- a/src/settings_proxy.ui +++ b/src/settings_proxy.ui @@ -14,13 +14,10 @@ </property> <layout class="QHBoxLayout" name="horizontalLayout" > <item> - <widget class="QGroupBox" name="proxySupport" > + <widget class="QGroupBox" name="kcfg_enableProxy" > <property name="title" > <string>Enable proxy</string> </property> - <property name="checkable" > - <bool>true</bool> - </property> <layout class="QGridLayout" name="gridLayout_6" > <item row="0" column="0" > <widget class="QLabel" name="label_9" > @@ -33,7 +30,7 @@ </widget> </item> <item row="0" column="1" colspan="2" > - <widget class="QComboBox" name="proxyType" > + <widget class="QComboBox" name="kcfg_proxyType" > <item> <property name="text" > <string>Socks5</string> @@ -57,7 +54,7 @@ </widget> </item> <item row="1" column="1" colspan="2" > - <widget class="KLineEdit" name="proxyHostName" /> + <widget class="KLineEdit" name="kcfg_proxyHostName" /> </item> <item row="2" column="0" > <widget class="QLabel" name="label_11" > @@ -70,7 +67,7 @@ </widget> </item> <item row="2" column="1" > - <widget class="QSpinBox" name="proxyPort" > + <widget class="QSpinBox" name="kcfg_proxyPort" > <property name="maximum" > <number>10000</number> </property> @@ -103,7 +100,7 @@ </widget> </item> <item row="3" column="1" colspan="2" > - <widget class="KLineEdit" name="proxyUserName" /> + <widget class="KLineEdit" name="kcfg_proxyUserName" /> </item> <item row="4" column="0" > <widget class="QLabel" name="label_13" > @@ -116,7 +113,7 @@ </widget> </item> <item row="4" column="1" colspan="2" > - <widget class="KLineEdit" name="proxyPassword" /> + <widget class="KLineEdit" name="kcfg_proxyPassword" /> </item> <item row="5" column="0" > <spacer name="verticalSpacer_2" > diff --git a/src/webview.cpp b/src/webview.cpp index 62acbba6..df629fc8 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -305,8 +305,8 @@ void WebView::downloadRequested(const QNetworkRequest &request) const KUrl url = KUrl( request.url() ); KConfig config("rekonqrc"); - KConfigGroup group1 = config.group("Global Settings"); - QString path = group1.readEntry(QString("downloadDirectory")) + QString("/") + url.fileName(); + KConfigGroup group = config.group("General"); + QString path = group.readEntry(QString("downloadDir")) + QString("/") + url.fileName(); KIO::NetAccess::download( url , path , this ); } |