diff --git a/settings/bookmarks/bookmarks.cpp b/settings/bookmarks/bookmarks.cpp index 03f9d4e1f9e6a702972170e18e6ed7ba0a8122c2..8536a7ebcfb14329e73f2a1061080348d7a317cd 100644 --- a/settings/bookmarks/bookmarks.cpp +++ b/settings/bookmarks/bookmarks.cpp @@ -60,14 +60,14 @@ void BookmarksConfigModule::load() ui.sbCacheSize->setValue(group.readEntry("CacheSize", 5 * 1024)); // Config changed notifications... - connect(ui.sbColumns, SIGNAL(valueChanged(int)), SLOT(configChanged())); - connect(ui.cbShowBackgrounds, SIGNAL(toggled(bool)), SLOT(configChanged())); - connect(ui.cbShowRoot, SIGNAL(toggled(bool)), SLOT(configChanged())); - connect(ui.cbFlattenTree, SIGNAL(toggled(bool)), SLOT(configChanged())); - connect(ui.cbShowPlaces, SIGNAL(toggled(bool)), SLOT(configChanged())); - connect(ui.sbCacheSize, SIGNAL(valueChanged(int)), SLOT(configChanged())); - - connect(ui.clearCacheButton, SIGNAL(clicked(bool)), SLOT(clearCache())); + connect(ui.sbColumns, QOverload::of(&QSpinBox::valueChanged), this, &BookmarksConfigModule::configChanged); + connect(ui.cbShowBackgrounds, &QAbstractButton::toggled, this, &BookmarksConfigModule::configChanged); + connect(ui.cbShowRoot, &QAbstractButton::toggled, this, &BookmarksConfigModule::configChanged); + connect(ui.cbFlattenTree, &QAbstractButton::toggled, this, &BookmarksConfigModule::configChanged); + connect(ui.cbShowPlaces, &QAbstractButton::toggled, this, &BookmarksConfigModule::configChanged); + connect(ui.sbCacheSize, QOverload::of(&QSpinBox::valueChanged), this, &BookmarksConfigModule::configChanged); + + connect(ui.clearCacheButton, &QAbstractButton::clicked, this, &BookmarksConfigModule::clearCache); delete c; emit changed(false); diff --git a/settings/konq/CMakeLists.txt b/settings/konq/CMakeLists.txt index f3c3f289026d34a66ff89240096f329835cd92fb..8ae845c3bf994551bf8922697a72c0255fbe1770 100644 --- a/settings/konq/CMakeLists.txt +++ b/settings/konq/CMakeLists.txt @@ -2,7 +2,6 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kcmkonq\") set(kcm_konq_PART_SRCS behaviour.cpp konqkcmfactory.cpp -# kcustommenueditor.cpp ) add_library(kcm_konq MODULE ${kcm_konq_PART_SRCS}) diff --git a/settings/konq/behaviour.cpp b/settings/konq/behaviour.cpp index 08ec4498427dffc25961bc0fa6b7fba5de21815e..8949fd8db50de76e29ea145a231fdc7cbb07e5d8 100644 --- a/settings/konq/behaviour.cpp +++ b/settings/konq/behaviour.cpp @@ -59,9 +59,9 @@ KBehaviourOptions::KBehaviourOptions(QWidget *parent, const QVariantList &) winPixmap->setFixedSize(winPixmap->sizeHint()); cbNewWin = new QCheckBox(i18n("Open folders in separate &windows"), this); - cbNewWin->setWhatsThis(i18n("If this option is checked, Konqueror will open a new window when " + cbNewWin->setToolTip(i18n("If this option is checked, Konqueror will open a new window when " "you open a folder, rather than showing that folder's contents in the current window.")); - connect(cbNewWin, SIGNAL(toggled(bool)), this, SLOT(changed())); + connect(cbNewWin, &QAbstractButton::toggled, this, &KBehaviourOptions::markAsChanged); connect(cbNewWin, &QAbstractButton::toggled, this, &KBehaviourOptions::updateWinPixmap); miscLayout->addWidget(cbNewWin); @@ -84,9 +84,9 @@ KBehaviourOptions::KBehaviourOptions(QWidget *parent, const QVariantList &) cbShowDeleteCommand = new QCheckBox(i18n("Show 'Delete' me&nu entries which bypass the trashcan"), this); mainLayout->addWidget(cbShowDeleteCommand); - connect(cbShowDeleteCommand, SIGNAL(toggled(bool)), this, SLOT(changed())); + connect(cbShowDeleteCommand, &QAbstractButton::toggled, this, &KBehaviourOptions::markAsChanged); - cbShowDeleteCommand->setWhatsThis(i18n("Check this if you want 'Delete' menu commands to be displayed " + cbShowDeleteCommand->setToolTip(i18n("Check this if you want 'Delete' menu commands to be displayed " "on the desktop and in the file manager's menus and context menus. " "You can always delete files by holding the Shift key " "while calling 'Move to Trash'.")); diff --git a/settings/konq/kcustommenueditor.cpp b/settings/konq/kcustommenueditor.cpp deleted file mode 100644 index 449ea64ea83ea5e6731564b3640529bfcf6e80e7..0000000000000000000000000000000000000000 --- a/settings/konq/kcustommenueditor.cpp +++ /dev/null @@ -1,252 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2002 Waldo Bastian (bastian@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// Own -#include "kcustommenueditor.h" - -// Qt -#include -#include -#include -#include - -// KDE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class KCustomMenuEditor::Item : public Q3ListViewItem -{ -public: - Item(Q3ListView *parent, KService::Ptr service) - : Q3ListViewItem(parent), - s(service) - { - init(); - } - - Item(Q3ListViewItem *parent, KService::Ptr service) - : Q3ListViewItem(parent), - s(service) - { - init(); - } - - void init() - { - QString serviceName = s->name(); - - // item names may contain ampersands. To avoid them being converted - // to accelerators, replace them with two ampersands. - serviceName.replace('&', "&&"); - - QPixmap normal = KIconLoader::global()->loadIcon(s->icon(), KIconLoader::Small, - 0, KIconLoader::DefaultState, QStringList(), 0L, true); - - // make sure they are not larger than 16x16 - if (normal.width() > 16 || normal.height() > 16) { - QImage tmp = normal.toImage(); - tmp = tmp.scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - normal = QPixmap::fromImage(tmp); - } - setText(0, serviceName); - setPixmap(0, normal); - } - - KService::Ptr s; -}; - -class KCustomMenuEditor::KCustomMenuEditorPrivate -{ -public: - QPushButton *pbRemove; - QPushButton *pbMoveUp; - QPushButton *pbMoveDown; -}; - -KCustomMenuEditor::KCustomMenuEditor(QWidget *parent) - : KDialog(parent), - m_listView(0), d(new KCustomMenuEditorPrivate) -{ - setCaption(i18nc("@title:window", "Menu Editor")); - setButtons(Ok | Cancel); - setDefaultButton(Ok); - QWidget *page = new QWidget(this); - QHBoxLayout *pageHBoxLayout = new QHBoxLayout(page); - pageHBoxLayout->setContentsMargins(0, 0, 0, 0); - setMainWidget(page); - m_listView = new K3ListView(page); - pageHBoxLayout->addWidget(m_listView); - m_listView->addColumn(i18n("Menu")); - m_listView->setFullWidth(true); - m_listView->setSorting(-1); - KDialogButtonBox *buttonBox = new KDialogButtonBox(page, Qt::Vertical); - buttonBox->addButton(i18n("New..."), QDialogButtonBox::ActionRole, this, SLOT(slotNewItem())); - d->pbRemove = buttonBox->addButton(i18n("Remove"), QDialogButtonBox::DestructiveRole, this, SLOT(slotRemoveItem())); - d->pbMoveUp = buttonBox->addButton(i18n("Move Up"), QDialogButtonBox::ActionRole, this, SLOT(slotMoveUp())); - d->pbMoveDown = buttonBox->addButton(i18n("Move Down"), QDialogButtonBox::ActionRole, this, SLOT(slotMoveDown())); - buttonBox->layout(); - connect(m_listView, SIGNAL(selectionChanged()), this, SLOT(refreshButton())); - refreshButton(); -} - -KCustomMenuEditor::~KCustomMenuEditor() -{ - delete d; -} - -void KCustomMenuEditor::refreshButton() -{ - Q3ListViewItem *item = m_listView->currentItem(); - d->pbRemove->setEnabled(item); - d->pbMoveUp->setEnabled(item && item->itemAbove()); - d->pbMoveDown->setEnabled(item && item->itemBelow()); -} - -void -KCustomMenuEditor::load(KConfig *cfg) -{ - KConfigGroup cg(cfg, QString()); - int count = cg.readEntry("NrOfItems", 0); - Q3ListViewItem *last = 0; - for (int i = 0; i < count; i++) { - QString entry = cg.readPathEntry(QString("Item%1").arg(i + 1), QString()); - if (entry.isEmpty()) { - continue; - } - - // Try KSycoca first. - KService::Ptr menuItem = KService::serviceByDesktopPath(entry); - if (!menuItem) { - menuItem = KService::serviceByDesktopName(entry); - } - if (!menuItem) { - menuItem = new KService(entry); - } - - if (!menuItem->isValid()) { - continue; - } - - Q3ListViewItem *item = new Item(m_listView, menuItem); - item->moveItem(last); - last = item; - } -} - -void -KCustomMenuEditor::save(KConfig *cfg) -{ - // First clear the whole config file. - const QStringList groups = cfg->groupList(); - for (QStringList::ConstIterator it = groups.begin(); - it != groups.end(); ++it) { - cfg->deleteGroup(*it); - } - - KConfigGroup cg(cfg, QString()); - Item *item = (Item *) m_listView->firstChild(); - int i = 0; - while (item) { - i++; - QString path = item->s->entryPath(); - if (QDir::isRelativePath(path) || QDir::isRelativePath(KGlobal::dirs()->relativeLocation("xdgdata-apps", path))) { - path = item->s->desktopEntryName(); - } - cg.writePathEntry(QString("Item%1").arg(i), path); - item = (Item *) item->nextSibling(); - } - cg.writeEntry("NrOfItems", i); -} - -void -KCustomMenuEditor::slotNewItem() -{ - Q3ListViewItem *item = m_listView->currentItem(); - - KOpenWithDialog dlg(this); - dlg.setSaveNewApplications(true); - - if (dlg.exec()) { - KService::Ptr s = dlg.service(); - if (s && s->isValid()) { - Item *newItem = new Item(m_listView, s); - newItem->moveItem(item); - } - refreshButton(); - } -} - -void -KCustomMenuEditor::slotRemoveItem() -{ - Q3ListViewItem *item = m_listView->currentItem(); - if (!item) { - return; - } - - delete item; - refreshButton(); -} - -void -KCustomMenuEditor::slotMoveUp() -{ - Q3ListViewItem *item = m_listView->currentItem(); - if (!item) { - return; - } - - Q3ListViewItem *searchItem = m_listView->firstChild(); - while (searchItem) { - Q3ListViewItem *next = searchItem->nextSibling(); - if (next == item) { - searchItem->moveItem(item); - break; - } - searchItem = next; - } - refreshButton(); -} - -void -KCustomMenuEditor::slotMoveDown() -{ - Q3ListViewItem *item = m_listView->currentItem(); - if (!item) { - return; - } - - Q3ListViewItem *after = item->nextSibling(); - if (!after) { - return; - } - - item->moveItem(after); - refreshButton(); -} - diff --git a/settings/konq/kcustommenueditor.h b/settings/konq/kcustommenueditor.h deleted file mode 100644 index 6f6306839e4e16b84c4091cd95945abc29213b23..0000000000000000000000000000000000000000 --- a/settings/konq/kcustommenueditor.h +++ /dev/null @@ -1,65 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2002 Waldo Bastian (bastian@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#ifndef _KCUSTOMMENUEDITOR_H_ -#define _KCUSTOMMENUEDITOR_H_ - -#include - -class K3ListView; - -/* - * Dialog for editing custom menus. - * - * @author Waldo Bastian (bastian@kde.org) - */ -class KCustomMenuEditor : public KDialog -{ - Q_OBJECT -public: - /** - * Create a dialog for editing a custom menu - */ - KCustomMenuEditor(QWidget *parent); - ~KCustomMenuEditor(); - /** - * load the custom menu - */ - void load(KConfig *); - - /** - * save the custom menu - */ - void save(KConfig *); - -public Q_SLOTS: - void slotNewItem(); - void slotRemoveItem(); - void slotMoveUp(); - void slotMoveDown(); - void refreshButton(); - -protected: - class Item; - K3ListView *m_listView; - - class KCustomMenuEditorPrivate; - KCustomMenuEditorPrivate *const d; -}; - -#endif diff --git a/settings/konqhtml/CMakeLists.txt b/settings/konqhtml/CMakeLists.txt index f3018682da5738720afb8e9d8ae05f75487e0853..7341bc3c5c1607228c69f61a076ba207e43c6b1d 100644 --- a/settings/konqhtml/CMakeLists.txt +++ b/settings/konqhtml/CMakeLists.txt @@ -10,9 +10,7 @@ set(kcm_konqhtml_PART_SRCS htmlopts.cpp jsopts.cpp javaopts.cpp - pluginopts.cpp appearance.cpp - khttpoptdlg.cpp policydlg.cpp main.cpp jspolicies.cpp @@ -24,7 +22,6 @@ set(kcm_konqhtml_PART_SRCS ) ki18n_wrap_ui(kcm_konqhtml_PART_SRCS - nsconfigwidget.ui advancedTabOptions.ui css/csscustom.ui css/cssconfig.ui @@ -32,10 +29,7 @@ ki18n_wrap_ui(kcm_konqhtml_PART_SRCS add_library(kcm_konqhtml MODULE ${kcm_konqhtml_PART_SRCS}) -target_link_libraries(kcm_konqhtml - KF5::Parts - KF5::KDELibs4Support -) +target_link_libraries(kcm_konqhtml KF5::Parts KF5::ItemViews) install(TARGETS kcm_konqhtml DESTINATION ${KDE_INSTALL_PLUGINDIR}) diff --git a/settings/konqhtml/appearance.cpp b/settings/konqhtml/appearance.cpp index 6799b1dac53bded13fe07edbbd531ab69d7f18aa..485bb974d008fe31578cf8bc38768e7a6af9f13e 100644 --- a/settings/konqhtml/appearance.cpp +++ b/settings/konqhtml/appearance.cpp @@ -7,21 +7,16 @@ #include #include #include - -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include #include +#include +#include +#include +#include + static const char *const animationValues[] = {"Enabled", "Disabled", "LoopOnce"}; enum AnimationsType { AnimationsAlways = 0, AnimationsNever = 1, AnimationsLoopOnce = 2 }; @@ -45,8 +40,7 @@ KAppearanceOptions::KAppearanceOptions(QWidget *parent, const QVariantList &) tabWidget->addTab(fontsTab, i18nc("@title:tab", "Fonts")); tabWidget->addTab(cssConfig, i18nc("@title:tab", "Stylesheets")); - connect(cssConfig, SIGNAL(changed()), this, SLOT(changed())); - connect(cssConfig, SIGNAL(changed(bool)), this, SIGNAL(changed(bool))); + connect(cssConfig, &CSSConfig::changed, this, &KAppearanceOptions::markAsChanged); l = new QVBoxLayout(mainTab); @@ -56,23 +50,23 @@ KAppearanceOptions::KAppearanceOptions(QWidget *parent, const QVariantList &) QFormLayout *fl = new QFormLayout(box); m_pAutoLoadImagesCheckBox = new QCheckBox(i18n("A&utomatically load images"), this); - m_pAutoLoadImagesCheckBox->setWhatsThis(i18n("If this box is checked, Konqueror will" - " automatically load any images that are embedded in a web page." - " Otherwise, it will display placeholders for the images, and" - " you can then manually load the images by clicking on the image" - " button.
Unless you have a very slow network connection, you" - " will probably want to check this box to enhance your browsing" - " experience.")); - connect(m_pAutoLoadImagesCheckBox, SIGNAL(toggled(bool)), SLOT(changed())); + m_pAutoLoadImagesCheckBox->setToolTip(i18n("If this box is checked, Konqueror will" + " automatically load any images that are embedded in a web page." + " Otherwise, it will display placeholders for the images, and" + " you can then manually load the images by clicking on the image" + " button.
Unless you have a very slow network connection, you" + " will probably want to check this box to enhance your browsing" + " experience.")); + connect(m_pAutoLoadImagesCheckBox, &QAbstractButton::toggled, this, &KAppearanceOptions::markAsChanged); fl->addRow(m_pAutoLoadImagesCheckBox); m_pUnfinishedImageFrameCheckBox = new QCheckBox(i18n("Dra&w frame around not completely loaded images"), this); - m_pUnfinishedImageFrameCheckBox->setWhatsThis(i18n("If this box is checked, Konqueror will draw" - " a frame as a placeholder around images embedded in a web page that are" - " not yet fully loaded.
You will probably want to check this box to" - " enhance your browsing experience, especially if have a slow network" - " connection.")); - connect(m_pUnfinishedImageFrameCheckBox, SIGNAL(toggled(bool)), SLOT(changed())); + m_pUnfinishedImageFrameCheckBox->setToolTip(i18n("If this box is checked, Konqueror will draw" + " a frame as a placeholder around images embedded in a web page that are" + " not yet fully loaded.
You will probably want to check this box to" + " enhance your browsing experience, especially if have a slow network" + " connection.")); + connect(m_pUnfinishedImageFrameCheckBox, &QAbstractButton::toggled, this, &KAppearanceOptions::markAsChanged); fl->addRow(m_pUnfinishedImageFrameCheckBox); m_pAnimationsCombo = new QComboBox(this); @@ -80,11 +74,11 @@ KAppearanceOptions::KAppearanceOptions(QWidget *parent, const QVariantList &) m_pAnimationsCombo->insertItem(AnimationsAlways, i18nc("animations", "Enabled")); m_pAnimationsCombo->insertItem(AnimationsNever, i18nc("animations", "Disabled")); m_pAnimationsCombo->insertItem(AnimationsLoopOnce, i18n("Show Only Once")); - m_pAnimationsCombo->setWhatsThis(i18n("Controls how Konqueror shows animated images:
" - "
  • Enabled: Show all animations completely.
  • " - "
  • Disabled: Never show animations, show the starting image only.
  • " - "
  • Show only once: Show all animations completely but do not repeat them.
