From 6debba6ebd47792310168af8a0d2ace4796eff10 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 23 May 2010 15:35:41 +0200 Subject: New Settings classes, one for each widget. It seems clear to me that this way code is more maintainable than merging everything in the settingsdialog class --- src/settings/adblockwidget.h | 4 +- src/settings/appearancewidget.cpp | 55 ++++++++ src/settings/appearancewidget.h | 58 +++++++++ src/settings/generalwidget.cpp | 85 ++++++++++++ src/settings/generalwidget.h | 60 +++++++++ src/settings/settings_appearance.ui | 248 ++++++++++++++++++++++++++++++++++++ src/settings/settings_fonts.ui | 192 ---------------------------- src/settings/settings_general.ui | 23 +--- src/settings/settings_webkit.ui | 41 +----- src/settings/settingsdialog.cpp | 149 +++++++++------------- src/settings/settingsdialog.h | 4 - src/settings/tabswidget.cpp | 53 ++++++++ src/settings/tabswidget.h | 58 +++++++++ src/settings/webkitwidget.cpp | 71 +++++++++++ src/settings/webkitwidget.h | 60 +++++++++ 15 files changed, 813 insertions(+), 348 deletions(-) create mode 100644 src/settings/appearancewidget.cpp create mode 100644 src/settings/appearancewidget.h create mode 100644 src/settings/generalwidget.cpp create mode 100644 src/settings/generalwidget.h create mode 100644 src/settings/settings_appearance.ui delete mode 100644 src/settings/settings_fonts.ui create mode 100644 src/settings/tabswidget.cpp create mode 100644 src/settings/tabswidget.h create mode 100644 src/settings/webkitwidget.cpp create mode 100644 src/settings/webkitwidget.h (limited to 'src/settings') diff --git a/src/settings/adblockwidget.h b/src/settings/adblockwidget.h index 1ed9aaa6..38a02636 100644 --- a/src/settings/adblockwidget.h +++ b/src/settings/adblockwidget.h @@ -32,8 +32,8 @@ #include "ui_settings_adblock.h" // Qt Includes -#include -#include +#include +#include class AdBlockWidget : public QWidget, private Ui::adblock diff --git a/src/settings/appearancewidget.cpp b/src/settings/appearancewidget.cpp new file mode 100644 index 00000000..be3c2980 --- /dev/null +++ b/src/settings/appearancewidget.cpp @@ -0,0 +1,55 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2010 by Andrea Diamantini +* +* +* 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 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* 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 . +* +* ============================================================ */ + + +// Self Includes +#include "appearancewidget.h" +#include "appearancewidget.moc" + + +AppearanceWidget::AppearanceWidget(QWidget *parent) + : QWidget(parent) + , _changed(false) +{ + setupUi(this); + + kcfg_fixedFont->setOnlyFixed(true); +} + + +void AppearanceWidget::save() +{ +} + + +bool AppearanceWidget::changed() +{ + return _changed; +} + + +void AppearanceWidget::hasChanged() +{ +} diff --git a/src/settings/appearancewidget.h b/src/settings/appearancewidget.h new file mode 100644 index 00000000..0e400031 --- /dev/null +++ b/src/settings/appearancewidget.h @@ -0,0 +1,58 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2010 by Andrea Diamantini +* +* +* 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 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* 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 . +* +* ============================================================ */ + + +#ifndef APPEARANCE_WIDGET_H +#define APPEARANCE_WIDGET_H + + +// Ui Includes +#include "ui_settings_appearance.h" + +// Qt Includes +#include + + +class AppearanceWidget : public QWidget, private Ui::appearance +{ + Q_OBJECT + +public: + AppearanceWidget(QWidget *parent = 0); + + void save(); + bool changed(); + +signals: + void changed(bool); + +private slots: + void hasChanged(); + +private: + bool _changed; +}; + +#endif // APPEARANCE_WIDGET_H diff --git a/src/settings/generalwidget.cpp b/src/settings/generalwidget.cpp new file mode 100644 index 00000000..fc2d4d5d --- /dev/null +++ b/src/settings/generalwidget.cpp @@ -0,0 +1,85 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2010 by Andrea Diamantini +* +* +* 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 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* 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 . +* +* ============================================================ */ + + +// Self Includes +#include "generalwidget.h" +#include "generalwidget.moc" + +// Auto Includes +#include "rekonq.h" + +// Local Includes +#include "application.h" +#include "mainwindow.h" +#include "webtab.h" + + +GeneralWidget::GeneralWidget(QWidget *parent) + : QWidget(parent) + , _changed(false) +{ + setupUi(this); + + connect(setHomeToCurrentPageButton, SIGNAL(clicked()), this, SLOT(setHomeToCurrentPage())); + + disableHomeSettings(ReKonfig::useNewTabPage()); + + connect(kcfg_useNewTabPage, SIGNAL(toggled(bool)), this, SLOT(disableHomeSettings(bool))); +} + + +void GeneralWidget::save() +{ +} + + +bool GeneralWidget::changed() +{ + return _changed; +} + + +void GeneralWidget::hasChanged() +{ +} + + +void GeneralWidget::setHomeToCurrentPage() +{ + MainWindow *mw = qobject_cast(parent()); + WebTab *webTab = mw->currentTab(); + if (webTab) + { + kcfg_homePage->setText(webTab->url().prettyUrl()); + } +} + + +void GeneralWidget::disableHomeSettings(bool b) +{ + kcfg_homePage->setEnabled(!b); + setHomeToCurrentPageButton->setEnabled(!b); +} diff --git a/src/settings/generalwidget.h b/src/settings/generalwidget.h new file mode 100644 index 00000000..d669fd04 --- /dev/null +++ b/src/settings/generalwidget.h @@ -0,0 +1,60 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2010 by Andrea Diamantini +* +* +* 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 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* 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 . +* +* ============================================================ */ + + +#ifndef GENERAL_WIDGET_H +#define GENERAL_WIDGET_H + + +// Ui Includes +#include "ui_settings_general.h" + +// Qt Includes +#include + + +class GeneralWidget : public QWidget, private Ui::general +{ + Q_OBJECT + +public: + GeneralWidget(QWidget *parent = 0); + + void save(); + bool changed(); + +signals: + void changed(bool); + +private slots: + void hasChanged(); + void setHomeToCurrentPage(); + void disableHomeSettings(bool); + +private: + bool _changed; +}; + +#endif // GENERAL_WIDGET_H diff --git a/src/settings/settings_appearance.ui b/src/settings/settings_appearance.ui new file mode 100644 index 00000000..aff6bfbe --- /dev/null +++ b/src/settings/settings_appearance.ui @@ -0,0 +1,248 @@ + + + appearance + + + + 0 + 0 + 569 + 484 + + + + Appearance + + + + + + Fonts + + + + + + + 0 + 0 + + + + + 150 + 0 + + + + Standard font: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + 150 + 0 + + + + Fixed font: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + + + + + + + Dimension + + + + + + + 0 + 0 + + + + + 150 + 0 + + + + Font size: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + 150 + 0 + + + + Minimal font size: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + + + + + + + User Style Sheet + + + + + + + 150 + 0 + + + + User CSS path: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + *.css + + + + + + + + + + Misc + + + + + + Disable automatic scrolling on middle click in a web page + + + Disable auto scrolling + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + KUrlRequester + QFrame +
kurlrequester.h
+
+ + KFontComboBox + KComboBox +
kfontcombobox.h
+
+ + KComboBox + QComboBox +
kcombobox.h
+
+
+ + +
diff --git a/src/settings/settings_fonts.ui b/src/settings/settings_fonts.ui deleted file mode 100644 index 52c7872e..00000000 --- a/src/settings/settings_fonts.ui +++ /dev/null @@ -1,192 +0,0 @@ - - - fonts - - - - 0 - 0 - 414 - 298 - - - - Appearance - - - - - - Fonts - - - - - - - 0 - 0 - - - - - 150 - 0 - - - - Standard font: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 150 - 0 - - - - Fixed font: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - - - - - - - Dimension - - - - - - - 0 - 0 - - - - - 150 - 0 - - - - Font size: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 150 - 0 - - - - Minimal font size: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - KFontComboBox - KComboBox -
kfontcombobox.h
-
- - KComboBox - QComboBox -
kcombobox.h
-
-
- - -
diff --git a/src/settings/settings_general.ui b/src/settings/settings_general.ui index c0060d76..63ab933c 100644 --- a/src/settings/settings_general.ui +++ b/src/settings/settings_general.ui @@ -6,8 +6,8 @@ 0 0 - 552 - 512 + 464 + 462 @@ -243,25 +243,6 @@ - - - - Navigation - - - - - - Disable automatic scrolling on middle click in a web page - - - Disable auto scrolling - - - - - - diff --git a/src/settings/settings_webkit.ui b/src/settings/settings_webkit.ui index e87e3fec..58fbe459 100644 --- a/src/settings/settings_webkit.ui +++ b/src/settings/settings_webkit.ui @@ -6,8 +6,8 @@ 0 0 - 643 - 560 + 480 + 377 @@ -191,38 +191,6 @@ - - - - User Style Sheet - - - - - - - 150 - 0 - - - - User CSS path: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - *.css - - - - - - @@ -239,11 +207,6 @@ - - KUrlRequester - QFrame -
kurlrequester.h
-
KComboBox QComboBox diff --git a/src/settings/settingsdialog.cpp b/src/settings/settingsdialog.cpp index 3f701c5b..27d40467 100644 --- a/src/settings/settingsdialog.cpp +++ b/src/settings/settingsdialog.cpp @@ -36,15 +36,15 @@ #include "application.h" #include "mainwindow.h" #include "webtab.h" -#include "adblockwidget.h" -#include "networkwidget.h" #include "searchengine.h" -//Ui Includes -#include "ui_settings_general.h" -#include "ui_settings_tabs.h" -#include "ui_settings_fonts.h" -#include "ui_settings_webkit.h" +// Widget Includes +#include "adblockwidget.h" +#include "networkwidget.h" +#include "generalwidget.h" +#include "appearancewidget.h" +#include "webkitwidget.h" +#include "tabswidget.h" // KDE Includes #include @@ -61,76 +61,79 @@ class Private { private: + Private(SettingsDialog *parent); - Ui::general generalUi; - Ui::tabs tabsUi; - Ui::fonts fontsUi; - Ui::webkit webkitUi; - - AdBlockWidget *adBlockWidg; +private: + GeneralWidget *generalWidg; + TabsWidget *tabsWidg; + AppearanceWidget *appearanceWidg; + WebKitWidget *webkitWidg; NetworkWidget *networkWidg; - + AdBlockWidget *adBlockWidg; + KCModuleProxy *ebrowsingModule; KShortcutsEditor *shortcutsEditor; - Private(SettingsDialog *parent); - friend class SettingsDialog; }; Private::Private(SettingsDialog *parent) { - QWidget *widget; KPageWidgetItem *pageItem; - widget = new QWidget; - generalUi.setupUi(widget); - widget->layout()->setMargin(0); - pageItem = parent->addPage(widget , i18n("General")); + // -- 1 + generalWidg = new GeneralWidget(parent); + generalWidg->layout()->setMargin(0); + pageItem = parent->addPage(generalWidg, i18n("General")); pageItem->setIcon(KIcon("rekonq")); - widget = new QWidget; - tabsUi.setupUi(widget); - widget->layout()->setMargin(0); - pageItem = parent->addPage(widget , i18n("Tabs")); + // -- 2 + tabsWidg = new TabsWidget(parent); + tabsWidg->layout()->setMargin(0); + pageItem = parent->addPage(tabsWidg, i18n("Tabs")); pageItem->setIcon(KIcon("tab-duplicate")); - - widget = new QWidget; - fontsUi.setupUi(widget); - widget->layout()->setMargin(0); - pageItem = parent->addPage(widget , i18n("Fonts")); + + // -- 3 + appearanceWidg = new AppearanceWidget(parent); + appearanceWidg->layout()->setMargin(0); + pageItem = parent->addPage(appearanceWidg, i18n("Appearance")); pageItem->setIcon(KIcon("preferences-desktop-font")); - - widget = new QWidget; - webkitUi.setupUi(widget); - widget->layout()->setMargin(0); - pageItem = parent->addPage(widget , i18n("WebKit")); + + // -- 4 + webkitWidg = new WebKitWidget(parent); + webkitWidg->layout()->setMargin(0); + pageItem = parent->addPage(webkitWidg, i18n("WebKit")); QString webkitIconPath = KStandardDirs::locate("appdata", "pics/webkit-icon.png"); KIcon webkitIcon = KIcon(QIcon(webkitIconPath)); pageItem->setIcon(webkitIcon); - + + // -- 5 networkWidg = new NetworkWidget(parent); networkWidg->layout()->setMargin(0); pageItem = parent->addPage(networkWidg , i18n("Network")); pageItem->setIcon(KIcon("preferences-system-network")); + // -- 6 adBlockWidg = new AdBlockWidget(parent); adBlockWidg->layout()->setMargin(0); pageItem = parent->addPage(adBlockWidg , i18n("Ad Block")); pageItem->setIcon(KIcon("preferences-web-browser-adblock")); + // -- 7 shortcutsEditor = new KShortcutsEditor(Application::instance()->mainWindow()->actionCollection(), parent); pageItem = parent->addPage(shortcutsEditor , i18n("Shortcuts")); pageItem->setIcon(KIcon("configure-shortcuts")); + // -- 8 KCModuleInfo ebrowsingInfo("ebrowsing.desktop"); ebrowsingModule = new KCModuleProxy(ebrowsingInfo, parent); pageItem = parent->addPage(ebrowsingModule, i18n(ebrowsingInfo.moduleName().toLocal8Bit())); pageItem->setIcon(KIcon(ebrowsingInfo.icon())); - // WARNING remember wheh changing here that the smallest netbooks + // WARNING + // remember wheh changing here that the smallest netbooks // have a 1024x576 resolution. So DON'T bother that limits!! parent->setMinimumSize(700, 525); } @@ -148,25 +151,20 @@ SettingsDialog::SettingsDialog(QWidget *parent) setModal(true); readConfig(); - - connect(d->generalUi.setHomeToCurrentPageButton, SIGNAL(clicked()), this, SLOT(setHomeToCurrentPage())); - - // new tab page - disableHomeSettings(ReKonfig::useNewTabPage()); - connect(d->generalUi.kcfg_useNewTabPage, SIGNAL(toggled(bool)), this, SLOT(disableHomeSettings(bool))); // update buttons - connect(d->adBlockWidg, SIGNAL(changed(bool)), this, SLOT(updateButtons())); + connect(d->generalWidg, SIGNAL(changed(bool)), this, SLOT(updateButtons())); + connect(d->tabsWidg, SIGNAL(changed(bool)), this, SLOT(updateButtons())); + connect(d->appearanceWidg, SIGNAL(changed(bool)), this, SLOT(updateButtons())); + connect(d->webkitWidg, SIGNAL(changed(bool)), this, SLOT(updateButtons())); connect(d->networkWidg, SIGNAL(changed(bool)), this, SLOT(updateButtons())); + connect(d->adBlockWidg, SIGNAL(changed(bool)), this, SLOT(updateButtons())); connect(d->ebrowsingModule, SIGNAL(changed(bool)), this, SLOT(updateButtons())); - connect(d->shortcutsEditor, SIGNAL(keyChange()), this, SLOT(updateButtons())); // save settings connect(this, SIGNAL(applyClicked()), this, SLOT(saveSettings())); connect(this, SIGNAL(okClicked()), this, SLOT(saveSettings())); - - setWebSettingsToolTips(); } @@ -176,29 +174,9 @@ SettingsDialog::~SettingsDialog() } -void SettingsDialog::setWebSettingsToolTips() -{ - d->webkitUi.kcfg_autoLoadImages->setToolTip(i18n("Specifies whether images are automatically loaded in web pages.")); - d->webkitUi.kcfg_dnsPrefetch->setToolTip(i18n("Specifies whether WebKit will try to prefetch DNS entries to speed up browsing.")); - d->webkitUi.kcfg_javascriptEnabled->setToolTip(i18n("Enables the execution of JavaScript programs.")); - d->webkitUi.kcfg_javaEnabled->setToolTip(i18n("Enables support for Java applets.")); - d->webkitUi.kcfg_pluginsEnabled->setToolTip(i18n("Enables support for plugins in web pages.")); - d->webkitUi.kcfg_javascriptCanOpenWindows->setToolTip(i18n("If enabled, JavaScript programs are allowed to open new windows.")); - d->webkitUi.kcfg_javascriptCanAccessClipboard->setToolTip(i18n("If enabled, JavaScript programs are allowed to read from and to write to the clipboard.")); - d->webkitUi.kcfg_linksIncludedInFocusChain->setToolTip(i18n("If enabled, hyperlinks are included in the keyboard focus chain.")); - d->webkitUi.kcfg_zoomTextOnly->setToolTip(i18n("If enabled, the zoom factor on a frame is only applied to the text.")); - d->webkitUi.kcfg_printElementBackgrounds->setToolTip(i18n("If enabled, background colors and images are also drawn when the page is printed.")); - d->webkitUi.kcfg_offlineStorageDatabaseEnabled->setToolTip(i18n("Enables support for the HTML 5 offline storage feature.")); - d->webkitUi.kcfg_offlineWebApplicationCacheEnabled->setToolTip(i18n("Enables support for the HTML 5 web application cache feature.")); - d->webkitUi.kcfg_localStorageEnabled->setToolTip(i18n("Enables support for the HTML 5 local storage feature.")); -} - - // we need this function to UPDATE the config widget data.. void SettingsDialog::readConfig() { - // ======= Fonts - d->fontsUi.kcfg_fixedFont->setOnlyFixed(true); } @@ -209,15 +187,20 @@ void SettingsDialog::saveSettings() return; ReKonfig::self()->writeConfig(); - d->ebrowsingModule->save(); - d->shortcutsEditor->save(); - d->adBlockWidg->save(); + + d->generalWidg->save(); + d->tabsWidg->save(); + d->appearanceWidg->save(); + d->webkitWidg->save(); d->networkWidg->save(); + d->adBlockWidg->save(); + d->shortcutsEditor->save(); + d->ebrowsingModule->save(); + SearchEngine::loadDefaultWS(); SearchEngine::loadDelimiter(); SearchEngine::loadFavorites(); - updateButtons(); emit settingsChanged("ReKonfig"); } @@ -226,27 +209,13 @@ void SettingsDialog::saveSettings() bool SettingsDialog::hasChanged() { return KConfigDialog::hasChanged() - || d->adBlockWidg->changed() + || d->generalWidg->changed() + || d->tabsWidg->changed() + || d->appearanceWidg->changed() + || d->webkitWidg->changed() || d->networkWidg->changed() + || d->adBlockWidg->changed() || d->ebrowsingModule->changed() || d->shortcutsEditor->isModified(); ; } - - -void SettingsDialog::setHomeToCurrentPage() -{ - MainWindow *mw = static_cast(parent()); - WebTab *webTab = mw->currentTab(); - if (webTab) - { - d->generalUi.kcfg_homePage->setText(webTab->url().prettyUrl()); - } -} - - -void SettingsDialog::disableHomeSettings(bool b) -{ - d->generalUi.kcfg_homePage->setEnabled(!b); - d->generalUi.setHomeToCurrentPageButton->setEnabled(!b); -} diff --git a/src/settings/settingsdialog.h b/src/settings/settingsdialog.h index cade78e3..c25db74b 100644 --- a/src/settings/settingsdialog.h +++ b/src/settings/settingsdialog.h @@ -52,14 +52,10 @@ public: private: Private* const d; - void setWebSettingsToolTips(); private slots: void readConfig(); void saveSettings(); - - void setHomeToCurrentPage(); - void disableHomeSettings(bool); }; #endif // SETTINGS_DIALOG_H diff --git a/src/settings/tabswidget.cpp b/src/settings/tabswidget.cpp new file mode 100644 index 00000000..aa555339 --- /dev/null +++ b/src/settings/tabswidget.cpp @@ -0,0 +1,53 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2010 by Andrea Diamantini +* +* +* 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 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* 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 . +* +* ============================================================ */ + + +// Local Includes +#include "tabswidget.h" +#include "tabswidget.moc" + + +TabsWidget::TabsWidget(QWidget *parent) + : QWidget(parent) + , _changed(false) +{ + setupUi(this); +} + + +void TabsWidget::save() +{ +} + + +bool TabsWidget::changed() +{ + return _changed; +} + + +void TabsWidget::hasChanged() +{ +} diff --git a/src/settings/tabswidget.h b/src/settings/tabswidget.h new file mode 100644 index 00000000..f1ff8a52 --- /dev/null +++ b/src/settings/tabswidget.h @@ -0,0 +1,58 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2010 by Andrea Diamantini +* +* +* 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 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* 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 . +* +* ============================================================ */ + + +#ifndef TABS_WIDGET_H +#define TABS_WIDGET_H + + +// Ui Includes +#include "ui_settings_tabs.h" + +// Qt Includes +#include + + +class TabsWidget : public QWidget, private Ui::tabs +{ + Q_OBJECT + +public: + TabsWidget(QWidget *parent = 0); + + void save(); + bool changed(); + +signals: + void changed(bool); + +private slots: + void hasChanged(); + +private: + bool _changed; +}; + +#endif // TABS_WIDGET_H diff --git a/src/settings/webkitwidget.cpp b/src/settings/webkitwidget.cpp new file mode 100644 index 00000000..f9d94d76 --- /dev/null +++ b/src/settings/webkitwidget.cpp @@ -0,0 +1,71 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2010 by Andrea Diamantini +* +* +* 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 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* 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 . +* +* ============================================================ */ + + +// Local Includes +#include "webkitwidget.h" +#include "webkitwidget.moc" + + +WebKitWidget::WebKitWidget(QWidget *parent) + : QWidget(parent) + , _changed(false) +{ + setupUi(this); +} + + +void WebKitWidget::save() +{ +} + + +bool WebKitWidget::changed() +{ + return _changed; +} + + +void WebKitWidget::hasChanged() +{ +} + + +void WebKitWidget::setWebSettingsToolTips() +{ + kcfg_autoLoadImages->setToolTip(i18n("Specifies whether images are automatically loaded in web pages.")); + kcfg_dnsPrefetch->setToolTip(i18n("Specifies whether WebKit will try to prefetch DNS entries to speed up browsing.")); + kcfg_javascriptEnabled->setToolTip(i18n("Enables the execution of JavaScript programs.")); + kcfg_javaEnabled->setToolTip(i18n("Enables support for Java applets.")); + kcfg_pluginsEnabled->setToolTip(i18n("Enables support for plugins in web pages.")); + kcfg_javascriptCanOpenWindows->setToolTip(i18n("If enabled, JavaScript programs are allowed to open new windows.")); + kcfg_javascriptCanAccessClipboard->setToolTip(i18n("If enabled, JavaScript programs are allowed to read from and to write to the clipboard.")); + kcfg_linksIncludedInFocusChain->setToolTip(i18n("If enabled, hyperlinks are included in the keyboard focus chain.")); + kcfg_zoomTextOnly->setToolTip(i18n("If enabled, the zoom factor on a frame is only applied to the text.")); + kcfg_printElementBackgrounds->setToolTip(i18n("If enabled, background colors and images are also drawn when the page is printed.")); + kcfg_offlineStorageDatabaseEnabled->setToolTip(i18n("Enables support for the HTML 5 offline storage feature.")); + kcfg_offlineWebApplicationCacheEnabled->setToolTip(i18n("Enables support for the HTML 5 web application cache feature.")); + kcfg_localStorageEnabled->setToolTip(i18n("Enables support for the HTML 5 local storage feature.")); +} diff --git a/src/settings/webkitwidget.h b/src/settings/webkitwidget.h new file mode 100644 index 00000000..b1eb8d76 --- /dev/null +++ b/src/settings/webkitwidget.h @@ -0,0 +1,60 @@ +/* ============================================================ +* +* This file is a part of the rekonq project +* +* Copyright (C) 2010 by Andrea Diamantini +* +* +* 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 2 of +* the License or (at your option) version 3 or any later version +* accepted by the membership of KDE e.V. (or its successor approved +* by the membership of KDE e.V.), which shall act as a proxy +* defined in Section 14 of version 3 of the license. +* +* 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 . +* +* ============================================================ */ + + +#ifndef WEBKIT_WIDGET_H +#define WEBKIT_WIDGET_H + + +// Ui Includes +#include "ui_settings_webkit.h" + +// Qt Includes +#include + + +class WebKitWidget : public QWidget, private Ui::webkit +{ + Q_OBJECT + +public: + WebKitWidget(QWidget *parent = 0); + + void save(); + bool changed(); + +signals: + void changed(bool); + +private slots: + void hasChanged(); + +private: + void setWebSettingsToolTips(); + + bool _changed; +}; + +#endif // WEBKIT_WIDGET_H -- cgit v1.2.1 From c03cf973fd44223335615b6dd576785746e2b409 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 24 May 2010 10:47:44 +0200 Subject: Improving fonts situation --- src/settings/appearancewidget.cpp | 2 +- src/settings/settings_appearance.ui | 118 +++++++++++++++++------------------- 2 files changed, 55 insertions(+), 65 deletions(-) (limited to 'src/settings') diff --git a/src/settings/appearancewidget.cpp b/src/settings/appearancewidget.cpp index be3c2980..875b67d2 100644 --- a/src/settings/appearancewidget.cpp +++ b/src/settings/appearancewidget.cpp @@ -35,7 +35,7 @@ AppearanceWidget::AppearanceWidget(QWidget *parent) { setupUi(this); - kcfg_fixedFont->setOnlyFixed(true); +// kcfg_fixedFont->setOnlyFixed(true); } diff --git a/src/settings/settings_appearance.ui b/src/settings/settings_appearance.ui index aff6bfbe..b564033c 100644 --- a/src/settings/settings_appearance.ui +++ b/src/settings/settings_appearance.ui @@ -6,8 +6,8 @@ 0 0 - 569 - 484 + 454 + 371
@@ -19,7 +19,7 @@ Fonts - + @@ -43,14 +43,7 @@ - - - - 0 - 0 - - - + @@ -75,26 +68,10 @@ - - - - 0 - 0 - - - + - - -
- - - - Dimension - - - - + + 0 @@ -108,52 +85,65 @@ - Font size: + Minimal font size: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - 0 - 0 - + + + + + + + + + + + + + + + + + + + Serif font: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - 0 - 0 - + + + + Sans Serif font: - - - 150 - 0 - + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + - Minimal font size: + Cursive font: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - 0 - 0 - + + + + Fantasy font: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -233,14 +223,14 @@
kurlrequester.h
- KFontComboBox - KComboBox -
kfontcombobox.h
+ KFontRequester + QWidget +
kfontrequester.h
- KComboBox - QComboBox -
kcombobox.h
+ KIntNumInput + QWidget +
knuminput.h
-- cgit v1.2.1