")); - connect(m_pAnimationsCombo, SIGNAL(currentIndexChanged(int)), SLOT(changed())); + m_pAnimationsCombo->setToolTip(i18n("Controls how Konqueror shows animated images:
" + "
  • Enabled: Show all animations completely.
  • " + "
  • Disabled: Never show animations, show the starting image only.
  • " + "
  • Show only once: Show all animations completely but do not repeat them.
")); + connect(m_pAnimationsCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &KAppearanceOptions::markAsChanged); fl->addRow(i18n("A&nimations:"), m_pAnimationsCombo); //Other @@ -98,13 +92,13 @@ KAppearanceOptions::KAppearanceOptions(QWidget *parent, const QVariantList &) m_pUnderlineCombo->insertItem(UnderlineHover, i18n("Only on Hover")); fl->addRow(i18n("Und&erline links:"), m_pUnderlineCombo); - m_pUnderlineCombo->setWhatsThis(i18n( - "Controls how Konqueror handles underlining hyperlinks:
" - "
  • Enabled: Always underline links
  • " - "
  • Disabled: Never underline links
  • " - "
  • Only on Hover: Underline when the mouse is moved over the link
  • " - "

Note: The site's CSS definitions can override this value.")); - connect(m_pUnderlineCombo, SIGNAL(currentIndexChanged(int)), SLOT(changed())); + m_pUnderlineCombo->setToolTip(i18n( + "Controls how Konqueror handles underlining hyperlinks:
" + "
  • Enabled: Always underline links
  • " + "
  • Disabled: Never underline links
  • " + "
  • Only on Hover: Underline when the mouse is moved over the link
  • " + "

Note: The site's CSS definitions can override this value.")); + connect(m_pUnderlineCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &KAppearanceOptions::markAsChanged); m_pSmoothScrollingCombo = new QComboBox(this); m_pSmoothScrollingCombo->setEditable(false); @@ -112,12 +106,12 @@ KAppearanceOptions::KAppearanceOptions(QWidget *parent, const QVariantList &) m_pSmoothScrollingCombo->insertItem(SmoothScrollingAlways, i18nc("smooth scrolling", "Always")); m_pSmoothScrollingCombo->insertItem(SmoothScrollingNever, i18nc("soft scrolling", "Never")); fl->addRow(i18n("S&mooth scrolling:"), m_pSmoothScrollingCombo); - m_pSmoothScrollingCombo->setWhatsThis(i18n( - "Determines whether Konqueror should use smooth steps to scroll HTML pages, or whole steps:
" - "
  • Always: Always use smooth steps when scrolling.
  • " - "
  • Never: Never use smooth scrolling, scroll with whole steps instead.
  • " - "
  • When Efficient: Only use smooth scrolling on pages where it can be achieved with moderate usage of system resources.
")); - connect(m_pSmoothScrollingCombo, SIGNAL(currentIndexChanged(int)), SLOT(changed())); + m_pSmoothScrollingCombo->setToolTip(i18n( + "Determines whether Konqueror should use smooth steps to scroll HTML pages, or whole steps:
" + "
  • Always: Always use smooth steps when scrolling.
  • " + "
  • Never: Never use smooth scrolling, scroll with whole steps instead.
  • " + "
  • When Efficient: Only use smooth scrolling on pages where it can be achieved with moderate usage of system resources.
")); + connect(m_pSmoothScrollingCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &KAppearanceOptions::markAsChanged); l->addStretch(5); @@ -137,24 +131,24 @@ KAppearanceOptions::KAppearanceOptions(QWidget *parent, const QVariantList &) QGroupBox *gb = new QGroupBox(i18n("Font Si&ze")); lay->addWidget(gb); fl = new QFormLayout(gb); - gb->setWhatsThis(i18n("This is the relative font size Konqueror uses to display web sites.")); + gb->setToolTip(i18n("This is the relative font size Konqueror uses to display web sites.")); m_minSize = new QSpinBox; m_minSize->setValue(fMinSize); fl->addRow(i18n("M&inimum font size:"), m_minSize); m_minSize->setRange(2, 30); - connect(m_minSize, SIGNAL(valueChanged(int)), this, SLOT(slotMinimumFontSize(int))); - connect(m_minSize, SIGNAL(valueChanged(int)), this, SLOT(changed())); - m_minSize->setWhatsThis("" + i18n("Konqueror will never display text smaller than " - "this size,
overriding any other settings.") + "
"); + connect(m_minSize, QOverload::of(&QSpinBox::valueChanged), this, &KAppearanceOptions::slotMinimumFontSize); + connect(m_minSize, QOverload::of(&QSpinBox::valueChanged), this, &KAppearanceOptions::markAsChanged); + m_minSize->setToolTip("" + i18n("Konqueror will never display text smaller than " + "this size,
overriding any other settings.") + "
"); m_MedSize = new QSpinBox(m_minSize); m_MedSize->setValue(fSize); fl->addRow(i18n("&Medium font size:"), m_MedSize); m_MedSize->setRange(2, 30); - connect(m_MedSize, SIGNAL(valueChanged(int)), this, SLOT(slotFontSize(int))); - connect(m_MedSize, SIGNAL(valueChanged(int)), this, SLOT(changed())); - m_MedSize->setWhatsThis( + connect(m_MedSize, QOverload::of(&QSpinBox::valueChanged), this, &KAppearanceOptions::slotFontSize); + connect(m_MedSize, QOverload::of(&QSpinBox::valueChanged), this, &KAppearanceOptions::markAsChanged); + m_MedSize->setToolTip( i18n("This is the relative font size Konqueror uses " "to display web sites.")); @@ -164,54 +158,44 @@ KAppearanceOptions::KAppearanceOptions(QWidget *parent, const QVariantList &) m_pFonts[0] = new QFontComboBox(fontsTab); fl->addRow(i18n("S&tandard font:"), m_pFonts[0]); - m_pFonts[0]->setWhatsThis(i18n("This is the font used to display normal text in a web page.")); - connect(m_pFonts[0], SIGNAL(currentFontChanged(QFont)), - SLOT(slotStandardFont(QFont))); + m_pFonts[0]->setToolTip(i18n("This is the font used to display normal text in a web page.")); + connect(m_pFonts[0], &QFontComboBox::currentFontChanged, this, &KAppearanceOptions::slotStandardFont); m_pFonts[1] = new QFontComboBox(fontsTab); fl->addRow(i18n("&Fixed font:"), m_pFonts[1]); - m_pFonts[1]->setWhatsThis(i18n("This is the font used to display fixed-width (i.e. non-proportional) text.")); - connect(m_pFonts[1], SIGNAL(currentFontChanged(QFont)), - SLOT(slotFixedFont(QFont))); + m_pFonts[1]->setToolTip(i18n("This is the font used to display fixed-width (i.e. non-proportional) text.")); + connect(m_pFonts[1], &QFontComboBox::currentFontChanged, this, &KAppearanceOptions::slotFixedFont); m_pFonts[2] = new QFontComboBox(this); fl->addRow(i18n("S&erif font:"), m_pFonts[2]); - m_pFonts[2]->setWhatsThis(i18n("This is the font used to display text that is marked up as serif.")); - - connect(m_pFonts[2], SIGNAL(currentFontChanged(QFont)), - SLOT(slotSerifFont(QFont))); + m_pFonts[2]->setToolTip(i18n("This is the font used to display text that is marked up as serif.")); + connect(m_pFonts[2], &QFontComboBox::currentFontChanged, this, &KAppearanceOptions::slotSerifFont); m_pFonts[3] = new QFontComboBox(this); fl->addRow(i18n("Sa&ns serif font:"), m_pFonts[3]); - m_pFonts[3]->setWhatsThis(i18n("This is the font used to display text that is marked up as sans-serif.")); - connect(m_pFonts[3], SIGNAL(currentFontChanged(QFont)), - SLOT(slotSansSerifFont(QFont))); + m_pFonts[3]->setToolTip(i18n("This is the font used to display text that is marked up as sans-serif.")); + connect(m_pFonts[3], &QFontComboBox::currentFontChanged, this, &KAppearanceOptions::slotSansSerifFont); m_pFonts[4] = new QFontComboBox(this); fl->addRow(i18n("C&ursive font:"), m_pFonts[4]); - m_pFonts[4]->setWhatsThis(i18n("This is the font used to display text that is marked up as italic.")); - connect(m_pFonts[4], SIGNAL(currentFontChanged(QFont)), - SLOT(slotCursiveFont(QFont))); + m_pFonts[4]->setToolTip(i18n("This is the font used to display text that is marked up as italic.")); + connect(m_pFonts[4], &QFontComboBox::currentFontChanged, this, &KAppearanceOptions::slotCursiveFont); m_pFonts[5] = new QFontComboBox(this); fl->addRow(i18n("Fantas&y font:"), m_pFonts[5]); - m_pFonts[5]->setWhatsThis(i18n("This is the font used to display text that is marked up as a fantasy font.")); - connect(m_pFonts[5], SIGNAL(currentFontChanged(QFont)), - SLOT(slotFantasyFont(QFont))); + m_pFonts[5]->setToolTip(i18n("This is the font used to display text that is marked up as a fantasy font.")); + connect(m_pFonts[5], &QFontComboBox::currentFontChanged, this, &KAppearanceOptions::slotFantasyFont); for (int i = 0; i < 6; ++i) - connect(m_pFonts[i], SIGNAL(currentFontChanged(QFont)), - SLOT(changed())); + connect(m_pFonts[i], &QFontComboBox::currentFontChanged, this, &KAppearanceOptions::markAsChanged); m_pFontSizeAdjust = new QSpinBox(this); m_pFontSizeAdjust->setRange(-5, 5); m_pFontSizeAdjust->setSingleStep(1); fl->addRow(i18n("Font &size adjustment for this encoding:"), m_pFontSizeAdjust); - connect(m_pFontSizeAdjust, SIGNAL(valueChanged(int)), - SLOT(slotFontSizeAdjust(int))); - connect(m_pFontSizeAdjust, SIGNAL(valueChanged(int)), - SLOT(changed())); + connect(m_pFontSizeAdjust, QOverload::of(&QSpinBox::valueChanged), this, &KAppearanceOptions::slotFontSizeAdjust); + connect(m_pFontSizeAdjust, QOverload::of(&QSpinBox::valueChanged), this, &KAppearanceOptions::markAsChanged); m_pEncoding = new QComboBox(this); m_pEncoding->setEditable(false); @@ -220,13 +204,11 @@ KAppearanceOptions::KAppearanceOptions(QWidget *parent, const QVariantList &) m_pEncoding->addItems(encodings); fl->addRow(i18n("Default encoding:"), m_pEncoding); - m_pEncoding->setWhatsThis(i18n("Select the default encoding to be used; normally, you will be fine with 'Use language encoding' " - "and should not have to change this.")); + m_pEncoding->setToolTip(i18n("Select the default encoding to be used; normally, you will be fine with 'Use language encoding' " + "and should not have to change this.")); - connect(m_pEncoding, SIGNAL(activated(QString)), - SLOT(slotEncoding(QString))); - connect(m_pEncoding, SIGNAL(activated(QString)), - SLOT(changed())); + connect(m_pEncoding, &QComboBox::textActivated, this, &KAppearanceOptions::slotEncoding); + connect(m_pEncoding, &QComboBox::textActivated, this, &KAppearanceOptions::markAsChanged); lay->addStretch(5); } @@ -342,7 +324,6 @@ void KAppearanceOptions::load() } encodingName = READ_ENTRYNODEFAULT("DefaultEncoding"); //TODO move - //kDebug(0) << "encoding = " << encodingName; m_pAutoLoadImagesCheckBox->setChecked(READ_BOOL("AutoLoadImages", true)); m_pUnfinishedImageFrameCheckBox->setChecked(READ_BOOL("UnfinishedImageFrame", true)); @@ -377,7 +358,7 @@ void KAppearanceOptions::defaults() void KAppearanceOptions::updateGUI() { - //kDebug() << "KAppearanceOptions::updateGUI " << charset; + //qCDebug(KONQUEROR_LOG) << "KAppearanceOptions::updateGUI " << charset; for (int f = 0; f < 6; f++) { QString ff = fonts[f]; if (ff.isEmpty()) { diff --git a/settings/konqhtml/css/kcmcss.cpp b/settings/konqhtml/css/kcmcss.cpp index 70d27cee507104aff4a7e82a50234c65b320f1d0..a53caecfdb42a9c2300ba51dbefcb4b35bdd50a0 100644 --- a/settings/konqhtml/css/kcmcss.cpp +++ b/settings/konqhtml/css/kcmcss.cpp @@ -4,23 +4,19 @@ // Qt #include +#include +#include +#include // KDE #include #include -#include -#include - +#include #include -#include -#include #include #include #include -#include -#include - // Local #include "template.h" @@ -38,18 +34,21 @@ public: CSSConfig::CSSConfig(QWidget *parent, const QVariantList &) : QWidget(parent) , configWidget(new CSSConfigWidget(this)) - , customDialogBase(new KDialog(this)) + , customDialogBase(new QDialog(this)) , customDialog(new CSSCustomDialog(customDialogBase)) { customDialogBase->setObjectName(QStringLiteral("customCSSDialog")); customDialogBase->setModal(true); - customDialogBase->setButtons(KDialog::Close); - customDialogBase->setDefaultButton(KDialog::Close); + QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, customDialogBase); + buttonBox->button(QDialogButtonBox::Close)->setDefault(true); + connect(buttonBox, &QDialogButtonBox::rejected, customDialogBase, &QDialog::reject); - customDialogBase->setMainWidget(customDialog); + QVBoxLayout *vLayout = new QVBoxLayout(customDialogBase); + vLayout->addWidget(customDialog); + vLayout->addStretch(1); + vLayout->addWidget(buttonBox); -// setQuickHelp( i18n("

Konqueror Stylesheets

This module allows you to apply your own color" - setWhatsThis(i18n("

Konqueror Stylesheets

This module allows you to apply your own color" + setToolTip(i18n("

Konqueror Stylesheets

This module allows you to apply your own color" " and font settings to Konqueror by using" " stylesheets (CSS). You can either specify" " options or apply your own self-written" @@ -60,12 +59,12 @@ CSSConfig::CSSConfig(QWidget *parent, const QVariantList &) " visually impaired people or for web pages" " that are unreadable due to bad design.")); - connect(configWidget->useDefault, SIGNAL(clicked()), SIGNAL(changed())); - connect(configWidget->useAccess, SIGNAL(clicked()), SIGNAL(changed())); - connect(configWidget->useUser, SIGNAL(clicked()), SIGNAL(changed())); - connect(configWidget->urlRequester, SIGNAL(textChanged(QString)), SIGNAL(changed())); - connect(configWidget->customize, SIGNAL(clicked()), SLOT(slotCustomize())); - connect(customDialog, SIGNAL(changed()), SIGNAL(changed())); + connect(configWidget->useDefault, &QAbstractButton::clicked, this, &CSSConfig::changed); + connect(configWidget->useAccess, &QAbstractButton::clicked, this, &CSSConfig::changed); + connect(configWidget->useUser, &QAbstractButton::clicked, this, &CSSConfig::changed); + connect(configWidget->urlRequester, &KUrlRequester::textChanged, this, &CSSConfig::changed); + connect(configWidget->customize, &QAbstractButton::clicked, this, &CSSConfig::slotCustomize); + connect(customDialog, &CSSCustomDialog::changed, this, &CSSConfig::changed); QVBoxLayout *vbox = new QVBoxLayout(this); vbox->setContentsMargins(0, 0, 0, 0); @@ -74,7 +73,7 @@ CSSConfig::CSSConfig(QWidget *parent, const QVariantList &) void CSSConfig::load() { - const bool signalsBlocked = customDialog->blockSignals(true); + QSignalBlocker block(customDialog); KConfig *c = new KConfig(QStringLiteral("kcmcssrc"), KConfig::NoGlobals); KConfigGroup group = c->group("Stylesheet"); @@ -115,7 +114,6 @@ void CSSConfig::load() customDialog->hideImages->setChecked(group.readEntry("Hide", false)); customDialog->hideBackground->setChecked(group.readEntry("HideBackground", true)); - customDialog->blockSignals(signalsBlocked); delete c; } @@ -291,22 +289,22 @@ CSSCustomDialog::CSSCustomDialog(QWidget *parent) : QWidget(parent) { setupUi(this); - connect(this, SIGNAL(changed()), SLOT(slotPreview())); - - connect(basefontsize, SIGNAL(activated(int)), SIGNAL(changed())); - connect(basefontsize, SIGNAL(editTextChanged(QString)), SIGNAL(changed())); - connect(dontScale, SIGNAL(clicked()), SIGNAL(changed())); - connect(blackOnWhite, SIGNAL(clicked()), SIGNAL(changed())); - connect(whiteOnBlack, SIGNAL(clicked()), SIGNAL(changed())); - connect(customColor, SIGNAL(clicked()), SIGNAL(changed())); - connect(foregroundColorButton, SIGNAL(changed(QColor)), SIGNAL(changed())); - connect(backgroundColorButton, SIGNAL(changed(QColor)), SIGNAL(changed())); - connect(fontFamily, SIGNAL(activated(int)), SIGNAL(changed())); - connect(fontFamily, SIGNAL(editTextChanged(QString)), SIGNAL(changed())); - connect(sameFamily, SIGNAL(clicked()), SIGNAL(changed())); - connect(sameColor, SIGNAL(clicked()), SIGNAL(changed())); - connect(hideImages, SIGNAL(clicked()), SIGNAL(changed())); - connect(hideBackground, SIGNAL(clicked()), SIGNAL(changed())); + connect(this, &CSSCustomDialog::changed, this, &CSSCustomDialog::slotPreview); + + connect(basefontsize, QOverload::of(&QComboBox::activated), this, &CSSCustomDialog::changed); + connect(basefontsize, &QComboBox::editTextChanged, this, &CSSCustomDialog::changed); + connect(dontScale, &QAbstractButton::clicked, this, &CSSCustomDialog::changed); + connect(blackOnWhite, &QAbstractButton::clicked, this, &CSSCustomDialog::changed); + connect(whiteOnBlack, &QAbstractButton::clicked, this, &CSSCustomDialog::changed); + connect(customColor, &QAbstractButton::clicked, this, &CSSCustomDialog::changed); + connect(foregroundColorButton, &KColorButton::changed, this, &CSSCustomDialog::changed); + connect(backgroundColorButton, &KColorButton::changed, this, &CSSCustomDialog::changed); + connect(fontFamily, QOverload::of(&QComboBox::activated), this, &CSSCustomDialog::changed); + connect(fontFamily, &QComboBox::editTextChanged, this, &CSSCustomDialog::changed); + connect(sameFamily, &QAbstractButton::clicked, this, &CSSCustomDialog::changed); + connect(sameColor, &QAbstractButton::clicked, this, &CSSCustomDialog::changed); + connect(hideImages, &QAbstractButton::clicked, this, &CSSCustomDialog::changed); + connect(hideBackground, &QAbstractButton::clicked, this, &CSSCustomDialog::changed); //QStringList fonts; //KFontChooser::getFontList(fonts, 0); diff --git a/settings/konqhtml/css/kcmcss.h b/settings/konqhtml/css/kcmcss.h index c4a549a67167033cd9dec4d9a43407b21a52e5bf..2764af17ad458e67b56a194ea3313459392d844e 100644 --- a/settings/konqhtml/css/kcmcss.h +++ b/settings/konqhtml/css/kcmcss.h @@ -24,7 +24,7 @@ #include "ui_csscustom.h" -class KDialog; +class QDialog; class CSSConfigWidget; class CSSCustomDialog: public QWidget, public Ui::CSSCustomDialog @@ -61,13 +61,12 @@ public Q_SLOTS: void slotCustomize(); Q_SIGNALS: - void changed(bool);//connected to KCModule signal void changed();//connected to KCModule slot private: CSSConfigWidget *configWidget; - KDialog *customDialogBase; + QDialog *customDialogBase; CSSCustomDialog *customDialog; }; diff --git a/settings/konqhtml/domainlistview.cpp b/settings/konqhtml/domainlistview.cpp index f13ba1a07208cb44abbcb98a4e23ef13dcb0d815..b097270191e15c0230d349aed53c27e8440b4402 100644 --- a/settings/konqhtml/domainlistview.cpp +++ b/settings/konqhtml/domainlistview.cpp @@ -33,6 +33,7 @@ #include #include #include +#include // Local #include "policies.h" @@ -49,8 +50,8 @@ DomainListView::DomainListView(KSharedConfig::Ptr config, const QString &title, domainSpecificLV->setSortingEnabled(true); domainSpecificLV->setHeaderLabels(QStringList() << i18n("Host/Domain") << i18n("Policy")); domainSpecificLV->setColumnWidth(0, 100); - connect(domainSpecificLV, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), SLOT(changePressed())); - connect(domainSpecificLV, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(updateButton())); + connect(domainSpecificLV, &QTreeWidget::itemDoubleClicked, this, &DomainListView::changePressed); + connect(domainSpecificLV, &QTreeWidget::currentItemChanged, this, &DomainListView::updateButton); thisLayout->addWidget(domainSpecificLV); QVBoxLayout *btnsLayout = new QVBoxLayout; @@ -81,11 +82,11 @@ DomainListView::DomainListView(KSharedConfig::Ptr config, const QString &title, btnsLayout->addStretch(); - addDomainPB->setWhatsThis(i18n("Click on this button to manually add a host or domain " + addDomainPB->setToolTip(i18n("Click on this button to manually add a host or domain " "specific policy.")); - changeDomainPB->setWhatsThis(i18n("Click on this button to change the policy for the " + changeDomainPB->setToolTip(i18n("Click on this button to change the policy for the " "host or domain selected in the list box.")); - deleteDomainPB->setWhatsThis(i18n("Click on this button to delete the policy for the " + deleteDomainPB->setToolTip(i18n("Click on this button to delete the policy for the " "host or domain selected in the list box.")); updateButton(); } diff --git a/settings/konqhtml/filteropts.cpp b/settings/konqhtml/filteropts.cpp index c1af8d833acb04e8831c0e7a6658556dca5c7aac..303c6a2b26091807812b30debf4432b0ac984989 100644 --- a/settings/konqhtml/filteropts.cpp +++ b/settings/konqhtml/filteropts.cpp @@ -29,24 +29,22 @@ #include #include #include +#include +#include +#include +#include +#include // KDE #include #include -#include -#include -#include #include #include #include -#include #include #include -#include -#include +#include #include - -#include #include KCMFilter::KCMFilter(QWidget *parent, const QVariantList &) @@ -97,7 +95,7 @@ KCMFilter::KCMFilter(QWidget *parent, const QVariantList &) vbox->addWidget(mListBox); QLabel *exprLabel = new QLabel(i18n("Filter expression (e.g. http://www.example.com/ad/*, more information):"), this); - connect(exprLabel, SIGNAL(linkActivated(QString)), SLOT(slotInfoLinkActivated(QString))); + connect(exprLabel, &QLabel::linkActivated, this, &KCMFilter::slotInfoLinkActivated); vbox->addWidget(exprLabel); mString = new KLineEdit; @@ -123,14 +121,14 @@ KCMFilter::KCMFilter(QWidget *parent, const QVariantList &) QLabel *label = new QLabel(i18n("Automatic update interval:"), container); grid->addWidget(label, 1, 0); - mRefreshFreqSpinBox = new KIntSpinBox(container); + mRefreshFreqSpinBox = new KPluralHandlingSpinBox(container); grid->addWidget(mRefreshFreqSpinBox, 1, 1); mRefreshFreqSpinBox->setRange(1, 365); mRefreshFreqSpinBox->setSuffix(ki18np(" day", " days")); /** connect signals and slots */ - connect(&mAutomaticFilterModel, SIGNAL(changed(bool)), this, SIGNAL(changed(bool))); - connect(mRefreshFreqSpinBox, SIGNAL(valueChanged(int)), this, SLOT(spinBoxChanged(int))); + connect(&mAutomaticFilterModel, &AutomaticFilterModel::changed, this, QOverload::of(&KCModule::changed)); + connect(mRefreshFreqSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &KCMFilter::spinBoxChanged); mInsertButton = new QPushButton(QIcon::fromTheme(QStringLiteral("list-add")), i18n("Insert"), buttonBox); buttonBoxHBoxLayout->addWidget(mInsertButton); @@ -155,31 +153,31 @@ KCMFilter::KCMFilter(QWidget *parent, const QVariantList &) QLabel *impexpLabel = new QLabel(i18n("More information on " "import format, " "export format"), impexpBox); - connect(impexpLabel, SIGNAL(linkActivated(QString)), SLOT(slotInfoLinkActivated(QString))); - + connect(impexpLabel, &QLabel::linkActivated, this, &KCMFilter::slotInfoLinkActivated); + impexpBoxHBoxLayout->addWidget(impexpLabel); vbox->addWidget(impexpBox, 0, Qt::AlignRight); - connect(mEnableCheck, SIGNAL(toggled(bool)), this, SLOT(slotEnableChecked())); + connect(mEnableCheck, &QAbstractButton::toggled, this, &KCMFilter::slotEnableChecked); connect(mKillCheck, &QAbstractButton::clicked, this, &KCMFilter::slotKillChecked); - connect(mListBox, SIGNAL(itemSelectionChanged()), this, SLOT(slotItemSelected())); - connect(mString, SIGNAL(textChanged(QString)), this, SLOT(updateButton())); + connect(mListBox, &QListWidget::itemSelectionChanged, this, &KCMFilter::slotItemSelected); + connect(mString, &QLineEdit::textChanged, this, &KCMFilter::updateButton); /* * Whats this items */ - mEnableCheck->setWhatsThis(i18n("Enable or disable AdBlocK filters. When enabled, a set of URL expressions " + mEnableCheck->setToolTip(i18n("Enable or disable AdBlocK filters. When enabled, a set of URL expressions " "should be defined in the filter list for blocking to take effect.")); - mKillCheck->setWhatsThis(i18n("When enabled blocked images will be removed from the page completely, " + mKillCheck->setToolTip(i18n("When enabled blocked images will be removed from the page completely, " "otherwise a placeholder 'blocked' image will be used.")); // The list is no longer sensitive to order, because of the new hashed // matching. So this tooltip doesn't imply that. // // FIXME: blocking of frames is not currently implemented by KHTML - mListBox->setWhatsThis(i18n("This is the list of URL filters that will be applied to all embedded " + mListBox->setToolTip(i18n("This is the list of URL filters that will be applied to all embedded " "images and media objects.")); // "images, objects and frames.") ); - mString->setWhatsThis(i18n("

Enter an expression to filter. Filters can be defined as either:" + mString->setToolTip(i18n("

Enter an expression to filter. Filters can be defined as either:" "

  • a shell-style wildcard, e.g. http://www.example.com/ads*, the wildcards *?[] may be used
  • " "
  • a full regular expression by surrounding the string with '/', e.g. /\\/(ad|banner)\\./
" "

Any filter string can be preceded by '@@' to whitelist (allow) any matching URL, " @@ -268,7 +266,7 @@ void KCMFilter::updateButton() void KCMFilter::importFilters() { - QString inFile = KFileDialog::getOpenFileName(QUrl(), QString(), this); + QString inFile = QFileDialog::getOpenFileName(this, i18n("Import Filters")); if (!inFile.isEmpty()) { QFile f(inFile); if (f.open(QIODevice::ReadOnly)) { @@ -313,7 +311,7 @@ void KCMFilter::importFilters() void KCMFilter::exportFilters() { - QString outFile = KFileDialog::getSaveFileName(QUrl(), QString(), this); + QString outFile = QFileDialog::getSaveFileName(this, i18n("Export Filters")); if (!outFile.isEmpty()) { QFile f(outFile); diff --git a/settings/konqhtml/filteropts.h b/settings/konqhtml/filteropts.h index 3fe15ede5190cb98e261cf7135140796afdbceeb..cbe85de3f90af092329f4d97afa158ba83ba3140 100644 --- a/settings/konqhtml/filteropts.h +++ b/settings/konqhtml/filteropts.h @@ -28,9 +28,9 @@ class QListWidget; class QPushButton; class QLineEdit; class QCheckBox; -class KListWidgetSearchLine; class QTreeView; -class KIntSpinBox; +class KListWidgetSearchLine; +class KPluralHandlingSpinBox; class AutomaticFilterModel : public QAbstractItemModel { @@ -80,8 +80,6 @@ public: void defaults() override; QString quickHelp() const override; -public Q_SLOTS: - protected Q_SLOTS: void insertFilter(); void updateFilter(); @@ -110,7 +108,7 @@ private: QPushButton *mExportButton; QTabWidget *mFilterWidget; QTreeView *mAutomaticFilterList; - KIntSpinBox *mRefreshFreqSpinBox; + KPluralHandlingSpinBox *mRefreshFreqSpinBox; KSharedConfig::Ptr mConfig; QString mGroupname; diff --git a/settings/konqhtml/generalopts.cpp b/settings/konqhtml/generalopts.cpp index 315e1e6ea7a2354488c47a5ef685562e8958843e..89f0712a31b2f197cefae7367d45e3ea895e0dff 100644 --- a/settings/konqhtml/generalopts.cpp +++ b/settings/konqhtml/generalopts.cpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -55,16 +54,16 @@ KKonqGeneralOptions::KKonqGeneralOptions(QWidget *parent, const QVariantList &) tabOptions = new Ui_advancedTabOptions; tabOptions->setupUi(tabsGroup); - connect(tabOptions->m_pShowMMBInTabs, SIGNAL(toggled(bool)), SLOT(slotChanged())); - connect(tabOptions->m_pDynamicTabbarHide, SIGNAL(toggled(bool)), SLOT(slotChanged())); - connect(tabOptions->m_pNewTabsInBackground, SIGNAL(toggled(bool)), SLOT(slotChanged())); - connect(tabOptions->m_pOpenAfterCurrentPage, SIGNAL(toggled(bool)), SLOT(slotChanged())); - connect(tabOptions->m_pTabConfirm, SIGNAL(toggled(bool)), SLOT(slotChanged())); - connect(tabOptions->m_pTabCloseActivatePrevious, SIGNAL(toggled(bool)), SLOT(slotChanged())); - connect(tabOptions->m_pPermanentCloseButton, SIGNAL(toggled(bool)), SLOT(slotChanged())); - connect(tabOptions->m_pKonquerorTabforExternalURL, SIGNAL(toggled(bool)), SLOT(slotChanged())); - connect(tabOptions->m_pPopupsWithinTabs, SIGNAL(toggled(bool)), SLOT(slotChanged())); - connect(tabOptions->m_pMiddleClickClose, SIGNAL(toggled(bool)), SLOT(slotChanged())); + connect(tabOptions->m_pShowMMBInTabs, &QAbstractButton::toggled, this, &KKonqGeneralOptions::slotChanged); + connect(tabOptions->m_pDynamicTabbarHide, &QAbstractButton::toggled, this, &KKonqGeneralOptions::slotChanged); + connect(tabOptions->m_pNewTabsInBackground, &QAbstractButton::toggled, this, &KKonqGeneralOptions::slotChanged); + connect(tabOptions->m_pOpenAfterCurrentPage, &QAbstractButton::toggled, this, &KKonqGeneralOptions::slotChanged); + connect(tabOptions->m_pTabConfirm, &QAbstractButton::toggled, this, &KKonqGeneralOptions::slotChanged); + connect(tabOptions->m_pTabCloseActivatePrevious, &QAbstractButton::toggled, this, &KKonqGeneralOptions::slotChanged); + connect(tabOptions->m_pPermanentCloseButton, &QAbstractButton::toggled, this, &KKonqGeneralOptions::slotChanged); + connect(tabOptions->m_pKonquerorTabforExternalURL, &QAbstractButton::toggled, this, &KKonqGeneralOptions::slotChanged); + connect(tabOptions->m_pPopupsWithinTabs, &QAbstractButton::toggled, this, &KKonqGeneralOptions::slotChanged); + connect(tabOptions->m_pMiddleClickClose, &QAbstractButton::toggled, this, &KKonqGeneralOptions::slotChanged); lay->addWidget(tabsGroup); @@ -90,18 +89,18 @@ void KKonqGeneralOptions::addHomeUrlWidgets(QVBoxLayout *lay) m_startCombo->addItem(i18nc("@item:inlistbox", "Show Blank Page"), ShowBlankPage); m_startCombo->addItem(i18nc("@item:inlistbox", "Show My Bookmarks"), ShowBookmarksPage); startLabel->setBuddy(m_startCombo); - connect(m_startCombo, SIGNAL(currentIndexChanged(int)), SLOT(slotChanged())); + connect(m_startCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &KKonqGeneralOptions::slotChanged); hboxLayout->addWidget(m_startCombo); startURL = new QLineEdit(this); startURL->setWindowTitle(i18nc("@title:window", "Select Start Page")); hboxLayout->addWidget(startURL); - connect(startURL, SIGNAL(textChanged(QString)), SLOT(slotChanged())); + connect(startURL, &QLineEdit::textChanged, this, &KKonqGeneralOptions::slotChanged); QString startstr = i18n("This is the URL of the web page " "Konqueror will show when starting."); - startURL->setWhatsThis(startstr); - connect(m_startCombo, static_cast(&QComboBox::currentIndexChanged), this, [this](int idx) { + startURL->setToolTip(startstr); + connect(m_startCombo, QOverload::of(&QComboBox::currentIndexChanged), this, [this](int idx) { startURL->setEnabled(idx == ShowStartUrlPage); }); startURL->setEnabled(false); @@ -113,14 +112,14 @@ void KKonqGeneralOptions::addHomeUrlWidgets(QVBoxLayout *lay) homeURL = new QLineEdit(this); homeURL->setWindowTitle(i18nc("@title:window", "Select Home Page")); formLayout->addRow(label, homeURL); - connect(homeURL, SIGNAL(textChanged(QString)), SLOT(slotChanged())); + connect(homeURL, &QLineEdit::textChanged, this, &KKonqGeneralOptions::slotChanged); label->setBuddy(homeURL); QString homestr = i18n("This is the URL of the web page where " "Konqueror will jump to when " "the \"Home\" button is pressed."); - label->setWhatsThis(homestr); - homeURL->setWhatsThis(homestr); + label->setToolTip(homestr); + homeURL->setToolTip(homestr); //// @@ -131,7 +130,7 @@ void KKonqGeneralOptions::addHomeUrlWidgets(QVBoxLayout *lay) m_webEngineCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents); formLayout->addRow(webLabel, m_webEngineCombo); webLabel->setBuddy(m_webEngineCombo); - connect(m_webEngineCombo, SIGNAL(currentIndexChanged(int)), SLOT(slotChanged())); + connect(m_webEngineCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &KKonqGeneralOptions::slotChanged); } KKonqGeneralOptions::~KKonqGeneralOptions() @@ -237,7 +236,7 @@ void KKonqGeneralOptions::save() if (m_webEngineCombo->currentIndex() > 0) { // The user changed the preferred web engine, save into mimeapps.list. const QString preferredWebEngine = m_webEngineCombo->itemData(m_webEngineCombo->currentIndex()).toString(); - //qDebug() << "preferredWebEngine=" << preferredWebEngine; + //qCDebug(KONQUEROR_LOG) << "preferredWebEngine=" << preferredWebEngine; KSharedConfig::Ptr profile = KSharedConfig::openConfig(QStringLiteral("mimeapps.list"), KConfig::NoGlobals, QStandardPaths::ConfigLocation); KConfigGroup addedServices(profile, "Added KDE Service Associations"); diff --git a/settings/konqhtml/htmlopts.cpp b/settings/konqhtml/htmlopts.cpp index 807eb02dee262239f1091272fc1a72c9785cbcfa..bd906883671c6dca926a5d5907176e407f2aa92f 100644 --- a/settings/konqhtml/htmlopts.cpp +++ b/settings/konqhtml/htmlopts.cpp @@ -17,15 +17,11 @@ #include #include #include +#include // KDE -#include // get default for DEFAULT_CHANGECURSOR #include -#include -#include -#include - -// Local +#include #include #include #include @@ -53,17 +49,17 @@ KMiscHTMLOptions::KMiscHTMLOptions(QWidget *parent, const QVariantList &) m_pAdvancedAddBookmarkCheckBox = new QCheckBox(i18n("Ask for name and folder when adding bookmarks")); laygroup1->addWidget(m_pAdvancedAddBookmarkCheckBox); - m_pAdvancedAddBookmarkCheckBox->setWhatsThis(i18n("If this box is checked, Konqueror will allow you to" + m_pAdvancedAddBookmarkCheckBox->setToolTip(i18n("If this box is checked, Konqueror will allow you to" " change the title of the bookmark and choose a folder" " in which to store it when you add a new bookmark.")); - connect(m_pAdvancedAddBookmarkCheckBox, SIGNAL(toggled(bool)), SLOT(changed())); + connect(m_pAdvancedAddBookmarkCheckBox, QOverload::of(&QAbstractButton::toggled), this, &KMiscHTMLOptions::markAsChanged); bgBookmarks->setLayout(laygroup1); m_pOnlyMarkedBookmarksCheckBox = new QCheckBox(i18n("Show only marked bookmarks in bookmark toolbar"), bgBookmarks); laygroup1->addWidget(m_pOnlyMarkedBookmarksCheckBox); - m_pOnlyMarkedBookmarksCheckBox->setWhatsThis(i18n("If this box is checked, Konqueror will show only those" + m_pOnlyMarkedBookmarksCheckBox->setToolTip(i18n("If this box is checked, Konqueror will show only those" " bookmarks in the bookmark toolbar which you have marked to do so in the bookmark editor.")); - connect(m_pOnlyMarkedBookmarksCheckBox, SIGNAL(toggled(bool)), SLOT(changed())); + connect(m_pOnlyMarkedBookmarksCheckBox, QOverload::of(&QAbstractButton::toggled), this, &KMiscHTMLOptions::markAsChanged); lay->addWidget(bgBookmarks); @@ -72,17 +68,17 @@ KMiscHTMLOptions::KMiscHTMLOptions(QWidget *parent, const QVariantList &) m_pFormCompletionCheckBox->setCheckable(true); QFormLayout *laygroup2 = new QFormLayout(m_pFormCompletionCheckBox); - m_pFormCompletionCheckBox->setWhatsThis(i18n("If this box is checked, Konqueror will remember" + m_pFormCompletionCheckBox->setToolTip(i18n("If this box is checked, Konqueror will remember" " the data you enter in web forms and suggest it in similar fields for all forms.")); - connect(m_pFormCompletionCheckBox, SIGNAL(toggled(bool)), SLOT(changed())); + connect(m_pFormCompletionCheckBox, &QGroupBox::toggled, this, &KMiscHTMLOptions::markAsChanged); - m_pMaxFormCompletionItems = new KIntNumInput(this); + m_pMaxFormCompletionItems = new QSpinBox(this); m_pMaxFormCompletionItems->setRange(0, 100); laygroup2->addRow(i18n("&Maximum completions:"), m_pMaxFormCompletionItems); - m_pMaxFormCompletionItems->setWhatsThis( + m_pMaxFormCompletionItems->setToolTip( i18n("Here you can select how many values Konqueror will remember for a form field.")); - connect(m_pMaxFormCompletionItems, SIGNAL(valueChanged(int)), SLOT(changed())); - connect(m_pFormCompletionCheckBox, SIGNAL(toggled(bool)), m_pMaxFormCompletionItems, SLOT(setEnabled(bool))); + connect(m_pMaxFormCompletionItems, QOverload::of(&QSpinBox::valueChanged), this, &KMiscHTMLOptions::markAsChanged); + connect(m_pFormCompletionCheckBox, &QGroupBox::toggled, m_pMaxFormCompletionItems, &QWidget::setEnabled); lay->addWidget(m_pFormCompletionCheckBox); @@ -92,23 +88,23 @@ KMiscHTMLOptions::KMiscHTMLOptions(QWidget *parent, const QVariantList &) m_cbCursor = new QCheckBox(i18n("Chan&ge cursor over links")); laygroup3->addWidget(m_cbCursor); - m_cbCursor->setWhatsThis(i18n("If this option is set, the shape of the cursor will change " + m_cbCursor->setToolTip(i18n("If this option is set, the shape of the cursor will change " "(usually to a hand) if it is moved over a hyperlink.")); - connect(m_cbCursor, SIGNAL(toggled(bool)), SLOT(changed())); + connect(m_cbCursor, QOverload::of(&QAbstractButton::toggled), this, &KMiscHTMLOptions::markAsChanged); m_pOpenMiddleClick = new QCheckBox(i18n("M&iddle click opens URL in selection"), bgMouse); laygroup3->addWidget(m_pOpenMiddleClick); - m_pOpenMiddleClick->setWhatsThis(i18n( + m_pOpenMiddleClick->setToolTip(i18n( "If this box is checked, you can open the URL in the selection by middle clicking on a " "Konqueror view.")); - connect(m_pOpenMiddleClick, SIGNAL(toggled(bool)), SLOT(changed())); + connect(m_pOpenMiddleClick, QOverload::of(&QAbstractButton::toggled), this, &KMiscHTMLOptions::markAsChanged); m_pBackRightClick = new QCheckBox(i18n("Right click goes &back in history"), bgMouse); laygroup3->addWidget(m_pBackRightClick); - m_pBackRightClick->setWhatsThis(i18n( + m_pBackRightClick->setToolTip(i18n( "If this box is checked, you can go back in history by right clicking on a Konqueror view. " "To access the context menu, press the right mouse button and move.")); - connect(m_pBackRightClick, SIGNAL(toggled(bool)), SLOT(changed())); + connect(m_pBackRightClick, QOverload::of(&QAbstractButton::toggled), this, &KMiscHTMLOptions::markAsChanged); lay->addWidget(bgMouse); @@ -117,32 +113,32 @@ KMiscHTMLOptions::KMiscHTMLOptions(QWidget *parent, const QVariantList &) QFormLayout *fl = new QFormLayout(bgMisc); m_pAutoRedirectCheckBox = new QCheckBox(i18n("Allow automatic delayed &reloading/redirecting"), this); - m_pAutoRedirectCheckBox->setWhatsThis(i18n("Some web pages request an automatic reload or redirection after" + m_pAutoRedirectCheckBox->setToolTip(i18n("Some web pages request an automatic reload or redirection after" " a certain period of time. By unchecking this box Konqueror will ignore these requests.")); - connect(m_pAutoRedirectCheckBox, SIGNAL(toggled(bool)), SLOT(changed())); + connect(m_pAutoRedirectCheckBox, QOverload::of(&QAbstractButton::toggled), this, &KMiscHTMLOptions::markAsChanged); fl->addRow(m_pAutoRedirectCheckBox); // Checkbox to enable/disable Access Key activation through the Ctrl key. m_pAccessKeys = new QCheckBox(i18n("Enable Access Ke&y activation with Ctrl key"), this); - m_pAccessKeys->setWhatsThis(i18n("Pressing the Ctrl key when viewing webpages activates Access Keys. Unchecking this box will disable this accessibility feature. (Konqueror needs to be restarted for this change to take effect.)")); - connect(m_pAccessKeys, SIGNAL(toggled(bool)), SLOT(changed())); + m_pAccessKeys->setToolTip(i18n("Pressing the Ctrl key when viewing webpages activates Access Keys. Unchecking this box will disable this accessibility feature. (Konqueror needs to be restarted for this change to take effect.)")); + connect(m_pAccessKeys, QOverload::of(&QAbstractButton::toggled), this, &KMiscHTMLOptions::markAsChanged); fl->addRow(m_pAccessKeys); m_pDoNotTrack = new QCheckBox(i18n("Send the DNT header to tell web sites you do not want to be tracked"), this); - m_pDoNotTrack->setWhatsThis(i18n("Check this box if you want to inform a web site that you do not want your web browsing habits tracked.")); - connect(m_pDoNotTrack, SIGNAL(toggled(bool)), SLOT(changed())); + m_pDoNotTrack->setToolTip(i18n("Check this box if you want to inform a web site that you do not want your web browsing habits tracked.")); + connect(m_pDoNotTrack, QOverload::of(&QAbstractButton::toggled), this, &KMiscHTMLOptions::markAsChanged); fl->addRow(m_pDoNotTrack); m_pOfferToSaveWebsitePassword = new QCheckBox(i18n("Offer to save website passwords"), this); - m_pOfferToSaveWebsitePassword->setWhatsThis(i18n("Uncheck this box to prevent being prompted to save website passwords")); - connect(m_pOfferToSaveWebsitePassword, SIGNAL(toggled(bool)), SLOT(changed())); + m_pOfferToSaveWebsitePassword->setToolTip(i18n("Uncheck this box to prevent being prompted to save website passwords")); + connect(m_pOfferToSaveWebsitePassword, QOverload::of(&QAbstractButton::toggled), this, &KMiscHTMLOptions::markAsChanged); fl->addRow(m_pOfferToSaveWebsitePassword); #ifdef WEBENGINE_PDF_VIEWER m_pdfViewer = new QCheckBox(i18n("Display online PDF files using WebEngine")); - m_pdfViewer->setWhatsThis(i18n("Uncheck this box to display online PDF files as configured in System Settings")); + m_pdfViewer->setToolTip(i18n("Uncheck this box to display online PDF files as configured in System Settings")); fl->addRow(m_pdfViewer); - connect(m_pdfViewer, &QCheckBox::toggled, this, QOverload<>::of(&KMiscHTMLOptions::changed)); + connect(m_pdfViewer, &QCheckBox::toggled, this, &KMiscHTMLOptions::markAsChanged); #endif lay->addWidget(bgMisc); @@ -167,7 +163,7 @@ void KMiscHTMLOptions::load() cg = KConfigGroup(m_pConfig, "HTML Settings"); cg2 = KConfigGroup(khtmlrcConfig, "HTML Settings"); - m_cbCursor->setChecked(cg.readEntry("ChangeCursor", cg2.readEntry("ChangeCursor", KDE_DEFAULT_CHANGECURSOR))); + m_cbCursor->setChecked(cg.readEntry("ChangeCursor", cg2.readEntry("ChangeCursor", true))); m_pAutoRedirectCheckBox->setChecked(cg.readEntry("AutoDelayedActions", true)); m_pFormCompletionCheckBox->setChecked(cg.readEntry("FormCompletion", true)); m_pMaxFormCompletionItems->setValue(cg.readEntry("MaxFormCompletionItems", 10)); diff --git a/settings/konqhtml/htmlopts.h b/settings/konqhtml/htmlopts.h index d7cd96876ad8016ae65e9e7b23e7d01ec6745cb2..7a16fa8c551a99ba5fd1d7a4cdb75360c90f8731 100644 --- a/settings/konqhtml/htmlopts.h +++ b/settings/konqhtml/htmlopts.h @@ -20,7 +20,7 @@ #include #include -class KIntNumInput; +class QSpinBox; class QGroupBox; class KMiscHTMLOptions : public KCModule @@ -48,7 +48,7 @@ private: QCheckBox *m_pAccessKeys; QCheckBox *m_pDoNotTrack; QCheckBox *m_pOfferToSaveWebsitePassword; - KIntNumInput *m_pMaxFormCompletionItems; + QSpinBox *m_pMaxFormCompletionItems; #ifdef WEBENGINE_PDF_VIEWER QCheckBox *m_pdfViewer; #endif diff --git a/settings/konqhtml/javaopts.cpp b/settings/konqhtml/javaopts.cpp index 67558d112dd026036cfc8064089bac9012b27034..8f51617dc2e8824b3fc00219cd39f0d2d24d19e0 100644 --- a/settings/konqhtml/javaopts.cpp +++ b/settings/konqhtml/javaopts.cpp @@ -31,11 +31,12 @@ #include #include #include -#include #include #include #include #include +#include +#include // Local #include "htmlopts.h" @@ -109,11 +110,13 @@ KJavaOptions::KJavaOptions(const KSharedConfig::Ptr &config, const QString &grou QHBoxLayout *secondsHBHBoxLayout = new QHBoxLayout(secondsHB); secondsHBHBoxLayout->setContentsMargins(0, 0, 0, 0); laygroup1->addWidget(secondsHB); - serverTimeoutSB = new KIntNumInput(secondsHB); + serverTimeoutSB = new KPluralHandlingSpinBox(secondsHB); + serverTimeoutSB->setSizePolicy(QSizePolicy::MinimumExpanding, serverTimeoutSB->sizePolicy().verticalPolicy()); secondsHBHBoxLayout->addWidget(serverTimeoutSB); - serverTimeoutSB->setRange(0, 1000, 5); + serverTimeoutSB->setSingleStep(5); + serverTimeoutSB->setRange(0, 1000); serverTimeoutSB->setSuffix(ki18np(" second", " seconds")); - connect(serverTimeoutSB, &KIntNumInput::valueChanged, this, &KJavaOptions::slotChanged); + connect(serverTimeoutSB, QOverload::of(&QSpinBox::valueChanged), this, [this](){ slotChanged(); }); laygroup1->addRow(enableShutdownCB, serverTimeoutSB); pathED = new KUrlRequester(this); @@ -127,7 +130,7 @@ KJavaOptions::KJavaOptions(const KSharedConfig::Ptr &config, const QString &grou /*************************************************************************** ********************** WhatsThis? items *********************************** **************************************************************************/ - enableJavaGloballyCB->setWhatsThis(i18n("Enables the execution of scripts written in Java " + enableJavaGloballyCB->setToolTip(i18n("Enables the execution of scripts written in Java " "that can be contained in HTML pages. " "Note that, as with any browser, enabling active contents can be a security problem.")); QString wtstr = i18n("

This box contains the domains and hosts you have set " @@ -135,16 +138,16 @@ KJavaOptions::KJavaOptions(const KSharedConfig::Ptr &config, const QString &grou "instead of the default policy for enabling or disabling Java applets on pages sent by these " "domains or hosts.

Select a policy and use the controls on " "the right to modify it.

"); - domainSpecific->listView()->setWhatsThis(wtstr); + domainSpecific->listView()->setToolTip(wtstr); #if 0 - domainSpecific->importButton()->setWhatsThis(i18n("Click this button to choose the file that contains " + domainSpecific->importButton()->setToolTip(i18n("Click this button to choose the file that contains " "the Java policies. These policies will be merged " "with the existing ones. Duplicate entries are ignored.")); - domainSpecific->exportButton()->setWhatsThis(i18n("Click this button to save the Java policy to a zipped " + domainSpecific->exportButton()->setToolTip(i18n("Click this button to save the Java policy to a zipped " "file. The file, named java_policy.tgz, will be " "saved to a location of your choice.")); #endif - domainSpecific->setWhatsThis(i18n("Here you can set specific Java policies for any particular " + domainSpecific->setToolTip(i18n("Here you can set specific Java policies for any particular " "host or domain. To add a new policy, simply click the New... " "button and supply the necessary information requested by the " "dialog box. To change an existing policy, click on the Change... " @@ -157,7 +160,7 @@ KJavaOptions::KJavaOptions(const KSharedConfig::Ptr &config, const QString &grou "you to save and retrieve them from a zipped file.")); #endif - javaSecurityManagerCB->setWhatsThis(i18n("Enabling the security manager will cause the jvm to run with a Security " + javaSecurityManagerCB->setToolTip(i18n("Enabling the security manager will cause the jvm to run with a Security " "Manager in place. This will keep applets from being able to read and " "write to your file system, creating arbitrary sockets, and other actions " "which could be used to compromise your system. Disable this option at your " @@ -165,14 +168,14 @@ KJavaOptions::KJavaOptions(const KSharedConfig::Ptr &config, const QString &grou "policytool utility to give code downloaded from certain sites more " "permissions.")); - useKioCB->setWhatsThis(i18n("Enabling this will cause the jvm to use KIO for network transport ")); + useKioCB->setToolTip(i18n("Enabling this will cause the jvm to use KIO for network transport ")); - pathED->setWhatsThis(i18n("Enter the path to the java executable. If you want to use the jre in " + pathED->setToolTip(i18n("Enter the path to the java executable. If you want to use the jre in " "your path, simply leave it as 'java'. If you need to use a different jre, " "enter the path to the java executable (e.g. /usr/lib/jdk/bin/java), " "or the path to the directory that contains 'bin/java' (e.g. /opt/IBMJava2-13).")); - addArgED->setWhatsThis(i18n("If you want special arguments to be passed to the virtual machine, enter them here.")); + addArgED->setToolTip(i18n("If you want special arguments to be passed to the virtual machine, enter them here.")); QString shutdown = i18n("When all the applets have been destroyed, the applet server should shut down. " "However, starting the jvm takes a lot of time. If you would like to " @@ -180,8 +183,8 @@ KJavaOptions::KJavaOptions(const KSharedConfig::Ptr &config, const QString &grou "browsing, you can set the timeout value to whatever you like. To keep " "the java process running for the whole time that the konqueror process is, " "leave the Shutdown Applet Server checkbox unchecked."); - serverTimeoutSB->setWhatsThis(shutdown); - enableShutdownCB->setWhatsThis(shutdown); + serverTimeoutSB->setToolTip(shutdown); + enableShutdownCB->setToolTip(shutdown); } void KJavaOptions::load() @@ -324,7 +327,7 @@ void JavaDomainListView::setupPolicyDlg(PushButton trigger, PolicyDialog &pDlg, case ChangeButton: caption = i18nc("@title:window", "Change Java Policy"); break; default:; // inhibit gcc warning }/*end switch*/ - pDlg.setCaption(caption); + pDlg.setWindowTitle(caption); pDlg.setFeatureEnabledLabel(i18n("&Java policy:")); pDlg.setFeatureEnabledWhatsThis(i18n("Select a Java policy for " "the above host or domain.")); diff --git a/settings/konqhtml/javaopts.h b/settings/konqhtml/javaopts.h index 3ca1d5ccd115937ac145e79b2cdd2766d7cfcf00..0c5b7531619e346001233d2097b3d7bc93f3b0d8 100644 --- a/settings/konqhtml/javaopts.h +++ b/settings/konqhtml/javaopts.h @@ -15,13 +15,13 @@ #include "domainlistview.h" #include "policies.h" -#include #include + class KUrlRequester; -class KIntNumInput; class QCheckBox; class QLineEdit; +class KPluralHandlingSpinBox; class KJavaOptions; @@ -104,7 +104,7 @@ private: QCheckBox *javaSecurityManagerCB; QCheckBox *useKioCB; QCheckBox *enableShutdownCB; - KIntNumInput *serverTimeoutSB; + KPluralHandlingSpinBox *serverTimeoutSB; QLineEdit *addArgED; KUrlRequester *pathED; bool _removeJavaDomainSettings; diff --git a/settings/konqhtml/jsopts.cpp b/settings/konqhtml/jsopts.cpp index 5273261399bbe0742218758fadae2887e8147aea..6b78e4656c81b9b102779d45c2bbc408d7864f76 100644 --- a/settings/konqhtml/jsopts.cpp +++ b/settings/konqhtml/jsopts.cpp @@ -28,6 +28,7 @@ #include // KDE #include +#include #include #include #include @@ -48,11 +49,11 @@ KJavaScriptOptions::KJavaScriptOptions(KSharedConfig::Ptr config, const QString QVBoxLayout *toplevel = new QVBoxLayout(this); enableJavaScriptGloballyCB = new QCheckBox(i18n("Ena&ble JavaScript globally")); - enableJavaScriptGloballyCB->setWhatsThis(i18n("Enables the execution of scripts written in ECMA-Script " + enableJavaScriptGloballyCB->setToolTip(i18n("Enables the execution of scripts written in ECMA-Script " "(also known as JavaScript) that can be contained in HTML pages. " "Note that, as with any browser, enabling scripting languages can be a security problem.")); - connect(enableJavaScriptGloballyCB, SIGNAL(clicked()), SLOT(changed())); - connect(enableJavaScriptGloballyCB, SIGNAL(clicked()), this, SLOT(slotChangeJSEnabled())); + connect(enableJavaScriptGloballyCB, &QAbstractButton::clicked, this, &KJavaScriptOptions::markAsChanged); + connect(enableJavaScriptGloballyCB, &QAbstractButton::clicked, this, &KJavaScriptOptions::slotChangeJSEnabled); toplevel->addWidget(enableJavaScriptGloballyCB); // the global checkbox @@ -61,22 +62,22 @@ KJavaScriptOptions::KJavaScriptOptions(KSharedConfig::Ptr config, const QString toplevel->addWidget(globalGB); jsDebugWindow = new QCheckBox(i18n("Enable debu&gger")); - jsDebugWindow->setWhatsThis(i18n("Enables builtin JavaScript debugger.")); - connect(jsDebugWindow, SIGNAL(clicked()), SLOT(changed())); + jsDebugWindow->setToolTip(i18n("Enables builtin JavaScript debugger.")); + connect(jsDebugWindow, &QAbstractButton::clicked, this, &KJavaScriptOptions::markAsChanged); hbox->addWidget(jsDebugWindow); reportErrorsCB = new QCheckBox(i18n("Report &errors")); - reportErrorsCB->setWhatsThis(i18n("Enables the reporting of errors that occur when JavaScript " + reportErrorsCB->setToolTip(i18n("Enables the reporting of errors that occur when JavaScript " "code is executed.")); - connect(reportErrorsCB, SIGNAL(clicked()), SLOT(changed())); + connect(reportErrorsCB, &QAbstractButton::clicked, this, &KJavaScriptOptions::markAsChanged); hbox->addWidget(reportErrorsCB); // the domain-specific listview domainSpecific = new JSDomainListView(m_pConfig, m_groupname, this, this); - connect(domainSpecific, SIGNAL(changed(bool)), SLOT(changed())); + connect(domainSpecific, &DomainListView::changed, this, &KJavaScriptOptions::markAsChanged); toplevel->addWidget(domainSpecific, 2); - domainSpecific->setWhatsThis(i18n("Here you can set specific JavaScript policies for any particular " + domainSpecific->setToolTip(i18n("Here you can set specific JavaScript policies for any particular " "host or domain. To add a new policy, simply click the New... " "button and supply the necessary information requested by the " "dialog box. To change an existing policy, click on the Change... " @@ -91,12 +92,12 @@ KJavaScriptOptions::KJavaScriptOptions(KSharedConfig::Ptr config, const QString "instead of the default policy for enabling or disabling JavaScript on pages sent by these " "domains or hosts.

Select a policy and use the controls on " "the right to modify it.

"); - domainSpecific->listView()->setWhatsThis(wtstr); + domainSpecific->listView()->setToolTip(wtstr); - domainSpecific->importButton()->setWhatsThis(i18n("Click this button to choose the file that contains " + domainSpecific->importButton()->setToolTip(i18n("Click this button to choose the file that contains " "the JavaScript policies. These policies will be merged " "with the existing ones. Duplicate entries are ignored.")); - domainSpecific->exportButton()->setWhatsThis(i18n("Click this button to save the JavaScript policy to a zipped " + domainSpecific->exportButton()->setToolTip(i18n("Click this button to save the JavaScript policy to a zipped " "file. The file, named javascript_policy.tgz, will be " "saved to a location of your choice.")); @@ -104,7 +105,7 @@ KJavaScriptOptions::KJavaScriptOptions(KSharedConfig::Ptr config, const QString js_policies_frame = new JSPoliciesFrame(&js_global_policies, i18n("Global JavaScript Policies"), this); toplevel->addWidget(js_policies_frame); - connect(js_policies_frame, SIGNAL(changed()), SLOT(changed())); + connect(js_policies_frame, &JSPoliciesFrame::changed, this, &KJavaScriptOptions::markAsChanged); } @@ -215,12 +216,12 @@ void JSDomainListView::setupPolicyDlg(PushButton trigger, PolicyDialog &pDlg, case ChangeButton: caption = i18nc("@title:window", "Change JavaScript Policy"); break; default:; // inhibit gcc warning }/*end switch*/ - pDlg.setCaption(caption); + pDlg.setWindowTitle(caption); pDlg.setFeatureEnabledLabel(i18n("JavaScript policy:")); pDlg.setFeatureEnabledWhatsThis(i18n("Select a JavaScript policy for " "the above host or domain.")); JSPoliciesFrame *panel = new JSPoliciesFrame(jspol, i18n("Domain-Specific " - "JavaScript Policies"), pDlg.mainWidget()); + "JavaScript Policies"), &pDlg); panel->refresh(); pDlg.addPolicyPanel(panel); pDlg.refresh(); diff --git a/settings/konqhtml/jsopts.h b/settings/konqhtml/jsopts.h index 26169e147b37f39a36eaa41994f9da86930b64b1..4655a1fff94b559dd8ffeb930f2927f8d5d0208d 100644 --- a/settings/konqhtml/jsopts.h +++ b/settings/konqhtml/jsopts.h @@ -11,7 +11,6 @@ #define JSOPTS_H #include -#include #include #include "domainlistview.h" #include "jspolicies.h" diff --git a/settings/konqhtml/jspolicies.cpp b/settings/konqhtml/jspolicies.cpp index 100bf7aa1d9d5bc3edb96d2a16f13f35a9ef35b0..61b61484cbf240212f73a240f6b9dd3159918083 100644 --- a/settings/konqhtml/jspolicies.cpp +++ b/settings/konqhtml/jspolicies.cpp @@ -42,16 +42,6 @@ JSPolicies::JSPolicies(KSharedConfig::Ptr config, const QString &group, { } -/* -JSPolicies::JSPolicies() : Policies(0,QString(),false, - QString(),QString(),QString()) { -} -*/ - -JSPolicies::~JSPolicies() -{ -} - void JSPolicies::load() { Policies::load(); @@ -162,32 +152,32 @@ JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title, QRadioButton *policy_btn; if (is_per_domain) { policy_btn = new QRadioButton(i18n("Use global"), this); - policy_btn->setWhatsThis(i18n("Use setting from global policy.")); + policy_btn->setToolTip(i18n("Use setting from global policy.")); js_popup->addButton(policy_btn, INHERIT_POLICY); this_layout->addWidget(policy_btn, 0, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); }/*end if*/ policy_btn = new QRadioButton(i18n("Allow"), this); - policy_btn->setWhatsThis(i18n("Accept all popup window requests.")); + policy_btn->setToolTip(i18n("Accept all popup window requests.")); js_popup->addButton(policy_btn, KParts::HtmlSettingsInterface::JSWindowOpenAllow); this_layout->addWidget(policy_btn, 0, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); policy_btn = new QRadioButton(i18n("Ask"), this); - policy_btn->setWhatsThis(i18n("Prompt every time a popup window is requested.")); + policy_btn->setToolTip(i18n("Prompt every time a popup window is requested.")); js_popup->addButton(policy_btn, KParts::HtmlSettingsInterface::JSWindowOpenAsk); this_layout->addWidget(policy_btn, 0, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); policy_btn = new QRadioButton(i18n("Deny"), this); - policy_btn->setWhatsThis(i18n("Reject all popup window requests.")); + policy_btn->setToolTip(i18n("Reject all popup window requests.")); js_popup->addButton(policy_btn, KParts::HtmlSettingsInterface::JSWindowOpenDeny); this_layout->addWidget(policy_btn, 0, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); policy_btn = new QRadioButton(i18n("Smart"), this); - policy_btn->setWhatsThis(i18n("Accept popup window requests only when " + policy_btn->setToolTip(i18n("Accept popup window requests only when " "links are activated through an explicit " "mouse click or keyboard operation.")); js_popup->addButton(policy_btn, KParts::HtmlSettingsInterface::JSWindowOpenSmart); @@ -203,8 +193,8 @@ JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title, "also break certain sites that require " "window.open() for proper operation. Use " "this feature carefully."); - label->setWhatsThis(wtstr); - connect(js_popup, SIGNAL(buttonClicked(int)), SLOT(setWindowOpenPolicy(int))); + label->setToolTip(wtstr); + connect(js_popup, QOverload::of(&QButtonGroup::buttonClicked), this, &JSPoliciesFrame::setWindowOpenPolicy); // === window.resizeBy/resizeTo ================================ colIdx = 0; @@ -216,20 +206,20 @@ JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title, if (is_per_domain) { policy_btn = new QRadioButton(i18n("Use global"), this); - policy_btn->setWhatsThis(i18n("Use setting from global policy.")); + policy_btn->setToolTip(i18n("Use setting from global policy.")); js_resize->addButton(policy_btn, INHERIT_POLICY); this_layout->addWidget(policy_btn, 1, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); }/*end if*/ policy_btn = new QRadioButton(i18n("Allow"), this); - policy_btn->setWhatsThis(i18n("Allow scripts to change the window size.")); + policy_btn->setToolTip(i18n("Allow scripts to change the window size.")); js_resize->addButton(policy_btn, KParts::HtmlSettingsInterface::JSWindowResizeAllow); this_layout->addWidget(policy_btn, 1, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); policy_btn = new QRadioButton(i18n("Ignore"), this); - policy_btn->setWhatsThis(i18n("Ignore attempts of scripts to change the window size. " + policy_btn->setToolTip(i18n("Ignore attempts of scripts to change the window size. " "The web page will think it changed the " "size but the actual window is not affected.")); js_resize->addButton(policy_btn, KParts::HtmlSettingsInterface::JSWindowResizeIgnore); @@ -240,8 +230,8 @@ JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title, "window.resizeBy() or window.resizeTo(). " "This option specifies the treatment of such " "attempts."); - label->setWhatsThis(wtstr); - connect(js_resize, SIGNAL(buttonClicked(int)), SLOT(setWindowResizePolicy(int))); + label->setToolTip(wtstr); + connect(js_resize, QOverload::of(&QButtonGroup::buttonClicked), this, &JSPoliciesFrame::setWindowResizePolicy); // === window.moveBy/moveTo ================================ colIdx = 0; @@ -253,20 +243,20 @@ JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title, if (is_per_domain) { policy_btn = new QRadioButton(i18n("Use global"), this); - policy_btn->setWhatsThis(i18n("Use setting from global policy.")); + policy_btn->setToolTip(i18n("Use setting from global policy.")); js_move->addButton(policy_btn, INHERIT_POLICY); this_layout->addWidget(policy_btn, 2, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); }/*end if*/ policy_btn = new QRadioButton(i18n("Allow"), this); - policy_btn->setWhatsThis(i18n("Allow scripts to change the window position.")); + policy_btn->setToolTip(i18n("Allow scripts to change the window position.")); js_move->addButton(policy_btn, KParts::HtmlSettingsInterface::JSWindowMoveAllow); this_layout->addWidget(policy_btn, 2, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); policy_btn = new QRadioButton(i18n("Ignore"), this); - policy_btn->setWhatsThis(i18n("Ignore attempts of scripts to change the window position. " + policy_btn->setToolTip(i18n("Ignore attempts of scripts to change the window position. " "The web page will think it moved the " "window but the actual position is not affected.")); js_move->addButton(policy_btn, KParts::HtmlSettingsInterface::JSWindowMoveIgnore); @@ -277,8 +267,8 @@ JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title, "window.moveBy() or window.moveTo(). " "This option specifies the treatment of such " "attempts."); - label->setWhatsThis(wtstr); - connect(js_move, SIGNAL(buttonClicked(int)), SLOT(setWindowMovePolicy(int))); + label->setToolTip(wtstr); + connect(js_move, QOverload::of(&QButtonGroup::buttonClicked), this, &JSPoliciesFrame::setWindowMovePolicy); // === window.focus ================================ colIdx = 0; @@ -290,20 +280,20 @@ JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title, if (is_per_domain) { policy_btn = new QRadioButton(i18n("Use global"), this); - policy_btn->setWhatsThis(i18n("Use setting from global policy.")); + policy_btn->setToolTip(i18n("Use setting from global policy.")); js_focus->addButton(policy_btn, INHERIT_POLICY); this_layout->addWidget(policy_btn, 3, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); }/*end if*/ policy_btn = new QRadioButton(i18n("Allow"), this); - policy_btn->setWhatsThis(i18n("Allow scripts to focus the window.")); + policy_btn->setToolTip(i18n("Allow scripts to focus the window.")); js_focus->addButton(policy_btn, KParts::HtmlSettingsInterface::JSWindowFocusAllow); this_layout->addWidget(policy_btn, 3, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); policy_btn = new QRadioButton(i18n("Ignore"), this); - policy_btn->setWhatsThis(i18n("Ignore attempts of scripts to focus the window. " + policy_btn->setToolTip(i18n("Ignore attempts of scripts to focus the window. " "The web page will think it brought " "the focus to the window but the actual " "focus will remain unchanged.")); @@ -317,8 +307,8 @@ JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title, "action the user was dedicated to at that time. " "This option specifies the treatment of such " "attempts."); - label->setWhatsThis(wtstr); - connect(js_focus, SIGNAL(buttonClicked(int)), SLOT(setWindowFocusPolicy(int))); + label->setToolTip(wtstr); + connect(js_focus, QOverload::of(&QButtonGroup::buttonClicked), this, &JSPoliciesFrame::setWindowFocusPolicy); // === window.status ================================ colIdx = 0; @@ -330,20 +320,20 @@ JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title, if (is_per_domain) { policy_btn = new QRadioButton(i18n("Use global"), this); - policy_btn->setWhatsThis(i18n("Use setting from global policy.")); + policy_btn->setToolTip(i18n("Use setting from global policy.")); js_statusbar->addButton(policy_btn, INHERIT_POLICY); this_layout->addWidget(policy_btn, 4, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); }/*end if*/ policy_btn = new QRadioButton(i18n("Allow"), this); - policy_btn->setWhatsThis(i18n("Allow scripts to change the text of the status bar.")); + policy_btn->setToolTip(i18n("Allow scripts to change the text of the status bar.")); js_statusbar->addButton(policy_btn, KParts::HtmlSettingsInterface::JSWindowStatusAllow); this_layout->addWidget(policy_btn, 4, colIdx++); this_layout->addItem(new QSpacerItem(10, 0), 0, colIdx++); policy_btn = new QRadioButton(i18n("Ignore"), this); - policy_btn->setWhatsThis(i18n("Ignore attempts of scripts to change the status bar text. " + policy_btn->setToolTip(i18n("Ignore attempts of scripts to change the status bar text. " "The web page will think it changed " "the text but the actual text will remain " "unchanged.")); @@ -356,12 +346,8 @@ JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title, "thus sometimes preventing displaying the real URLs of hyperlinks. " "This option specifies the treatment of such " "attempts."); - label->setWhatsThis(wtstr); - connect(js_statusbar, SIGNAL(buttonClicked(int)), SLOT(setWindowStatusPolicy(int))); -} - -JSPoliciesFrame::~JSPoliciesFrame() -{ + label->setToolTip(wtstr); + connect(js_statusbar, QOverload::of(&QButtonGroup::buttonClicked), this, &JSPoliciesFrame::setWindowStatusPolicy); } void JSPoliciesFrame::refresh() diff --git a/settings/konqhtml/jspolicies.h b/settings/konqhtml/jspolicies.h index 8194be6e4cb3246dda0af032a446f3d3caa11616..89ee7ae047f2b5d8f70327b8d53659ca78d93be0 100644 --- a/settings/konqhtml/jspolicies.h +++ b/settings/konqhtml/jspolicies.h @@ -65,7 +65,7 @@ public: */ JSPolicies(); - ~JSPolicies() override; + ~JSPolicies() override = default; /** * Returns whether the WindowOpen policy is inherited. @@ -215,7 +215,7 @@ public: */ JSPoliciesFrame(JSPolicies *policies, const QString &title, QWidget *parent = nullptr); - ~JSPoliciesFrame() override; + ~JSPoliciesFrame() override = default; /** * updates the controls to resemble the status of the underlying diff --git a/settings/konqhtml/khttpoptdlg.cpp b/settings/konqhtml/khttpoptdlg.cpp deleted file mode 100644 index e0fa7680e47b5dcefa8d5c6a570bfff7331f0b42..0000000000000000000000000000000000000000 --- a/settings/konqhtml/khttpoptdlg.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) Jacek Konieczny - * - * Copyright (C) David Faure - * Port to KControl - * - */ - -// Own -#include "khttpoptdlg.h" - -// Qt -#include //CT - -// KDE -#include -#include -#include -#include -#include - -KHTTPOptions::KHTTPOptions(KSharedConfig::Ptr config, const QString &group, const KAboutData *aboutData, QWidget *parent) - : KCModule(aboutData, parent), m_pConfig(config), m_groupname(group) -{ - QVBoxLayout *lay = new QVBoxLayout(this); - - lay->addWidget(new QLabel(i18n("Accept languages:"), this)); - - le_languages = new QLineEdit(this); - lay->addWidget(le_languages); - connect(le_languages, SIGNAL(textChanged(QString)), - this, SLOT(slotChanged())); - - lay->addSpacing(10); - lay->addWidget(new QLabel(i18n("Accept character sets:"), this)); - - le_charsets = new QLineEdit(this); - lay->addWidget(le_charsets); - connect(le_charsets, SIGNAL(textChanged(QString)), - this, SLOT(slotChanged())); - - lay->addStretch(10); - - // defaultCharsets = QString("utf-8 ")+klocale->charset()+" iso-8859-1"; - defaultCharsets = QStringLiteral("utf-8 ") + " iso-8859-1"; // TODO - // if lang=ru or uk then +cp1251+koi8u - these are most used encodings (though locale may/should be utf8) --nick shaforostoff - -} - -void KHTTPOptions::load() -{ - QString tmp; - KConfigGroup cg(m_pConfig, "Browser Settings/HTTP"); - tmp = cg.readEntry("AcceptLanguages", KLocale::global()->languageList().join(QStringLiteral(","))); - le_languages->setText(tmp); - tmp = cg.readEntry("AcceptCharsets", defaultCharsets); - le_charsets->setText(tmp); -} - -void KHTTPOptions::save() -{ - KConfigGroup cg(m_pConfig, "Browser Settings/HTTP"); - cg.writeEntry("AcceptLanguages", le_languages->text()); - cg.writeEntry("AcceptCharsets", le_charsets->text()); - cg.sync(); -} - -void KHTTPOptions::defaults() -{ - le_languages->setText(KLocale::global()->languageList().join(QStringLiteral(","))); - le_charsets->setText(defaultCharsets); -} - -void KHTTPOptions::slotChanged() -{ - emit changed(true); -} - diff --git a/settings/konqhtml/khttpoptdlg.h b/settings/konqhtml/khttpoptdlg.h deleted file mode 100644 index 16cc2f19568e6d4d55629f152369c7525df83644..0000000000000000000000000000000000000000 --- a/settings/konqhtml/khttpoptdlg.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) Jacek Konieczy - * extra HTTP configuration - * - */ - -#ifndef __KHTTPOPTDLG_H -#define __KHTTPOPTDLG_H - -#include -#include -#include - -#include -#include -#include - -class KAboutData; - -/** -* Dialog for configuring HTTP Options like charset and language negotiation -* and assuming that file got from HTTP is HTML if no Content-Type is given -*/ -class KHTTPOptions : public KCModule -{ - Q_OBJECT -public: - KHTTPOptions(KSharedConfig::Ptr config, const QString &group, const KAboutData *aboutData, QWidget *parent); - - void load() override; - void save() override; - void defaults() override; - -private: - - KSharedConfig::Ptr m_pConfig; - QString m_groupname; - - // Acceptable languages "LANG" - locale selected languages - QLabel *lb_languages; - QLineEdit *le_languages; - - // Acceptable charsets "CHARSET" - locale selected charset - QLabel *lb_charsets; - QLineEdit *le_charsets; - - QString defaultCharsets; - -private Q_SLOTS: - void slotChanged(); - -}; - -#endif // __KHTTPOPTDLG_H diff --git a/settings/konqhtml/main.cpp b/settings/konqhtml/main.cpp index a00114e7b5f30c7fa3499d299c230b358df23cc2..0740a457eed0230e465e6fd18793593a58ef26fa 100644 --- a/settings/konqhtml/main.cpp +++ b/settings/konqhtml/main.cpp @@ -28,6 +28,7 @@ // Qt #include +#include #include #include @@ -36,11 +37,12 @@ #include #include #include +#include +#include // Local #include "jsopts.h" #include "javaopts.h" -#include "pluginopts.h" #include "appearance.h" #include "htmlopts.h" #include "filteropts.h" @@ -48,7 +50,6 @@ K_PLUGIN_FACTORY(KcmKonqHtmlFactory, registerPlugin("khtml_java_js"); - registerPlugin("khtml_plugins"); registerPlugin("khtml_behavior"); registerPlugin("khtml_general"); registerPlugin("khtml_filter"); @@ -85,11 +86,11 @@ KJSParts::KJSParts(QWidget *parent, const QVariantList &) // ### the groupname is duplicated in KJSParts::save java = new KJavaOptions(mConfig, QStringLiteral("Java/JavaScript Settings"), this); tab->addTab(java, i18n("&Java")); - connect(java, SIGNAL(changed(bool)), SIGNAL(changed(bool))); + connect(java, QOverload::of(&KJavaOptions::changed), this, &KJSParts::markAsChanged); javascript = new KJavaScriptOptions(mConfig, QStringLiteral("Java/JavaScript Settings"), this); tab->addTab(javascript, i18n("Java&Script")); - connect(javascript, SIGNAL(changed(bool)), SIGNAL(changed(bool))); + connect(javascript, QOverload::of(&KJavaScriptOptions::changed), this, &KJSParts::markAsChanged); } void KJSParts::load() diff --git a/settings/konqhtml/nsconfigwidget.ui b/settings/konqhtml/nsconfigwidget.ui deleted file mode 100644 index a953321c5fd3fb6d0090f600eff1aee74ba0e74a..0000000000000000000000000000000000000000 --- a/settings/konqhtml/nsconfigwidget.ui +++ /dev/null @@ -1,170 +0,0 @@ - - Stefan Schimanski <1Stein@gmx.de> - NSConfigWidget - - - - 0 - 0 - 523 - 398 - - - - Plugins - - - - - - - 300 - 0 - - - - Folders - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 0 - - - - - - - - false - - - &Remove - - - - - - - &New - - - - - - - false - - - - - - - false - - - Do&wn - - - - - - - false - - - &Up - - - - - - - - 0 - 0 - - - - - - - - Click here to scan for newly installed Netscape plugins now. - - - &Scan for Plugins - - - - - dirRemove - dirNew - dirEdit - dirDown - dirUp - dirList - scanButton - - - - - - Plugins - - - - - - Here you can see a list of the Netscape plugins KDE has found. - - - true - - - - Information - - - - - Value - - - - - - - - - - - - QListWidget - QListWidget -
klistwidget.h
-
- - KUrlRequester - QFrame -
kurlrequester.h
- 1 -
-
- - klocale.h - kurlrequester.h - kdialog.h - - - -
diff --git a/settings/konqhtml/pluginopts.cpp b/settings/konqhtml/pluginopts.cpp deleted file mode 100644 index 7382cab7a8ee11188528dbdebda996833c96a740..0000000000000000000000000000000000000000 --- a/settings/konqhtml/pluginopts.cpp +++ /dev/null @@ -1,698 +0,0 @@ -/* - * Copyright (C) 2002-2003 Leo Savernik - * per-domain settings - * Copyright (C) 2001, Daniel Naber - * based on javaopts.cpp - * Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de> - * Netscape parts - * - */ - -// Own -#include "pluginopts.h" - -// std -#include -#include - -// Qt -#include -#include -#include -#include -#include -#include -#include -#include - -// KDE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// Local -#include "htmlopts.h" -#include "ui_nsconfigwidget.h" -#include "policydlg.h" - -// == class PluginPolicies ===== - -PluginPolicies::PluginPolicies(KSharedConfig::Ptr config, const QString &group, bool global, - const QString &domain) : - Policies(config, group, global, domain, QStringLiteral("plugins."), QStringLiteral("EnablePlugins")) -{ -} - -PluginPolicies::~PluginPolicies() -{ -} - -// == class KPluginOptions ===== - -KPluginOptions::KPluginOptions(QWidget *parent, const QVariantList &) - : KCModule(parent), - m_pConfig(KSharedConfig::openConfig(QStringLiteral("konquerorrc"), KConfig::NoGlobals)), - m_groupname(QStringLiteral("Java/JavaScript Settings")), - global_policies(m_pConfig, m_groupname, true) -{ - QVBoxLayout *toplevel = new QVBoxLayout(this); - - QTabWidget *topleveltab = new QTabWidget(this); - toplevel->addWidget(topleveltab); - - QWidget *globalGB = new QWidget(topleveltab); - topleveltab->addTab(globalGB, i18n("Global Settings")); - - /************************************************************************** - ******************** Global Settings ************************************* - *************************************************************************/ - enablePluginsGloballyCB = new QCheckBox(i18n("&Enable plugins globally"), globalGB); - enableHTTPOnly = new QCheckBox(i18n("Only allow &HTTP and HTTPS URLs for plugins"), globalGB); - enableUserDemand = new QCheckBox(i18n("&Load plugins on demand only"), globalGB); - priorityLabel = new QLabel(i18n("CPU priority for plugins: %1", QString()), globalGB); - //priority = new QSlider(5, 100, 5, 100, Qt::Horizontal, globalGB); - priority = new QSlider(Qt::Horizontal, globalGB); - priority->setMinimum(5); - priority->setMaximum(100); - priority->setPageStep(5); - - QVBoxLayout *vbox = new QVBoxLayout; - vbox->addWidget(enablePluginsGloballyCB); - vbox->addWidget(enableHTTPOnly); - vbox->addWidget(enableUserDemand); - vbox->addWidget(priorityLabel); - vbox->addWidget(priority); - - connect(enablePluginsGloballyCB, SIGNAL(clicked()), this, SLOT(slotChanged())); - connect(enablePluginsGloballyCB, SIGNAL(clicked()), this, SLOT(slotTogglePluginsEnabled())); - connect(enableHTTPOnly, SIGNAL(clicked()), this, SLOT(slotChanged())); - connect(enableUserDemand, SIGNAL(clicked()), this, SLOT(slotChanged())); - connect(priority, SIGNAL(valueChanged(int)), this, SLOT(slotChanged())); - connect(priority, SIGNAL(valueChanged(int)), this, SLOT(updatePLabel(int))); - - QFrame *hrule = new QFrame(globalGB); - hrule->setFrameStyle(QFrame::HLine | QFrame::Sunken); - hrule->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - - /************************************************************************** - ********************* Domain-specific Settings *************************** - *************************************************************************/ - QPushButton *domainSpecPB = new QPushButton(i18n("Domain-Specific Settin&gs"), - globalGB); - domainSpecPB->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - connect(domainSpecPB, SIGNAL(clicked()), SLOT(slotShowDomainDlg())); - - vbox->addWidget(hrule); - vbox->addWidget(domainSpecPB); - - globalGB->setLayout(vbox); - - vbox->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)); - - domainSpecificDlg = new KDialog(this); - domainSpecificDlg->setCaption(i18nc("@title:window", "Domain-Specific Policies")); - domainSpecificDlg->setButtons(KDialog::Close); - domainSpecificDlg->setDefaultButton(KDialog::Close); - domainSpecificDlg->setObjectName(QStringLiteral("domainSpecificDlg")); - domainSpecificDlg->setModal(true); - - domainSpecific = new PluginDomainListView(m_pConfig, m_groupname, this, domainSpecificDlg); - domainSpecific->setMinimumSize(320, 200); - connect(domainSpecific, SIGNAL(changed(bool)), SLOT(slotChanged())); - - domainSpecificDlg->setMainWidget(domainSpecific); - - /************************************************************************** - ********************** WhatsThis? items ********************************** - *************************************************************************/ - enablePluginsGloballyCB->setWhatsThis(i18n("Enables the execution of plugins " - "that can be contained in HTML pages, e.g. Macromedia Flash. " - "Note that, as with any browser, enabling active contents can be a security problem.")); - - QString wtstr = i18n("

This box contains the domains and hosts you have set " - "a specific plugin policy for. This policy will be used " - "instead of the default policy for enabling or disabling plugins on pages sent by these " - "domains or hosts.

Select a policy and use the controls on " - "the right to modify it.

"); - domainSpecific->listView()->setWhatsThis(wtstr); - domainSpecific->importButton()->setWhatsThis(i18n("Click this button to choose the file that contains " - "the plugin policies. These policies will be merged " - "with the existing ones. Duplicate entries are ignored.")); - domainSpecific->exportButton()->setWhatsThis(i18n("Click this button to save the plugin policy to a zipped " - "file. The file, named plugin_policy.tgz, will be " - "saved to a location of your choice.")); - domainSpecific->setWhatsThis(i18n("Here you can set specific plugin policies for any particular " - "host or domain. To add a new policy, simply click the New... " - "button and supply the necessary information requested by the " - "dialog box. To change an existing policy, click on the Change... " - "button and choose the new policy from the policy dialog box. Clicking " - "on the Delete button will remove the selected policy causing the default " - "policy setting to be used for that domain.")); -#if 0 - "The Import and Export " - "button allows you to easily share your policies with other people by allowing " - "you to save and retrieve them from a zipped file.")); -#endif - - /*****************************************************************************/ - - QWidget *pluginsSettingsContainer = new QWidget(topleveltab); - topleveltab->addTab(pluginsSettingsContainer, i18n("Plugins")); - - // create Designer made widget - m_widget.setupUi(pluginsSettingsContainer); - pluginsSettingsContainer->setObjectName(QStringLiteral("configwidget")); - m_widget.dirEdit->setMode(KFile::ExistingOnly | KFile::LocalOnly | KFile::Directory); - - // setup widgets - connect(m_widget.scanButton, SIGNAL(clicked()), SLOT(scan())); - - m_changed = false; - - dirInit(); - pluginInit(); - -} - -void KPluginOptions::updatePLabel(int p) -{ - QString level; - p = (100 - p) / 5; - if (p > 15) { - level = i18nc("lowest priority", "lowest"); - } else if (p > 11) { - level = i18nc("low priority", "low"); - } else if (p > 7) { - level = i18nc("medium priority", "medium"); - } else if (p > 3) { - level = i18nc("high priority", "high"); - } else { - level = i18nc("highest priority", "highest"); - } - - priorityLabel->setText(i18n("CPU priority for plugins: %1", level)); -} - -void KPluginOptions::load() -{ - // *** load *** - global_policies.load(); - bool bPluginGlobal = global_policies.isFeatureEnabled(); - - // *** apply to GUI *** - enablePluginsGloballyCB->setChecked(bPluginGlobal); - - domainSpecific->initialize(m_pConfig->group(m_groupname).readEntry("PluginDomains", QStringList())); - - /****************************************************************************/ - - KSharedConfig::Ptr config = KSharedConfig::openConfig(QStringLiteral("kcmnspluginrc")); - KConfigGroup cg(config, "Misc"); - - m_widget.dirEdit->setUrl(QUrl()); - m_widget.dirEdit->setEnabled(false); - m_widget.dirRemove->setEnabled(false); - m_widget.dirUp->setEnabled(false); - m_widget.dirDown->setEnabled(false); - enableHTTPOnly->setChecked(cg.readEntry("HTTP URLs Only", false)); - enableUserDemand->setChecked(cg.readEntry("demandLoad", false)); - priority->setValue(100 - qBound(0, cg.readEntry("Nice Level", 0), 19) * 5); - updatePLabel(priority->value()); - - dirLoad(config); - pluginLoad(config); - - change(false); -} - -void KPluginOptions::defaults() -{ - global_policies.defaults(); - enablePluginsGloballyCB->setChecked(global_policies.isFeatureEnabled()); - enableHTTPOnly->setChecked(false); - enableUserDemand->setChecked(false); - priority->setValue(100); - - /*****************************************************************************/ - - KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::NoGlobals); - - m_widget.dirEdit->setUrl(QUrl()); - m_widget.dirEdit->setEnabled(false); - m_widget.dirRemove->setEnabled(false); - - dirLoad(config, true); - pluginLoad(config); - - change(); -} - -void KPluginOptions::save() -{ - global_policies.save(); - - domainSpecific->save(m_groupname, QStringLiteral("PluginDomains")); - - m_pConfig->sync(); // I need a sync here, otherwise "apply" won't work - // instantly - // Send signal to all konqueror instances - QDBusMessage message = - QDBusMessage::createSignal(QStringLiteral("/KonqMain"), QStringLiteral("org.kde.Konqueror.Main"), QStringLiteral("reparseConfiguration")); - QDBusConnection::sessionBus().send(message); - - /*****************************************************************************/ - - KSharedConfig::Ptr config = KSharedConfig::openConfig(QStringLiteral("kcmnspluginrc")); - - dirSave(config); - pluginSave(config); - - KConfigGroup cg(config, "Misc"); - cg.writeEntry("HTTP URLs Only", enableHTTPOnly->isChecked()); - cg.writeEntry("demandLoad", enableUserDemand->isChecked()); - cg.writeEntry("Nice Level", (int)(100 - priority->value()) / 5); - cg.sync(); - - change(false); -} - -QString KPluginOptions::quickHelp() const -{ - return i18n("

Konqueror Plugins

The Konqueror web browser can use Netscape" - " plugins to show special content, just like the Navigator does. Please note that" - " the way you have to install Netscape plugins may depend on your distribution. A typical" - " place to install them is, for example, '/opt/netscape/plugins'."); -} - -void KPluginOptions::slotChanged() -{ - emit changed(true); -} - -void KPluginOptions::slotTogglePluginsEnabled() -{ - global_policies.setFeatureEnabled(enablePluginsGloballyCB->isChecked()); -} - -void KPluginOptions::slotShowDomainDlg() -{ - domainSpecificDlg->show(); -} - -/***********************************************************************************/ - -void KPluginOptions::scan() -{ - m_widget.scanButton->setEnabled(false); - if (m_changed) { - int ret = KMessageBox::warningYesNoCancel(this, - i18n("Do you want to apply your changes " - "before the scan? Otherwise the " - "changes will be lost."), QString(), KStandardGuiItem::save(), KStandardGuiItem::discard()); - if (ret == KMessageBox::Cancel) { - m_widget.scanButton->setEnabled(true); - return; - } - if (ret == KMessageBox::Yes) { - save(); - } - } - - nspluginscan = new KProcess(this); - nspluginscan->setOutputChannelMode(KProcess::SeparateChannels); - QString scanExe = KStandardDirs::findExe(QStringLiteral("nspluginscan")); - if (scanExe.isEmpty()) { - qDebug() << "can't find nspluginviewer"; - - KMessageBox::sorry(this, - i18n("The nspluginscan executable cannot be found. " - "Netscape plugins will not be scanned.")); - m_widget.scanButton->setEnabled(true); - return; - } - - // find nspluginscan executable - m_progress = new KProgressDialog(this, QString(), i18n("Scanning for plugins")); - m_progress->progressBar()->setValue(5); - - // start nspluginscan - *nspluginscan << scanExe << QStringLiteral("--verbose"); - qDebug() << "Running nspluginscan"; - connect(nspluginscan, SIGNAL(readyReadStandardOutput()), - this, SLOT(progress())); - connect(nspluginscan, SIGNAL(finished(int,QProcess::ExitStatus)), - this, SLOT(scanDone())); - connect(m_progress, SIGNAL(cancelClicked()), this, SLOT(scanDone())); - - nspluginscan->start(); -} - -void KPluginOptions::progress() -{ - // we do not know if the output array ends in the middle of an utf-8 sequence - m_output += nspluginscan->readAllStandardOutput(); - QString line; - int pos; - while ((pos = m_output.indexOf('\n')) != -1) { - line = QString::fromLocal8Bit(m_output, pos + 1); - m_output.remove(0, pos + 1); - } - m_progress->progressBar()->setValue(line.trimmed().toInt()); -} - -void KPluginOptions::scanDone() -{ - // update dialog - if (m_progress) { - m_progress->progressBar()->setValue(100); - load(); - m_progress->deleteLater(); - m_progress = nullptr; - } - m_widget.scanButton->setEnabled(true); -} - -/***********************************************************************************/ - -void KPluginOptions::dirInit() -{ - m_widget.dirEdit->setWindowTitle(i18nc("@title:window", "Select Plugin Scan Folder")); - connect(m_widget.dirNew, SIGNAL(clicked()), SLOT(dirNew())); - connect(m_widget.dirRemove, SIGNAL(clicked()), SLOT(dirRemove())); - connect(m_widget.dirUp, SIGNAL(clicked()), SLOT(dirUp())); - connect(m_widget.dirDown, SIGNAL(clicked()), SLOT(dirDown())); - connect(m_widget.dirEdit, - SIGNAL(textChanged(QString)), - SLOT(dirEdited(QString))); - - connect(m_widget.dirList, - SIGNAL(executed(QListWidgetItem*)), - SLOT(dirSelect(QListWidgetItem*))); - - connect(m_widget.dirList, - SIGNAL(itemChanged(QListWidgetItem*)), - SLOT(dirSelect(QListWidgetItem*))); -} - -void KPluginOptions::dirLoad(KSharedConfig::Ptr config, bool useDefault) -{ - QStringList paths; - - // read search paths - - KConfigGroup cg(config, "Misc"); - if (cg.hasKey("scanPaths") && !useDefault) { - paths = cg.readEntry("scanPaths", QStringList()); - } else { //keep sync with kdebase/apps/nsplugins - paths.append(QStringLiteral("$HOME/.mozilla/plugins")); - paths.append(QStringLiteral("$HOME/.netscape/plugins")); - paths.append(QStringLiteral("/usr/lib/firefox/plugins")); - paths.append(QStringLiteral("/usr/lib64/browser-plugins")); - paths.append(QStringLiteral("/usr/lib/browser-plugins")); - paths.append(QStringLiteral("/usr/local/netscape/plugins")); - paths.append(QStringLiteral("/opt/mozilla/plugins")); - paths.append(QStringLiteral("/opt/mozilla/lib/plugins")); - paths.append(QStringLiteral("/opt/netscape/plugins")); - paths.append(QStringLiteral("/opt/netscape/communicator/plugins")); - paths.append(QStringLiteral("/usr/lib/netscape/plugins")); - paths.append(QStringLiteral("/usr/lib/netscape/plugins-libc5")); - paths.append(QStringLiteral("/usr/lib/netscape/plugins-libc6")); - paths.append(QStringLiteral("/usr/lib/mozilla/plugins")); - paths.append(QStringLiteral("/usr/lib64/netscape/plugins")); - paths.append(QStringLiteral("/usr/lib64/mozilla/plugins")); - paths.append(QStringLiteral("$MOZILLA_HOME/plugins")); - } - - // fill list - m_widget.dirList->clear(); - m_widget.dirList->addItems(paths); - -} - -void KPluginOptions::dirSave(KSharedConfig::Ptr config) -{ - // create stringlist - QStringList paths; - - for (int rowIndex = 0; rowIndex < m_widget.dirList->count(); rowIndex++) { - if (!m_widget.dirList->item(rowIndex)->text().isEmpty()) { - paths << m_widget.dirList->item(rowIndex)->text(); - } - } - - // write entry - KConfigGroup cg(config, "Misc"); - cg.writeEntry("scanPaths", paths); -} - -void KPluginOptions::dirSelect(QListWidgetItem *item) -{ - m_widget.dirEdit->setEnabled(item != nullptr); - m_widget.dirRemove->setEnabled(item != nullptr); - - int cur = m_widget.dirList->currentRow(); - m_widget.dirDown->setEnabled(item != nullptr && cur < m_widget.dirList->count() - 1); - m_widget.dirUp->setEnabled(item != nullptr && cur > 0); - m_widget.dirEdit->setUrl(item != nullptr ? QUrl::fromUserInput(item->text()) : QUrl()); -} - -void KPluginOptions::dirNew() -{ - m_widget.dirList->insertItem(0, QString()); - m_widget.dirList->setCurrentRow(0); - dirSelect(m_widget.dirList->currentItem()); - m_widget.dirEdit->setUrl(QUrl()); - m_widget.dirEdit->setFocus(); - change(); -} - -void KPluginOptions::dirRemove() -{ - m_widget.dirEdit->setUrl(QUrl()); - delete m_widget.dirList->currentItem(); - m_widget.dirRemove->setEnabled(false); - m_widget.dirUp->setEnabled(false); - m_widget.dirDown->setEnabled(false); - m_widget.dirEdit->setEnabled(false); - change(); -} - -void KPluginOptions::dirUp() -{ - int cur = m_widget.dirList->currentRow(); - if (cur > 0) { - QString txt = m_widget.dirList->item(cur - 1)->text(); - delete m_widget.dirList->takeItem(cur - 1); - m_widget.dirList->insertItem(cur, txt); - - m_widget.dirUp->setEnabled(cur - 1 > 0); - m_widget.dirDown->setEnabled(true); - change(); - } -} - -void KPluginOptions::dirDown() -{ - int cur = m_widget.dirList->currentRow(); - if (cur < m_widget.dirList->count() - 1) { - QString txt = m_widget.dirList->item(cur + 1)->text(); - delete m_widget.dirList->takeItem(cur + 1); - m_widget.dirList->insertItem(cur, txt); - - m_widget.dirUp->setEnabled(true); - m_widget.dirDown->setEnabled(cur + 1 < m_widget.dirList->count() - 1); - change(); - } -} - -void KPluginOptions::dirEdited(const QString &txt) -{ - if (m_widget.dirList->currentItem()->text() != txt) { - m_widget.dirList->blockSignals(true); - m_widget.dirList->currentItem()->setText(txt); - m_widget.dirList->blockSignals(false); - change(); - } -} - -/***********************************************************************************/ - -void KPluginOptions::pluginInit() -{ -} - -void KPluginOptions::pluginLoad(KSharedConfig::Ptr /*config*/) -{ - m_widget.pluginList->setRootIsDecorated(false); - m_widget.pluginList->setColumnWidth(0, 200); - qDebug() << "-> KPluginOptions::fillPluginList"; - m_widget.pluginList->clear(); - QRegExp version(";version=[^:]*:"); - - // open the cache file - QFile cachef(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("nsplugins/cache"))); - if (!cachef.exists() || !cachef.open(QIODevice::ReadOnly)) { - qDebug() << "Could not load plugin cache file!"; - return; - } - - QTextStream cache(&cachef); - - // root object - QTreeWidgetItem *root = new QTreeWidgetItem(m_widget.pluginList, QStringList() << i18n("Netscape Plugins")); - root->setFlags(Qt::ItemIsEnabled); - root->setExpanded(true); - root->setIcon(0, QIcon::fromTheme(QStringLiteral("netscape"))); - - // read in cache - QString line, plugin; - QTreeWidgetItem *next = nullptr; - QTreeWidgetItem *lastMIME = nullptr; - while (!cache.atEnd()) { - - line = cache.readLine(); - //qDebug() << line; - if (line.isEmpty() || (line.left(1) == QLatin1String("#"))) { - continue; - } - - if (line.left(1) == QLatin1String("[")) { - - plugin = line.mid(1, line.length() - 2); - //qDebug() << "plugin=" << plugin; - - // add plugin root item - next = new QTreeWidgetItem(root, QStringList() << i18n("Plugin") << plugin); - next->setFlags(Qt::ItemIsEnabled); - - lastMIME = nullptr; - - continue; - } - - const QStringList desc = line.split(':'); - // avoid crash on broken lines - if (desc.size() < 2) { - continue; - } - - QString mime = desc[0].trimmed(); - QString name; - QString suffixes; - if (desc.count() > 2) { - name = desc[2]; - } - if (desc.count() > 1) { - suffixes = desc[1]; - } - - if (!mime.isEmpty() && next) { - //qDebug() << "mime=" << mime << " desc=" << name << " suffix=" << suffixes; - lastMIME = new QTreeWidgetItem(next, QStringList() << i18n("MIME type") << mime); - lastMIME->setFlags(Qt::ItemIsEnabled); - - QTreeWidgetItem *last = new QTreeWidgetItem(lastMIME, QStringList() << i18n("Description") << name); - last->setFlags(Qt::ItemIsEnabled); - - last = new QTreeWidgetItem(lastMIME, QStringList() << i18n("Suffixes") << suffixes); - last->setFlags(Qt::ItemIsEnabled); - } - } - - //qDebug() << "<- KPluginOptions::fillPluginList"; -} - -void KPluginOptions::pluginSave(KSharedConfig::Ptr /*config*/) -{ - -} - -// == class PluginDomainDialog ===== - -PluginDomainDialog::PluginDomainDialog(QWidget *parent) : - QWidget(parent) -{ - setObjectName(QStringLiteral("PluginDomainDialog")); - setWindowTitle(i18nc("@title:window", "Domain-Specific Policies")); - - thisLayout = new QVBoxLayout(this); - thisLayout->addSpacing(6); - QFrame *hrule = new QFrame(this); - hrule->setFrameStyle(QFrame::HLine | QFrame::Sunken); - thisLayout->addWidget(hrule); - thisLayout->addSpacing(6); - - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); - connect(buttonBox, SIGNAL(rejected()), SLOT(slotClose())); - thisLayout->addWidget(buttonBox); -} - -PluginDomainDialog::~PluginDomainDialog() -{ -} - -void PluginDomainDialog::setMainWidget(QWidget *widget) -{ - thisLayout->insertWidget(0, widget); -} - -void PluginDomainDialog::slotClose() -{ - hide(); -} - -// == class PluginDomainListView ===== - -PluginDomainListView::PluginDomainListView(KSharedConfig::Ptr config, const QString &group, - KPluginOptions *options, QWidget *parent) - : DomainListView(config, i18n("Doma&in-Specific"), parent), - group(group), options(options) -{ -} - -PluginDomainListView::~PluginDomainListView() -{ -} - -void PluginDomainListView::setupPolicyDlg(PushButton trigger, PolicyDialog &pDlg, - Policies *pol) -{ - QString caption; - switch (trigger) { - case AddButton: - caption = i18nc("@title:window", "New Plugin Policy"); - pol->setFeatureEnabled(!options->enablePluginsGloballyCB->isChecked()); - break; - case ChangeButton: caption = i18nc("@title:window", "Change Plugin Policy"); break; - default:; // inhibit gcc warning - }/*end switch*/ - pDlg.setWindowTitle(caption); - pDlg.setFeatureEnabledLabel(i18n("&Plugin policy:")); - pDlg.setFeatureEnabledWhatsThis(i18n("Select a plugin policy for " - "the above host or domain.")); - pDlg.refresh(); -} - -PluginPolicies *PluginDomainListView::createPolicies() -{ - return new PluginPolicies(config, group, false); -} - -PluginPolicies *PluginDomainListView::copyPolicies(Policies *pol) -{ - return new PluginPolicies(*static_cast(pol)); -} - diff --git a/settings/konqhtml/pluginopts.h b/settings/konqhtml/pluginopts.h deleted file mode 100644 index a37bd240a987ad717a53ae6eefc587853dbd3b9d..0000000000000000000000000000000000000000 --- a/settings/konqhtml/pluginopts.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Plugin Options - * - * Copyright (c) 2002 Leo Savernik, per-domain settings - * Copyright (c) 2001, Daniel Naber, based on javaopts.h - * Copyright (c) 2000, Stefan Schimanski <1Stein@gmx.de> - * Netscape parts - * - */ - -#ifndef PLUGINOPTS_H -#define PLUGINOPTS_H - -#include - -#include "domainlistview.h" -#include "policies.h" - -class QCheckBox; - -#include -#include -#include -#include "ui_nsconfigwidget.h" - -class QBoxLayout; -class QLabel; -class KProgressDialog; -class QSlider; -class KDialog; -class KPluginOptions; -class KProcess; -namespace Ui -{ -class NSConfigWidget; -} - -/** policies with plugin-specific constructor - */ -class PluginPolicies : public Policies -{ -public: - /** - * constructor - * @param config configuration to initialize this instance from - * @param group config group to use if this instance contains the global - * policies (global == true) - * @param global true if this instance contains the global policy settings, - * false if this instance contains policies specific for a domain. - * @param domain name of the domain this instance is used to configure the - * policies for (case insensitive, ignored if global == true) - */ - PluginPolicies(KSharedConfig::Ptr config, const QString &group, bool global, - const QString &domain = QString()); - - ~PluginPolicies() override; -}; - -/** Plugin-specific enhancements to the domain list view - */ -class PluginDomainListView : public DomainListView -{ - Q_OBJECT -public: - PluginDomainListView(KSharedConfig::Ptr config, const QString &group, KPluginOptions *opt, - QWidget *parent); - ~PluginDomainListView() override; - -protected: - PluginPolicies *createPolicies() override; - PluginPolicies *copyPolicies(Policies *pol) override; - void setupPolicyDlg(PushButton trigger, PolicyDialog &pDlg, - Policies *copy) override; - -private: - QString group; - KPluginOptions *options; -}; - -/** - * dialog for embedding a PluginDomainListView widget - */ -class PluginDomainDialog : public QWidget -{ - Q_OBJECT -public: - - PluginDomainDialog(QWidget *parent); - ~PluginDomainDialog() override; - - void setMainWidget(QWidget *widget); - -private Q_SLOTS: - virtual void slotClose(); - -private: - PluginDomainListView *domainSpecific; - QBoxLayout *thisLayout; -}; - -class KPluginOptions : public KCModule -{ - Q_OBJECT - -public: - KPluginOptions(QWidget *parent, const QVariantList &); - - void load() override; - void save() override; - void defaults() override; - QString quickHelp() const override; - -private Q_SLOTS: - void slotChanged(); - void slotTogglePluginsEnabled(); - void slotShowDomainDlg(); - -private: - - KSharedConfig::Ptr m_pConfig; - QString m_groupname; - KProcess *nspluginscan; - QByteArray m_output; - - QCheckBox *enablePluginsGloballyCB, *enableHTTPOnly, *enableUserDemand; - -protected Q_SLOTS: - void progress(); - void updatePLabel(int); - void change() - { - change(true); - } - void change(bool c) - { - emit changed(c); - m_changed = c; - } - - void scan(); - void scanDone(); - -private: - Ui::NSConfigWidget m_widget; - bool m_changed; - KProgressDialog *m_progress; - QSlider *priority; - QLabel *priorityLabel; - PluginPolicies global_policies; - PluginDomainListView *domainSpecific; - KDialog *domainSpecificDlg; - - /******************************************************************************/ -protected: - void dirInit(); - void dirLoad(KSharedConfig::Ptr config, bool useDefault = false); - void dirSave(KSharedConfig::Ptr config); - -protected Q_SLOTS: - void dirNew(); - void dirRemove(); - void dirUp(); - void dirDown(); - void dirEdited(const QString &); - void dirSelect(QListWidgetItem *); - - /******************************************************************************/ -protected: - void pluginInit(); - void pluginLoad(KSharedConfig::Ptr config); - void pluginSave(KSharedConfig::Ptr config); - - friend class PluginDomainListView; -}; - -#endif // __PLUGINOPTS_H__ diff --git a/settings/konqhtml/policydlg.cpp b/settings/konqhtml/policydlg.cpp index 0f2da9fe13f141d16cdc6df3a5c6268274916467..047e257ba1a1131aabd90a9d2a929499ab161a32 100644 --- a/settings/konqhtml/policydlg.cpp +++ b/settings/konqhtml/policydlg.cpp @@ -13,6 +13,7 @@ #include #include #include +#include // KDE #include #include @@ -21,15 +22,19 @@ #include "policies.h" PolicyDialog::PolicyDialog(Policies *policies, QWidget *parent, const char *name) - : KDialog(parent), + : QDialog(parent), policies(policies) { setObjectName(name); setModal(true); - setButtons(Ok | Cancel); + setWindowTitle(i18nc("@title:window", "Domain-Specific Policies")); + + QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this); + connect(buttonBox, &QDialogButtonBox::accepted, this, &PolicyDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &PolicyDialog::reject); + okButton = buttonBox->button(QDialogButtonBox::Ok); QFrame *main = new QFrame(this); - setMainWidget(main); insertIdx = 1; // index where to insert additional panels topl = new QVBoxLayout(main); @@ -45,10 +50,9 @@ PolicyDialog::PolicyDialog(Policies *policies, QWidget *parent, const char *name le_domain = new QLineEdit(main); l->setBuddy(le_domain); grid->addWidget(le_domain, 0, 1); - connect(le_domain, SIGNAL(textChanged(QString)), - SLOT(slotTextChanged(QString))); + connect(le_domain, &QLineEdit::textChanged, this, &PolicyDialog::slotTextChanged); - le_domain->setWhatsThis(i18n("Enter the name of a host (like www.kde.org) " + le_domain->setToolTip(i18n("Enter the name of a host (like www.kde.org) " "or a domain, starting with a dot (like .kde.org or .org)")); l_feature_policy = new QLabel(main); @@ -60,9 +64,13 @@ PolicyDialog::PolicyDialog(Policies *policies, QWidget *parent, const char *name cb_feature_policy->addItems(policy_values); grid->addWidget(cb_feature_policy, 1, 1); - le_domain->setFocus(); + QVBoxLayout *vLayout = new QVBoxLayout(this); + vLayout->addWidget(main); + vLayout->addStretch(1); + vLayout->addWidget(buttonBox); - enableButtonOk(!le_domain->text().isEmpty()); + le_domain->setFocus(); + okButton->setEnabled(!le_domain->text().isEmpty()); } PolicyDialog::FeatureEnabledPolicy PolicyDialog::featureEnabledPolicy() const @@ -72,7 +80,7 @@ PolicyDialog::FeatureEnabledPolicy PolicyDialog::featureEnabledPolicy() const void PolicyDialog::slotTextChanged(const QString &text) { - enableButtonOk(!text.isEmpty()); + okButton->setEnabled(!text.isEmpty()); } void PolicyDialog::setDisableEdit(bool state, const QString &text) @@ -107,7 +115,7 @@ void PolicyDialog::setFeatureEnabledLabel(const QString &text) void PolicyDialog::setFeatureEnabledWhatsThis(const QString &text) { - cb_feature_policy->setWhatsThis(text); + cb_feature_policy->setToolTip(text); } void PolicyDialog::addPolicyPanel(QWidget *panel) @@ -141,6 +149,6 @@ void PolicyDialog::accept() } else { policies->setFeatureEnabled(true); } - KDialog::accept(); + QDialog::accept(); } diff --git a/settings/konqhtml/policydlg.h b/settings/konqhtml/policydlg.h index c6ecd5cbe073096d3afb9bb84f36d7cc1de4181f..b3241c72b5faf4172253d2b4c7c36d882cebad93 100644 --- a/settings/konqhtml/policydlg.h +++ b/settings/konqhtml/policydlg.h @@ -8,8 +8,7 @@ #ifndef _POLICYDLG_H #define _POLICYDLG_H -#include - +#include #include #include @@ -32,7 +31,7 @@ class Policies; * * @author unknown */ -class PolicyDialog : public KDialog +class PolicyDialog : public QDialog { Q_OBJECT diff --git a/settings/performance/kcmperformance.cpp b/settings/performance/kcmperformance.cpp index e39a50aa953f6b4bcde1213ebb66d6faaa0949d3..637f355f851a28077d93ce6a88942c61f20c03bd 100644 --- a/settings/performance/kcmperformance.cpp +++ b/settings/performance/kcmperformance.cpp @@ -46,10 +46,10 @@ Config::Config(QWidget *parent_P, const QVariantList &) QVBoxLayout *topLayout = new QVBoxLayout(this); QTabWidget *tabs = new QTabWidget(this); konqueror_widget = new Konqueror; - connect(konqueror_widget, SIGNAL(changed()), SLOT(changed())); + connect(konqueror_widget, &Konqueror::changed, this, &Config::markAsChanged); tabs->addTab(konqueror_widget, i18n("Konqueror")); system_widget = new SystemWidget; - connect(system_widget, SIGNAL(changed()), SLOT(changed())); + connect(system_widget, &SystemWidget::changed, this, &Config::markAsChanged); tabs->addTab(system_widget, i18n("System")); topLayout->addWidget(tabs); } @@ -83,7 +83,7 @@ KonquerorConfig::KonquerorConfig(QWidget *parent_P, const QVariantList &) QVBoxLayout *topLayout = new QVBoxLayout(this); topLayout->setContentsMargins(0, 0, 0, 0); widget = new Konqueror(this); - connect(widget, SIGNAL(changed()), SLOT(changed())); + connect(widget, &Konqueror::changed, this, &KonquerorConfig::markAsChanged); topLayout->addWidget(widget); } diff --git a/settings/performance/konqueror.cpp b/settings/performance/konqueror.cpp index ed8b137c01ed415aa69b6cce4b1b01cec141aa5e..411de620c9c65b2956cfee2b73695b86bac1ff8f 100644 --- a/settings/performance/konqueror.cpp +++ b/settings/performance/konqueror.cpp @@ -32,20 +32,20 @@ Konqueror::Konqueror(QWidget *parent_P) : Konqueror_ui(parent_P) { // TODO move these strings to konqueror.kcfg and use that from here - cb_preload_on_startup->setWhatsThis( + cb_preload_on_startup->setToolTip( i18n("

If enabled, an instance of Konqueror will be preloaded after the ordinary Plasma " "startup sequence.

" "

This will make the first Konqueror window open faster, but " "at the expense of longer Plasma startup times (but you will be able to work " "while it is loading, so you may not even notice that it is taking longer).

")); - cb_always_have_preloaded->setWhatsThis( + cb_always_have_preloaded->setToolTip( i18n("

If enabled, Konqueror will always try to have one preloaded instance ready; " "preloading a new instance in the background whenever there is not one available, " "so that windows will always open quickly.

" "

Warning: In some cases, it is actually possible that this will " "reduce perceived performance.

")); - connect(cb_preload_on_startup, SIGNAL(toggled(bool)), SIGNAL(changed())); - connect(cb_always_have_preloaded, SIGNAL(toggled(bool)), SIGNAL(changed())); + connect(cb_preload_on_startup, &QAbstractButton::toggled, this, &Konqueror::changed); + connect(cb_always_have_preloaded, &QAbstractButton::toggled, this, &Konqueror::changed); defaults(); } diff --git a/settings/performance/system.cpp b/settings/performance/system.cpp index 1de7756a90a0bb7174513963f9637f2599d491df..cb3032100fcbb4741a0313a74b9665b2e2131465 100644 --- a/settings/performance/system.cpp +++ b/settings/performance/system.cpp @@ -45,9 +45,9 @@ SystemWidget::SystemWidget(QWidget *parent_P) "

Changes of system configuration mostly happen by (un)installing applications." " It is therefore recommended to turn this option temporarily off while" " (un)installing applications.

"); - cb_disable_kbuildsycoca->setWhatsThis(tmp); - label_kbuildsycoca->setWhatsThis(tmp); - connect(cb_disable_kbuildsycoca, SIGNAL(clicked()), SIGNAL(changed())); + cb_disable_kbuildsycoca->setToolTip(tmp); + label_kbuildsycoca->setToolTip(tmp); + connect(cb_disable_kbuildsycoca, &QAbstractButton::clicked, this, &SystemWidget::changed); defaults(); }