summaryrefslogtreecommitdiffstats
path: root/kcontrol/konqhtml
diff options
context:
space:
mode:
Diffstat (limited to 'kcontrol/konqhtml')
-rw-r--r--kcontrol/konqhtml/Makefile.am26
-rw-r--r--kcontrol/konqhtml/advancedTabDialog.cpp121
-rw-r--r--kcontrol/konqhtml/advancedTabDialog.h45
-rw-r--r--kcontrol/konqhtml/advancedTabOptions.ui155
-rw-r--r--kcontrol/konqhtml/appearance.cpp417
-rw-r--r--kcontrol/konqhtml/appearance.h70
-rw-r--r--kcontrol/konqhtml/domainlistview.cpp230
-rw-r--r--kcontrol/konqhtml/domainlistview.h209
-rw-r--r--kcontrol/konqhtml/filteropts.cpp327
-rw-r--r--kcontrol/konqhtml/filteropts.h74
-rw-r--r--kcontrol/konqhtml/htmlopts.cpp365
-rw-r--r--kcontrol/konqhtml/htmlopts.h68
-rw-r--r--kcontrol/konqhtml/javaopts.cpp337
-rw-r--r--kcontrol/konqhtml/javaopts.h126
-rw-r--r--kcontrol/konqhtml/jsopts.cpp231
-rw-r--r--kcontrol/konqhtml/jsopts.h90
-rw-r--r--kcontrol/konqhtml/jspolicies.cpp407
-rw-r--r--kcontrol/konqhtml/jspolicies.h270
-rw-r--r--kcontrol/konqhtml/khtml_behavior.desktop231
-rw-r--r--kcontrol/konqhtml/khtml_filter.desktop145
-rw-r--r--kcontrol/konqhtml/khtml_fonts.desktop230
-rw-r--r--kcontrol/konqhtml/khtml_java_js.desktop211
-rw-r--r--kcontrol/konqhtml/khttpoptdlg.cpp81
-rw-r--r--kcontrol/konqhtml/khttpoptdlg.h49
-rw-r--r--kcontrol/konqhtml/main.cpp171
-rw-r--r--kcontrol/konqhtml/main.h60
-rw-r--r--kcontrol/konqhtml/nsconfigwidget.ui273
-rw-r--r--kcontrol/konqhtml/pluginopts.cpp659
-rw-r--r--kcontrol/konqhtml/pluginopts.h163
-rw-r--r--kcontrol/konqhtml/policies.cpp74
-rw-r--r--kcontrol/konqhtml/policies.h134
-rw-r--r--kcontrol/konqhtml/policydlg.cpp128
-rw-r--r--kcontrol/konqhtml/policydlg.h130
-rw-r--r--kcontrol/konqhtml/uninstall.desktop2
34 files changed, 6309 insertions, 0 deletions
diff --git a/kcontrol/konqhtml/Makefile.am b/kcontrol/konqhtml/Makefile.am
new file mode 100644
index 000000000..87cf8a664
--- /dev/null
+++ b/kcontrol/konqhtml/Makefile.am
@@ -0,0 +1,26 @@
+AM_CPPFLAGS = -I$(top_srcdir)/libkonq -I$(top_srcdir)/kcontrol/input $(all_includes)
+AM_LDFLAGS = $(all_libraries)
+
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES = kcm_konqhtml.la
+
+kcm_konqhtml_la_SOURCES = advancedTabDialog.cpp htmlopts.cpp jsopts.cpp \
+ javaopts.cpp pluginopts.cpp appearance.cpp \
+ khttpoptdlg.cpp policydlg.cpp main.cpp \
+ jspolicies.cpp nsconfigwidget.ui policies.cpp \
+ domainlistview.cpp advancedTabOptions.ui \
+ filteropts.cpp
+
+kcm_konqhtml_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
+kcm_konqhtml_la_LIBADD = -lkhtml -lkdeui
+
+xdg_apps_DATA = khtml_behavior.desktop khtml_java_js.desktop khtml_fonts.desktop khtml_filter.desktop
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/kcmkonqhtml.pot
+
+install-data-local: uninstall.desktop
+ $(mkinstalldirs) $(DESTDIR)$(kde_appsdir)/Settings/WebBrowsing
+ $(INSTALL_DATA) $(srcdir)/uninstall.desktop $(DESTDIR)$(kde_appsdir)/Settings/WebBrowsing/nsplugin.desktop
+ $(INSTALL_DATA) $(srcdir)/uninstall.desktop $(DESTDIR)$(kde_appsdir)/Settings/WebBrowsing/khtml_appearance.desktop
diff --git a/kcontrol/konqhtml/advancedTabDialog.cpp b/kcontrol/konqhtml/advancedTabDialog.cpp
new file mode 100644
index 000000000..93a576043
--- /dev/null
+++ b/kcontrol/konqhtml/advancedTabDialog.cpp
@@ -0,0 +1,121 @@
+/*
+ * advancedTabDialog.cpp
+ *
+ * Copyright (c) 2002 Aaron J. Seigo <aseigo@olympusproject.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ */
+
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qslider.h>
+
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <kcolorbutton.h>
+#include <klocale.h>
+#include <kconfig.h>
+
+#include "advancedTabDialog.h"
+#include "advancedTabOptions.h"
+#include "main.h"
+
+advancedTabDialog::advancedTabDialog(QWidget* parent, KConfig* config, const char* name)
+ : KDialogBase(KDialogBase::Plain,
+ i18n("Advanced Options"),
+ KDialogBase::Ok |
+ KDialogBase::Apply |
+ KDialogBase::Cancel,
+ KDialogBase::Ok,
+ parent,
+ name,
+ true, true),
+ m_pConfig(config)
+{
+ connect(this, SIGNAL(applyClicked()),
+ this, SLOT(save()));
+ connect(this, SIGNAL(okClicked()),
+ this, SLOT(save()));
+ actionButton(Apply)->setEnabled(false);
+ QFrame* page = plainPage();
+ QVBoxLayout* layout = new QVBoxLayout(page);
+ m_advancedWidget = new advancedTabOptions(page);
+ layout->addWidget(m_advancedWidget);
+ layout->addSpacing( 20 );
+ layout->addStretch();
+
+ connect(m_advancedWidget->m_pNewTabsInBackground, SIGNAL(clicked()), this, SLOT(changed()));
+ connect(m_advancedWidget->m_pOpenAfterCurrentPage, SIGNAL(clicked()), this, SLOT(changed()));
+ connect(m_advancedWidget->m_pTabConfirm, SIGNAL(clicked()), this, SLOT(changed()));
+ connect(m_advancedWidget->m_pTabCloseActivatePrevious, SIGNAL(clicked()), this, SLOT(changed()));
+ connect(m_advancedWidget->m_pPermanentCloseButton, SIGNAL(clicked()), this, SLOT(changed()));
+ connect(m_advancedWidget->m_pKonquerorTabforExternalURL, SIGNAL(clicked()), this, SLOT(changed()));
+ connect(m_advancedWidget->m_pPopupsWithinTabs, SIGNAL(clicked()), this, SLOT(changed()));
+
+ load();
+}
+
+advancedTabDialog::~advancedTabDialog()
+{
+}
+
+void advancedTabDialog::load()
+{
+ m_pConfig->setGroup("FMSettings");
+ m_advancedWidget->m_pNewTabsInBackground->setChecked( ! (m_pConfig->readBoolEntry( "NewTabsInFront", false )) );
+ m_advancedWidget->m_pOpenAfterCurrentPage->setChecked( m_pConfig->readBoolEntry( "OpenAfterCurrentPage", false ) );
+ m_advancedWidget->m_pPermanentCloseButton->setChecked( m_pConfig->readBoolEntry( "PermanentCloseButton", false ) );
+ m_advancedWidget->m_pKonquerorTabforExternalURL->setChecked( m_pConfig->readBoolEntry( "KonquerorTabforExternalURL", false ) );
+ m_advancedWidget->m_pPopupsWithinTabs->setChecked( m_pConfig->readBoolEntry( "PopupsWithinTabs", false ) );
+ m_advancedWidget->m_pTabCloseActivatePrevious->setChecked( m_pConfig->readBoolEntry( "TabCloseActivatePrevious", false ) );
+
+ m_pConfig->setGroup("Notification Messages");
+ m_advancedWidget->m_pTabConfirm->setChecked( !m_pConfig->hasKey("MultipleTabConfirm") );
+
+ actionButton(Apply)->setEnabled(false);
+}
+
+void advancedTabDialog::save()
+{
+ m_pConfig->setGroup("FMSettings");
+ m_pConfig->writeEntry( "NewTabsInFront", !(m_advancedWidget->m_pNewTabsInBackground->isChecked()) );
+ m_pConfig->writeEntry( "OpenAfterCurrentPage", m_advancedWidget->m_pOpenAfterCurrentPage->isChecked() );
+ m_pConfig->writeEntry( "PermanentCloseButton", m_advancedWidget->m_pPermanentCloseButton->isChecked() );
+ m_pConfig->writeEntry( "KonquerorTabforExternalURL", m_advancedWidget->m_pKonquerorTabforExternalURL->isChecked() );
+ m_pConfig->writeEntry( "PopupsWithinTabs", m_advancedWidget->m_pPopupsWithinTabs->isChecked() );
+ m_pConfig->writeEntry( "TabCloseActivatePrevious", m_advancedWidget->m_pTabCloseActivatePrevious->isChecked() );
+ m_pConfig->sync();
+
+ // It only matters wether the key is present, its value has no meaning
+ m_pConfig->setGroup("Notification Messages");
+ if ( m_advancedWidget->m_pTabConfirm->isChecked() ) m_pConfig->deleteEntry( "MultipleTabConfirm" );
+ else m_pConfig->writeEntry( "MultipleTabConfirm", true );
+
+ QByteArray data;
+ if ( !KApplication::kApplication()->dcopClient()->isAttached() )
+ kapp->dcopClient()->attach();
+ KApplication::kApplication()->dcopClient()->send( "konqueror*", "KonquerorIface", "reparseConfiguration()", data );
+
+ actionButton(Apply)->setEnabled(false);
+}
+
+void advancedTabDialog::changed()
+{
+ actionButton(Apply)->setEnabled(true);
+}
+
+#include "advancedTabDialog.moc"
diff --git a/kcontrol/konqhtml/advancedTabDialog.h b/kcontrol/konqhtml/advancedTabDialog.h
new file mode 100644
index 000000000..728e8928b
--- /dev/null
+++ b/kcontrol/konqhtml/advancedTabDialog.h
@@ -0,0 +1,45 @@
+/*
+ * advancedTabDialog.h
+ *
+ * Copyright (c) 2002 Aaron J. Seigo <aseigo@olympusproject.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ */
+
+#ifndef __ADVANCEDTABDIALOG_H
+#define __ADVANCEDTABDIALOG_H
+
+#include <kdialogbase.h>
+
+class advancedTabOptions;
+
+class advancedTabDialog : public KDialogBase
+{
+ Q_OBJECT
+
+ public:
+ advancedTabDialog(QWidget* parent, KConfig *config, const char* name);
+ ~advancedTabDialog();
+
+ protected slots:
+ void load();
+ void save();
+ void changed();
+
+ private:
+ KConfig* m_pConfig;
+ advancedTabOptions* m_advancedWidget;
+};
+
+#endif
diff --git a/kcontrol/konqhtml/advancedTabOptions.ui b/kcontrol/konqhtml/advancedTabOptions.ui
new file mode 100644
index 000000000..7116bc1ee
--- /dev/null
+++ b/kcontrol/konqhtml/advancedTabOptions.ui
@@ -0,0 +1,155 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>advancedTabOptions</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>advancedTabOptions</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>644</width>
+ <height>208</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Advanced Options&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>Line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pNewTabsInBackground</cstring>
+ </property>
+ <property name="text">
+ <string>O&amp;pen new tabs in the background</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This will open a new tab in the background, instead of in the foreground.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pOpenAfterCurrentPage</cstring>
+ </property>
+ <property name="text">
+ <string>Open &amp;new tab after current tab</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This will open a new tab opened from a page after the current tab, instead of after the last tab.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pTabConfirm</cstring>
+ </property>
+ <property name="text">
+ <string>Confirm &amp;when closing windows with multiple tabs</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This will ask you whether you are sure you want to close a window when it has multiple tabs opened in it.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pPermanentCloseButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Show close button instead of website icon</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This will display close buttons inside each tab instead of websites' icons.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pPopupsWithinTabs</cstring>
+ </property>
+ <property name="text">
+ <string>Open pop&amp;ups in new tab instead of in new window</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Whether or not JavaScript popups if allowed shall open in a new tab or in a new window.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pTabCloseActivatePrevious</cstring>
+ </property>
+ <property name="text">
+ <string>Activate previous used tab when closing the current tab</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>When checking this the previous used or opened tab will be activated when you close the current active tab instead of the one right to the current tab.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pKonquerorTabforExternalURL</cstring>
+ </property>
+ <property name="text">
+ <string>Open as tab in existing Konqueror when URL is called externally</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>When you click a URL in another KDE program or call kfmclient to open a URL, the current desktop will be searched for a non-minimized Konqueror and, if found, the URL opened as a new tab within it. Otherwise a new Konqueror window will be opened with the required URL.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<includes>
+ <include location="local" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="3" margin="6"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/kcontrol/konqhtml/appearance.cpp b/kcontrol/konqhtml/appearance.cpp
new file mode 100644
index 000000000..15cbd036a
--- /dev/null
+++ b/kcontrol/konqhtml/appearance.cpp
@@ -0,0 +1,417 @@
+
+#include <qfontdatabase.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qvgroupbox.h>
+#include <qwhatsthis.h>
+
+#include <dcopclient.h>
+
+#include <kapplication.h>
+#include <kcharsets.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kdialog.h>
+#include <kfontcombo.h>
+#include <kglobal.h>
+#include <khtmldefaults.h>
+#include <klocale.h>
+#include <knuminput.h>
+
+#if defined Q_WS_X11 && !defined K_WS_QTONLY
+#include <X11/Xlib.h>
+#endif
+
+
+#include "appearance.moc"
+
+KAppearanceOptions::KAppearanceOptions(KConfig *config, QString group, QWidget *parent, const char *)
+ : KCModule( parent, "kcmkonqhtml" ), m_pConfig(config), m_groupname(group),
+ fSize( 10 ), fMinSize( HTML_DEFAULT_MIN_FONT_SIZE )
+
+{
+ setQuickHelp( i18n("<h1>Konqueror Fonts</h1>On this page, you can configure "
+ "which fonts Konqueror should use to display the web "
+ "pages you view."));
+
+ QString wtstr;
+
+ QGridLayout *lay = new QGridLayout(this, 1 ,1 , 0, KDialog::spacingHint());
+ int r = 0;
+ int E = 0, M = 1, W = 3; //CT 3 (instead 2) allows smaller color buttons
+
+ QGroupBox* gb = new QGroupBox( 1, QGroupBox::Horizontal, i18n("Font Si&ze"), this );
+ lay->addMultiCellWidget(gb, r, r, E, W);
+
+ QWhatsThis::add( gb, i18n("This is the relative font size Konqueror uses to display web sites.") );
+
+ m_minSize = new KIntNumInput( fMinSize, gb );
+ m_minSize->setLabel( i18n( "M&inimum font size:" ) );
+ m_minSize->setRange( 2, 30 );
+ connect( m_minSize, SIGNAL( valueChanged( int ) ), this, SLOT( slotMinimumFontSize( int ) ) );
+ connect( m_minSize, SIGNAL( valueChanged( int ) ), this, SLOT( changed() ) );
+ QWhatsThis::add( m_minSize, i18n( "Konqueror will never display text smaller than "
+ "this size,<br>overriding any other settings" ) );
+
+ m_MedSize = new KIntNumInput( m_minSize, fSize, gb );
+ m_MedSize->setLabel( i18n( "&Medium font size:" ) );
+ m_MedSize->setRange( 2, 30 );
+ connect( m_MedSize, SIGNAL( valueChanged( int ) ), this, SLOT( slotFontSize( int ) ) );
+ connect( m_MedSize, SIGNAL( valueChanged( int ) ), this, SLOT( changed() ) );
+ QWhatsThis::add( m_MedSize,
+ i18n("This is the relative font size Konqueror uses "
+ "to display web sites.") );
+
+ QStringList emptyList;
+
+ QLabel* label = new QLabel( i18n("S&tandard font:"), this );
+ lay->addWidget( label , ++r, E);
+
+ m_pFonts[0] = new KFontCombo( emptyList, this );
+
+ label->setBuddy( m_pFonts[0] );
+ lay->addMultiCellWidget(m_pFonts[0], r, r, M, W);
+
+ wtstr = i18n("This is the font used to display normal text in a web page.");
+ QWhatsThis::add( label, wtstr );
+ QWhatsThis::add( m_pFonts[0], wtstr );
+
+ connect( m_pFonts[0], SIGNAL( activated(const QString&) ),
+ SLOT( slotStandardFont(const QString&) ) );
+ connect( m_pFonts[0], SIGNAL( activated(const QString&) ),
+ SLOT(changed() ) );
+ connect( m_pFonts[0]->lineEdit(), SIGNAL( textChanged(const QString&) ),
+ SLOT( slotStandardFont(const QString&) ) );
+ connect( m_pFonts[0], SIGNAL( textChanged(const QString&) ),
+ SLOT(changed() ) );
+
+ label = new QLabel( i18n( "&Fixed font:"), this );
+ lay->addWidget( label, ++r, E );
+
+ m_pFonts[1] = new KFontCombo( emptyList, this );
+
+ label->setBuddy( m_pFonts[1] );
+ lay->addMultiCellWidget(m_pFonts[1], r, r, M, W);
+
+ wtstr = i18n("This is the font used to display fixed-width (i.e. non-proportional) text.");
+ QWhatsThis::add( label, wtstr );
+ QWhatsThis::add( m_pFonts[1], wtstr );
+
+ connect( m_pFonts[1], SIGNAL( activated(const QString&) ),
+ SLOT( slotFixedFont(const QString&) ) );
+ connect( m_pFonts[1], SIGNAL( activated(const QString&) ),
+ SLOT(changed() ) );
+ connect( m_pFonts[1]->lineEdit(), SIGNAL( textChanged(const QString&) ),
+ SLOT( slotFixedFont(const QString&) ) );
+ connect( m_pFonts[1], SIGNAL( textChanged(const QString&) ),
+ SLOT(changed() ) );
+
+ label = new QLabel( i18n( "S&erif font:" ), this );
+ lay->addWidget( label, ++r, E );
+
+ m_pFonts[2] = new KFontCombo( emptyList, this );
+
+ label->setBuddy( m_pFonts[2] );
+ lay->addMultiCellWidget( m_pFonts[2], r, r, M, W );
+
+ wtstr= i18n( "This is the font used to display text that is marked up as serif." );
+ QWhatsThis::add( label, wtstr );
+ QWhatsThis::add( m_pFonts[2], wtstr );
+
+ connect( m_pFonts[2], SIGNAL( activated( const QString& ) ),
+ SLOT( slotSerifFont( const QString& ) ) );
+ connect( m_pFonts[2], SIGNAL( activated( const QString& ) ),
+ SLOT( changed() ) );
+ connect( m_pFonts[2]->lineEdit(), SIGNAL( textChanged(const QString&) ),
+ SLOT( slotSerifFont(const QString&) ) );
+ connect( m_pFonts[2], SIGNAL( textChanged(const QString&) ),
+ SLOT(changed() ) );
+
+ label = new QLabel( i18n( "Sa&ns serif font:" ), this );
+ lay->addWidget( label, ++r, E );
+
+ m_pFonts[3] = new KFontCombo( emptyList, this );
+
+ label->setBuddy( m_pFonts[3] );
+ lay->addMultiCellWidget( m_pFonts[3], r, r, M, W );
+
+ wtstr= i18n( "This is the font used to display text that is marked up as sans-serif." );
+ QWhatsThis::add( label, wtstr );
+ QWhatsThis::add( m_pFonts[3], wtstr );
+
+ connect( m_pFonts[3], SIGNAL( activated( const QString& ) ),
+ SLOT( slotSansSerifFont( const QString& ) ) );
+ connect( m_pFonts[3], SIGNAL( activated( const QString& ) ),
+ SLOT( changed() ) );
+ connect( m_pFonts[3]->lineEdit(), SIGNAL( textChanged(const QString&) ),
+ SLOT( slotSansSerifFont(const QString&) ) );
+ connect( m_pFonts[3], SIGNAL( textChanged(const QString&) ),
+ SLOT(changed() ) );
+
+
+ label = new QLabel( i18n( "C&ursive font:" ), this );
+ lay->addWidget( label, ++r, E );
+
+ m_pFonts[4] = new KFontCombo( emptyList, this );
+
+ label->setBuddy( m_pFonts[4] );
+ lay->addMultiCellWidget( m_pFonts[4], r, r, M, W );
+
+ wtstr= i18n( "This is the font used to display text that is marked up as italic." );
+ QWhatsThis::add( label, wtstr );
+ QWhatsThis::add( m_pFonts[4], wtstr );
+
+ connect( m_pFonts[4], SIGNAL( activated( const QString& ) ),
+ SLOT( slotCursiveFont( const QString& ) ) );
+ connect( m_pFonts[4], SIGNAL( activated( const QString& ) ),
+ SLOT( changed() ) );
+ connect( m_pFonts[4]->lineEdit(), SIGNAL( textChanged(const QString&) ),
+ SLOT( slotCursiveFont(const QString&) ) );
+ connect( m_pFonts[4], SIGNAL( textChanged(const QString&) ),
+ SLOT(changed() ) );
+
+
+ label = new QLabel( i18n( "Fantas&y font:" ), this );
+ lay->addWidget( label, ++r, E );
+
+ m_pFonts[5] = new KFontCombo( emptyList, this );
+
+ label->setBuddy( m_pFonts[5] );
+ lay->addMultiCellWidget( m_pFonts[5], r, r, M, W );
+
+ wtstr= i18n( "This is the font used to display text that is marked up as a fantasy font." );
+ QWhatsThis::add( label, wtstr );
+ QWhatsThis::add( m_pFonts[5], wtstr );
+
+ connect( m_pFonts[5], SIGNAL( activated( const QString& ) ),
+ SLOT( slotFantasyFont( const QString& ) ) );
+ connect( m_pFonts[5], SIGNAL( activated( const QString& ) ),
+ SLOT( changed() ) );
+ connect( m_pFonts[5]->lineEdit(), SIGNAL( textChanged(const QString&) ),
+ SLOT( slotFantasyFont(const QString&) ) );
+ connect( m_pFonts[5], SIGNAL( textChanged(const QString&) ),
+ SLOT(changed() ) );
+
+
+ label = new QLabel( i18n( "Font &size adjustment for this encoding:" ), this );
+ lay->addWidget( label, ++r, M );
+
+ m_pFontSizeAdjust = new QSpinBox( -5, 5, 1, this );
+ label->setBuddy( m_pFontSizeAdjust );
+ lay->addMultiCellWidget( m_pFontSizeAdjust, r, r, M+1, W );
+
+ connect( m_pFontSizeAdjust, SIGNAL( valueChanged( int ) ),
+ SLOT( slotFontSizeAdjust( int ) ) );
+ connect( m_pFontSizeAdjust, SIGNAL( valueChanged( int ) ),
+ SLOT( changed() ) );
+
+ label = new QLabel( i18n( "Default encoding:"), this );
+ //++r;
+ //lay->addMultiCellWidget( label, r, r, E, E+1);
+ lay->addWidget( label, ++r, E);
+
+ m_pEncoding = new QComboBox( false, this );
+ label->setBuddy( m_pEncoding );
+ encodings = KGlobal::charsets()->availableEncodingNames();
+ encodings.prepend(i18n("Use Language Encoding"));
+ m_pEncoding->insertStringList( encodings );
+ lay->addMultiCellWidget(m_pEncoding,r, r, M, W);
+
+ wtstr = i18n( "Select the default encoding to be used; normally, you will be fine with 'Use language encoding' "
+ "and should not have to change this.");
+ QWhatsThis::add( label, wtstr );
+ QWhatsThis::add( m_pEncoding, wtstr );
+
+ connect( m_pEncoding, SIGNAL( activated(const QString& ) ),
+ SLOT( slotEncoding(const QString&) ) );
+ connect( m_pEncoding, SIGNAL( activated(const QString& ) ),
+ SLOT( changed() ) );
+
+ ++r; lay->setRowStretch(r, 8);
+
+ QFontDatabase db;
+
+ m_families = db.families();
+
+ m_pFonts[0]->setFonts( m_families );
+ m_pFonts[1]->setFonts( m_families );
+ m_pFonts[2]->setFonts( m_families );
+ m_pFonts[3]->setFonts( m_families );
+ m_pFonts[4]->setFonts( m_families );
+ m_pFonts[5]->setFonts( m_families );
+
+ load();
+}
+
+KAppearanceOptions::~KAppearanceOptions()
+{
+delete m_pConfig;
+}
+
+void KAppearanceOptions::slotFontSize( int i )
+{
+ fSize = i;
+ if ( fSize < fMinSize ) {
+ m_minSize->setValue( fSize );
+ fMinSize = fSize;
+ }
+}
+
+
+void KAppearanceOptions::slotMinimumFontSize( int i )
+{
+ fMinSize = i;
+ if ( fMinSize > fSize ) {
+ m_MedSize->setValue( fMinSize );
+ fSize = fMinSize;
+ }
+}
+
+
+void KAppearanceOptions::slotStandardFont(const QString& n )
+{
+ fonts[0] = n;
+}
+
+
+void KAppearanceOptions::slotFixedFont(const QString& n )
+{
+ fonts[1] = n;
+}
+
+
+void KAppearanceOptions::slotSerifFont( const QString& n )
+{
+ fonts[2] = n;
+}
+
+
+void KAppearanceOptions::slotSansSerifFont( const QString& n )
+{
+ fonts[3] = n;
+}
+
+
+void KAppearanceOptions::slotCursiveFont( const QString& n )
+{
+ fonts[4] = n;
+}
+
+
+void KAppearanceOptions::slotFantasyFont( const QString& n )
+{
+ fonts[5] = n;
+}
+
+void KAppearanceOptions::slotFontSizeAdjust( int value )
+{
+ fonts[6] = QString::number( value );
+}
+
+void KAppearanceOptions::slotEncoding(const QString& n)
+{
+ encodingName = n;
+}
+
+void KAppearanceOptions::load()
+{
+ load( false );
+}
+
+void KAppearanceOptions::load( bool useDefaults )
+{
+ KConfig khtmlrc("khtmlrc", true, false);
+ m_pConfig->setReadDefaults( useDefaults );
+
+ khtmlrc.setReadDefaults( useDefaults );
+
+#define SET_GROUP(x) m_pConfig->setGroup(x); khtmlrc.setGroup(x)
+#define READ_NUM(x,y) m_pConfig->readNumEntry(x, khtmlrc.readNumEntry(x, y))
+#define READ_ENTRY(x,y) m_pConfig->readEntry(x, khtmlrc.readEntry(x, y))
+#define READ_LIST(x) m_pConfig->readListEntry(x, khtmlrc.readListEntry(x))
+
+ SET_GROUP(m_groupname);
+ fSize = READ_NUM( "MediumFontSize", 12 );
+ fMinSize = READ_NUM( "MinimumFontSize", HTML_DEFAULT_MIN_FONT_SIZE );
+ if (fSize < fMinSize)
+ fSize = fMinSize;
+
+ defaultFonts = QStringList();
+ defaultFonts.append( READ_ENTRY( "StandardFont", KGlobalSettings::generalFont().family() ) );
+ defaultFonts.append( READ_ENTRY( "FixedFont", KGlobalSettings::fixedFont().family() ) );
+ defaultFonts.append( READ_ENTRY( "SerifFont", HTML_DEFAULT_VIEW_SERIF_FONT ) );
+ defaultFonts.append( READ_ENTRY( "SansSerifFont", HTML_DEFAULT_VIEW_SANSSERIF_FONT ) );
+ defaultFonts.append( READ_ENTRY( "CursiveFont", HTML_DEFAULT_VIEW_CURSIVE_FONT ) );
+ defaultFonts.append( READ_ENTRY( "FantasyFont", HTML_DEFAULT_VIEW_FANTASY_FONT ) );
+ defaultFonts.append( QString("0") ); // default font size adjustment
+
+ if (m_pConfig->hasKey("Fonts"))
+ fonts = m_pConfig->readListEntry( "Fonts" );
+ else
+ fonts = khtmlrc.readListEntry( "Fonts" );
+ while (fonts.count() < 7)
+ fonts.append(QString::null);
+
+ encodingName = READ_ENTRY( "DefaultEncoding", QString::null );
+ //kdDebug(0) << "encoding = " << encodingName << endl;
+
+ updateGUI();
+ emit changed( useDefaults );
+
+#undef SET_GROUP
+#undef READ_NUM
+#undef READ_ENTRY
+#undef READ_LIST
+}
+
+void KAppearanceOptions::defaults()
+{
+ load( true );
+}
+
+void KAppearanceOptions::updateGUI()
+{
+ //kdDebug() << "KAppearanceOptions::updateGUI " << charset << endl;
+ for ( int f = 0; f < 6; f++ ) {
+ QString ff = fonts[f];
+ if (ff.isEmpty())
+ ff = defaultFonts[f];
+ m_pFonts[f]->setCurrentFont(ff);
+ }
+
+ int i = 0;
+ for ( QStringList::Iterator it = encodings.begin(); it != encodings.end(); ++it, ++i )
+ if ( encodingName == *it )
+ m_pEncoding->setCurrentItem( i );
+ if(encodingName.isEmpty())
+ m_pEncoding->setCurrentItem( 0 );
+ m_pFontSizeAdjust->setValue( fonts[6].toInt() );
+ m_MedSize->blockSignals(true);
+ m_MedSize->setValue( fSize );
+ m_MedSize->blockSignals(false);
+ m_minSize->blockSignals(true);
+ m_minSize->setValue( fMinSize );
+ m_minSize->blockSignals(false);
+}
+
+void KAppearanceOptions::save()
+{
+ m_pConfig->setGroup(m_groupname);
+ m_pConfig->writeEntry( "MediumFontSize", fSize );
+ m_pConfig->writeEntry( "MinimumFontSize", fMinSize );
+ m_pConfig->writeEntry( "Fonts", fonts );
+
+ // If the user chose "Use language encoding", write an empty string
+ if (encodingName == i18n("Use Language Encoding"))
+ encodingName = "";
+ m_pConfig->writeEntry( "DefaultEncoding", encodingName );
+ m_pConfig->sync();
+
+ QByteArray data;
+ if ( !kapp->dcopClient()->isAttached() )
+ kapp->dcopClient()->attach();
+ kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "reparseConfiguration()", data );
+
+ emit changed(false);
+}
+
diff --git a/kcontrol/konqhtml/appearance.h b/kcontrol/konqhtml/appearance.h
new file mode 100644
index 000000000..dd16626bd
--- /dev/null
+++ b/kcontrol/konqhtml/appearance.h
@@ -0,0 +1,70 @@
+// -*- c-basic-offset: 2 -*-
+// (c) Martin R. Jones 1996
+// (c) Bernd Wuebben 1998
+// KControl port & modifications
+// (c) Torben Weis 1998
+// End of the KControl port, added 'kfmclient configure' call.
+// (c) David Faure 1998
+// Cleanup and modifications for KDE 2.1
+// (c) Daniel Molkentin 2000
+
+#ifndef __APPEARANCE_H__
+#define __APPEARANCE_H__
+
+#include <qwidget.h>
+#include <qmap.h>
+
+#include <kcmodule.h>
+
+class QSpinBox;
+class KFontCombo;
+
+class KAppearanceOptions : public KCModule
+{
+ Q_OBJECT
+public:
+ KAppearanceOptions(KConfig *config, QString group, QWidget *parent=0, const char *name=0);
+ ~KAppearanceOptions();
+
+ virtual void load();
+ virtual void load( bool useDefaults );
+ virtual void save();
+ virtual void defaults();
+
+public slots:
+ void slotFontSize( int );
+ void slotMinimumFontSize( int );
+ void slotStandardFont(const QString& n);
+ void slotFixedFont(const QString& n);
+ void slotSerifFont( const QString& n );
+ void slotSansSerifFont( const QString& n );
+ void slotCursiveFont( const QString& n );
+ void slotFantasyFont( const QString& n );
+ void slotEncoding( const QString& n);
+ void slotFontSizeAdjust( int value );
+
+private:
+ void updateGUI();
+
+private:
+
+ KConfig *m_pConfig;
+ QString m_groupname;
+ QStringList m_families;
+
+ KIntNumInput* m_minSize;
+ KIntNumInput* m_MedSize;
+ KIntNumInput* m_pageDPI;
+ KFontCombo* m_pFonts[6];
+ QComboBox* m_pEncoding;
+ QSpinBox *m_pFontSizeAdjust;
+
+ int fSize;
+ int fMinSize;
+ QStringList encodings;
+ QStringList fonts;
+ QStringList defaultFonts;
+ QString encodingName;
+};
+
+#endif // __APPEARANCE_H__
diff --git a/kcontrol/konqhtml/domainlistview.cpp b/kcontrol/konqhtml/domainlistview.cpp
new file mode 100644
index 000000000..a55221f43
--- /dev/null
+++ b/kcontrol/konqhtml/domainlistview.cpp
@@ -0,0 +1,230 @@
+/*
+ Copyright (c) 2002 Leo Savernik <l.savernik@aon.at>
+ Derived from jsopts.cpp and javaopts.cpp, code copied from there is
+ copyrighted to its respective owners.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qwhatsthis.h>
+
+#include <kconfig.h>
+#include <klistview.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+#include "domainlistview.h"
+#include "policies.h"
+#include "policydlg.h"
+
+DomainListView::DomainListView(KConfig *config,const QString &title,
+ QWidget *parent,const char *name) :
+ QGroupBox(title, parent, name), config(config) {
+ setColumnLayout(0, Qt::Vertical);
+ layout()->setSpacing(0);
+ layout()->setMargin(0);
+ QGridLayout* thisLayout = new QGridLayout(layout());
+ thisLayout->setAlignment(Qt::AlignTop);
+ thisLayout->setSpacing(KDialog::spacingHint());
+ thisLayout->setMargin(KDialog::marginHint());
+
+ domainSpecificLV = new KListView(this);
+ domainSpecificLV->addColumn(i18n("Host/Domain"));
+ domainSpecificLV->addColumn(i18n("Policy"), 100);
+ connect(domainSpecificLV,SIGNAL(doubleClicked(QListViewItem *)), SLOT(changePressed()));
+ connect(domainSpecificLV,SIGNAL(returnPressed(QListViewItem *)), SLOT(changePressed()));
+ connect(domainSpecificLV, SIGNAL( executed( QListViewItem *)), SLOT( updateButton()));
+ connect(domainSpecificLV, SIGNAL(selectionChanged()), SLOT(updateButton()));
+ thisLayout->addMultiCellWidget(domainSpecificLV, 0, 5, 0, 0);
+
+ addDomainPB = new QPushButton(i18n("&New..."), this);
+ thisLayout->addWidget(addDomainPB, 0, 1);
+ connect(addDomainPB, SIGNAL(clicked()), SLOT(addPressed()));
+
+ changeDomainPB = new QPushButton( i18n("Chan&ge..."), this);
+ thisLayout->addWidget(changeDomainPB, 1, 1);
+ connect(changeDomainPB, SIGNAL(clicked()), this, SLOT(changePressed()));
+
+ deleteDomainPB = new QPushButton(i18n("De&lete"), this);
+ thisLayout->addWidget(deleteDomainPB, 2, 1);
+ connect(deleteDomainPB, SIGNAL(clicked()), this, SLOT(deletePressed()));
+
+ importDomainPB = new QPushButton(i18n("&Import..."), this);
+ thisLayout->addWidget(importDomainPB, 3, 1);
+ connect(importDomainPB, SIGNAL(clicked()), this, SLOT(importPressed()));
+ importDomainPB->setEnabled(false);
+ importDomainPB->hide();
+
+ exportDomainPB = new QPushButton(i18n("&Export..."), this);
+ thisLayout->addWidget(exportDomainPB, 4, 1);
+ connect(exportDomainPB, SIGNAL(clicked()), this, SLOT(exportPressed()));
+ exportDomainPB->setEnabled(false);
+ exportDomainPB->hide();
+
+ QSpacerItem* spacer = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding);
+ thisLayout->addItem(spacer, 5, 1);
+
+ QWhatsThis::add( addDomainPB, i18n("Click on this button to manually add a host or domain "
+ "specific policy.") );
+ QWhatsThis::add( changeDomainPB, i18n("Click on this button to change the policy for the "
+ "host or domain selected in the list box.") );
+ QWhatsThis::add( deleteDomainPB, i18n("Click on this button to delete the policy for the "
+ "host or domain selected in the list box.") );
+ updateButton();
+}
+
+DomainListView::~DomainListView() {
+ // free all policies
+ DomainPolicyMap::Iterator it = domainPolicies.begin();
+ for (; it != domainPolicies.end(); ++it) {
+ delete it.data();
+ }/*next it*/
+}
+
+void DomainListView::updateButton()
+{
+ QListViewItem *index = domainSpecificLV->currentItem();
+ bool enable = ( index != 0 );
+ changeDomainPB->setEnabled( enable );
+ deleteDomainPB->setEnabled( enable );
+
+}
+
+void DomainListView::addPressed()
+{
+// JavaPolicies pol_copy(m_pConfig,m_groupname,false);
+ Policies *pol = createPolicies();
+ pol->defaults();
+ PolicyDialog pDlg(pol, this);
+ setupPolicyDlg(AddButton,pDlg,pol);
+ if( pDlg.exec() ) {
+ QListViewItem* index = new QListViewItem( domainSpecificLV, pDlg.domain(),
+ pDlg.featureEnabledPolicyText() );
+ pol->setDomain(pDlg.domain());
+ domainPolicies.insert(index, pol);
+ domainSpecificLV->setCurrentItem( index );
+ emit changed(true);
+ } else {
+ delete pol;
+ }
+ updateButton();
+}
+
+void DomainListView::changePressed()
+{
+ QListViewItem *index = domainSpecificLV->currentItem();
+ if ( index == 0 )
+ {
+ KMessageBox::information( 0, i18n("You must first select a policy to be changed." ) );
+ return;
+ }
+
+ Policies *pol = domainPolicies[index];
+ // This must be copied because the policy dialog is allowed to change
+ // the data even if the changes are rejected in the end.
+ Policies *pol_copy = copyPolicies(pol);
+
+ PolicyDialog pDlg( pol_copy, this );
+ pDlg.setDisableEdit( true, index->text(0) );
+ setupPolicyDlg(ChangeButton,pDlg,pol_copy);
+ if( pDlg.exec() )
+ {
+ pol_copy->setDomain(pDlg.domain());
+ domainPolicies[index] = pol_copy;
+ pol_copy = pol;
+ index->setText(0, pDlg.domain() );
+ index->setText(1, pDlg.featureEnabledPolicyText());
+ emit changed(true);
+ }
+ delete pol_copy;
+}
+
+void DomainListView::deletePressed()
+{
+ QListViewItem *index = domainSpecificLV->currentItem();
+ if ( index == 0 )
+ {
+ KMessageBox::information( 0, i18n("You must first select a policy to delete." ) );
+ return;
+ }
+
+ DomainPolicyMap::Iterator it = domainPolicies.find(index);
+ if (it != domainPolicies.end()) {
+ delete it.data();
+ domainPolicies.remove(it);
+ delete index;
+ emit changed(true);
+ }
+ updateButton();
+}
+
+void DomainListView::importPressed()
+{
+ // PENDING(kalle) Implement this.
+}
+
+void DomainListView::exportPressed()
+{
+ // PENDING(kalle) Implement this.
+}
+
+void DomainListView::initialize(const QStringList &domainList)
+{
+ domainSpecificLV->clear();
+ domainPolicies.clear();
+// JavaPolicies pol(m_pConfig,m_groupname,false);
+ for (QStringList::ConstIterator it = domainList.begin();
+ it != domainList.end(); ++it) {
+ QString domain = *it;
+ Policies *pol = createPolicies();
+ pol->setDomain(domain);
+ pol->load();
+
+ QString policy;
+ if (pol->isFeatureEnabledPolicyInherited())
+ policy = i18n("Use Global");
+ else if (pol->isFeatureEnabled())
+ policy = i18n("Accept");
+ else
+ policy = i18n("Reject");
+ QListViewItem *index =
+ new QListViewItem( domainSpecificLV, domain, policy );
+
+ domainPolicies[index] = pol;
+ }
+}
+
+void DomainListView::save(const QString &group, const QString &domainListKey) {
+ QStringList domainList;
+ DomainPolicyMap::Iterator it = domainPolicies.begin();
+ for (; it != domainPolicies.end(); ++it) {
+ QListViewItem *current = it.key();
+ Policies *pol = it.data();
+ pol->save();
+ domainList.append(current->text(0));
+ }
+ config->setGroup(group);
+ config->writeEntry(domainListKey, domainList);
+}
+
+void DomainListView::setupPolicyDlg(PushButton /*trigger*/,
+ PolicyDialog &/*pDlg*/,Policies */*copy*/) {
+ // do nothing
+}
+
+#include "domainlistview.moc"
diff --git a/kcontrol/konqhtml/domainlistview.h b/kcontrol/konqhtml/domainlistview.h
new file mode 100644
index 000000000..3fb3f102e
--- /dev/null
+++ b/kcontrol/konqhtml/domainlistview.h
@@ -0,0 +1,209 @@
+/*
+ Copyright (c) 2002 Leo Savernik <l.savernik@aon.at>
+ Derived from jsopts.h and javaopts.h, code copied from there is
+ copyrighted to its respective owners.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef __DOMAINLISTVIEW_H__
+#define __DOMAINLISTVIEW_H__
+
+#include <qgroupbox.h>
+#include <qmap.h>
+
+class QListViewItem;
+class QPushButton;
+class QStringList;
+
+class KConfig;
+class KListView;
+
+class Policies;
+class PolicyDialog;
+
+/**
+ * @short Provides a list view of domains which policies are attached to.
+ *
+ * This class resembles a list view of domain names and some buttons to
+ * manipulate it. You should use this widget if you need to manage domains
+ * whose policies are described by (derivatives of) Policies objects.
+ *
+ * The contained widgets can be accessed by respective getters for
+ * fine-tuning/customizing them afterwards.
+ *
+ * To use this class you have to derive your own and implement most
+ * (all) of the protected methods. You need these to customize this widget
+ * for its special purpose.
+ *
+ * @author Leo Savernik
+ */
+class DomainListView : public QGroupBox {
+ Q_OBJECT
+public:
+ /** Enumerates the available buttons.
+ */
+ enum PushButton {
+ AddButton, ChangeButton, DeleteButton, ImportButton, ExportButton
+ };
+
+ /**
+ * constructor
+ * @param config configuration to read from and to write to
+ * @param title title to be used for enclosing group box
+ * @param parent parent widget
+ * @param name internal name for debugging
+ */
+ DomainListView(KConfig *config,const QString &title,QWidget *parent,
+ const char *name = 0);
+
+ virtual ~DomainListView();
+
+ /**
+ * clears the list view.
+ */
+// void clear();
+
+ /**
+ * returns the list view displaying the domains
+ */
+ KListView *listView() const { return domainSpecificLV; }
+
+ /**
+ * returns the add push-button.
+ *
+ * Note: The add button already contains a default "what's this" text.
+ */
+ QPushButton *addButton() const { return addDomainPB; }
+
+ /**
+ * returns the change push-button.
+ *
+ * Note: The change button already contains a default "what's this" text.
+ */
+ QPushButton *changeButton() const { return changeDomainPB; }
+
+ /**
+ * returns the delete push-button.
+ *
+ * Note: The delete button already contains a default "what's this" text.
+ */
+ QPushButton *deleteButton() const { return deleteDomainPB; }
+
+ /**
+ * returns the import push-button.
+ */
+ QPushButton *importButton() const { return importDomainPB; }
+
+ /**
+ * returns the export push-button.
+ */
+ QPushButton *exportButton() const { return exportDomainPB; }
+
+ /**
+ * Initializes the list view with the given list of domains as well
+ * as the domain policy map.
+ *
+ * This method may be called multiple times on a DomainListView instance.
+ *
+ * @param domainList given list of domains
+ */
+ void initialize(const QStringList &domainList);
+
+ /**
+ * saves the current state of all domains to the configuration object.
+ * @param group the group the information is to be saved under
+ * @param domainListKey the name of the key which the list of domains
+ * is stored under.
+ */
+ void save(const QString &group, const QString &domainListKey);
+
+
+signals:
+ /**
+ * indicates that a configuration has been changed within this list view.
+ * @param state true if changed, false if not
+ */
+ void changed(bool state);
+
+protected:
+ /**
+ * factory method for creating a new domain-specific policies object.
+ *
+ * Example:
+ * <pre>
+ * JavaPolicies *JavaDomainListView::createPolicies() {
+ * return new JavaPolicies(m_pConfig,m_groupname,false);
+ * }
+ * </pre>
+ */
+ virtual Policies *createPolicies() = 0;
+
+ /**
+ * factory method for copying a policies object.
+ *
+ * Derived classes must interpret the given object as the same type
+ * as those created by createPolicies and return a copy of this very type.
+ *
+ * Example:
+ * <pre>
+ * JavaPolicies *JavaDomainListView::copyPolicies(Policies *pol) {
+ * return new JavaPolicies(*static_cast<JavaPolicies *>(pol));
+ * }
+ * </pre>
+ * @param pol policies object to be copied
+ */
+ virtual Policies *copyPolicies(Policies *pol) = 0;
+
+ /**
+ * allows derived classes to customize the policy dialog.
+ *
+ * The default implementation does nothing.
+ * @param trigger triggered by which button
+ * @param pDlg reference to policy dialog
+ * @param copy policies object this dialog is used for changing. Derived
+ * classes can safely cast the @p copy object to the same type they
+ * returned in their createPolicies implementation.
+ */
+ virtual void setupPolicyDlg(PushButton trigger,PolicyDialog &pDlg,
+ Policies *copy);
+
+private slots:
+ void addPressed();
+ void changePressed();
+ void deletePressed();
+ void importPressed();
+ void exportPressed();
+ void updateButton();
+
+protected:
+
+ KConfig *config;
+
+ KListView *domainSpecificLV;
+
+ QPushButton* addDomainPB;
+ QPushButton* changeDomainPB;
+ QPushButton* deleteDomainPB;
+ QPushButton* importDomainPB;
+ QPushButton* exportDomainPB;
+
+ typedef QMap<QListViewItem*, Policies *> DomainPolicyMap;
+ DomainPolicyMap domainPolicies;
+};
+
+#endif // __DOMAINLISTVIEW_H__
+
diff --git a/kcontrol/konqhtml/filteropts.cpp b/kcontrol/konqhtml/filteropts.cpp
new file mode 100644
index 000000000..a1a68b63e
--- /dev/null
+++ b/kcontrol/konqhtml/filteropts.cpp
@@ -0,0 +1,327 @@
+/*
+ Copyright (C) 2005 Ivor Hewitt <ivor@ivor.org>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#include <kconfig.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kaboutdata.h>
+#include <kfiledialog.h>
+#include <dcopclient.h>
+
+#include <qlayout.h>
+#include <qlistbox.h>
+#include <qpushbutton.h>
+#include <qgroupbox.h>
+#include <qhbox.h>
+#include <qvbox.h>
+#include <qlineedit.h>
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qwhatsthis.h>
+#include <qregexp.h>
+
+#include "filteropts.h"
+#include "filteropts.moc"
+
+KCMFilter::KCMFilter(KConfig *config, QString group,
+ QWidget *parent, const char * )
+ : KCModule( parent, "kcmkonqhtml" ),
+ mConfig( config ),
+ mGroupname( group ),
+ mSelCount(0)
+{
+ setButtons(Default|Apply);
+
+ QVBoxLayout *topLayout = new QVBoxLayout(this, 0, KDialog::spacingHint());
+
+ mEnableCheck = new QCheckBox(i18n("Enable filters"), this);
+ topLayout->addWidget( mEnableCheck );
+
+ mKillCheck = new QCheckBox(i18n("Hide filtered images"), this);
+ topLayout->addWidget( mKillCheck );
+
+ QGroupBox *topBox = new QGroupBox( 1, Horizontal, i18n("URL Expressions to Filter"), this );
+ topLayout->addWidget( topBox );
+
+ mListBox = new QListBox( topBox );
+ mListBox->setSelectionMode(QListBox::Extended);
+ new QLabel( i18n("Expression (e.g. http://www.site.com/ad/*):"), topBox);
+ mString = new QLineEdit( topBox );
+
+ QHBox *buttonBox = new QHBox( topBox );
+ buttonBox->setSpacing( KDialog::spacingHint() );
+
+ mInsertButton = new QPushButton( i18n("Insert"), buttonBox );
+ connect( mInsertButton, SIGNAL( clicked() ), SLOT( insertFilter() ) );
+ mUpdateButton = new QPushButton( i18n("Update"), buttonBox );
+ connect( mUpdateButton, SIGNAL( clicked() ), SLOT( updateFilter() ) );
+ mRemoveButton = new QPushButton( i18n("Remove"), buttonBox );
+ connect( mRemoveButton, SIGNAL( clicked() ), SLOT( removeFilter() ) );
+
+ mImportButton = new QPushButton(i18n("Import..."),buttonBox);
+ connect( mImportButton, SIGNAL( clicked() ), SLOT( importFilters() ) );
+ mExportButton = new QPushButton(i18n("Export..."),buttonBox);
+ connect( mExportButton, SIGNAL( clicked() ), SLOT( exportFilters() ) );
+
+ connect( mEnableCheck, SIGNAL( clicked()), this, SLOT( slotEnableChecked()));
+ connect( mKillCheck, SIGNAL( clicked()), this, SLOT( slotKillChecked()));
+ connect( mListBox, SIGNAL( selectionChanged ()),this, SLOT( slotItemSelected()));
+
+/*
+ * Whats this items
+ */
+ QWhatsThis::add( mEnableCheck, i18n("Enable or disable AdBlocK filters. When enabled a set of expressions "
+ "to be blocked should be defined in the filter list for blocking to "
+ "take effect."));
+ QWhatsThis::add( mKillCheck, i18n("When enabled blocked images will be removed from the page completely "
+ "otherwise a placeholder 'blocked' image will be used."));
+ QWhatsThis::add( mListBox, i18n("This is the list of URL filters that will be applied to all linked "
+ "images and frames. The filters are processed in order so place "
+ "more generic filters towards the top of the list."));
+ QWhatsThis::add( mString, i18n("Enter an expression to filter. Expressions can be defined as either "
+ "a filename style wildcard e.g. http://www.site.com/ads* or as a full "
+ "regular expression by surrounding the string with '/' e.g. "
+ " //(ad|banner)\\./"));
+ load();
+ updateButton();
+}
+
+KCMFilter::~KCMFilter()
+{
+ delete mConfig;
+}
+
+void KCMFilter::slotKillChecked()
+{
+ emit changed( true );
+}
+
+void KCMFilter::slotEnableChecked()
+{
+ updateButton();
+ emit changed( true );
+}
+
+void KCMFilter::slotItemSelected()
+{
+ int currentId=-1;
+ unsigned int i;
+ for( i=0,mSelCount=0; i < mListBox->count() && mSelCount<2; ++i )
+ {
+ if (mListBox->isSelected(i))
+ {
+ currentId=i;
+ mSelCount++;
+ }
+ }
+
+ if ( currentId >= 0 )
+ {
+ mString->setText(mListBox->text(currentId));
+ }
+ updateButton();
+}
+
+void KCMFilter::updateButton()
+{
+ bool state = mEnableCheck->isChecked();
+
+ mUpdateButton->setEnabled(state && (mSelCount == 1));
+ mRemoveButton->setEnabled(state && (mSelCount > 0));
+ mInsertButton->setEnabled(state);
+ mImportButton->setEnabled(state);
+ mExportButton->setEnabled(state);
+
+ mListBox->setEnabled(state);
+ mString->setEnabled(state);
+ mKillCheck->setEnabled(state);
+}
+
+void KCMFilter::importFilters()
+{
+ QString inFile = KFileDialog::getOpenFileName();
+ if (inFile.length() > 0)
+ {
+ QFile f(inFile);
+ if ( f.open( IO_ReadOnly ) )
+ {
+ QTextStream ts( &f );
+ QStringList paths;
+ QString line;
+ while (!ts.atEnd())
+ {
+ line = ts.readLine();
+ if (line.lower().compare("[adblock]") == 0)
+ continue;
+
+ // Treat leading ! as filter comment, otherwise check expressions
+ // are valid.
+ if (!line.startsWith("!"))
+ {
+ if (line.length()>2 && line[0]=='/' && line[line.length()-1] == '/')
+ {
+ QString inside = line.mid(1, line.length()-2);
+ QRegExp rx(inside);
+ if (!rx.isValid())
+ continue;
+ }
+ else
+ {
+ QRegExp rx(line);
+ rx.setWildcard(true);
+ if (!rx.isValid())
+ continue;
+ }
+ }
+
+ if (!line.isEmpty() && mListBox->findItem(line, Qt::CaseSensitive|Qt::ExactMatch) == 0)
+ paths.append(line);
+ }
+ f.close();
+
+ mListBox->insertStringList( paths );
+ emit changed(true);
+ }
+ }
+}
+
+void KCMFilter::exportFilters()
+{
+ QString outFile = KFileDialog::getSaveFileName();
+ if (outFile.length() > 0)
+ {
+ QFile f(outFile);
+ if ( f.open( IO_WriteOnly ) )
+ {
+ QTextStream ts( &f );
+ ts.setEncoding( QTextStream::UnicodeUTF8 );
+ ts << "[AdBlock]" << endl;
+
+ uint i;
+ for( i = 0; i < mListBox->count(); ++i )
+ ts << mListBox->text(i) << endl;
+
+ f.close();
+ }
+ }
+}
+
+void KCMFilter::defaults()
+{
+ load( true );
+}
+
+void KCMFilter::save()
+{
+ mConfig->deleteGroup(mGroupname);
+ mConfig->setGroup(mGroupname);
+
+ mConfig->writeEntry("Enabled",mEnableCheck->isChecked());
+ mConfig->writeEntry("Shrink",mKillCheck->isChecked());
+
+ uint i;
+ for( i = 0; i < mListBox->count(); ++i )
+ {
+ QString key = "Filter-" + QString::number(i);
+ mConfig->writeEntry(key, mListBox->text(i));
+ }
+ mConfig->writeEntry("Count",mListBox->count());
+
+ mConfig->sync();
+ DCOPClient::mainClient()->send("konqueror*","KonquerorIface","reparseConfiguration()",QByteArray());
+
+}
+void KCMFilter::load()
+{
+ load( false );
+}
+
+void KCMFilter::load( bool useDefaults )
+{
+ QStringList paths;
+
+ mConfig->setReadDefaults( useDefaults );
+
+ mConfig->setGroup( mGroupname );
+ mEnableCheck->setChecked( mConfig->readBoolEntry("Enabled",false));
+ mKillCheck->setChecked( mConfig->readBoolEntry("Shrink",false));
+
+ QMap<QString,QString> entryMap = mConfig->entryMap( mGroupname );
+ QMap<QString,QString>::ConstIterator it;
+ int num = mConfig->readNumEntry("Count",0);
+ for (int i=0; i<num; ++i)
+ {
+ QString key = "Filter-" + QString::number(i);
+ it = entryMap.find(key);
+ if (it != entryMap.end())
+ paths.append(it.data());
+ }
+
+ mListBox->insertStringList( paths );
+
+ emit changed( useDefaults );
+}
+
+void KCMFilter::insertFilter()
+{
+ if ( !mString->text().isEmpty() )
+ {
+ mListBox->insertItem( mString->text() );
+ int id=mListBox->count()-1;
+ mListBox->clearSelection();
+ mListBox->setSelected(id,true);
+ mListBox->setCurrentItem(id);
+ mListBox->ensureCurrentVisible();
+ mString->clear();
+ emit changed( true );
+ }
+ updateButton();
+}
+
+void KCMFilter::removeFilter()
+{
+ for( int i = mListBox->count(); i >= 0; --i )
+ {
+ if (mListBox->isSelected(i))
+ mListBox->removeItem(i);
+ }
+ mString->clear();
+ emit changed( true );
+ updateButton();
+}
+
+void KCMFilter::updateFilter()
+{
+ if ( !mString->text().isEmpty() )
+ {
+ int index = mListBox->currentItem();
+ if ( index >= 0 )
+ {
+ mListBox->changeItem( mString->text(), index );
+ emit changed( true );
+ }
+ }
+ updateButton();
+}
+
+QString KCMFilter::quickHelp() const
+{
+ return i18n("<h1>Konqueror AdBlocK</h1> Konqueror AdBlocK allows you to create a list of filters"
+ " that are checked against linked images and frames. URL's that match are either discarded or"
+ " replaced with a placeholder image. ");
+}
diff --git a/kcontrol/konqhtml/filteropts.h b/kcontrol/konqhtml/filteropts.h
new file mode 100644
index 000000000..28fcaa652
--- /dev/null
+++ b/kcontrol/konqhtml/filteropts.h
@@ -0,0 +1,74 @@
+/*
+ Copyright (C) 2005 Ivor Hewitt <ivor@ivor.org>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#ifndef FILTEROPTS_H
+#define FILTEROPTS_H
+
+#include <kcmodule.h>
+
+class QListBox;
+class QPushButton;
+class QLineEdit;
+class QListBoxItem;
+class QCheckBox;
+
+class KConfig;
+
+class KCMFilter : public KCModule
+{
+ Q_OBJECT
+public:
+ KCMFilter( KConfig* config, QString group, QWidget* parent = 0, const char* name = 0 );
+ ~KCMFilter();
+
+ void load();
+ void load( bool useDefaults );
+ void save();
+ void defaults();
+ QString quickHelp() const;
+
+public slots:
+
+protected slots:
+ void insertFilter();
+ void updateFilter();
+ void removeFilter();
+ void slotItemSelected();
+ void slotEnableChecked();
+ void slotKillChecked();
+
+ void exportFilters();
+ void importFilters();
+
+private:
+ void updateButton();
+ QListBox *mListBox;
+ QLineEdit *mString;
+ QCheckBox *mEnableCheck;
+ QCheckBox *mKillCheck;
+ QPushButton *mInsertButton;
+ QPushButton *mUpdateButton;
+ QPushButton *mRemoveButton;
+ QPushButton *mImportButton;
+ QPushButton *mExportButton;
+
+ KConfig *mConfig;
+ QString mGroupname;
+ int mSelCount;
+};
+
+#endif
diff --git a/kcontrol/konqhtml/htmlopts.cpp b/kcontrol/konqhtml/htmlopts.cpp
new file mode 100644
index 000000000..44738e293
--- /dev/null
+++ b/kcontrol/konqhtml/htmlopts.cpp
@@ -0,0 +1,365 @@
+////
+// "Misc Options" Tab for KFM configuration
+//
+// (c) Sven Radej 1998
+// (c) David Faure 1998
+// (c) 2001 Waldo Bastian <bastian@kde.org>
+
+#include <qlayout.h>//CT - 12Nov1998
+#include <qwhatsthis.h>
+#include <qvgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+
+#include "htmlopts.h"
+#include "advancedTabDialog.h"
+
+#include <konq_defaults.h> // include default values directly from konqueror
+#include <kglobalsettings.h> // get default for DEFAULT_CHANGECURSOR
+#include <klocale.h>
+#include <kdialog.h>
+#include <knuminput.h>
+#include <kseparator.h>
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+
+#include "htmlopts.moc"
+
+enum UnderlineLinkType { UnderlineAlways=0, UnderlineNever=1, UnderlineHover=2 };
+enum AnimationsType { AnimationsAlways=0, AnimationsNever=1, AnimationsLoopOnce=2 };
+//-----------------------------------------------------------------------------
+
+KMiscHTMLOptions::KMiscHTMLOptions(KConfig *config, QString group, QWidget *parent, const char *)
+ : KCModule( parent, "kcmkonqhtml" ), m_pConfig(config), m_groupname(group)
+{
+ int row = 0;
+ QGridLayout *lay = new QGridLayout(this, 10, 2, 0, KDialog::spacingHint());
+
+ // Bookmarks
+ setQuickHelp( i18n("<h1>Konqueror Browser</h1> Here you can configure Konqueror's browser "
+ "functionality. Please note that the file manager "
+ "functionality has to be configured using the \"File Manager\" "
+ "configuration module. You can make some "
+ "settings how Konqueror should handle the HTML code in "
+ "the web pages it loads. It is usually not necessary to "
+ "change anything here."));
+
+ QVGroupBox *bgBookmarks = new QVGroupBox( i18n("Boo&kmarks"), this );
+ m_pAdvancedAddBookmarkCheckBox = new QCheckBox(i18n( "Ask for name and folder when adding bookmarks" ), bgBookmarks);
+ QWhatsThis::add( m_pAdvancedAddBookmarkCheckBox, 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(clicked()), SLOT(slotChanged()));
+
+ m_pOnlyMarkedBookmarksCheckBox = new QCheckBox(i18n( "Show only marked bookmarks in bookmark toolbar" ), bgBookmarks);
+ QWhatsThis::add( m_pOnlyMarkedBookmarksCheckBox, 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(clicked()), SLOT(slotChanged()));
+
+ lay->addMultiCellWidget( bgBookmarks, row, row, 0, 1 );
+ row++;
+
+ // Form completion
+
+ QVGroupBox *bgForm = new QVGroupBox( i18n("Form Com&pletion"), this );
+ m_pFormCompletionCheckBox = new QCheckBox(i18n( "Enable completion of &forms" ), bgForm);
+ QWhatsThis::add( m_pFormCompletionCheckBox, 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(clicked()), SLOT(slotChanged()));
+
+ m_pMaxFormCompletionItems = new KIntNumInput( bgForm );
+ m_pMaxFormCompletionItems->setLabel( i18n( "&Maximum completions:" ) );
+ m_pMaxFormCompletionItems->setRange( 0, 100 );
+ QWhatsThis::add( m_pMaxFormCompletionItems,
+ i18n( "Here you can select how many values Konqueror will remember for a form field." ) );
+ connect(m_pMaxFormCompletionItems, SIGNAL(valueChanged(int)), SLOT(slotChanged()));
+
+ lay->addMultiCellWidget( bgForm, row, row, 0, 1 );
+ row++;
+
+ // Tabbed Browsing
+
+ QGroupBox *bgTabbedBrowsing = new QGroupBox( 0, Qt::Vertical, i18n("Tabbed Browsing"), this );
+ QVBoxLayout *laygroup = new QVBoxLayout(bgTabbedBrowsing->layout(), KDialog::spacingHint() );
+
+ m_pShowMMBInTabs = new QCheckBox( i18n( "Open &links in new tab instead of in new window" ), bgTabbedBrowsing );
+ QWhatsThis::add( m_pShowMMBInTabs, i18n("This will open a new tab instead of a new window in various situations, "
+ "such as choosing a link or a folder with the middle mouse button.") );
+ connect(m_pShowMMBInTabs, SIGNAL(clicked()), SLOT(slotChanged()));
+ laygroup->addWidget(m_pShowMMBInTabs);
+
+ m_pDynamicTabbarHide = new QCheckBox( i18n( "Hide the tab bar when only one tab is open" ), bgTabbedBrowsing );
+ QWhatsThis::add( m_pDynamicTabbarHide, i18n("This will display the tab bar only if there are two or more tabs. Otherwise it will always be displayed.") );
+ connect(m_pDynamicTabbarHide, SIGNAL(clicked()), SLOT(slotChanged()));
+ laygroup->addWidget(m_pDynamicTabbarHide);
+
+ QHBoxLayout *laytab = new QHBoxLayout(laygroup, KDialog::spacingHint());
+ QPushButton *advancedTabButton = new QPushButton( i18n( "Advanced Options"), bgTabbedBrowsing );
+ laytab->addWidget(advancedTabButton);
+ laytab->addStretch();
+ connect(advancedTabButton, SIGNAL(clicked()), this, SLOT(launchAdvancedTabDialog()));
+
+ lay->addMultiCellWidget( bgTabbedBrowsing, row, row, 0, 1 );
+ row++;
+
+ // Mouse behavior
+
+ QVGroupBox *bgMouse = new QVGroupBox( i18n("Mouse Beha&vior"), this );
+
+ m_cbCursor = new QCheckBox(i18n("Chan&ge cursor over links"), bgMouse );
+ QWhatsThis::add( m_cbCursor, 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(clicked()), SLOT(slotChanged()));
+
+ m_pOpenMiddleClick = new QCheckBox( i18n ("M&iddle click opens URL in selection" ), bgMouse );
+ QWhatsThis::add( m_pOpenMiddleClick, 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(clicked()), SLOT(slotChanged()));
+
+ m_pBackRightClick = new QCheckBox( i18n( "Right click goes &back in history" ), bgMouse );
+ QWhatsThis::add( m_pBackRightClick, 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(clicked()), SLOT(slotChanged()));
+
+ lay->addMultiCellWidget( bgMouse, row, row, 0, 1 );
+ row++;
+
+ // Misc
+
+ m_pAutoLoadImagesCheckBox = new QCheckBox( i18n( "A&utomatically load images"), this );
+ QWhatsThis::add( m_pAutoLoadImagesCheckBox, 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.<br>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(clicked()), SLOT(slotChanged()));
+ lay->addMultiCellWidget( m_pAutoLoadImagesCheckBox, row, row, 0, 1 );
+ row++;
+
+ m_pUnfinishedImageFrameCheckBox = new QCheckBox( i18n( "Dra&w frame around not completely loaded images"), this );
+ QWhatsThis::add( m_pUnfinishedImageFrameCheckBox, i18n( "If this box is checked, Konqueror will draw a frame as placeholder around not yet fully loaded images that are embedded in a web page.<br>Especially if you have a slow network connection, you will probably want to check this box to enhance your browsing experience." ) );
+ connect(m_pUnfinishedImageFrameCheckBox, SIGNAL(clicked()), SLOT(slotChanged()));
+ lay->addMultiCellWidget( m_pUnfinishedImageFrameCheckBox, row, row, 0, 1 );
+ row++;
+
+ m_pAutoRedirectCheckBox = new QCheckBox( i18n( "Allow automatic delayed &reloading/redirecting"), this );
+ QWhatsThis::add( m_pAutoRedirectCheckBox,
+ 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(clicked()), SLOT(slotChanged()));
+ lay->addMultiCellWidget( m_pAutoRedirectCheckBox, row, row, 0, 1 );
+ row++;
+
+
+ // More misc
+
+ KSeparator *sep = new KSeparator(this);
+ lay->addMultiCellWidget(sep, row, row, 0, 1);
+ row++;
+
+ QLabel *label = new QLabel( i18n("Und&erline links:"), this);
+ m_pUnderlineCombo = new QComboBox( false, this );
+ label->setBuddy(m_pUnderlineCombo);
+ m_pUnderlineCombo->insertItem(i18n("underline","Enabled"), UnderlineAlways);
+ m_pUnderlineCombo->insertItem(i18n("underline","Disabled"), UnderlineNever);
+ m_pUnderlineCombo->insertItem(i18n("Only on Hover"), UnderlineHover);
+ lay->addWidget(label, row, 0);
+ lay->addWidget(m_pUnderlineCombo, row, 1);
+ row++;
+ QString whatsThis = i18n("Controls how Konqueror handles underlining hyperlinks:<br>"
+ "<ul><li><b>Enabled</b>: Always underline links</li>"
+ "<li><b>Disabled</b>: Never underline links</li>"
+ "<li><b>Only on Hover</b>: Underline when the mouse is moved over the link</li>"
+ "</ul><br><i>Note: The site's CSS definitions can override this value</i>");
+ QWhatsThis::add( label, whatsThis);
+ QWhatsThis::add( m_pUnderlineCombo, whatsThis);
+ connect(m_pUnderlineCombo, SIGNAL(activated(int)), SLOT(slotChanged()));
+
+
+
+ label = new QLabel( i18n("A&nimations:"), this);
+ m_pAnimationsCombo = new QComboBox( false, this );
+ label->setBuddy(m_pAnimationsCombo);
+ m_pAnimationsCombo->insertItem(i18n("animations","Enabled"), AnimationsAlways);
+ m_pAnimationsCombo->insertItem(i18n("animations","Disabled"), AnimationsNever);
+ m_pAnimationsCombo->insertItem(i18n("Show Only Once"), AnimationsLoopOnce);
+ lay->addWidget(label, row, 0);
+ lay->addWidget(m_pAnimationsCombo, row, 1);
+ row++;
+ whatsThis = i18n("Controls how Konqueror shows animated images:<br>"
+ "<ul><li><b>Enabled</b>: Show all animations completely.</li>"
+ "<li><b>Disabled</b>: Never show animations, show the start image only.</li>"
+ "<li><b>Show only once</b>: Show all animations completely but do not repeat them.</li>");
+ QWhatsThis::add( label, whatsThis);
+ QWhatsThis::add( m_pAnimationsCombo, whatsThis);
+ connect(m_pAnimationsCombo, SIGNAL(activated(int)), SLOT(slotChanged()));
+
+ lay->setRowStretch(row, 1);
+
+ load();
+ emit changed(false);
+}
+
+KMiscHTMLOptions::~KMiscHTMLOptions()
+{
+ delete m_pConfig;
+}
+
+void KMiscHTMLOptions::load()
+{
+ load( false );
+}
+
+void KMiscHTMLOptions::load( bool useDefaults )
+{
+ KConfig khtmlrc("khtmlrc", true, false);
+ khtmlrc.setReadDefaults( useDefaults );
+ m_pConfig->setReadDefaults( useDefaults );
+
+#define SET_GROUP(x) m_pConfig->setGroup(x); khtmlrc.setGroup(x)
+#define READ_BOOL(x,y) m_pConfig->readBoolEntry(x, khtmlrc.readBoolEntry(x, y))
+#define READ_ENTRY(x) m_pConfig->readEntry(x, khtmlrc.readEntry(x))
+
+
+ // *** load ***
+ SET_GROUP( "MainView Settings" );
+ bool bOpenMiddleClick = READ_BOOL( "OpenMiddleClick", true );
+ bool bBackRightClick = READ_BOOL( "BackRightClick", false );
+ SET_GROUP( "HTML Settings" );
+ bool changeCursor = READ_BOOL("ChangeCursor", KDE_DEFAULT_CHANGECURSOR);
+ bool underlineLinks = READ_BOOL("UnderlineLinks", DEFAULT_UNDERLINELINKS);
+ bool hoverLinks = READ_BOOL("HoverLinks", true);
+ bool bAutoLoadImages = READ_BOOL( "AutoLoadImages", true );
+ bool bUnfinishedImageFrame = READ_BOOL( "UnfinishedImageFrame", true );
+ QString strAnimations = READ_ENTRY( "ShowAnimations" ).lower();
+
+ bool bAutoRedirect = m_pConfig->readBoolEntry( "AutoDelayedActions", true );
+
+ // *** apply to GUI ***
+ m_cbCursor->setChecked( changeCursor );
+ m_pAutoLoadImagesCheckBox->setChecked( bAutoLoadImages );
+ m_pUnfinishedImageFrameCheckBox->setChecked( bUnfinishedImageFrame );
+ m_pAutoRedirectCheckBox->setChecked( bAutoRedirect );
+ m_pOpenMiddleClick->setChecked( bOpenMiddleClick );
+ m_pBackRightClick->setChecked( bBackRightClick );
+
+ // we use two keys for link underlining so that this config file
+ // is backwards compatible with KDE 2.0. the HoverLink setting
+ // has precedence over the UnderlineLinks setting
+ if (hoverLinks)
+ {
+ m_pUnderlineCombo->setCurrentItem( UnderlineHover );
+ }
+ else
+ {
+ if (underlineLinks)
+ m_pUnderlineCombo->setCurrentItem( UnderlineAlways );
+ else
+ m_pUnderlineCombo->setCurrentItem( UnderlineNever );
+ }
+ if (strAnimations == "disabled")
+ m_pAnimationsCombo->setCurrentItem( AnimationsNever );
+ else if (strAnimations == "looponce")
+ m_pAnimationsCombo->setCurrentItem( AnimationsLoopOnce );
+ else
+ m_pAnimationsCombo->setCurrentItem( AnimationsAlways );
+
+ m_pFormCompletionCheckBox->setChecked( m_pConfig->readBoolEntry( "FormCompletion", true ) );
+ m_pMaxFormCompletionItems->setValue( m_pConfig->readNumEntry( "MaxFormCompletionItems", 10 ) );
+ m_pMaxFormCompletionItems->setEnabled( m_pFormCompletionCheckBox->isChecked() );
+
+ m_pConfig->setGroup("FMSettings");
+ m_pShowMMBInTabs->setChecked( m_pConfig->readBoolEntry( "MMBOpensTab", false ) );
+ m_pDynamicTabbarHide->setChecked( ! (m_pConfig->readBoolEntry( "AlwaysTabbedMode", false )) );
+
+ KConfig config("kbookmarkrc", true, false);
+ config.setReadDefaults( useDefaults );
+ config.setGroup("Bookmarks");
+ m_pAdvancedAddBookmarkCheckBox->setChecked( config.readBoolEntry("AdvancedAddBookmarkDialog", false) );
+ m_pOnlyMarkedBookmarksCheckBox->setChecked( config.readBoolEntry("FilteredToolbar", false) );
+
+ emit changed( useDefaults );
+
+#undef READ_ENTRY
+#undef READ_BOOL
+#undef SET_GROUP
+}
+
+void KMiscHTMLOptions::defaults()
+{
+ load( true );
+}
+
+void KMiscHTMLOptions::save()
+{
+ m_pConfig->setGroup( "MainView Settings" );
+ m_pConfig->writeEntry( "OpenMiddleClick", m_pOpenMiddleClick->isChecked() );
+ m_pConfig->writeEntry( "BackRightClick", m_pBackRightClick->isChecked() );
+ m_pConfig->setGroup( "HTML Settings" );
+ m_pConfig->writeEntry( "ChangeCursor", m_cbCursor->isChecked() );
+ m_pConfig->writeEntry( "AutoLoadImages", m_pAutoLoadImagesCheckBox->isChecked() );
+ m_pConfig->writeEntry( "UnfinishedImageFrame", m_pUnfinishedImageFrameCheckBox->isChecked() );
+ m_pConfig->writeEntry( "AutoDelayedActions", m_pAutoRedirectCheckBox->isChecked() );
+ switch(m_pUnderlineCombo->currentItem())
+ {
+ case UnderlineAlways:
+ m_pConfig->writeEntry( "UnderlineLinks", true );
+ m_pConfig->writeEntry( "HoverLinks", false );
+ break;
+ case UnderlineNever:
+ m_pConfig->writeEntry( "UnderlineLinks", false );
+ m_pConfig->writeEntry( "HoverLinks", false );
+ break;
+ case UnderlineHover:
+ m_pConfig->writeEntry( "UnderlineLinks", false );
+ m_pConfig->writeEntry( "HoverLinks", true );
+ break;
+ }
+ switch(m_pAnimationsCombo->currentItem())
+ {
+ case AnimationsAlways:
+ m_pConfig->writeEntry( "ShowAnimations", "Enabled" );
+ break;
+ case AnimationsNever:
+ m_pConfig->writeEntry( "ShowAnimations", "Disabled" );
+ break;
+ case AnimationsLoopOnce:
+ m_pConfig->writeEntry( "ShowAnimations", "LoopOnce" );
+ break;
+ }
+
+ m_pConfig->writeEntry( "FormCompletion", m_pFormCompletionCheckBox->isChecked() );
+ m_pConfig->writeEntry( "MaxFormCompletionItems", m_pMaxFormCompletionItems->value() );
+
+ m_pConfig->setGroup("FMSettings");
+ m_pConfig->writeEntry( "MMBOpensTab", m_pShowMMBInTabs->isChecked() );
+ m_pConfig->writeEntry( "AlwaysTabbedMode", !(m_pDynamicTabbarHide->isChecked()) );
+ m_pConfig->sync();
+
+ KConfig config("kbookmarkrc", false, false);
+ config.setGroup("Bookmarks");
+ config.writeEntry("AdvancedAddBookmarkDialog", m_pAdvancedAddBookmarkCheckBox->isChecked());
+ config.writeEntry("FilteredToolbar", m_pOnlyMarkedBookmarksCheckBox->isChecked());
+ config.sync();
+
+ QByteArray data;
+ if ( !kapp->dcopClient()->isAttached() )
+ kapp->dcopClient()->attach();
+ kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "reparseConfiguration()", data );
+
+ emit changed(false);
+}
+
+
+void KMiscHTMLOptions::slotChanged()
+{
+ m_pMaxFormCompletionItems->setEnabled( m_pFormCompletionCheckBox->isChecked() );
+ emit changed(true);
+}
+
+
+void KMiscHTMLOptions::launchAdvancedTabDialog()
+{
+ advancedTabDialog* dialog = new advancedTabDialog(this, m_pConfig, "advancedTabDialog");
+ dialog->exec();
+}
+
+
diff --git a/kcontrol/konqhtml/htmlopts.h b/kcontrol/konqhtml/htmlopts.h
new file mode 100644
index 000000000..15f5a2511
--- /dev/null
+++ b/kcontrol/konqhtml/htmlopts.h
@@ -0,0 +1,68 @@
+//
+//
+// "Misc Options" Tab for KFM configuration
+//
+// (c) Sven Radej 1998
+// (c) David Faure 1998
+
+#ifndef __KMISCHTML_OPTIONS_H
+#define __KMISCHTML_OPTIONS_H
+
+#include <qstrlist.h>
+#include <qcheckbox.h>
+#include <qlineedit.h>
+#include <qcombobox.h>
+
+
+//-----------------------------------------------------------------------------
+// The "Misc Options" Tab for the HTML view contains :
+
+// Change cursor over links
+// Underline links
+// AutoLoad Images
+// ... there is room for others :))
+
+
+#include <qstring.h>
+#include <kconfig.h>
+#include <kcmodule.h>
+class QRadioButton;
+class KIntNumInput;
+
+class KMiscHTMLOptions : public KCModule
+{
+ Q_OBJECT
+
+public:
+ KMiscHTMLOptions(KConfig *config, QString group, QWidget *parent = 0L, const char *name = 0L );
+ ~KMiscHTMLOptions();
+ virtual void load();
+ virtual void load( bool useDefaults );
+ virtual void save();
+ virtual void defaults();
+
+private slots:
+ void slotChanged();
+ void launchAdvancedTabDialog();
+
+private:
+ KConfig* m_pConfig;
+ QString m_groupname;
+
+ QComboBox* m_pUnderlineCombo;
+ QComboBox* m_pAnimationsCombo;
+ QCheckBox* m_cbCursor;
+ QCheckBox* m_pAutoLoadImagesCheckBox;
+ QCheckBox* m_pUnfinishedImageFrameCheckBox;
+ QCheckBox* m_pAutoRedirectCheckBox;
+ QCheckBox* m_pOpenMiddleClick;
+ QCheckBox* m_pBackRightClick;
+ QCheckBox* m_pShowMMBInTabs;
+ QCheckBox* m_pFormCompletionCheckBox;
+ QCheckBox* m_pDynamicTabbarHide;
+ QCheckBox* m_pAdvancedAddBookmarkCheckBox;
+ QCheckBox* m_pOnlyMarkedBookmarksCheckBox;
+ KIntNumInput* m_pMaxFormCompletionItems;
+};
+
+#endif
diff --git a/kcontrol/konqhtml/javaopts.cpp b/kcontrol/konqhtml/javaopts.cpp
new file mode 100644
index 000000000..539e9bb37
--- /dev/null
+++ b/kcontrol/konqhtml/javaopts.cpp
@@ -0,0 +1,337 @@
+// (c) Martin R. Jones 1996
+// (c) Bernd Wuebben 1998
+// KControl port & modifications
+// (c) Torben Weis 1998
+// End of the KControl port, added 'kfmclient configure' call.
+// (c) David Faure 1998
+// New configuration scheme for Java/JavaScript
+// (c) Kalle Dalheimer 2000
+// Redesign and cleanup
+// (c) Daniel Molkentin 2000
+// Big changes to accommodate per-domain settings
+// (c) Leo Savernik 2002-2003
+
+#include <config.h>
+#include <klistview.h>
+#include <kurlrequester.h>
+#include <kdebug.h>
+#include <klineedit.h>
+#include <klocale.h>
+#include <khtml_settings.h>
+#include <knuminput.h>
+
+#include <qlayout.h>
+#include <qwhatsthis.h>
+#include <qvgroupbox.h>
+#include <qlabel.h>
+
+#include "htmlopts.h"
+#include "policydlg.h"
+#include "javaopts.h"
+
+// == class JavaPolicies =====
+
+JavaPolicies::JavaPolicies(KConfig* config, const QString &group, bool global,
+ const QString &domain) :
+ Policies(config,group,global,domain,"java.","EnableJava") {
+}
+
+JavaPolicies::JavaPolicies() : Policies(0,QString::null,false,
+ QString::null,QString::null,QString::null) {
+}
+
+JavaPolicies::~JavaPolicies() {
+}
+
+// == class KJavaOptions =====
+
+KJavaOptions::KJavaOptions( KConfig* config, QString group,
+ QWidget *parent, const char *name )
+ : KCModule( parent, name ),
+ _removeJavaScriptDomainAdvice(false),
+ m_pConfig( config ),
+ m_groupname( group ),
+ java_global_policies(config,group,true),
+ _removeJavaDomainSettings(false)
+{
+ QVBoxLayout* toplevel = new QVBoxLayout( this, 10, 5 );
+
+ /***************************************************************************
+ ********************* Global Settings *************************************
+ **************************************************************************/
+ QVGroupBox* globalGB = new QVGroupBox( i18n( "Global Settings" ), this );
+ toplevel->addWidget( globalGB );
+ enableJavaGloballyCB = new QCheckBox( i18n( "Enable Ja&va globally" ), globalGB );
+ connect( enableJavaGloballyCB, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
+ connect( enableJavaGloballyCB, SIGNAL( clicked() ), this, SLOT( toggleJavaControls() ) );
+
+
+ /***************************************************************************
+ ***************** Domain Specific Settings ********************************
+ **************************************************************************/
+ domainSpecific = new JavaDomainListView(m_pConfig,m_groupname,this,this);
+ connect(domainSpecific,SIGNAL(changed(bool)),SLOT(slotChanged()));
+ toplevel->addWidget( domainSpecific, 2 );
+
+ /***************************************************************************
+ ***************** Java Runtime Settings ***********************************
+ **************************************************************************/
+ QVGroupBox* javartGB = new QVGroupBox( i18n( "Java Runtime Settings" ), this );
+ toplevel->addWidget( javartGB );
+
+ QWidget* checkboxes = new QWidget( javartGB );
+ QGridLayout* grid = new QGridLayout( checkboxes, 2, 2 );
+
+ javaSecurityManagerCB = new QCheckBox( i18n("&Use security manager" ), checkboxes );
+ grid->addWidget( javaSecurityManagerCB, 0, 0 );
+ connect( javaSecurityManagerCB, SIGNAL(toggled( bool )), this, SLOT(slotChanged()) );
+
+ useKioCB = new QCheckBox( i18n("Use &KIO"), checkboxes );
+ grid->addWidget( useKioCB, 0, 1 );
+ connect( useKioCB, SIGNAL(toggled( bool )), this, SLOT(slotChanged()) );
+
+ enableShutdownCB = new QCheckBox( i18n("Shu&tdown applet server when inactive"), checkboxes );
+ grid->addWidget( enableShutdownCB, 1, 0 );
+ connect( enableShutdownCB, SIGNAL(toggled( bool )), this, SLOT(slotChanged()) );
+ connect( enableShutdownCB, SIGNAL(clicked()), this, SLOT(toggleJavaControls()) );
+
+ QHBox* secondsHB = new QHBox( javartGB );
+ serverTimeoutSB = new KIntNumInput( secondsHB );
+ serverTimeoutSB->setRange( 0, 1000, 5 );
+ serverTimeoutSB->setLabel( i18n("App&let server timeout:"), AlignLeft );
+ serverTimeoutSB->setSuffix(i18n(" sec"));
+ connect(serverTimeoutSB, SIGNAL(valueChanged(int)),this,SLOT(slotChanged()));
+
+ QHBox* pathHB = new QHBox( javartGB );
+ pathHB->setSpacing( 10 );
+ QLabel* pathLA = new QLabel( i18n( "&Path to Java executable, or 'java':" ),
+ pathHB );
+ pathED = new KURLRequester( pathHB );
+ connect( pathED, SIGNAL(textChanged( const QString& )), this, SLOT(slotChanged()) );
+ pathLA->setBuddy( pathED );
+
+ QHBox* addArgHB = new QHBox( javartGB );
+ addArgHB->setSpacing( 10 );
+ QLabel* addArgLA = new QLabel( i18n( "Additional Java a&rguments:" ), addArgHB );
+ addArgED = new QLineEdit( addArgHB );
+ connect( addArgED, SIGNAL(textChanged( const QString& )), this, SLOT(slotChanged()) );
+ addArgLA->setBuddy( addArgED );
+
+ /***************************************************************************
+ ********************** WhatsThis? items ***********************************
+ **************************************************************************/
+ QWhatsThis::add( enableJavaGloballyCB, 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 "
+ "a specific Java policy for. This policy will be used "
+ "instead of the default policy for enabling or disabling Java applets on pages sent by these "
+ "domains or hosts. <p>Select a policy and use the controls on "
+ "the right to modify it.");
+ QWhatsThis::add( domainSpecific->listView(), wtstr );
+#if 0
+ QWhatsThis::add( domainSpecific->importButton(), 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.") );
+ QWhatsThis::add( domainSpecific->exportButton(), i18n("Click this button to save the Java policy to a zipped "
+ "file. The file, named <b>java_policy.tgz</b>, will be "
+ "saved to a location of your choice." ) );
+#endif
+ QWhatsThis::add( domainSpecific, i18n("Here you can set specific Java policies for any particular "
+ "host or domain. To add a new policy, simply click the <i>New...</i> "
+ "button and supply the necessary information requested by the "
+ "dialog box. To change an existing policy, click on the <i>Change...</i> "
+ "button and choose the new policy from the policy dialog box. Clicking "
+ "on the <i>Delete</i> button will remove the selected policy, causing the default "
+ "policy setting to be used for that domain.") );
+#if 0
+ "The <i>Import</i> and <i>Export</i> "
+ "button allows you to easily share your policies with other people by allowing "
+ "you to save and retrieve them from a zipped file.") );
+#endif
+
+ QWhatsThis::add( javaSecurityManagerCB, 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 "
+ "own risk. You can modify your $HOME/.java.policy file with the Java "
+ "policytool utility to give code downloaded from certain sites more "
+ "permissions." ) );
+
+ QWhatsThis::add( useKioCB, i18n( "Enabling this will cause the jvm to use KIO for network transport ") );
+
+ QWhatsThis::add( pathED, 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).") );
+
+ QWhatsThis::add( addArgED, 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 "
+ "keep the java process running while you are "
+ "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.");
+ QWhatsThis::add( serverTimeoutSB, shutdown);
+ QWhatsThis::add( enableShutdownCB, shutdown);
+ // Finally do the loading
+ load();
+}
+
+void KJavaOptions::load()
+{
+ load( false );
+}
+
+void KJavaOptions::load(bool useDefaults)
+{
+ m_pConfig->setReadDefaults( useDefaults );
+
+ // *** load ***
+ java_global_policies.load();
+ bool bJavaGlobal = java_global_policies.isFeatureEnabled();
+ bool bSecurityManager = m_pConfig->readBoolEntry( "UseSecurityManager", true );
+ bool bUseKio = m_pConfig->readBoolEntry( "UseKio", false );
+ bool bServerShutdown = m_pConfig->readBoolEntry( "ShutdownAppletServer", true );
+ int serverTimeout = m_pConfig->readNumEntry( "AppletServerTimeout", 60 );
+#if defined(PATH_JAVA)
+ QString sJavaPath = m_pConfig->readPathEntry( "JavaPath", PATH_JAVA );
+#else
+ QString sJavaPath = m_pConfig->readPathEntry( "JavaPath", "java" );
+#endif
+
+ if( sJavaPath == "/usr/lib/jdk" )
+ sJavaPath = "java";
+
+ if( m_pConfig->hasKey( "JavaDomains" ) )
+ domainSpecific->initialize(m_pConfig->readListEntry("JavaDomains"));
+ else if( m_pConfig->hasKey( "JavaDomainSettings" ) ) {
+ domainSpecific->updateDomainListLegacy( m_pConfig->readListEntry("JavaDomainSettings") );
+ _removeJavaDomainSettings = true;
+ } else {
+ domainSpecific->updateDomainListLegacy( m_pConfig->readListEntry("JavaScriptDomainAdvice") );
+ _removeJavaScriptDomainAdvice = true;
+ }
+
+ // *** apply to GUI ***
+ enableJavaGloballyCB->setChecked( bJavaGlobal );
+ javaSecurityManagerCB->setChecked( bSecurityManager );
+ useKioCB->setChecked( bUseKio );
+
+ addArgED->setText( m_pConfig->readEntry( "JavaArgs" ) );
+ pathED->lineEdit()->setText( sJavaPath );
+
+ enableShutdownCB->setChecked( bServerShutdown );
+ serverTimeoutSB->setValue( serverTimeout );
+
+ toggleJavaControls();
+ emit changed( useDefaults );
+}
+
+void KJavaOptions::defaults()
+{
+ load( true );
+}
+
+void KJavaOptions::save()
+{
+ java_global_policies.save();
+ m_pConfig->writeEntry( "JavaArgs", addArgED->text() );
+ m_pConfig->writePathEntry( "JavaPath", pathED->lineEdit()->text() );
+ m_pConfig->writeEntry( "UseSecurityManager", javaSecurityManagerCB->isChecked() );
+ m_pConfig->writeEntry( "UseKio", useKioCB->isChecked() );
+ m_pConfig->writeEntry( "ShutdownAppletServer", enableShutdownCB->isChecked() );
+ m_pConfig->writeEntry( "AppletServerTimeout", serverTimeoutSB->value() );
+
+ domainSpecific->save(m_groupname,"JavaDomains");
+
+ if (_removeJavaDomainSettings) {
+ m_pConfig->deleteEntry("JavaDomainSettings");
+ _removeJavaDomainSettings = false;
+ }
+
+ // sync moved to KJSParts::save
+// m_pConfig->sync();
+ emit changed( false );
+}
+
+void KJavaOptions::slotChanged()
+{
+ emit changed(true);
+}
+
+
+void KJavaOptions::toggleJavaControls()
+{
+ bool isEnabled = true; //enableJavaGloballyCB->isChecked();
+
+ java_global_policies.setFeatureEnabled( enableJavaGloballyCB->isChecked() );
+ javaSecurityManagerCB->setEnabled( isEnabled );
+ useKioCB->setEnabled( isEnabled );
+ addArgED->setEnabled( isEnabled );
+ pathED->setEnabled( isEnabled );
+ enableShutdownCB->setEnabled( isEnabled );
+
+ serverTimeoutSB->setEnabled( enableShutdownCB->isChecked() && isEnabled );
+}
+
+// == class JavaDomainListView =====
+
+JavaDomainListView::JavaDomainListView(KConfig *config,const QString &group,
+ KJavaOptions *options,QWidget *parent,const char *name)
+ : DomainListView(config,i18n( "Doma&in-Specific" ), parent, name),
+ group(group), options(options) {
+}
+
+JavaDomainListView::~JavaDomainListView() {
+}
+
+void JavaDomainListView::updateDomainListLegacy(const QStringList &domainConfig)
+{
+ domainSpecificLV->clear();
+ JavaPolicies pol(config,group,false);
+ pol.defaults();
+ for ( QStringList::ConstIterator it = domainConfig.begin();
+ it != domainConfig.end(); ++it)
+ {
+ QString domain;
+ KHTMLSettings::KJavaScriptAdvice javaAdvice;
+ KHTMLSettings::KJavaScriptAdvice javaScriptAdvice;
+ KHTMLSettings::splitDomainAdvice(*it, domain, javaAdvice, javaScriptAdvice);
+ if (javaAdvice != KHTMLSettings::KJavaScriptDunno) {
+ QListViewItem* index = new QListViewItem( domainSpecificLV, domain,
+ i18n(KHTMLSettings::adviceToStr(javaAdvice)) );
+ pol.setDomain(domain);
+ pol.setFeatureEnabled(javaAdvice != KHTMLSettings::KJavaScriptReject);
+ domainPolicies[index] = new JavaPolicies(pol);
+ }
+ }
+}
+
+void JavaDomainListView::setupPolicyDlg(PushButton trigger,PolicyDialog &pDlg,
+ Policies *pol) {
+ QString caption;
+ switch (trigger) {
+ case AddButton: caption = i18n( "New Java Policy" );
+ pol->setFeatureEnabled(!options->enableJavaGloballyCB->isChecked());
+ break;
+ case ChangeButton: caption = i18n( "Change Java Policy" ); break;
+ default: ; // inhibit gcc warning
+ }/*end switch*/
+ pDlg.setCaption(caption);
+ pDlg.setFeatureEnabledLabel(i18n("&Java policy:"));
+ pDlg.setFeatureEnabledWhatsThis(i18n("Select a Java policy for "
+ "the above host or domain."));
+ pDlg.refresh();
+}
+
+JavaPolicies *JavaDomainListView::createPolicies() {
+ return new JavaPolicies(config,group,false);
+}
+
+JavaPolicies *JavaDomainListView::copyPolicies(Policies *pol) {
+ return new JavaPolicies(*static_cast<JavaPolicies *>(pol));
+}
+
+#include "javaopts.moc"
diff --git a/kcontrol/konqhtml/javaopts.h b/kcontrol/konqhtml/javaopts.h
new file mode 100644
index 000000000..638b3a921
--- /dev/null
+++ b/kcontrol/konqhtml/javaopts.h
@@ -0,0 +1,126 @@
+//-----------------------------------------------------------------------------
+//
+// HTML Options
+//
+// (c) Martin R. Jones 1996
+//
+// Port to KControl
+// (c) Torben Weis 1998
+//
+// Redesign and cleanup
+// (c) Daniel Molkentin 2000
+//
+//-----------------------------------------------------------------------------
+
+#ifndef __JAVAOPTS_H__
+#define __JAVAOPTS_H__
+
+#include <kcmodule.h>
+
+#include "domainlistview.h"
+#include "policies.h"
+
+class KColorButton;
+class KConfig;
+class KListView;
+class KURLRequester;
+class KIntNumInput;
+
+class QCheckBox;
+class QComboBox;
+class QLineEdit;
+class QListViewItem;
+class QRadioButton;
+
+class KJavaOptions;
+
+/** policies with java-specific constructor
+ */
+class JavaPolicies : 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)
+ */
+ JavaPolicies(KConfig* config, const QString &group, bool global,
+ const QString &domain = QString::null);
+
+ /** empty constructur to make QMap happy
+ * don't use for constructing a policies instance.
+ * @internal
+ */
+ JavaPolicies();
+
+ virtual ~JavaPolicies();
+};
+
+/** Java-specific enhancements to the domain list view
+ */
+class JavaDomainListView : public DomainListView {
+ Q_OBJECT
+public:
+ JavaDomainListView(KConfig *config,const QString &group,KJavaOptions *opt,
+ QWidget *parent,const char *name = 0);
+ virtual ~JavaDomainListView();
+
+ /** remnant for importing pre KDE 3.2 settings
+ */
+ void updateDomainListLegacy(const QStringList &domainConfig);
+
+protected:
+ virtual JavaPolicies *createPolicies();
+ virtual JavaPolicies *copyPolicies(Policies *pol);
+ virtual void setupPolicyDlg(PushButton trigger,PolicyDialog &pDlg,
+ Policies *copy);
+
+private:
+ QString group;
+ KJavaOptions *options;
+};
+
+class KJavaOptions : public KCModule
+{
+ Q_OBJECT
+
+public:
+ KJavaOptions( KConfig* config, QString group, QWidget* parent = 0, const char* name = 0 );
+
+ virtual void load();
+ virtual void load( bool useDefaults );
+ virtual void save();
+ virtual void defaults();
+
+ bool _removeJavaScriptDomainAdvice;
+
+private slots:
+ void slotChanged();
+ void toggleJavaControls();
+
+private:
+
+ KConfig* m_pConfig;
+ QString m_groupname;
+ JavaPolicies java_global_policies;
+
+ QCheckBox* enableJavaGloballyCB;
+ QCheckBox* javaSecurityManagerCB;
+ QCheckBox* useKioCB;
+ QCheckBox* enableShutdownCB;
+ KIntNumInput* serverTimeoutSB;
+ QLineEdit* addArgED;
+ KURLRequester* pathED;
+ bool _removeJavaDomainSettings;
+
+ JavaDomainListView *domainSpecific;
+
+ friend class JavaDomainListView;
+};
+
+#endif // __HTML_OPTIONS_H__
+
diff --git a/kcontrol/konqhtml/jsopts.cpp b/kcontrol/konqhtml/jsopts.cpp
new file mode 100644
index 000000000..b6522f767
--- /dev/null
+++ b/kcontrol/konqhtml/jsopts.cpp
@@ -0,0 +1,231 @@
+// (c) Martin R. Jones 1996
+// (c) Bernd Wuebben 1998
+// KControl port & modifications
+// (c) Torben Weis 1998
+// End of the KControl port, added 'kfmclient configure' call.
+// (c) David Faure 1998
+// New configuration scheme for JavaScript
+// (C) Kalle Dalheimer 2000
+// Major cleanup & Java/JS settings splitted
+// (c) Daniel Molkentin 2000
+// Big changes to accommodate per-domain settings
+// (c) Leo Savernik 2002-2003
+
+#include <qlayout.h>
+#include <qwhatsthis.h>
+#include <qvgroupbox.h>
+#include <kconfig.h>
+#include <klistview.h>
+#include <kdebug.h>
+#include <kurlrequester.h>
+
+#if defined Q_WS_X11 && !defined K_WS_QTONLY
+#include <X11/Xlib.h>
+#endif
+
+#include "htmlopts.h"
+#include "policydlg.h"
+
+#include <klocale.h>
+
+#include "jsopts.h"
+
+#include "jsopts.moc"
+
+// == class KJavaScriptOptions =====
+
+KJavaScriptOptions::KJavaScriptOptions( KConfig* config, QString group, QWidget *parent,
+ const char *name ) :
+ KCModule( parent, name ),
+ _removeJavaScriptDomainAdvice(false),
+ m_pConfig( config ), m_groupname( group ),
+ js_global_policies(config,group,true,QString::null),
+ _removeECMADomainSettings(false)
+{
+ QVBoxLayout* toplevel = new QVBoxLayout( this, 10, 5 );
+
+ // the global checkbox
+ QGroupBox* globalGB = new QGroupBox( 2, Vertical, i18n( "Global Settings" ), this );
+ toplevel->addWidget( globalGB );
+
+ enableJavaScriptGloballyCB = new QCheckBox( i18n( "Ena&ble JavaScript globally" ), globalGB );
+ QWhatsThis::add( enableJavaScriptGloballyCB, 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() ) );
+
+ reportErrorsCB = new QCheckBox( i18n( "Report &errors" ), globalGB );
+ QWhatsThis::add( reportErrorsCB, i18n("Enables the reporting of errors that occur when JavaScript "
+ "code is executed.") );
+ connect( reportErrorsCB, SIGNAL( clicked() ), SLOT( changed() ) );
+
+ jsDebugWindow = new QCheckBox( i18n( "Enable debu&gger" ), globalGB );
+ QWhatsThis::add( jsDebugWindow, i18n( "Enables builtin JavaScript debugger." ) );
+ connect( jsDebugWindow, SIGNAL( clicked() ), SLOT( changed() ) );
+
+ // the domain-specific listview
+ domainSpecific = new JSDomainListView(m_pConfig,m_groupname,this,this);
+ connect(domainSpecific,SIGNAL(changed(bool)),SLOT(changed()));
+ toplevel->addWidget( domainSpecific, 2 );
+
+ QWhatsThis::add( domainSpecific, i18n("Here you can set specific JavaScript policies for any particular "
+ "host or domain. To add a new policy, simply click the <i>New...</i> "
+ "button and supply the necessary information requested by the "
+ "dialog box. To change an existing policy, click on the <i>Change...</i> "
+ "button and choose the new policy from the policy dialog box. Clicking "
+ "on the <i>Delete</i> button will remove the selected policy causing the default "
+ "policy setting to be used for that domain. The <i>Import</i> and <i>Export</i> "
+ "button allows you to easily share your policies with other people by allowing "
+ "you to save and retrieve them from a zipped file.") );
+
+ QString wtstr = i18n("This box contains the domains and hosts you have set "
+ "a specific JavaScript policy for. This policy will be used "
+ "instead of the default policy for enabling or disabling JavaScript on pages sent by these "
+ "domains or hosts. <p>Select a policy and use the controls on "
+ "the right to modify it.");
+ QWhatsThis::add( domainSpecific->listView(), wtstr );
+
+ QWhatsThis::add( domainSpecific->importButton(), 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.") );
+ QWhatsThis::add( domainSpecific->exportButton(), i18n("Click this button to save the JavaScript policy to a zipped "
+ "file. The file, named <b>javascript_policy.tgz</b>, will be "
+ "saved to a location of your choice." ) );
+
+ // the frame containing the JavaScript policies settings
+ 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()));
+
+ // Finally do the loading
+ load();
+}
+
+void KJavaScriptOptions::load()
+{
+ load( false );
+}
+
+void KJavaScriptOptions::load( bool useDefaults )
+{
+ m_pConfig->setReadDefaults( useDefaults );
+
+ // *** load ***
+ m_pConfig->setGroup(m_groupname);
+
+ if( m_pConfig->hasKey( "ECMADomains" ) )
+ domainSpecific->initialize(m_pConfig->readListEntry("ECMADomains"));
+ else if( m_pConfig->hasKey( "ECMADomainSettings" ) ) {
+ domainSpecific->updateDomainListLegacy( m_pConfig->readListEntry( "ECMADomainSettings" ) );
+ _removeECMADomainSettings = true;
+ } else {
+ domainSpecific->updateDomainListLegacy(m_pConfig->readListEntry("JavaScriptDomainAdvice") );
+ _removeJavaScriptDomainAdvice = true;
+ }
+
+ // *** apply to GUI ***
+ js_policies_frame->load();
+ enableJavaScriptGloballyCB->setChecked(
+ js_global_policies.isFeatureEnabled());
+ reportErrorsCB->setChecked( m_pConfig->readBoolEntry("ReportJavaScriptErrors",false));
+ jsDebugWindow->setChecked( m_pConfig->readBoolEntry( "EnableJavaScriptDebug",false ) );
+
+ emit changed(useDefaults);
+}
+
+void KJavaScriptOptions::defaults()
+{
+ load( true );
+}
+
+void KJavaScriptOptions::save()
+{
+ m_pConfig->setGroup(m_groupname);
+ m_pConfig->writeEntry( "ReportJavaScriptErrors", reportErrorsCB->isChecked() );
+ m_pConfig->writeEntry( "EnableJavaScriptDebug", jsDebugWindow->isChecked() );
+
+ domainSpecific->save(m_groupname,"ECMADomains");
+ js_policies_frame->save();
+
+ if (_removeECMADomainSettings) {
+ m_pConfig->deleteEntry("ECMADomainSettings");
+ _removeECMADomainSettings = false;
+ }
+
+ // sync moved to KJSParts::save
+// m_pConfig->sync();
+ emit changed(false);
+}
+
+void KJavaScriptOptions::slotChangeJSEnabled() {
+ js_global_policies.setFeatureEnabled(enableJavaScriptGloballyCB->isChecked());
+}
+
+// == class JSDomainListView =====
+
+JSDomainListView::JSDomainListView(KConfig *config,const QString &group,
+ KJavaScriptOptions *options, QWidget *parent,const char *name)
+ : DomainListView(config,i18n( "Do&main-Specific" ), parent, name),
+ group(group), options(options) {
+}
+
+JSDomainListView::~JSDomainListView() {
+}
+
+void JSDomainListView::updateDomainListLegacy(const QStringList &domainConfig)
+{
+ domainSpecificLV->clear();
+ JSPolicies pol(config,group,false);
+ pol.defaults();
+ for (QStringList::ConstIterator it = domainConfig.begin();
+ it != domainConfig.end(); ++it) {
+ QString domain;
+ KHTMLSettings::KJavaScriptAdvice javaAdvice;
+ KHTMLSettings::KJavaScriptAdvice javaScriptAdvice;
+ KHTMLSettings::splitDomainAdvice(*it, domain, javaAdvice, javaScriptAdvice);
+ if (javaScriptAdvice != KHTMLSettings::KJavaScriptDunno) {
+ QListViewItem *index =
+ new QListViewItem( domainSpecificLV, domain,
+ i18n(KHTMLSettings::adviceToStr(javaScriptAdvice)) );
+
+ pol.setDomain(domain);
+ pol.setFeatureEnabled(javaScriptAdvice != KHTMLSettings::KJavaScriptReject);
+ domainPolicies[index] = new JSPolicies(pol);
+ }
+ }
+}
+
+void JSDomainListView::setupPolicyDlg(PushButton trigger,PolicyDialog &pDlg,
+ Policies *pol) {
+ JSPolicies *jspol = static_cast<JSPolicies *>(pol);
+ QString caption;
+ switch (trigger) {
+ case AddButton:
+ caption = i18n( "New JavaScript Policy" );
+ jspol->setFeatureEnabled(!options->enableJavaScriptGloballyCB->isChecked());
+ break;
+ case ChangeButton: caption = i18n( "Change JavaScript Policy" ); break;
+ default: ; // inhibit gcc warning
+ }/*end switch*/
+ pDlg.setCaption(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());
+ panel->refresh();
+ pDlg.addPolicyPanel(panel);
+ pDlg.refresh();
+}
+
+JSPolicies *JSDomainListView::createPolicies() {
+ return new JSPolicies(config,group,false);
+}
+
+JSPolicies *JSDomainListView::copyPolicies(Policies *pol) {
+ return new JSPolicies(*static_cast<JSPolicies *>(pol));
+}
+
+
diff --git a/kcontrol/konqhtml/jsopts.h b/kcontrol/konqhtml/jsopts.h
new file mode 100644
index 000000000..41f5c87fd
--- /dev/null
+++ b/kcontrol/konqhtml/jsopts.h
@@ -0,0 +1,90 @@
+//-----------------------------------------------------------------------------
+//
+// HTML Options
+//
+// (c) Martin R. Jones 1996
+//
+// Port to KControl
+// (c) Torben Weis 1998
+
+#ifndef __JSOPTS_H__
+#define __JSOPTS_H__
+
+#include <kcmodule.h>
+
+#include "domainlistview.h"
+#include "jspolicies.h"
+
+class KColorButton;
+class KConfig;
+class KURLRequester;
+class QCheckBox;
+class QComboBox;
+class QLineEdit;
+class QListViewItem;
+class QRadioButton;
+class QSpinBox;
+class QButtonGroup;
+
+class PolicyDialog;
+
+class KJavaScriptOptions;
+
+/** JavaScript-specific enhancements to the domain list view
+ */
+class JSDomainListView : public DomainListView {
+ Q_OBJECT
+public:
+ JSDomainListView(KConfig *config,const QString &group,KJavaScriptOptions *opt,
+ QWidget *parent,const char *name = 0);
+ virtual ~JSDomainListView();
+
+ /** remnant for importing pre KDE 3.2 settings
+ */
+ void updateDomainListLegacy(const QStringList &domainConfig);
+
+protected:
+ virtual JSPolicies *createPolicies();
+ virtual JSPolicies *copyPolicies(Policies *pol);
+ virtual void setupPolicyDlg(PushButton trigger,PolicyDialog &pDlg,
+ Policies *copy);
+
+private:
+ QString group;
+ KJavaScriptOptions *options;
+};
+
+class KJavaScriptOptions : public KCModule
+{
+ Q_OBJECT
+public:
+ KJavaScriptOptions( KConfig* config, QString group, QWidget* parent = 0, const char* name = 0 );
+
+ virtual void load();
+ virtual void load( bool useDefaults );
+ virtual void save();
+ virtual void defaults();
+
+ bool _removeJavaScriptDomainAdvice;
+
+private slots:
+ void slotChangeJSEnabled();
+
+private:
+
+ KConfig *m_pConfig;
+ QString m_groupname;
+ JSPolicies js_global_policies;
+ QCheckBox *enableJavaScriptGloballyCB;
+ QCheckBox *reportErrorsCB;
+ QCheckBox *jsDebugWindow;
+ JSPoliciesFrame *js_policies_frame;
+ bool _removeECMADomainSettings;
+
+ JSDomainListView* domainSpecific;
+
+ friend class JSDomainListView;
+};
+
+#endif // __JSOPTS_H__
+
diff --git a/kcontrol/konqhtml/jspolicies.cpp b/kcontrol/konqhtml/jspolicies.cpp
new file mode 100644
index 000000000..d4afbbd1d
--- /dev/null
+++ b/kcontrol/konqhtml/jspolicies.cpp
@@ -0,0 +1,407 @@
+/*
+ Copyright (c) 2002 Leo Savernik <l.savernik@aon.at>
+ Derived from jsopt.cpp, code copied from there is copyrighted to its
+ respective owners.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include <qbuttongroup.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qradiobutton.h>
+#include <qwhatsthis.h>
+
+#include <kconfig.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+#include "jspolicies.h"
+
+// == class JSPolicies ==
+
+JSPolicies::JSPolicies(KConfig* config,const QString &group,
+ bool global,const QString &domain) :
+ Policies(config,group,global,domain,"javascript.","EnableJavaScript") {
+}
+
+JSPolicies::JSPolicies() : Policies(0,QString::null,false,
+ QString::null,QString::null,QString::null) {
+}
+
+JSPolicies::~JSPolicies() {
+}
+
+void JSPolicies::load() {
+ Policies::load();
+
+ QString key;
+
+// enableJavaScriptDebugCB->setChecked( m_pConfig->readBoolEntry("EnableJavaScriptDebug",false));
+// enableDebugOutputCB->setChecked( m_pConfig->readBoolEntry("EnableJSDebugOutput") );
+ key = prefix + "WindowOpenPolicy";
+ window_open = config->readUnsignedNumEntry(key,
+ is_global ? KHTMLSettings::KJSWindowOpenSmart : INHERIT_POLICY);
+
+ key = prefix + "WindowResizePolicy";
+ window_resize = config->readUnsignedNumEntry(key,
+ is_global ? KHTMLSettings::KJSWindowResizeAllow : INHERIT_POLICY);
+
+ key = prefix + "WindowMovePolicy";
+ window_move = config->readUnsignedNumEntry(key,
+ is_global ? KHTMLSettings::KJSWindowMoveAllow : INHERIT_POLICY);
+
+ key = prefix + "WindowFocusPolicy";
+ window_focus = config->readUnsignedNumEntry(key,
+ is_global ? KHTMLSettings::KJSWindowFocusAllow : INHERIT_POLICY);
+
+ key = prefix + "WindowStatusPolicy";
+ window_status = config->readUnsignedNumEntry(key,
+ is_global ? KHTMLSettings::KJSWindowStatusAllow : INHERIT_POLICY);
+}
+
+void JSPolicies::defaults() {
+ Policies::defaults();
+// enableJavaScriptGloballyCB->setChecked( true );
+// enableJavaScriptDebugCB->setChecked( false );
+// js_popup->setButton(0);
+ // enableDebugOutputCB->setChecked( false );
+ window_open = is_global ? KHTMLSettings::KJSWindowOpenSmart : INHERIT_POLICY;
+ window_resize = is_global ? KHTMLSettings::KJSWindowResizeAllow : INHERIT_POLICY;
+ window_move = is_global ? KHTMLSettings::KJSWindowMoveAllow : INHERIT_POLICY;
+ window_focus = is_global ? KHTMLSettings::KJSWindowFocusAllow : INHERIT_POLICY;
+ window_status = is_global ? KHTMLSettings::KJSWindowStatusAllow : INHERIT_POLICY;
+}
+
+void JSPolicies::save() {
+ Policies::save();
+
+ QString key;
+ key = prefix + "WindowOpenPolicy";
+ if (window_open != INHERIT_POLICY)
+ config->writeEntry(key, window_open);
+ else
+ config->deleteEntry(key);
+
+ key = prefix + "WindowResizePolicy";
+ if (window_resize != INHERIT_POLICY)
+ config->writeEntry(key, window_resize);
+ else
+ config->deleteEntry(key);
+
+ key = prefix + "WindowMovePolicy";
+ if (window_move != INHERIT_POLICY)
+ config->writeEntry(key, window_move);
+ else
+ config->deleteEntry(key);
+
+ key = prefix + "WindowFocusPolicy";
+ if (window_focus != INHERIT_POLICY)
+ config->writeEntry(key, window_focus);
+ else
+ config->deleteEntry(key);
+
+ key = prefix + "WindowStatusPolicy";
+ if (window_status != INHERIT_POLICY)
+ config->writeEntry(key, window_status);
+ else
+ config->deleteEntry(key);
+
+ // don't do a config->sync() here for sake of efficiency
+}
+
+// == class JSPoliciesFrame ==
+
+JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title,
+ QWidget* parent) :
+ QGroupBox(title, parent, "jspoliciesframe"),
+ policies(policies) {
+
+ bool is_per_domain = !policies->isGlobal();
+
+ setColumnLayout(0, Qt::Vertical);
+ layout()->setSpacing(0);
+ layout()->setMargin(0);
+ QGridLayout *this_layout = new QGridLayout(layout(),5,10+is_per_domain*2);
+ this_layout->setAlignment(Qt::AlignTop);
+ this_layout->setSpacing(3);
+ this_layout->setMargin(11);
+
+ QString wtstr; // what's this description
+ int colIdx; // column index
+
+ // === window.open ================================
+ colIdx = 0;
+ QLabel *label = new QLabel(i18n("Open new windows:"),this);
+ this_layout->addWidget(label,0,colIdx++);
+
+ js_popup = new QButtonGroup(this);
+ js_popup->setExclusive(true);
+ js_popup->setHidden(true);
+
+ QRadioButton* policy_btn;
+ if (is_per_domain) {
+ policy_btn = new QRadioButton(i18n("Use global"), this);
+ QWhatsThis::add(policy_btn,i18n("Use setting from global policy."));
+ js_popup->insert(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);
+ QWhatsThis::add(policy_btn,i18n("Accept all popup window requests."));
+ js_popup->insert(policy_btn,KHTMLSettings::KJSWindowOpenAllow);
+ this_layout->addWidget(policy_btn,0,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ policy_btn = new QRadioButton(i18n("Ask"), this);
+ QWhatsThis::add(policy_btn,i18n("Prompt every time a popup window is requested."));
+ js_popup->insert(policy_btn,KHTMLSettings::KJSWindowOpenAsk);
+ this_layout->addWidget(policy_btn,0,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ policy_btn = new QRadioButton(i18n("Deny"), this);
+ QWhatsThis::add(policy_btn,i18n("Reject all popup window requests."));
+ js_popup->insert(policy_btn,KHTMLSettings::KJSWindowOpenDeny);
+ this_layout->addWidget(policy_btn,0,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ policy_btn = new QRadioButton(i18n("Smart"), this);
+ QWhatsThis::add(policy_btn, i18n("Accept popup window requests only when "
+ "links are activated through an explicit "
+ "mouse click or keyboard operation."));
+ js_popup->insert(policy_btn,KHTMLSettings::KJSWindowOpenSmart);
+ this_layout->addWidget(policy_btn,0,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ wtstr = i18n("If you disable this, Konqueror will stop "
+ "interpreting the <i>window.open()</i> "
+ "JavaScript command. This is useful if you "
+ "regularly visit sites that make extensive use "
+ "of this command to pop up ad banners.<br>"
+ "<br><b>Note:</b> Disabling this option might "
+ "also break certain sites that require <i>"
+ "window.open()</i> for proper operation. Use "
+ "this feature carefully.");
+ QWhatsThis::add(label, wtstr);
+ connect(js_popup, SIGNAL(clicked(int)), SLOT(setWindowOpenPolicy(int)));
+
+ // === window.resizeBy/resizeTo ================================
+ colIdx = 0;
+ label = new QLabel(i18n("Resize window:"),this);
+ this_layout->addWidget(label,1,colIdx++);
+
+ js_resize = new QButtonGroup(this);
+ js_resize->setExclusive(true);
+ js_resize->setHidden(true);
+
+ if (is_per_domain) {
+ policy_btn = new QRadioButton(i18n("Use global"), this);
+ QWhatsThis::add(policy_btn,i18n("Use setting from global policy."));
+ js_resize->insert(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);
+ QWhatsThis::add(policy_btn,i18n("Allow scripts to change the window size."));
+ js_resize->insert(policy_btn,KHTMLSettings::KJSWindowResizeAllow);
+ this_layout->addWidget(policy_btn,1,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ policy_btn = new QRadioButton(i18n("Ignore"), this);
+ QWhatsThis::add( policy_btn,i18n("Ignore attempts of scripts to change the window size. "
+ "The web page will <i>think</i> it changed the "
+ "size but the actual window is not affected."));
+ js_resize->insert(policy_btn,KHTMLSettings::KJSWindowResizeIgnore);
+ this_layout->addWidget(policy_btn,1,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ wtstr = i18n("Some websites change the window size on their own by using "
+ "<i>window.resizeBy()</i> or <i>window.resizeTo()</i>. "
+ "This option specifies the treatment of such "
+ "attempts.");
+ QWhatsThis::add(label, wtstr);
+ connect(js_resize, SIGNAL(clicked(int)), SLOT(setWindowResizePolicy(int)));
+
+ // === window.moveBy/moveTo ================================
+ colIdx = 0;
+ label = new QLabel(i18n("Move window:"),this);
+ this_layout->addWidget(label,2,colIdx++);
+
+ js_move = new QButtonGroup(this);
+ js_move->setExclusive(true);
+ js_move->setHidden(true);
+
+ if (is_per_domain) {
+ policy_btn = new QRadioButton(i18n("Use global"), this);
+ QWhatsThis::add(policy_btn,i18n("Use setting from global policy."));
+ js_move->insert(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);
+ QWhatsThis::add(policy_btn,i18n("Allow scripts to change the window position."));
+ js_move->insert(policy_btn,KHTMLSettings::KJSWindowMoveAllow);
+ this_layout->addWidget(policy_btn,2,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ policy_btn = new QRadioButton(i18n("Ignore"), this);
+ QWhatsThis::add(policy_btn,i18n("Ignore attempts of scripts to change the window position. "
+ "The web page will <i>think</i> it moved the "
+ "window but the actual position is not affected."));
+ js_move->insert(policy_btn,KHTMLSettings::KJSWindowMoveIgnore);
+ this_layout->addWidget(policy_btn,2,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ wtstr = i18n("Some websites change the window position on their own by using "
+ "<i>window.moveBy()</i> or <i>window.moveTo()</i>. "
+ "This option specifies the treatment of such "
+ "attempts.");
+ QWhatsThis::add(label, wtstr);
+ connect(js_move, SIGNAL(clicked(int)), SLOT(setWindowMovePolicy(int)));
+
+ // === window.focus ================================
+ colIdx = 0;
+ label = new QLabel(i18n("Focus window:"),this);
+ this_layout->addWidget(label,3,colIdx++);
+
+ js_focus = new QButtonGroup(this);
+ js_focus->setExclusive(true);
+ js_focus->setHidden(true);
+
+ if (is_per_domain) {
+ policy_btn = new QRadioButton(i18n("Use global"), this);
+ QWhatsThis::add(policy_btn,i18n("Use setting from global policy."));
+ js_focus->insert(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);
+ QWhatsThis::add( policy_btn,i18n("Allow scripts to focus the window.") );
+ js_focus->insert(policy_btn,KHTMLSettings::KJSWindowFocusAllow);
+ this_layout->addWidget(policy_btn,3,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ policy_btn = new QRadioButton(i18n("Ignore"), this);
+ QWhatsThis::add( policy_btn,i18n("Ignore attempts of scripts to focus the window. "
+ "The web page will <i>think</i> it brought "
+ "the focus to the window but the actual "
+ "focus will remain unchanged.") );
+ js_focus->insert(policy_btn,KHTMLSettings::KJSWindowFocusIgnore);
+ this_layout->addWidget(policy_btn,3,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ wtstr = i18n("Some websites set the focus to their browser window on their "
+ "own by using <i>window.focus()</i>. This usually leads to "
+ "the window being moved to the front interrupting whatever "
+ "action the user was dedicated to at that time. "
+ "This option specifies the treatment of such "
+ "attempts.");
+ QWhatsThis::add(label, wtstr);
+ connect(js_focus, SIGNAL(clicked(int)), SLOT(setWindowFocusPolicy(int)));
+
+ // === window.status ================================
+ colIdx = 0;
+ label = new QLabel(i18n("Modify status bar text:"),this);
+ this_layout->addWidget(label,4,colIdx++);
+
+ js_statusbar = new QButtonGroup(this);
+ js_statusbar->setExclusive(true);
+ js_statusbar->setHidden(true);
+
+ if (is_per_domain) {
+ policy_btn = new QRadioButton(i18n("Use global"), this);
+ QWhatsThis::add(policy_btn,i18n("Use setting from global policy."));
+ js_statusbar->insert(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);
+ QWhatsThis::add(policy_btn,i18n("Allow scripts to change the text of the status bar."));
+ js_statusbar->insert(policy_btn,KHTMLSettings::KJSWindowStatusAllow);
+ this_layout->addWidget(policy_btn,4,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ policy_btn = new QRadioButton(i18n("Ignore"), this);
+ QWhatsThis::add( policy_btn,i18n("Ignore attempts of scripts to change the status bar text. "
+ "The web page will <i>think</i> it changed "
+ "the text but the actual text will remain "
+ "unchanged.") );
+ js_statusbar->insert(policy_btn,KHTMLSettings::KJSWindowStatusIgnore);
+ this_layout->addWidget(policy_btn,4,colIdx++);
+ this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
+
+ wtstr = i18n("Some websites change the status bar text by setting "
+ "<i>window.status</i> or <i>window.defaultStatus</i>, "
+ "thus sometimes preventing displaying the real URLs of hyperlinks. "
+ "This option specifies the treatment of such "
+ "attempts.");
+ QWhatsThis::add(label, wtstr);
+ connect(js_statusbar, SIGNAL(clicked(int)), SLOT(setWindowStatusPolicy(int)));
+}
+
+JSPoliciesFrame::~JSPoliciesFrame() {
+}
+
+void JSPoliciesFrame::refresh() {
+ QRadioButton *button;
+ button = static_cast<QRadioButton *>(js_popup->find(
+ policies->window_open));
+ if (button != 0) button->setChecked(true);
+ button = static_cast<QRadioButton *>(js_resize->find(
+ policies->window_resize));
+ if (button != 0) button->setChecked(true);
+ button = static_cast<QRadioButton *>(js_move->find(
+ policies->window_move));
+ if (button != 0) button->setChecked(true);
+ button = static_cast<QRadioButton *>(js_focus->find(
+ policies->window_focus));
+ if (button != 0) button->setChecked(true);
+ button = static_cast<QRadioButton *>(js_statusbar->find(
+ policies->window_status));
+ if (button != 0) button->setChecked(true);
+}
+
+void JSPoliciesFrame::setWindowOpenPolicy(int id) {
+ policies->window_open = id;
+ emit changed();
+}
+
+void JSPoliciesFrame::setWindowResizePolicy(int id) {
+ policies->window_resize = id;
+ emit changed();
+}
+
+void JSPoliciesFrame::setWindowMovePolicy(int id) {
+ policies->window_move = id;
+ emit changed();
+}
+
+void JSPoliciesFrame::setWindowFocusPolicy(int id) {
+ policies->window_focus = id;
+ emit changed();
+}
+
+void JSPoliciesFrame::setWindowStatusPolicy(int id) {
+ policies->window_status = id;
+ emit changed();
+}
+
+#include "jspolicies.moc"
diff --git a/kcontrol/konqhtml/jspolicies.h b/kcontrol/konqhtml/jspolicies.h
new file mode 100644
index 000000000..a955abc96
--- /dev/null
+++ b/kcontrol/konqhtml/jspolicies.h
@@ -0,0 +1,270 @@
+/*
+ Copyright (c) 2002 Leo Savernik <l.savernik@aon.at>
+ Derived from jsopt.h, code copied from there is copyrighted to its
+ respective owners.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef __JSPOLICIES_H__
+#define __JSPOLICIES_H__
+
+#include <qgroupbox.h>
+#include <qstring.h>
+
+#include <khtml_settings.h>
+
+#include "policies.h"
+
+class KConfig;
+class QRadioButton;
+class QButtonGroup;
+
+// special value for inheriting a global policy
+#define INHERIT_POLICY 32767
+
+/**
+ * @short Contains all the JavaScript policies and methods for their manipulation.
+ *
+ * This class provides access to the JavaScript policies.
+ *
+ * @author Leo Savernik
+ */
+class JSPolicies : public Policies {
+public:
+#if 0
+ /**
+ * Enumeration for all policies
+ */
+ enum Policies { JavaScriptEnabled = 0, WindowOpen, WindowResize,
+ WindowMove, WindowFocus, WindowStatus, NumPolicies };
+#endif
+
+ /**
+ * 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)
+ */
+ JSPolicies(KConfig* config, const QString &group, bool global,
+ const QString &domain = QString::null);
+
+ /**
+ * dummy constructor to make QMap happy.
+ *
+ * Never construct an object by using this.
+ * @internal
+ */
+ JSPolicies();
+
+ virtual ~JSPolicies();
+
+ /**
+ * Returns whether the WindowOpen policy is inherited.
+ */
+ bool isWindowOpenPolicyInherited() const {
+ return window_open == INHERIT_POLICY;
+ }
+ /**
+ * Returns the current value of the WindowOpen policy.
+ *
+ * This will return an illegal value if isWindowOpenPolicyInherited is
+ * true.
+ */
+ KHTMLSettings::KJSWindowOpenPolicy windowOpenPolicy() const {
+ return (KHTMLSettings::KJSWindowOpenPolicy)window_open;
+ }
+
+ /**
+ * Returns whether the WindowResize policy is inherited.
+ */
+ bool isWindowResizePolicyInherited() const {
+ return window_resize == INHERIT_POLICY;
+ }
+ /**
+ * Returns the current value of the WindowResize policy.
+ *
+ * This will return an illegal value if isWindowResizePolicyInherited is
+ * true.
+ */
+ KHTMLSettings::KJSWindowResizePolicy windowResizePolicy() const {
+ return (KHTMLSettings::KJSWindowResizePolicy)window_resize;
+ }
+
+ /**
+ * Returns whether the WindowMove policy is inherited.
+ */
+ bool isWindowMovePolicyInherited() const {
+ return window_move == INHERIT_POLICY;
+ }
+ /**
+ * Returns the current value of the WindowMove policy.
+ *
+ * This will return an illegal value if isWindowMovePolicyInherited is
+ * true.
+ */
+ KHTMLSettings::KJSWindowMovePolicy windowMovePolicy() const {
+ return (KHTMLSettings::KJSWindowMovePolicy)window_move;
+ }
+
+ /**
+ * Returns whether the WindowFocus policy is inherited.
+ */
+ bool isWindowFocusPolicyInherited() const {
+ return window_focus == INHERIT_POLICY;
+ }
+ /**
+ * Returns the current value of the WindowFocus policy.
+ *
+ * This will return an illegal value if isWindowFocusPolicyInherited is
+ * true.
+ */
+ KHTMLSettings::KJSWindowFocusPolicy windowFocusPolicy() const {
+ return (KHTMLSettings::KJSWindowFocusPolicy)window_focus;
+ }
+
+ /**
+ * Returns whether the WindowStatus policy is inherited.
+ */
+ bool isWindowStatusPolicyInherited() const {
+ return window_status == INHERIT_POLICY;
+ }
+ /**
+ * Returns the current value of the WindowStatus policy.
+ *
+ * This will return an illegal value if isWindowStatusPolicyInherited is
+ * true.
+ */
+ KHTMLSettings::KJSWindowStatusPolicy windowStatusPolicy() const {
+ return (KHTMLSettings::KJSWindowStatusPolicy)window_status;
+ }
+
+ /**
+ * (re)loads settings from configuration file given in the constructor.
+ */
+ virtual void load();
+ /**
+ * saves current settings to the configuration file given in the constructor
+ */
+ virtual void save();
+ /**
+ * restores the default settings
+ */
+ virtual void defaults();
+
+private:
+ // one of KHTMLSettings::KJSWindowOpenPolicy or INHERIT_POLICY
+ unsigned int window_open;
+ // one of KHTMLSettings::KJSWindowResizePolicy or INHERIT_POLICY
+ unsigned int window_resize;
+ // one of KHTMLSettings::KJSWindowMovePolicy or INHERIT_POLICY
+ unsigned int window_move;
+ // one of KHTMLSettings::KJSWindowFocusPolicy or INHERIT_POLICY
+ unsigned int window_focus;
+ // one of KHTMLSettings::KJSWindowStatusPolicy or INHERIT_POLICY
+ unsigned int window_status;
+
+ friend class JSPoliciesFrame; // for changing policies
+};
+
+/**
+ * @short Provides a framed widget with controls for the JavaScript policy settings.
+ *
+ * This widget contains controls for changing all JavaScript policies
+ * except the JavaScript enabled policy itself. The rationale behind this is
+ * that the enabled policy be separate from the rest in a prominent
+ * place.
+ *
+ * It is suitable for the global policy settings as well as for the
+ * domain-specific settings.
+ *
+ * The difference between global and domain-specific is the existence of
+ * a special inheritance option in the latter case. That way domain-specific
+ * policies can inherit their value from the global policies.
+ *
+ * @author Leo Savernik
+ */
+class JSPoliciesFrame : public QGroupBox {
+ Q_OBJECT
+public:
+ /**
+ * constructor
+ * @param policies associated object containing the policy values. This
+ * object will be updated accordingly as the settings are changed.
+ * @param title title for group box
+ * @param parent parent widget
+ */
+ JSPoliciesFrame(JSPolicies *policies, const QString &title,
+ QWidget* parent = 0);
+
+ virtual ~JSPoliciesFrame();
+
+ /**
+ * updates the controls to resemble the status of the underlying
+ * JSPolicies object.
+ */
+ void refresh();
+ /**
+ * (re)loads settings from configuration file given in the constructor.
+ */
+ void load() {
+ policies->load();
+ refresh();
+ }
+ /**
+ * saves current settings to the configuration file given in the constructor
+ */
+ void save() {
+ policies->save();
+ }
+ /**
+ * restores the default settings
+ */
+ void defaults() {
+ policies->defaults();
+ refresh();
+ }
+
+signals:
+ /**
+ * emitted every time an option has been changed
+ */
+ void changed();
+
+private slots:
+ void setWindowOpenPolicy(int id);
+ void setWindowResizePolicy(int id);
+ void setWindowMovePolicy(int id);
+ void setWindowFocusPolicy(int id);
+ void setWindowStatusPolicy(int id);
+
+private:
+
+ JSPolicies *policies;
+ QButtonGroup *js_popup;
+ QButtonGroup *js_resize;
+ QButtonGroup *js_move;
+ QButtonGroup *js_focus;
+ QButtonGroup *js_statusbar;
+};
+
+
+#endif // __JSPOLICIES_H__
+
diff --git a/kcontrol/konqhtml/khtml_behavior.desktop b/kcontrol/konqhtml/khtml_behavior.desktop
new file mode 100644
index 000000000..60719d007
--- /dev/null
+++ b/kcontrol/konqhtml/khtml_behavior.desktop
@@ -0,0 +1,231 @@
+[Desktop Entry]
+Type=Application
+DocPath=kcontrol/khtml/index.html#kbrowse-html
+Icon=konqueror
+Exec=kcmshell khtml_behavior
+
+
+X-KDE-Library=konqhtml
+X-KDE-FactoryName=khtml_behavior
+
+Name=Web Behavior
+Name[af]=Web Gedrag
+Name[ar]=سلوك الشبكة
+Name[az]=Veb Davranışı
+Name[be]=Паводзіны ў Сеціве
+Name[bg]=Уеб браузър
+Name[bn]=ওয়েব আচরণ
+Name[br]=Emzalc'h ar gwiad
+Name[bs]=Ponašanje web preglednika
+Name[ca]=Comportament web
+Name[cs]=Chování na webu
+Name[csb]=Przezéranié WWW
+Name[cy]=Ymddygiad Gwê
+Name[da]=WWW-Opførsel
+Name[de]=Webverhalten
+Name[el]=Συμπεριφορά ιστού
+Name[en_GB]=Web Behaviour
+Name[eo]=TTT-Konduto
+Name[es]=Comportamiento
+Name[et]=Veebilehitseja käitumine
+Name[eu]=Web portaera
+Name[fa]=رفتار وب
+Name[fi]=Verkkokäyttäytyminen
+Name[fr]=Comportement web
+Name[fy]=Webgedrach
+Name[ga]=Oibriú Lín
+Name[gl]=Comportamento Web
+Name[he]=התנהגות רשת
+Name[hi]=वेब बर्ताव
+Name[hr]=Web ponašanje
+Name[hu]=Webes működés
+Name[is]=Vefhegðun
+Name[it]=Comportamento Web
+Name[ja]=ウェブでの挙動
+Name[ka]=წევ ქცევა
+Name[kk]=Веб қасиеттері
+Name[km]=ឥរិយាបថ​បណ្ដាញ
+Name[ko]=웹 행동
+Name[lt]=Žiniatinklio elgsena
+Name[lv]=Tīmekļa izturēšanās
+Name[mk]=Веб-однесување
+Name[mn]=Вэб байдал
+Name[ms]=Kelakuan Web
+Name[mt]=Imġieba web
+Name[nb]=Nettoppførsel
+Name[nds]=Bedregen in't Nett
+Name[ne]=वेभ व्यवहार
+Name[nl]=Webgedrag
+Name[nn]=Vevåtferd
+Name[pa]=ਵੈਬ ਵਿਹਾਰ
+Name[pl]=Przeglądanie WWW
+Name[pt]=Comportamento na Web
+Name[pt_BR]=Comportamento Web
+Name[ro]=Comportament web
+Name[ru]=Поведение Веб
+Name[rw]=Imyitwarire Urubugamakuru
+Name[se]=Webláhtten
+Name[sk]=Správanie WWW
+Name[sl]=Spletno obnašanje
+Name[sr]=Веб понашање
+Name[sr@Latn]=Veb ponašanje
+Name[sv]=Nätbeteende
+Name[ta]=வலைப் பண்புகள்
+Name[te]=వెబ్ ప్రవర్తన
+Name[tg]=Рафтори Вэб
+Name[th]=พฤติกรรมของเว็บ
+Name[tr]=Web Davranışı
+Name[tt]=Web Çağılışı
+Name[uk]=Поведінка Навігатора
+Name[uz]=Veb xususiyatlari
+Name[uz@cyrillic]=Веб хусусиятлари
+Name[vi]=Cách hoạt động của duyệt mạng
+Name[wa]=Dujhance waibe
+Name[zh_CN]=Web 行为
+Name[zh_TW]=網頁行為
+Comment=Configure the browser behavior
+Comment[af]=Konfigureer die blaaier gedrag
+Comment[ar]=إعداد سلوك المتصفح
+Comment[be]=Настаўленні паводзінаў вандроўніка
+Comment[bg]=Настройване на уеб браузъра
+Comment[bn]=ব্রাউজারের আচরণ কনফিগার করুন
+Comment[br]=Kefluniañ emzalc'h ar furcher
+Comment[bs]=Podesite ponašanje web preglednika
+Comment[ca]=Configura el comportament del navegador
+Comment[cs]=Nastavení chování prohlížeče
+Comment[csb]=Kònfigùracëjô zachòwaniô przezérnika
+Comment[cy]=Ffurfweddu ymddygiad y porydd
+Comment[da]=Indstil browserens opførsel
+Comment[de]=Verhalten des Webbrowsers festlegen
+Comment[el]=Ρυθμίστε τη συμπεριφορά του περιηγητή
+Comment[en_GB]=Configure the browser behaviour
+Comment[eo]=Agordas la konduton de la TTT-legilo
+Comment[es]=Configuración del comportamiento del navegador
+Comment[et]=Konquerori veebilehitseja käitumine
+Comment[eu]=Konfiguratu arakatzailearen portaera
+Comment[fa]=پیکربندی رفتار مرورگر
+Comment[fi]=Selaimen asetukset
+Comment[fr]=Configuration du comportement du navigateur
+Comment[fy]=Hjir kinne jo it gedrach fan de webblêder ynstelle
+Comment[ga]=Cumraigh oibriú an bhrabhsálaí
+Comment[gl]=Configurar o comportamento do navegador
+Comment[he]=שינוי הגדרות פעולת הדפדפן
+Comment[hi]=वेब बर्ताव कॉन्फ़िगर करें
+Comment[hr]=Konfiguriranje ponašanja preglednika
+Comment[hu]=A Konqueror webböngésző részének működési jellemzői
+Comment[is]=Stilla hegðan vafrara
+Comment[it]=Configura il comportamento del browser
+Comment[ja]=ウェブブラウザの挙動を設定
+Comment[ka]=ბრაუზერის ქცევის კონფიგურაცია
+Comment[kk]=Браузер қасиеттерін баптау
+Comment[km]=កំណត់​រចនាសម្ព័ន្ធ​ឥរិយាបថ​កម្មវិធី​រុករក​បណ្ដាញ
+Comment[ko]=브라우저 행동 설정
+Comment[lo]=ປັບແຕ່ງເຊີເວີພຣັອກຊີ
+Comment[lt]=Konfigūruoti naršyklės elgesį
+Comment[lv]=Konfigurēt pārlūka izturešanos
+Comment[mk]=Конфигурирајте го однесувањето на прелистувачот
+Comment[mn]=Вэб-Хөтөчийн байдлыг тогтоох
+Comment[ms]=Konfigur kalakuan pelayar
+Comment[mt]=Ikkonfigura l-imġieba tal-browser
+Comment[nb]=Tilpass nettleserens oppførsel
+Comment[nds]=Dat Bedregen vun den Nettkieker instellen
+Comment[ne]=ब्राउजरको व्यवहार कन्फिगर गर्नुहोस्
+Comment[nl]=Hier kunt u het gedrag van de webbrowser instellen
+Comment[nn]=Oppsett av nettlesaråtferda
+Comment[nso]=Beakanya maitshwaro a seinyakisi
+Comment[pa]=ਝਲਕਾਰਾ ਵਿਹਾਰ ਸੰਰਚਨਾ
+Comment[pl]=Konfiguracja zachowania przeglądarki
+Comment[pt]=Configurar o comportamento do navegador
+Comment[pt_BR]=Configura o comportamento do navegador
+Comment[ro]=Configurează comportamentul de navigator de web
+Comment[ru]=Настройка поведения браузера
+Comment[rw]=Kuboneza imyitwarire ya mucukumbuzi
+Comment[se]=Heivet mo fierpmádatlogan láhtte
+Comment[sk]=Nastavenie správania prehliadača
+Comment[sl]=Nastavitve obnašanja brskalnika
+Comment[sr]=Подешавање понашања прегледача
+Comment[sr@Latn]=Podešavanje ponašanja pregledača
+Comment[sv]=Anpassa webbläsarens beteende
+Comment[ta]=உலாவியின் இயக்கத்தை வடிவமை
+Comment[tg]=Танзими рафтори тафсир
+Comment[th]=ปรับแต่งพฤติกรมของบราวเซอร์
+Comment[tr]=Web tarayıcı davranışlarını yapılandır
+Comment[tt]=Girgeç çağılışın caylaw
+Comment[uk]=Налаштування поведінки навігатора
+Comment[uz]=Brauzerning xususiyatlarini moslash
+Comment[uz@cyrillic]=Браузернинг хусусиятларини мослаш
+Comment[ven]=Dzudzanyani maitele a burausa
+Comment[vi]=Cấu hình cách hoạt động của trình duyệt
+Comment[wa]=Apontyî l' dujhance do betchteu waibe
+Comment[xh]=Qwalasela indlela umkhangeli zincwadi aziphatha ngayo
+Comment[zh_CN]=配置浏览器行为
+Comment[zh_TW]=設定瀏覽器行為
+Comment[zu]=Hlanaganisela ukuziphatha komcingi
+Keywords=konqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encoding
+Keywords[az]=konqueror,kfm,səyyah,html,şəbəkə,www,yazı növləri,rənglər,java,javascript,hərf,hərf dəstəsi,kodlama,bağlantılar,rəsmlər,ox
+Keywords[be]=Вандроўнік,Сеціва,Шрыфты,Колеры,Сцэнар,Курсор,Спасылкі,Відарысы,Малюнкі,Знаказбор,Знаказборы,konqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encoding
+Keywords[bg]=браузър, страници, Интернет, уеб, konqueror,kfm, browser, html, web, www, fonts, colours, colors, java, javascript, cursor, links, images, charsets, character sets, encoding
+Keywords[bs]=konqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encoding,kodni raspored,preglednik,fontovi,boje,font,boja,kursor,link,linkovi,slike,slika,skup znakova
+Keywords[ca]=konqueror,kfm,navegador,html,web,www,lletres,colorits,colors,java,javascript,cursor,enllaços,imatges,caràcters,joc de caràcters,codificació
+Keywords[cs]=Konqueror,Kfm,Prohlížeč,HTML,Web,WWW,Písma,Barvy,Java,JavaScript, Kurzor,Odkazy,Obrázky,Znakové sady,Kódování
+Keywords[csb]=konqueror,kfm,przezérnik,html,séc www,fòntë,farwë,java,javascript,kùrsor,lënczi,òbrôzczi,zestôw merków,kòdowanié
+Keywords[cy]=konqueror,kfm,porydd,html,gw?,www,ffontiau,lliwiau,java,javascript,cyrchydd,cysylltiadau,delweddau,setiau nodau,nod,amgodiad
+Keywords[da]=konqueror,kfm,browser,HTML,net,skrifttyper,farver,java,javascript,markør,henvisninger,billeder,tegnsæt,indkodning
+Keywords[de]=Konqueror,Kfm,Browser,HTML,Web,WWW,Schriften,Farben,Java,JavaScript,Cursor,Links,Verknüpfungen,Bilder,Zeichensätze,Encoding
+Keywords[el]=konqueror,kfm,περιηγητής,html,ιστός,www,γραμματοσειρές,χρώματα,χρώματα,java,javascript,δρομέας,δεσμοί,εικόνες,σύνολα χαρακτήρων,σύνολα χαρακτήρων,κωδικοποίηση
+Keywords[en_GB]=konqueror,kfm,browser,html,web,www,fonts,colours,java,javascript,cursor,links,images,charsets,character sets,encoding
+Keywords[eo]=Konkeranto,Kfm,TTT,HTML,WWW,tiparo,koloro,Javo,Javoskripto,kursoro,kursilo,ligo,referenco,bildo,signaro,kodo
+Keywords[es]=konqueror,kfm,navegador,html,web,www,tipo de letra,colores,java,javascript,cursor,enlaces,imágenes,mapas de caracteres,codificación
+Keywords[et]=konqueror,kfm,veebilehitseja,html,veeb,www,fondid,värvid,java,javascript,kursor,viidad,lingid,pildid,kooditabel,kodeering
+Keywords[eu]=konqueror,kfm,arakatzailea,html,web,www,letra-tipoak,koloreak,java,javascript,kurtsorea,linkak,irudiak,karaktere-multzoak,karaktereen hobespenak,kodeketa
+Keywords[fa]=konqueror، kfm، مرورگر، زنگام، وب، www، قلمها، رنگها، رنگها، جاوا، جاوااسکریپت، مکان‌نما، پیوندها، تصاویر، نوسه‌گان، نویسه‌گان، کدبندی
+Keywords[fi]=konqueror,kfm,selain,html,web,www,kirjasimet,värit,java,javascript,osoitin,linkit,kuvat,merkistöt,koodaus
+Keywords[fr]=konqueror,kfm,navigateur,html,web,www,polices,couleurs,java,javascript,curseur,liens,images,jeu de caractères,caractères,codage,encodage
+Keywords[fy]=konqueror,kfm,browser,blêder,html,web,www,fonts,lettertypen,kleuren,java,javascript,javaskript,cursor,links,rinnerke,skeakels,ôfbyldingen,charsets,tekensets,karaktersamling,kodearring,ynternet
+Keywords[ga]=konqueror,kfm,brabhsálaí,html,gréasán,www,clófhoirne,clónna,dathanna,java,javascript,cúrsóir,naisc,nascanna,íomhánna,tacair charachtair,ionchódú
+Keywords[gl]=konqueror,kfm,navegador,html,web,www,fontes,cores,java,javascript,ponteiro,ligazóns,imaxes,carácteres,conxunto de carácteres,codificación
+Keywords[he]=גופנים,צבעים,Java,ג'אווה,מצביע,קישורים,תמונות,מערכי תווים,קידוד,WWW,רשת, HTML,דפדפן,KFM,Konqueror, kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links, images,charsets,character sets,encoding
+Keywords[hi]=कॉन्करर,केएफएम,ब्राउज़र,एचटीएमएल,वेब,डब्ल्यूडब्ल्यूडब्ल्यू,फ़ॉन्ट्स,रंग,जावा,जावास्क्रिप्ट,संकेतक,लिंक्स,छवि,अक्षर माला,अक्षरमाला,एनकोडिंग
+Keywords[hr]=konqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encoding,preglednik,fontovi,boja,boje,pokazivač,veze,slike,znakovi,kodiranje,kodiranje zakova
+Keywords[hu]=Konqueror,KFM,böngésző,HTML,web,WWW,betűtípusok,színek,Java,JavaScript,egérmutató,linkek,képek,karakterkészletek,kódolás
+Keywords[is]=vafri,vefur,vefurinn,vefsíður,letur,litir,kóðun,stafatafla,bendill,myndir,www,html,stafir
+Keywords[it]=konqueror,kfm,browser,html,web,www,caratteri,colori,java,javascript,cursore,collegamenti,link,immagini,set di caratteri,charset,codifica
+Keywords[ja]=konqueror,kfm,ブラウザ,html,web,ウェブ,www,フォント,色,色,java,javascript,カーソル,リンク,画像,文字セット,文字セット,エンコーディング
+Keywords[km]=konqueror,kfm,កម្មវិធី​រុករក,html,បណ្ដាញ,វើលវ៉ាយវិប,ពុម្ពអក្សរ,ពណ៌,java,javascript,ទស្សន៍ទ្រនិច,តំណ,រូបភាព,សំណុំ​តួអក្សរ,
+Keywords[lt]=konqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encoding,narašymas,html,tinklalapis,tinklapis,www,šriftai,koloritai,spalvos,,java,java scebarijus,žymeklis,nuorodos,paveikslai,simboliai,koduotė,simbolių rinkinys
+Keywords[lv]=iekarotājs,kfm,pārlūks,html,web,www,fonti,krāsojums,krāsas,java,javaskripts,kursors,saites,attēli,simbolukomplekti,simbolu komplekti,kodējums
+Keywords[mk]=konqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encoding,прелистувач,веб,фонтови,бои,курсор,врски,слики,знаковни множества,кодирање
+Keywords[mn]=Конкюрор,Kfm,Хөтөч,HTML,Вэб,WWW,Бичиг,Өнгө,Java,JavaScript,Түүчээ,Холбоосууд,Links,Зураг,Тэмдэгт олонлог,Кодчилол
+Keywords[nb]=konqueror,kfm,nettleser,html,nettet,www,veven,verdensveven,skriftyper,farger,java,javaskript,markør,tegnsett,koding,bilde,skriptspråk,Internett
+Keywords[nds]=Konqueror,kfm,Browser,Nettkieker,HTML,web,www,Schriftoorden,Klören,Klöör,Java,JavaScript,Cursor,Links,Biller,Tekensett,Tekensetten,Koderen
+Keywords[ne]=कन्क्वेरर, kfm, ब्राउजर,html, वेब,www, फन्ट, रङ, रङहरू, जाभा, जाभास्क्रिप्ट, कर्सर, लिङ्क, छवि, चारसेट, क्यारेक्टर सेट, सङ्केतन
+Keywords[nl]=konqueror,kfm,browser,html,web,www,fonts,lettertypen,kleuren,,java,,javascript,cursor,links,koppelingen,afbeeldingen,charsets,tekensets,tekenverzamelingen,codering,internet
+Keywords[nn]=Konqueror,KFM,nettlesar,HTML,verdsveven,WWW,skrifter,fargar,Java,JavaScript,skriptspråk,Internett,peikar,lenkjer,bilete,teiknsett,koding,teiknkoding
+Keywords[nso]=konqueror,kfm,seinyakisi,html,web,www,difonto,mebala,mebala,java,setlankana sa java,cursor,dikgokaganyi,diponagalo,charsets,dipeakanyo tsa dihlaka,go khouta
+Keywords[pa]=ਕੋਨਕਿਉਰਰ,kfm,ਝਲਕਾਰਾ,html,web,www,ਫੋਂਟ, ਰੰਗ, ਜਾਵਾ, ਜਾਵਾ ਸਕ੍ਰਿਪਟ, ਕਰਸਰ, ਸਬੰਧ, ਚਿੱਤਰ, ਅੱਖਰ-ਸੈਟ, ਇੰਕੋਡਿੰਗ
+Keywords[pl]=konqueror,kfm,przeglądarka,html,sieć www,czcionki,kolory,java,javascript,kursor,linki,odnośniki,obrazki,zestawy znaków,kodowanie
+Keywords[pt]=konqueror,kfm,navegador,html,web,www,tipos de letra,fontes,cores,java,javascript,cursor,ligações,imagens,charsets,mapas de caracteres,codificação
+Keywords[pt_BR]=Konqueror,kfm,navegador,html,web,WWW,fontes,cores,java,javascript, cursor,ligações,imagens,conjuntos de caracteres,codificação
+Keywords[ro]=konqueror,kfm,navigator,browser,html,web,www,font,culori,java,javascript,cursor,legături,imagini,set de caractere,codare
+Keywords[rw]=Konqueror,kfm,mucukumbuzi,html,urubuga,www,imyandikire, amabara,amabara,java,javascript,inyoborayandika,amahuza,itsinda-nyuguti,amatsinda y'inyuguti,gusobeka
+Keywords[se]=konqueror,kfm,fierpmádatlogan,html,web,WWW,fonttat,ivnnit,java,javascript,seaván,liŋkkat,govat,mearkarájut,koden
+Keywords[sk]=konqueror,kfm,prehliadač,html,web,www,písma,farby,java,javascript,kurzor,odkazy,obrázky,znakové sady,kódovanie
+Keywords[sl]=konqueror,kfm,brskalnik,html,splet,www,pisave,barve,java,javascript,kurzor,povezave,slike,nabori znakov,znakovni nabori,kodiranje
+Keywords[sr]=konqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encoding,прегледач,веб,фонтови,боје,показивач,везе,слике,скупови знакова,кодирање
+Keywords[sr@Latn]=konqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encoding,pregledač,veb,fontovi,boje,pokazivač,veze,slike,skupovi znakova,kodiranje
+Keywords[sv]=konqueror,kfm,webbläsare,html,webb,www,teckensnitt,färger,java,javaskript,länkar,bilder,kodning,teckenuppsättningar
+Keywords[ta]=கான்கொரர்,kfm,உலாவி,html,வலை,www,எழுத்துருக்கள்,வண்ணங்கள்,வண்ணங்கள்,ஜாவா,ஜாவா எழுத்துரு,நிலைக்காட்டி,இணைப்புகள்,பிம்பங்கள்,charsets,சொல் அமைப்புகள்,குறியீடு
+Keywords[th]=คอนเควอร์เรอร์,kfm,บราวเซอร์,html,เว็บ,www,แบบอักษร,สี,จาวา,จาวาสคริปต์,เคอร์เซอร์,ลิงค์,ภาพ,ชุดรหัสอักขระ,ชุดรหัสอักขระ,การเข้ารหัส
+Keywords[tr]=konqueror,kfm,tarayıcı,html,web,www,yazı tipleri,renkler,java,javascript,karakter,karakter seti,kodlama,bağlantılar,resimler,imleç
+Keywords[uk]=konqueror,kfm,навігатор,html,шрифти,web,Тенета,кольори,java,javascript,курсор,www,посилання,зображення,набори символів,кодування
+Keywords[uz]=konqueror,kfm,html,www,brauzer,veb,shriftlar,belgilar toʻplami,kodlash usuli,java,javascript,bogʻlar,kursor,ranglar
+Keywords[uz@cyrillic]=konqueror,kfm,html,www,браузер,веб,шрифтлар,белгилар тўплами,кодлаш усули,java,javascript,боғлар,курсор,ранглар
+Keywords[ven]=konqueror,kfm,buronza,html,webu,www,dzifontu,mivhala,mivhala,java,manwalwa a java,cursor,vhukwamani,zwifanyiso,tshasete,mavhekanyele a muanewa,uinikhouda
+Keywords[vi]=konqueror,kfm,trình duyệt,html,web,www,phông chữ,màu sắc,màu,java,javascript,con trỏ,liên kết,hình ảnh,ký tự,tập ký tự,mã ký tự
+Keywords[wa]=konqueror,kfm,betchteu,html,waibe,www,fontes,coleurs,java,javascript,cursoe,loyéns,imådjes,ecôdaedjes
+Keywords[xh]=konqueror,kfm,umkhangeli zincwadi,html,web,www,imigca,imibala,imibala,java,okushicilelwe phantsi kwe java,isalatisi,amakhonkco,imifanekiso,icharsets,amaqela abasebenzi, encoding
+Keywords[zh_CN]=konqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encoding,浏览,字体,颜色,光标,链接,图像,字符集,编码
+Keywords[zh_TW]=konqueror,kfm,browser,html,web,www,fonts,colours,colors,java,javascript,cursor,links,images,charsets,character sets,encoding,瀏覽,字型,色彩,顏色,游標,連結,影像,字元,字集,編碼
+Keywords[zu]=konqueror,kfm,umcingi,html,web,www,izinhlobo zamagama, imibala,imibala,java,javascripy,inkomba,izixhumanisi,izithombe,charsets, amaqoqo ezimpawu,ukubhala ngekhodi
+
+Categories=Qt;KDE;X-KDE-settings-webbrowsing;
diff --git a/kcontrol/konqhtml/khtml_filter.desktop b/kcontrol/konqhtml/khtml_filter.desktop
new file mode 100644
index 000000000..25356f562
--- /dev/null
+++ b/kcontrol/konqhtml/khtml_filter.desktop
@@ -0,0 +1,145 @@
+[Desktop Entry]
+Type=Application
+DocPath=kcontrol/khtml/index.html#khtml-adblock
+Icon=filter
+Exec=kcmshell khtml_filter
+
+X-KDE-Library=konqhtml
+X-KDE-FactoryName=khtml_filter
+
+Name=AdBlocK Filters
+Name[af]=Advertensie blok filters
+Name[ar]=مرشحات مكافحة الدعايات
+Name[be]=Фільтры AdBlocK
+Name[bg]=Блокиране на реклами
+Name[bn]=অ্যাড্-ব্লক ফিল্টার
+Name[br]=Siloù AdBlocK
+Name[bs]=AdBlocK filteri
+Name[ca]=Filtres de bloqueig publicitari
+Name[cs]=AdBlocK filtry
+Name[csb]=Flitrë AdBlocK
+Name[da]=AdBlocK filtre
+Name[de]=Werbefilter
+Name[el]=Φίλτρα AdBlocK
+Name[eo]=ReklamBloK Filtroj
+Name[es]=Filtros de anuncios (AdBlock)
+Name[et]=AdBlocK filtrid
+Name[eu]=AdBlocK iragazkiak
+Name[fa]=پالایه‌های AdBlocK
+Name[fi]=AdBlocK-suotimet
+Name[fr]=Filtres AdBlocK
+Name[fy]=AdBlock-filters
+Name[ga]=Scagairí AdBlockK
+Name[gl]=Filtros AdBlocK
+Name[he]=מסנני חלונות מקופצים (AdBlock)
+Name[hr]=AdBlocK filtri
+Name[hu]=AdBlocK szűrők
+Name[is]=AdBlocK síur
+Name[it]=Filtri AdBlocK
+Name[ja]=AdBlocK フィルタ
+Name[ka]=AdBlocK ფილტრები
+Name[kk]=AdBlocK сүзгілері
+Name[km]=តម្រង AdBlocK
+Name[ko]=AdBlocK 필터
+Name[lt]=AdBlocK filtrai
+Name[mk]=AdBlocK-филтри
+Name[ms]=Penapis AdBlocK
+Name[nb]=Reklamefiltere
+Name[nds]=Warvenfilter
+Name[ne]=AdBlocK फिल्टर
+Name[nl]=AdBlock-filters
+Name[nn]=Reklamefilter
+Name[pa]=AdBlocK ਫਿਲਟਰ
+Name[pl]=Flitry AdBlocK
+Name[pt]=Filtros do AdBlock
+Name[pt_BR]=Filtros AdBlocK
+Name[ro]=Filtre AdBlocK
+Name[ru]=Фильтры AdBlocK
+Name[rw]=Muyunguruzi AdBlocK
+Name[se]=AdBlocK-sillit
+Name[sk]=AdBlock filtre
+Name[sl]=Filtri AdBlocK
+Name[sr]=AdBlocK-ови филтери
+Name[sr@Latn]=AdBlocK-ovi filteri
+Name[sv]=Reklamblockeringsfilter
+Name[te]=ఏడ్ బ్లాక్ గలనులు
+Name[tg]=Филтрҳои AdBlocK
+Name[th]=ตัวกรองของ AdBlocK
+Name[tr]=AdBlocK Filtreleri
+Name[tt]=Reklam Sözgeçläre
+Name[uk]=Фільтри AdBlocK
+Name[uz]=AdBlocK filterlari
+Name[uz@cyrillic]=AdBlocK филтерлари
+Name[vi]=Lọc Quảng cáo
+Name[wa]=Passetes AdBlocK
+Name[zh_CN]=广告拦截过滤器
+Name[zh_TW]=AdBlocK 過濾器
+
+Comment=Configure Konqueror AdBlocK filters
+Comment[af]=Konfigureer die weg Konqueror raporte self
+Comment[ar]=إعداد مرشحات Konqueror لمكافحة الدعايات
+Comment[be]=Настаўленні фільтраў AdBlocK для Konqueror
+Comment[bg]=Настройване на филтрите за блокиране на реклами
+Comment[bn]=কনকরার-এ বিজ্ঞাপন আটকাতে ব্যবহৃত ফিল্টার কনফিগার করুন
+Comment[br]=Kefluniañ siloù AdBlocK Konqueror
+Comment[bs]=Podesite Konqueror AdBlocK filtere
+Comment[ca]=Configura els filtres de bloqueig publicitari de Konqueror
+Comment[cs]=Zde můžete nastavit blokování reklam
+Comment[csb]=Kònfigùracëjô filtrów AdBlocK Konquerora
+Comment[da]=Indstil Konquerors adblock filtre
+Comment[de]=Hier können Sie Einstellungen zum Werbefilter vornehmen
+Comment[el]=Ρυθμίστε τα φίλτρα AdBlocK του Konqueror
+Comment[eo]=Agordo de Konkeranto-ReklamBloK filtroj
+Comment[es]=Configuración de los filtros de anuncios de Konqueror
+Comment[et]=Konqueror AdBlocK filtrite seadistamine
+Comment[eu]=Konfiguratu Konqueror AdBlock iragazkiak
+Comment[fa]=پیکربندی پالایه‌های AdBlocK Konqueror
+Comment[fi]=Aseta Konquerorin AdBlocK-suotimia
+Comment[fr]=Configurer les filtres AdBlocK de Konqueror
+Comment[fy]=Konfigurearje de filters om reklame te warjen
+Comment[ga]=Cumraigh na Scagairí AdBlocK Konqueror
+Comment[gl]=Configurar os filtros AdBlocK en Konqueror
+Comment[he]=הגדרת מסנני חלונות מקופצים (AdBlock)
+Comment[hr]=Konfiguriranje Konqueror AdBlocK filtara
+Comment[hu]=A Konqueror AdBlocK szűrőinek beállítása
+Comment[is]=Stilla Konqueror AdBlocK síur
+Comment[it]=Configura i filtri AdBlock per Konqueror
+Comment[ja]=Konqueror AdBlocK フィルタの設定
+Comment[ka]=Configure Konqueror AdBlocK ფილტრები
+Comment[kk]=Konqueror AdBlocK сүзгілерді баптау
+Comment[km]=កំណត់​រចនាសម្ព័ន្ធតម្រង​របស់ Konqueror AdBlocK
+Comment[ko]=Konqueror AdBlocK 필터 설정
+Comment[lt]=Konfigūruoti Konqueror AdBlocK filtrus
+Comment[mk]=Конфигурирајте ги AdBlocK-филтрите на Konqueror
+Comment[ms]=Konfigur penapis AdBlocK Konqueror
+Comment[nb]=Tilpass Konquerors reklamefiltere
+Comment[nds]=Hier kannst Du Konquerors Warvenfilter instellen
+Comment[ne]=कन्क्वेरर AdBlocK फिल्टर कन्फिगर गर्नुहोस्
+Comment[nl]=Filters voor blokkeren van advertenties in Konqueror instellen
+Comment[nn]=Tilpass reklamefiltera til Konqueror
+Comment[pa]=ਕੋਨਕਿਉਰਰ ਐਡਬਲਾਕ ਫਿਲਟਰ ਸੰਰਚਨਾ
+Comment[pl]=Konfiguracja filtrów AdBlocK Konquerora
+Comment[pt]=Configurar os filtros AdBlock do Konqueror
+Comment[pt_BR]=Configura os filtros AdBlocK no Konqueror
+Comment[ro]=Configurează filtrele AdBlocK pentru Konqueror
+Comment[ru]=Настройка блокирования рекламы для Konqueror
+Comment[rw]=Kuboneza muyunguruzi AdBlocK Konqueror
+Comment[se]=Heivet Konqueror:a AdBlocK-silliid
+Comment[sk]=Nastavenie AdBlock filtrov pre Konqueror
+Comment[sl]=Nastavitev filtrov AdBlocK za Konqueror
+Comment[sr]=Подешавање AdBlock-ових филтера за Konqueror
+Comment[sr@Latn]=Podešavanje AdBlock-ovih filtera za Konqueror
+Comment[sv]=Anpassa Konquerors reklamblockeringsfilter
+Comment[tg]=Танзимоти қулфи рекламаи Ad барои Konqueror
+Comment[th]=ปรับแต่งตัวกรอง AdBlocK ของคอนเควอร์เรอร์
+Comment[tr]=Konqueror'ın AdBlocK Filtrelerini yapılandır
+Comment[tt]=Konqueror'dağı reklam kistergeçneñ caylaw
+Comment[uk]=Налаштувати фільтри блокування реклами для Konqueror
+Comment[uz]=Konqueror uchun AdBlocK filterlarini moslash
+Comment[uz@cyrillic]=Konqueror учун AdBlocK филтерларини мослаш
+Comment[vi]=Cấu hình cách Konqueror lọc bỏ các quảng cáo khó chịu
+Comment[wa]=Apontyî es passetes AdBlocK di Konqueror
+Comment[zh_CN]=配置 Konqueror 的广告拦截过滤器
+Comment[zh_TW]=設定 Konqueror AdBlocK 過濾器
+
+Categories=Qt;KDE;X-KDE-settings-webbrowsing;
diff --git a/kcontrol/konqhtml/khtml_fonts.desktop b/kcontrol/konqhtml/khtml_fonts.desktop
new file mode 100644
index 000000000..7c1511840
--- /dev/null
+++ b/kcontrol/konqhtml/khtml_fonts.desktop
@@ -0,0 +1,230 @@
+[Desktop Entry]
+Type=Application
+DocPath=kcontrol/khtml/index.html#kbrowse-appearance
+Icon=fonts
+Exec=kcmshell khtml_fonts
+
+
+X-KDE-Library=konqhtml
+X-KDE-FactoryName=khtml_fonts
+
+Name=Fonts
+Name[af]=Skriftipes
+Name[ar]=المحارف
+Name[az]=Yazı növləri
+Name[be]=Шрыфты
+Name[bg]=Шрифтове
+Name[bn]=ফন্ট
+Name[br]=Fontoù
+Name[bs]=Fontovi
+Name[ca]=Lletres
+Name[cs]=Písma
+Name[csb]=Fòntë
+Name[cy]=Ffontiau
+Name[da]=Skrifttyper
+Name[de]=Schriftarten
+Name[el]=Γραμματοσειρές
+Name[eo]=Tiparoj
+Name[es]=Tipos de letra
+Name[et]=Fondid
+Name[eu]=Letra-tipoak
+Name[fa]=قلمها
+Name[fi]=Kirjasimet
+Name[fr]=Polices
+Name[fy]=Lettertypen
+Name[ga]=Clónna
+Name[gl]=Fontes
+Name[he]=גופנים
+Name[hi]=फ़ॉन्ट्स
+Name[hr]=Fontovi
+Name[hu]=Betűtípusok
+Name[is]=Letur
+Name[it]=Tipi di carattere
+Name[ja]=フォント
+Name[ka]=ფონტები
+Name[kk]=Қаріптер
+Name[km]=ពុម្ពអក្សរ
+Name[ko]=글꼴
+Name[lo]=ຮູບແບບຕົວອັກສອນ
+Name[lt]=Šriftai
+Name[lv]=Fonti
+Name[mk]=Фонтови
+Name[mn]=Бичгүүд
+Name[ms]=Fon
+Name[nb]=Skrifttype
+Name[nds]=Schriftoorden
+Name[ne]=फन्ट
+Name[nl]=Lettertypen
+Name[nn]=Skrifttypar
+Name[nso]=Difonto
+Name[pa]=ਫੋਂਟ
+Name[pl]=Czcionki
+Name[pt]=Tipos de Letra
+Name[pt_BR]=Fontes
+Name[ro]=Fonturi
+Name[ru]=Шрифты
+Name[rw]=Imyandikire
+Name[se]=Fonttat
+Name[sk]=Písma
+Name[sl]=Pisave
+Name[sr]=Фонтови
+Name[sr@Latn]=Fontovi
+Name[ss]=Timo tetinhlamvu temagama
+Name[sv]=Teckensnitt
+Name[ta]=எழுத்துருக்கள்
+Name[tg]=Ҳарфҳо
+Name[th]=แบบอักษร
+Name[tr]=Yazıtipleri
+Name[tt]=Yazu
+Name[uk]=Шрифти
+Name[uz]=Shriftlar
+Name[uz@cyrillic]=Шрифтлар
+Name[ven]=Fontu
+Name[vi]=Phông chữ
+Name[wa]=Fontes
+Name[xh]=Uhlobo lwamagama
+Name[zh_CN]=字体
+Name[zh_TW]=字型
+Name[zu]=Izinhlobo zamagama
+Comment=Configure the fonts used on web pages
+Comment[af]=Konfigureer die skriftipes gebruik word op web bladsye
+Comment[ar]=إعداد المحارف المستعملة على صفحات الشبكة
+Comment[be]=Настаўленні шрыфтоў для выкарыстання на старонках Сеціва
+Comment[bg]=Настройване на шрифтовете за уеб страниците
+Comment[bn]=ওয়েব পেজ-এ ব্যবহৃত ফন্ট কনফিগার করুন
+Comment[br]=Kefluniañ an nodrezhoù evit ar pajennoù gwiad
+Comment[bs]=Podesite fontove korištene na web stranicama
+Comment[ca]=Configura els tipus de lletres emprades a les pàgines web
+Comment[cs]=Nastavení písem pro webové stránky
+Comment[csb]=Kònfigùracëjô fòntów na internetowëch starnach
+Comment[cy]=Ffurfweddu'r ffontiau sy'n cael eu defnyddio ar dudalennau gwe
+Comment[da]=Indstil de skrifttyper der bruges på netsider
+Comment[de]=Schriften für die Darstellung von Webseiten festlegen
+Comment[el]=Ρυθμίστε τις γραμματοσειρές που χρησιμοποιούνται στις ιστοσελίδες
+Comment[eo]=Agordas la tiparojn kiuj estas uzataj sur TTT-paĝoj
+Comment[es]=Configuración de los tipos de letra usados en las páginas web
+Comment[et]=Veebilehtedel kasutatavate fontide seadistamine
+Comment[eu]=Konfiguratu web orrietan erabiliko diren letra-tipoak
+Comment[fa]=پیکربندی قلمهای استفاده‌شده در صفحات وب
+Comment[fi]=WWW-sivujen kirjasimet
+Comment[fr]=Configuration des polices utilisées sur les pages web
+Comment[fy]=Hjir kinne jo de lettertypen die brûkt wurde op de websiden ynstelle
+Comment[gl]=Configurar as fontes empregadas nas páxinas web
+Comment[he]=שינוי הגדרות הגופנים שנעשה בהם שימוש בדפי אינטרנט
+Comment[hi]=वेब पृष्ठ पर उपयोग में आने वाले फ़ॉन्ट्स कॉन्फ़िगर करें
+Comment[hr]=Konfiguriranje fontova upotrijebljenih na web-stranicama
+Comment[hu]=A Konqueror webböngésző betűtípusainak beállítása
+Comment[is]=Stillta letur sem notað er á vefsíðum
+Comment[it]=Configura i caratteri da usare nelle pagine web
+Comment[ja]=ウェブページで使用するフォントを設定
+Comment[ka]=ვებ გვერდების შრიფტების კონფიგურაცია
+Comment[kk]=Веб парақтарда қолданатын қаріптер
+Comment[km]=កំណត់​រចនាសម្ព័ន្ធ​ពុម្ពអក្សរ ដែល​ប្រើ​លើ​ទំព័រ​បណ្ដាញ
+Comment[ko]=웹 페이지의 글꼴 설정
+Comment[lo]=ທ່ານສາມາດປັບແຕ່ງລັກສະນະແລະຄວາມຮູ້ສຶກໃນການໃຊ້ງານ Konqueror ໄດ້ທີ່ນີ້
+Comment[lt]=Čia galite konfigūruoti šriftus, naudojamus tinklalapiuose
+Comment[lv]=Šeit Jūs varat konfigurēt tīmekļa lapās lietotos fontus
+Comment[mk]=Конфигурирајте ги фонтовите што се користат за веб-страници
+Comment[mn]=Вэб хуудас харагдалтын бичиг тогтоох
+Comment[ms]=Konfigur fon yang digunakan dalam halaman web
+Comment[mt]=Agħżel il-fonts li jintużaw fuq paġni web
+Comment[nb]=Tilpass hvilke skrifttyper som brukes på nettsider
+Comment[nds]=De Schriftoorden för Nettsieden instellen
+Comment[ne]=वेब पृष्ठहरूमा प्रयोग गरिने फन्ट कन्फिगर गर्नुहोस्
+Comment[nl]=Hier kunt u de lettertypen die op webpagina's gebruikt worden instellen
+Comment[nn]=Oppsett av skrifter for nettsider
+Comment[nso]=Beakanya difonto tseo di somiswago go matlakala a web
+Comment[pa]=ਵੈੱਬ ਸਫੇ 'ਤੇ ਫੋਂਟ ਸੰਰਚਨਾ
+Comment[pl]=Konfiguracja czcionek na stronach internetowych
+Comment[pt]=Configurar os tipos de letra usados nas páginas Web
+Comment[pt_BR]=Configura as fontes usadas em páginas da web
+Comment[ro]=Configurează fonturile utilizate în paginile web
+Comment[ru]=Настройка шрифтов веб-страниц
+Comment[rw]=Kuboneza imyandikire ikoreshwa ku mapaji rubuga
+Comment[se]=Heivet makkár fonttat geavahuvvojit fierpmádatsiidduin
+Comment[sk]=Nastavenie písiem pre webové stránky
+Comment[sl]=Nastavitve pisav, prikazanih na spletnih straneh
+Comment[sr]=Подешавање фонтова који се користе на веб страницама
+Comment[sr@Latn]=Podešavanje fontova koji se koriste na veb stranicama
+Comment[sv]=Anpassa teckensnitt som används på webbsidor
+Comment[ta]=வலைபக்கங்களில் பயன்படுத்தப்படும் எழுத்துருக்களை வடிவமை
+Comment[tg]=Танзими ҳарфҳои лозимӣ барои намоиши сафҳоти Вэб
+Comment[th]=ปรับแต่งแบบอักษรที่จะใช้กับหน้าเว็บ
+Comment[tr]=Web sayfalarında kullanılan yazıtipini buradan yapılandırın
+Comment[tt]=Säxifä bitlärendä qullanası yazu törlären caylaw
+Comment[uk]=Налаштування шрифтів для сторінок Тенет
+Comment[uz]=Veb-sahifalarida ishlatiladigan shriftlarni moslash
+Comment[uz@cyrillic]=Веб-саҳифаларида ишлатиладиган шрифтларни мослаш
+Comment[ven]=Dzudzanyani dzifontu dzo shumiswa kha masiatari a webu
+Comment[vi]=Cấu hình phông chữ sử dụng trên các trang mạng
+Comment[wa]=Apontyî les fontes eployeyes ezès pådjes waibe
+Comment[xh]=Qwlasela uhlobo lwamagama asebenziswe kumaphepha e web
+Comment[zh_CN]=配置网页所使用的字体
+Comment[zh_TW]=設定使用於網頁的字型
+Comment[zu]=Hlanganisela uhlobo lwamagama olusetshenziswa emakhasini e-web
+Keywords=konqueror,kfm,browser,html,web,www,fonts,charsets,character sets,encoding
+Keywords[be]=Вандроўнік,Сеціва,Шрыфт,Знаказборы,Знаказбор,konqueror,kfm,browser,html,web,www,fonts,charsets,character sets,encoding
+Keywords[bg]=уеб, шрифтове, страници, браузър, Интернет, konqueror, kfm, browser, html, web, www, fonts, charsets, character sets, encoding
+Keywords[bs]=konqueror,kfm,browser,html,web,www,fonts,charsets,character sets,encoding,preglednik,font,fontovi,skup znakova,kodni raspored
+Keywords[ca]=konqueror,kfm,navegador,html,web,www,lletres,caràcters.jocs de caràcters,codificació
+Keywords[cs]=Konqueror,Kfm,Prohlížeč,HTML,Web,WWW,Písma,Znakové sady,Kódování
+Keywords[csb]=konqueror,kfm,przezérnik,html,séc www,zestôw merków,kòdowanié
+Keywords[cy]=konqueror,kfm,porydd,html,gwe,www,ffontiau,setiau nodau,amgodiad
+Keywords[da]=konqueror,kfm,browser,HTML,net,www,skrifttyper,tegnsæt,indkodning
+Keywords[de]=Konqueror,kfm,Browser,HTML,Web,WWW,Schriften,Zeichensätze,Kodierung
+Keywords[el]=konqueror,kfm,περιηγητής,html,ιστός,www,γραμματοσειρές,σύνολα χαρακτήρων,σύνολα χαρακτήρων,κωδικοποίηση
+Keywords[eo]=Konkeranto,Kfm,TTT,HTML,WWW,tiparo,koloro,Javo,Javoskripto,kursoro,kursilo,ligo,referenco,bildo,signaro,kodo
+Keywords[es]=konqueror,kfm,navegador,html,web,www,tipos de letra,mapas de caracteres,codificación
+Keywords[et]=konqueror,kfm,veebilehitseja,html,veeb,www,fondid,kooditabel,kodeering
+Keywords[eu]=konqueror,kfm,arakatzailea,html,web,www,letra-tipoak,karaktere-multzoak, karaktere hobespenak,kodeketa
+Keywords[fa]=konqueror،kfm، مرورگر، زنگام، وب، www،قلمها، نویسه‌گان، نویسه‌گان،کدبندی
+Keywords[fi]=konqueror,kfm,selain,html,web,www,kirjasimet,merkistöt,koodaus
+Keywords[fr]=konqueror,kfm,navigateur,html,web,www,polices,couleurs,java,javascript,curseur,liens,images,jeu de caractères,caractères,codage,encodage
+Keywords[fy]=konqueror,kfm,browser,blêder,html,web,www,fonts,lettertypen,tekensets,karaktersamling,kodearring,ynternet
+Keywords[ga]=konqueror,kfm,brabhsálaí,html,gréasán,www,clónna,clófhoirne,tacair charachtair,ionchódú
+Keywords[gl]=konqueror,kfm,navegador,html,web,www,fontes,carácteres,conxunto de carácteres,codificación
+Keywords[he]=konqueror,kfm,דפדפן,html,web,www,אינטרנט,browser,web,fonts,charsets,character sets,encoding, גופנים,מערכי תווים,קידוד
+Keywords[hi]=कॉन्करर,केएफएम,ब्राउजर,एचटीएमएल,वेब,डब्ल्यूडब्ल्यूडब्ल्यू,फ़ॉन्ट्स,अक्षरमाला,अक्षर माला,एनकोडिंग
+Keywords[hr]=konqueror,kfm,browser,html,web,www,fonts,charsets,character sets,encoding,preglednik,fontovi,kodiranje,kodiranje zakova
+Keywords[hu]=Konqueror,kfm,böngésző,HTML,web,WWW,betűtípusok,karakterkészletek,betűkészletek,kódolás
+Keywords[is]=vafri,vefur,vefurinn,vefsíður,letur,litir,kóðun,stafatafla, bendill,myndir,www,html,stafir
+Keywords[it]=konqueror,kfm,browser,html,web,www,caratteri,colori,set di caratteri,charset,codifica
+Keywords[ja]=konqueror,kfm,ブラウザ,html,web,ウェブ,www,フォント,文字,文字セット,色,カラー,エンコーディング
+Keywords[km]=konqueror,kfm,កម្មវិធី​រុករក,html,បណ្ដាញ,វើលវ៉ាយវិប,ពុម្ពអក្សរ,ការ​អ៊ិនកូដ
+Keywords[lt]=konqueror,kfm,browser,html,web,www,fonts,colours,colors,charsets,character sets,encodingsets,encoding,narašymas,html,tinklalapis,tinklapis,www,šriftai,spalvos,simbolių rinkiniai,koduotė
+Keywords[lv]=iekarotājs,kfm,pārlūks,html,web,www,fonti,krāsojums,krāsas,java,javaskripts,kursors,saites,attēli,simbolukomplekti,simbolu komplekti,kodējums
+Keywords[mk]=konqueror,kfm,browser,html,web,www,fonts,charsets,character sets,encoding,прелистувач,веб,фонтови,знаковни множества,кодирање
+Keywords[mn]=Конкюрор,kfm,Хөтөч,HTML,Вэб,WWW,Бичиг,Тэмдэгт олонлог,Кодчилол
+Keywords[nb]=konqueror,kfm,nettleser,html,nettet,www,veven,verdensveven,Internett,skriftyper,skrifter,koding,tegnsett,tegnkoding
+Keywords[nds]=Konqueror,kfm,Nettkieker,browser,HTML,web,www,Schriftoorden,Tekensetten,Koderen
+Keywords[ne]=कन्क्वेरर,kfm, ब्राउजर,html, वेब,www, फन्टहरू, चारसेटहरू, क्यारेक्टर सेट, सङ्केतन
+Keywords[nl]=konqueror,kfm,browser,html,web,www,fonts,lettertypen,tekensets,karakterverzamelingen,codering,encoding,internet
+Keywords[nn]=Konqueror,KFM,nettlesar,HTML,verdsveven,WWW,skrifter,teiknsett,koding,teiknkoding
+Keywords[nso]=konqueror,kfm,seinyakisi,html,web,www,difonto,charsets,dipeakanyo tsa dihlaka,go khouta
+Keywords[pa]=ਕੋਨਕਿਉਰਰ,kfm,ਝਲਕਾਰਾ,html,web,www,ਫੋਂਟ, ਅੱਖਰ-ਸੈਟ, ਅੱਖਰ ਸੈਟ, ਇੰਕੋਡਿੰਗ
+Keywords[pl]=konqueror,kfm,przeglądarka,html,sieć www,zestawy znaków,kodowanie
+Keywords[pt]=konqueror,kfm,navegador,html,web,www,tipos de letra,fontes,cores,java,javascript,cursor,ligações,imagens,charsets,mapas de caracteres,codificação
+Keywords[pt_BR]=konqueror,kfm,navegador,html,web,WWW,fontes,conjuntos de caracteres,codificação
+Keywords[ro]=konqueror,kfm,navigator,browser,html,web,www,fonturi,culori,java,javascript,cursor,legături,imagini,set de caractere,codare
+Keywords[rw]= Konqueror,kfm,mucukumbuzi,html,urubuga,www,imyandikire, itsinda-nyuguti, amatsinda y'inyuguti,gusobeka
+Keywords[se]=Konqueror,kfm,fierpmádatlogan,html,web,www,fonttat,mearkarájut,koden
+Keywords[sk]=konqueror,kfm,prehliadač,html,web,www,písma,farby,znakové sady,kódovanie
+Keywords[sl]=konqueror,kfm,brskalnik,html,splet,www,pisave,nabori znakov,znakovni nabori,kodiranje
+Keywords[sr]=konqueror,kfm,прегледач,html,web,www,фонтови,боје,java,јавасцрипт,показивач,везе,слике,кодни распоред,скуп знакова,кодирање
+Keywords[sr@Latn]=konqueror,kfm,pregledač,html,web,www,fontovi,boje,java,javascript,pokazivač,veze,slike,kodni raspored,skup znakova,kodiranje
+Keywords[sv]=konqueror,kfm,webbläsare,html,webb,www,teckensnitt,färger,java,javaskript,länkar,bilder,kodning,teckenuppsättningar
+Keywords[ta]=கான்கொரர், கோப்பு மேலாளர், html,வலை, www,எழுத்துரு, எழுத்தமைப்பு முறை,எழுத்தமைப்பு முறை, குறியீடு முறை
+Keywords[th]=คอนเควอร์เรอร์,kfm,บราวเซอร์,html,เว็บ,www,แบบอักษร,อักขระ,ชุดอักขระ,การเข้ารหัส
+Keywords[tr]=konqueror,kfm,tarayıcı,html,web,www,yazı tipleri,kodlama
+Keywords[uk]=konqueror,kfm,навігатор,html,шрифти,Тенета,www,набори символів,кодування
+Keywords[uz]=konqueror,kfm,html,www,brauzer,veb,shriftlar,belgilar toʻplami,kodlash usuli
+Keywords[uz@cyrillic]=konqueror,kfm,html,www,браузер,веб,шрифтлар,белгилар тўплами,кодлаш усули
+Keywords[ven]=konqueror,kfm,buronza,html,webu,www,dzifontu,mivhala,mivhala,java,manwalwa a java,cursor,vhukwamani,zwifanyiso,tshasete,mavhekanyele a muanewa,uinikhouda
+Keywords[vi]=konqueror,kfm,trình duyệt,html,web,www,phông chữ,ký tự,bảng ký tự,mã ký tự
+Keywords[wa]=konqueror,kfm,betchteu,html,waibe,www,fontes,ecôdaedjes,ecôdaedje
+Keywords[xh]=konqueror,kfm,umkhangeli zincwadi,html,web,www,imigca, amaqela abasebenzisi,encoding
+Keywords[zh_CN]=konqueror,kfm,browser,html,web,www,fonts,charsets,character sets,encoding,浏览器,网页,字体,字符集,编码
+Keywords[zh_TW]=konqueror,kfm,browser,html,web,www,fonts,charsets,character sets,征服家,字元,字元集,編碼,瀏覽器,字型,網頁
+Keywords[zu]=konqueror,kfm,umcingi,html,web,www,izinhlobo zamagama,charsets,amaqoqo ezimpawu,ukubhala ngekhodi
+
+Categories=Qt;KDE;X-KDE-settings-webbrowsing;
diff --git a/kcontrol/konqhtml/khtml_java_js.desktop b/kcontrol/konqhtml/khtml_java_js.desktop
new file mode 100644
index 000000000..7ba252b91
--- /dev/null
+++ b/kcontrol/konqhtml/khtml_java_js.desktop
@@ -0,0 +1,211 @@
+[Desktop Entry]
+Type=Application
+DocPath=kcontrol/khtml/index.html#kbrowse-java
+Icon=konqueror
+Exec=kcmshell khtml_java_js
+
+
+X-KDE-Library=konqhtml
+X-KDE-FactoryName=khtml_java_js
+
+Name=Java & JavaScript
+Name[af]=Java & Javaskrip
+Name[ar]=Java و JavaScript
+Name[az]=Java və JavaScript
+Name[be]=Java і JavaScript
+Name[bg]=Java и JavaScript
+Name[bn]=জাভা এবং জাভাস্ক্রিপ্ট
+Name[bs]=JavaScript i Java
+Name[ca]=Java i JavaScript
+Name[cs]=Java a JavaScript
+Name[csb]=Java ë JavaScript
+Name[cy]=Java a JavaScript
+Name[eo]=Ĝavo kaj Ĝavoskripto
+Name[es]=Java y JavaScript
+Name[et]=Java ja JavaScript
+Name[eu]=Java eta JavaScript
+Name[fa]=جاوا و جاوااسکریپت
+Name[fi]=Java ja JavaScript
+Name[fy]=Java en JavaSkript
+Name[gl]=Java e JavaScript
+Name[he]=JavaScript-ו Java
+Name[hi]=जावा एवं जावा-स्क्रिप्ट
+Name[hr]=Java i JavaScript
+Name[hu]=Java/Javascript
+Name[is]=Java og JavaScript
+Name[it]=Java e JavaScript
+Name[ka]=Java და JavaScript
+Name[kk]=Java және JavaScript
+Name[ko]=자바와 자바스크립트
+Name[lo]=ແຟ້່ມໂພສ໌ສຄລິບແລະ PDF
+Name[lt]=Java ir JavaScript
+Name[mk]=Java и JavaScript
+Name[mt]=Java u JavaScript
+Name[nb]=Java og JavaScript
+Name[ne]=जाभा र जाभा स्क्रिप्ट
+Name[nl]=Java en JavaScript
+Name[nn]=Java og JavaScript
+Name[nso]=Java & Setlankana sa Java
+Name[pa]=Java ਅਤੇ ਜਾਵਾ ਸਕਰਿਪਟ
+Name[pl]=Java i JavaScript
+Name[pt]=Java e JavaScript
+Name[ro]=Java și JavaScript
+Name[ru]=Java и JavaScript
+Name[se]=Java ja Javascript
+Name[sl]=Java in javascript
+Name[ss]=I-Java & JavaScript
+Name[sv]=Java och Javaskript
+Name[ta]=ஜாவா & ஜாவா எழுத்தாக்கம்
+Name[te]=జావా & జావాస్క్రిప్ట్
+Name[tg]=Java ва JavaScript
+Name[th]=จาวาและจาวาสคริปต์
+Name[tr]=Java ve JavaScript
+Name[tt]=Java belän JavaScript
+Name[uz]=Java va JavaScript
+Name[uz@cyrillic]=Java ва JavaScript
+Name[wa]=Java eyet JavaScript
+Name[zh_CN]=Java 和 JavaScript
+Name[zh_TW]=Java 與 JavaScript
+Comment=Configure the behavior of Java and JavaScript
+Comment[af]=Konfigureer die gedrag van Java en Javaskrip
+Comment[ar]=إعداد سلوك Java و JavaScript
+Comment[be]=Настаўленні Java і JavaScript
+Comment[bg]=Настройване на Java и JavaScript
+Comment[bn]=জাভা এবং জাভাস্ক্রিপ্ট-এর আচরণ কনফিগার করুন
+Comment[br]=Kefluniañ emzalc'h Java ha JavaScript
+Comment[bs]=Podesite ponašanje JavaScript i Java-e
+Comment[ca]=Configura el comportament de Java i JavaScript
+Comment[cs]=Nastavení chování Javy a Javascriptu
+Comment[csb]=Kònfigùracëjô dzejaniô Javë ë JavaScriptu
+Comment[cy]=Ffurfweddu ymddygiad Java a JavaScript
+Comment[da]=Indstil hvordan JavaScript og Java opfører sig
+Comment[de]=Verhalten von Java und JavaScript festlegen
+Comment[el]=Ρυθμίστε τη συμπεριφορά της Java και της JavaScript
+Comment[en_GB]=Configure the behaviour of Java and JavaScript
+Comment[eo]=Agordo la konduton de Ĝavo kaj Ĝavoskripto
+Comment[es]=Configuración del comportamiento de Java y JavaScript
+Comment[et]=Java ja JavaScripti käitumise seadistamine
+Comment[eu]=Konfiguratu Java eta JavaScripten portaera
+Comment[fa]=پیکربندی رفتار جاوا و جاوااسکریپت
+Comment[fi]=Javan ja JavaScriptin asetukset
+Comment[fr]=Configuration du comportement de Java et JavaScript
+Comment[fy]=Hjir kinne jo it gedrach fan Java en JavaSkript ynstelle
+Comment[ga]=Cumraigh oibriú Java agus JavaScript
+Comment[gl]=Configurar o comportamento de Java e JavaScript
+Comment[he]=שינוי הגדרות Java ו־JavaScript
+Comment[hi]=जावा एवं जावा-स्क्रिप्ट कॉन्फ़िगर करें
+Comment[hr]=Konfiguriranje ponašanja Jave i JavaScripta
+Comment[hu]=A Java és a Javascript beállításai
+Comment[is]=Stilla hegðun Java og JavaScript
+Comment[it]=Configura il comportamento di Java e JavaScript
+Comment[ja]=Java と JavaScript の挙動を設定
+Comment[ka]=Java და JavaScript -ის ქცევის კონფიგურაცია
+Comment[kk]=Java және JavaScript қасиеттерін баптау
+Comment[km]=កំណត់​រចនាសម្ព័ន្ធ​ឥរិយាបថ​របស់ Java និង JavaScript
+Comment[ko]=자바와 자바스크립트 행동 설정
+Comment[lo]=ທ່ານສາມາດປັບແຕ່ງການທຳງານ ຂອງເຄື່ອງມືການຈັດເຊສຊັນໄດ້ທີ່ນີ້
+Comment[lt]=Čia galite konfigūruoti Java bei JavaScript elgseną
+Comment[lv]=Šeit Jūs varat konfigurēt Java un JavaScript izturēšanos
+Comment[mk]=Конфигурирајте го однесувањето на Java и JavaScript
+Comment[mn]=Java ба JavaScript-н байдлыг тогтоох
+Comment[ms]=Konfigur kelakuan Java dan JavaScript
+Comment[mt]=Ikkonfigura l-imġieba ta' Java u JavaScript
+Comment[nb]=Innstillinger for Java og JavaScript
+Comment[nds]=Dat Bedregen vun Java un JavaSkript hier instellen
+Comment[ne]=जाभा र जाभा स्क्रिप्टकको व्यवहार कन्फिगर गर्नुहोस्
+Comment[nl]=Hier kunt u het gedrag van Java en JavaScript instellen
+Comment[nn]=Innstillingar for Java og JavaScript
+Comment[nso]=Beakanya maitshwaro a Java le setlankana sa Java
+Comment[pa]=Java ਅਤੇ ਜਾਵਾ-ਸਕਰਿਪਟ ਦੇ ਵਿਹਾਰ ਦੀ ਸੰਰਚਨਾ
+Comment[pl]=Konfiguracja działania Javy i JavaScriptu
+Comment[pt]=Configurar o comportamento do Java e do JavaScript
+Comment[pt_BR]=Configura o comportamento do Java e JavaScript
+Comment[ro]=Configurează comportamentul Java și JavaScript
+Comment[ru]=Настройка поведения Java и JavaScript
+Comment[rw]=Kuboneza imyitwarire ya Java na JavaScript
+Comment[se]=Java ja Javascript-heivehusat
+Comment[sk]=Nastavenie správania jazykov JavaScript a Java
+Comment[sl]=Nastavitve obnašanja jave in javascripta
+Comment[sr]=Подешавање понашања Java-е и JavaScript-а
+Comment[sr@Latn]=Podešavanje ponašanja Java-e i JavaScript-a
+Comment[sv]=Anpassa beteendet hos Java och Javaskript
+Comment[ta]=ஜாவா மற்றும் ஜாவா எழுத்தாக்கத்தின் இயக்கத்தை வடிவமைக்க முடியும்.
+Comment[tg]=Танзими нафъи рафтори Java ва JavaScript
+Comment[th]=ปรับแต่งพฤติกรรมของจาวาและจาวาสคริปต์
+Comment[tr]=Java ve JavaScript ayarlarını buradan hazırlayın
+Comment[tt]=Java belän JavaScript caylaw
+Comment[uk]=Налаштування поведінки Java та JavaScript
+Comment[uz]=Java va JavaScript xususiyatlarini moslash
+Comment[uz@cyrillic]=Java ва JavaScript хусусиятларини мослаш
+Comment[ven]=Dzudzanyani maitele a Java na Javascript
+Comment[vi]=Cấu hình cách hoạt động của Java và JavaScript
+Comment[wa]=Apontyî li dujhance pol Java eyet l' JavaScript
+Comment[xh]=Qwalasela ukuziphatha kwe Java ne JavaScript
+Comment[zh_CN]=配置 Java 和 JavaScript 的行为
+Comment[zh_TW]=設定 Java 與 JavaScript 的行為
+Comment[zu]=Hlanganisela ukuthi i-Java kanye ne-JavaScript iziphathe kanjani
+Keywords=konqueror,kfm,browser,html,web,www,java,javascript
+Keywords[be]=Вандроўнік,Сеціва,Сцэнар,konqueror,kfm,browser,html,web,www,java,javascript
+Keywords[bg]=Джава, Джава скрипт, скрипт, konqueror, kfm, browser, html, web, www, java, javascript
+Keywords[br]=konqueror,kfm,furcher,html,web,gwiad,java,javascript
+Keywords[ca]=konqueror,kfm,navegador,html,web,www,java,javascript
+Keywords[cs]=Konqueror,Kfm,Prohlížeč,HTML,Web,WWW,Java,JavaScript
+Keywords[csb]=konqueror,kfm,przezérnik,html,séc www,www,java,javascript
+Keywords[cy]=konqueror,kfm,porydd,html,gwe,www,java,javascript
+Keywords[da]=konqueror,kfm,browser,HTML,net,www,java,javascript
+Keywords[de]=Konqueror,kfm,Browser,HTML,Web,WWW,Java,JavaScript
+Keywords[el]=konqueror,kfm,περιηγητής,html,ιστός,www,java,javascript
+Keywords[eo]=Konkeranto,Kfm,TTT,HTML,WWW,tiparo,koloro,Javo,Javoskripto,kursoro,kursilo,ligo,referenco,bildo,signaro,kodo
+Keywords[es]=konqueror,kfm,navegador,html,web,wwwjava,javascript
+Keywords[et]=konqueror,kfm,veebilehitseja,html,veeb,www,java,javascript
+Keywords[eu]=konqueror,kfm,arakatzailea,html,web,www,java,javascript
+Keywords[fa]=konqueror، kfm، مرورگر، زنگام، وب، www، جاوا، جاوااسکریپت
+Keywords[fi]=konqueror,kfm,selain,html,web,www,java,javascript
+Keywords[fr]=konqueror,kfm,navigateur,html,web,www,polices,couleurs,java,javascript,curseur,liens,images,jeu de caractères,caractères,codage,encodage
+Keywords[fy]=konqueror,kfm,browser,blêder,html,web,www,java,javaskript,ynternet
+Keywords[ga]=konqueror,kfm,brabhsálaí,html,gréasán,www,java,javascript
+Keywords[gl]=konqueror,kfm,navegador,html,web,www,java,javascript
+Keywords[he]=konqueror,kfm,דפדפן,html,אינטרנט,www,java,javascript,ג'אווה, browser,web,www,java,javascript
+Keywords[hi]=कॉन्करर,केएफएम,ब्राउज़र,एचटीएमएल,वेब,डब्ल्यूडब्ल्यूडब्ल्यू.जावा,जावा-स्क्रिप्ट
+Keywords[hr]=konqueror,kfm,browser,html,web,www,java,javascript,preglednik
+Keywords[hu]=Konqueror,kfm,böngésző,HTML,web,WWW,Java,Javascript
+Keywords[is]=konqueror,kfm,browser,html,web,www,java,javascript,vafri
+Keywords[ja]=konqueror,kfm,ブラウザ,html,web,ウェブ,www,java,javascript
+Keywords[km]=konqueror,kfm,កម្មវិធី​រុករក,html,វិប,វើលវ៉ាយវិប,java,javascript
+Keywords[lt]=konqueror,kfm,browser,html,web,www,java,javascript, naršyklė,tinklalapiai, žiniatinklis
+Keywords[lv]=iekarotājs,kfm,pārlūks,html,web,www,java,javaskripts
+Keywords[mk]=konqueror,kfm,browser,html,web,www,java,javascript,прелистувач,веб
+Keywords[mn]=Конкюрор,kfm,Хөтөч,HTML,Веб,WWW,Java,JavaScript
+Keywords[nb]=konqueror,kfm,html,nettet,www,java,javascript,nettleser,Internett
+Keywords[nds]=Konqueror,kfm,browser,Nettkieker,HTML,web,www,Java,JavaScript
+Keywords[ne]=कन्क्वेरर, kfm, ब्राउजर, html, वेब, www, जाभा, जाभास्क्रिप्ट
+Keywords[nl]=konqueror,kfm,browser,html,web,www,java,javascript,internet
+Keywords[nn]=Konqueror,KFM,nettlesar,HTML,verdsveven,WWW,Java,JavaScript
+Keywords[nso]=konqueror,kfm,seinyakisi,html,web,www,java,setlankana sa java
+Keywords[pa]=ਕੋਨਕਿਉਰਰ,kfm,ਝਲਕਾਰਾ,html,web,www,java,javascript,ਜਾਵਾ
+Keywords[pl]=konqueror,kfm,przeglądarka,html,sieć www,www,java,javascript
+Keywords[pt]=konqueror,kfm,navegador,html,web,www,java,javascript
+Keywords[pt_BR]=konqueror,kfm,navegador,html,web,WWW,java,javascript
+Keywords[ro]=konqueror,kfm,navigator,browser,html,web,www,java,javascript
+Keywords[rw]= Konqueror,kfm,mucukumbuzi,html,urubuga,www,java,javascript
+Keywords[se]=konqueror,kfm,fierpmádatlogan,html,web,www,java,javascript
+Keywords[sk]=konqueror,kfm,prehliadač,html,web,www,java,javascript
+Keywords[sl]=konqueror,kfm,brskalnik,html,splet,www,java,javascript
+Keywords[sr]=konqueror,kfm,прегледач,html,web,www,java,javascript
+Keywords[sr@Latn]=konqueror,kfm,pregledač,html,web,www,java,javascript
+Keywords[sv]=konqueror,kfm,webbläsare,html,webb,www,teckensnitt,färger,java,javaskript,länkar,bilder,kodning,teckenuppsättningar
+Keywords[ta]=கான்கொரர்,kfm,உலாவி,html,வலை,www,ஜாவா,ஜாவா எழுத்தாக்கம்
+Keywords[th]=คอนเควอร์เรอร์,kfm,บราวเซอร์,html,เว็บ,www,จาวา,จาวาสคริปต์
+Keywords[tr]=konqueror,kfm,tarayıcı,html,web,www,java,javascript
+Keywords[uk]=konqueror,kfm,навігатор,html,web,Тенета,java,javascript,www
+Keywords[uz]=konqueror,kfm,brauzer,html,veb,www,java,javascript
+Keywords[uz@cyrillic]=konqueror,kfm,браузер,html,веб,www,java,javascript
+Keywords[ven]=konqueror,kfm,buronza,html,webu,www,dzifontu,mivhala,mivhala,java,manwalwa a java,cursor,vhukwamani,zwifanyiso,tshasete,mavhekanyele a muanewa,uinikhouda
+Keywords[vi]=konqueror,kfm,trình duyệt,html,web,www,java,javascript
+Keywords[wa]=konqueror,kfm,betchteu,html,waibe,waibes,www,java,javascript
+Keywords[xh]=konqueror,kfm,umkhangeli zincwadi,html,web, www,java,okushicilelwe phantsi kwe java
+Keywords[zh_CN]=konqueror,kfm,browser,html,web,www,java,javascript,浏览器
+Keywords[zh_TW]=konqueror,kfm,browser,html,web,www,java,javascript,征服家,瀏覽器,網頁
+Keywords[zu]=konqueror,kfm,umcingi,html,web,www,java,javascript
+
+Categories=Qt;KDE;X-KDE-settings-webbrowsing;
diff --git a/kcontrol/konqhtml/khttpoptdlg.cpp b/kcontrol/konqhtml/khttpoptdlg.cpp
new file mode 100644
index 000000000..e6c9a95ba
--- /dev/null
+++ b/kcontrol/konqhtml/khttpoptdlg.cpp
@@ -0,0 +1,81 @@
+// File khttpoptdlg.cpp by Jacek Konieczny <jajcus@zeus.posl.gliwice.pl>
+// Port to KControl by David Faure <faure@kde.org>
+
+#include <qlayout.h> //CT
+
+#include <klocale.h>
+#include <kglobal.h>
+#include "khttpoptdlg.h"
+
+
+KHTTPOptions::KHTTPOptions(KConfig *config, QString group, QWidget *parent, const char *name)
+ : KCModule( parent, name ), m_pConfig(config), m_groupname(group)
+{
+ QVBoxLayout *lay = new QVBoxLayout(this, 10, 5);
+
+ lay->addWidget( new QLabel(i18n("Accept languages:"), this) );
+
+ le_languages = new QLineEdit(this);
+ lay->addWidget( le_languages );
+ connect(le_languages, SIGNAL(textChanged(const 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(const QString&)),
+ this, SLOT(slotChanged()));
+
+ lay->addStretch(10);
+
+ // defaultCharsets = QString("utf-8 ")+klocale->charset()+" iso-8859-1";
+ defaultCharsets = QString("utf-8 ")+" iso-8859-1"; // TODO
+
+ // finaly read the options
+ load();
+}
+
+void KHTTPOptions::load()
+{
+ load( false );
+}
+
+void KHTTPOptions::load( bool useDefaults )
+{
+ QString tmp;
+
+ m_pConfig->setReadDefaults( useDefaults );
+
+ m_pConfig->setGroup( "Browser Settings/HTTP" );
+ tmp = m_pConfig->readEntry( "AcceptLanguages",KGlobal::locale()->languageList().join(","));
+ le_languages->setText( tmp );
+ tmp = m_pConfig->readEntry( "AcceptCharsets",defaultCharsets);
+ le_charsets->setText( tmp );
+
+ emit changed( useDefaults );
+
+}
+
+void KHTTPOptions::save()
+{
+ m_pConfig->setGroup( "Browser Settings/HTTP" );
+ m_pConfig->writeEntry( "AcceptLanguages", le_languages->text());
+ m_pConfig->writeEntry( "AcceptCharsets", le_charsets->text());
+ m_pConfig->sync();
+}
+
+void KHTTPOptions::defaults()
+{
+ load( true );
+}
+
+
+void KHTTPOptions::slotChanged()
+{
+ emit changed(true);
+}
+
+
+#include "khttpoptdlg.moc"
diff --git a/kcontrol/konqhtml/khttpoptdlg.h b/kcontrol/konqhtml/khttpoptdlg.h
new file mode 100644
index 000000000..36e3650b4
--- /dev/null
+++ b/kcontrol/konqhtml/khttpoptdlg.h
@@ -0,0 +1,49 @@
+// khttpoptdlg.h - extra HTTP configuration by Jacek Konieczy <jajcus@zeus.polsl.gliwice.pl>
+#ifndef __KHTTPOPTDLG_H
+#define __KHTTPOPTDLG_H
+
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qcheckbox.h>
+#include <qstring.h>
+
+#include <kcmodule.h>
+#include <kconfig.h>
+
+
+/**
+* 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(KConfig *config, QString group, QWidget *parent = 0L, const char *name = 0L);
+
+ virtual void load();
+ virtual void load( bool useDefaults );
+ virtual void save();
+ virtual void defaults();
+
+ private:
+
+ KConfig *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 slots:
+ void slotChanged();
+
+};
+
+#endif // __KHTTPOPTDLG_H
diff --git a/kcontrol/konqhtml/main.cpp b/kcontrol/konqhtml/main.cpp
new file mode 100644
index 000000000..b1d459b00
--- /dev/null
+++ b/kcontrol/konqhtml/main.cpp
@@ -0,0 +1,171 @@
+/*
+ * main.cpp
+ *
+ * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ * Copyright (c) 2000 Daniel Molkentin <molkentin@kde.org>
+ *
+ * Requires the Qt widget libraries, available at no cost at
+ * http://www.troll.no/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+
+#include <unistd.h>
+
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <qtabwidget.h>
+#include <qlayout.h>
+
+#include "jsopts.h"
+#include "javaopts.h"
+#include "pluginopts.h"
+#include "appearance.h"
+#include "htmlopts.h"
+#include "filteropts.h"
+
+#include "main.h"
+#include <kaboutdata.h>
+#include "main.moc"
+
+extern "C"
+{
+ KDE_EXPORT KCModule *create_khtml_behavior(QWidget *parent, const char *name)
+ {
+ KConfig *c = new KConfig( "konquerorrc", false, false );
+ return new KMiscHTMLOptions(c, "HTML Settings", parent, name);
+ }
+
+ KDE_EXPORT KCModule *create_khtml_fonts(QWidget *parent, const char *name)
+ {
+ KConfig *c = new KConfig( "konquerorrc", false, false );
+ return new KAppearanceOptions(c, "HTML Settings", parent, name);
+ }
+
+ KDE_EXPORT KCModule *create_khtml_java_js(QWidget *parent, const char* /*name*/)
+ {
+ KConfig *c = new KConfig( "konquerorrc", false, false );
+ return new KJSParts(c, parent, "kcmkonqhtml");
+ }
+
+ KDE_EXPORT KCModule *create_khtml_plugins(QWidget *parent, const char *name)
+ {
+ KConfig *c = new KConfig( "konquerorrc", false, false );
+ return new KPluginOptions(c, "Java/JavaScript Settings", parent, name);
+ }
+
+ KDE_EXPORT KCModule *create_khtml_filter(QWidget *parent, const char *name )
+ {
+ KConfig *c = new KConfig( "khtmlrc", false, false );
+ return new KCMFilter(c, "Filter Settings", parent, name);
+ }
+}
+
+
+KJSParts::KJSParts(KConfig *config, QWidget *parent, const char *name)
+ : KCModule(parent, name), mConfig(config)
+{
+ KAboutData *about =
+ new KAboutData(I18N_NOOP("kcmkonqhtml"), I18N_NOOP("Konqueror Browsing Control Module"),
+ 0, 0, KAboutData::License_GPL,
+ I18N_NOOP("(c) 1999 - 2001 The Konqueror Developers"));
+
+ about->addAuthor("Waldo Bastian",0,"bastian@kde.org");
+ about->addAuthor("David Faure",0,"faure@kde.org");
+ about->addAuthor("Matthias Kalle Dalheimer",0,"kalle@kde.org");
+ about->addAuthor("Lars Knoll",0,"knoll@kde.org");
+ about->addAuthor("Dirk Mueller",0,"mueller@kde.org");
+ about->addAuthor("Daniel Molkentin",0,"molkentin@kde.org");
+ about->addAuthor("Wynn Wilkes",0,"wynnw@caldera.com");
+
+ about->addCredit("Leo Savernik",I18N_NOOP("JavaScript access controls\n"
+ "Per-domain policies extensions"),
+ "l.savernik@aon.at");
+
+ setAboutData( about );
+
+ QVBoxLayout *layout = new QVBoxLayout(this);
+ tab = new QTabWidget(this);
+ layout->addWidget(tab);
+
+ // ### the groupname is duplicated in KJSParts::save
+ java = new KJavaOptions( config, "Java/JavaScript Settings", this, name );
+ tab->addTab( java, i18n( "&Java" ) );
+ connect( java, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) );
+
+ javascript = new KJavaScriptOptions( config, "Java/JavaScript Settings", this, name );
+ tab->addTab( javascript, i18n( "Java&Script" ) );
+ connect( javascript, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) );
+}
+
+KJSParts::~KJSParts()
+{
+ delete mConfig;
+}
+
+void KJSParts::load()
+{
+ javascript->load();
+ java->load();
+}
+
+
+void KJSParts::save()
+{
+ javascript->save();
+ java->save();
+
+ // delete old keys after they have been migrated
+ if (javascript->_removeJavaScriptDomainAdvice
+ || java->_removeJavaScriptDomainAdvice) {
+ mConfig->setGroup("Java/JavaScript Settings");
+ mConfig->deleteEntry("JavaScriptDomainAdvice");
+ javascript->_removeJavaScriptDomainAdvice = false;
+ java->_removeJavaScriptDomainAdvice = false;
+ }
+
+ mConfig->sync();
+
+ // Send signal to konqueror
+ // Warning. In case something is added/changed here, keep kfmclient in sync
+ QByteArray data;
+ if ( !kapp->dcopClient()->isAttached() )
+ kapp->dcopClient()->attach();
+ kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "reparseConfiguration()", data );
+}
+
+
+void KJSParts::defaults()
+{
+ javascript->defaults();
+ java->defaults();
+}
+
+QString KJSParts::quickHelp() const
+{
+ return i18n("<h2>JavaScript</h2>On this page, you can configure "
+ "whether JavaScript programs embedded in web pages should "
+ "be allowed to be executed by Konqueror."
+ "<h2>Java</h2>On this page, you can configure "
+ "whether Java applets embedded in web pages should "
+ "be allowed to be executed by Konqueror."
+ "<br><br><b>Note:</b> Active content is always a "
+ "security risk, which is why Konqueror allows you to specify very "
+ "fine-grained from which hosts you want to execute Java and/or "
+ "JavaScript programs." );
+}
+
+
diff --git a/kcontrol/konqhtml/main.h b/kcontrol/konqhtml/main.h
new file mode 100644
index 000000000..20f461fa2
--- /dev/null
+++ b/kcontrol/konqhtml/main.h
@@ -0,0 +1,60 @@
+/*
+ * main.h
+ *
+ * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ * Copyright (c) 2000 Daniel Molkentin <molkentin@kde.org>
+ *
+ * Requires the Qt widget libraries, available at no cost at
+ * http://www.troll.no/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef __MAIN_H__
+#define __MAIN_H__
+
+#include <kcmodule.h>
+
+class KJavaOptions;
+class KJavaScriptOptions;
+
+class QTabWidget;
+
+class KJSParts : public KCModule
+{
+ Q_OBJECT
+
+public:
+
+ KJSParts(KConfig *config,QWidget *parent, const char *name);
+ virtual ~KJSParts();
+
+ void load();
+ void save();
+ void defaults();
+ QString quickHelp() const;
+
+
+private:
+ QTabWidget *tab;
+
+ KJavaScriptOptions *javascript;
+ KJavaOptions *java;
+
+ KConfig *mConfig;
+};
+
+#endif
diff --git a/kcontrol/konqhtml/nsconfigwidget.ui b/kcontrol/konqhtml/nsconfigwidget.ui
new file mode 100644
index 000000000..d772595c2
--- /dev/null
+++ b/kcontrol/konqhtml/nsconfigwidget.ui
@@ -0,0 +1,273 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>NSConfigWidget</class>
+<author>Stefan Schimanski &lt;1Stein@gmx.de&gt;</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>NSConfigWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>458</width>
+ <height>373</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Netscape Plugin Config</string>
+ </property>
+ <property name="layoutMargin" stdset="0">
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>TabWidget2</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Scan</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>scanButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Scan for New Plugins</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Click here to scan for newly installed Netscape plugins now.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>scanAtStartup</cstring>
+ </property>
+ <property name="text">
+ <string>Scan for new plugins at &amp;KDE startup</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If this option is enabled, KDE will look for new Netscape plugins every time it starts up. This makes it easier for you if you often install new plugins, but it may also slow down KDE startup. You might want to disable this option, especially if you seldom install plugins.</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>300</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Scan Folders</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>dirRemove</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="2">
+ <property name="name">
+ <cstring>dirNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>dirEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="mode" stdset="0">
+ <number>18</number>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="3" column="2">
+ <property name="name">
+ <cstring>dirDown</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Do&amp;wn</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="2">
+ <property name="name">
+ <cstring>dirUp</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Up</string>
+ </property>
+ </widget>
+ <widget class="KListBox" row="1" column="0" rowspan="4" colspan="2">
+ <property name="name">
+ <cstring>dirList</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <spacer row="4" column="2">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Plugins</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView" row="1" column="0">
+ <column>
+ <property name="text">
+ <string>Information</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>pluginList</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Here you can see a list of the Netscape plugins KDE has found.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>useArtsdsp</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Use a&amp;rtsdsp to pipe plugin sound through aRts</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<includes>
+ <include location="global" impldecl="in declaration">klocale.h</include>
+ <include location="global" impldecl="in declaration">kurlrequester.h</include>
+ <include location="global" impldecl="in declaration">klistbox.h</include>
+ <include location="local" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="3" margin="6"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>qwidget.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistbox.h</includehint>
+</includehints>
+</UI>
diff --git a/kcontrol/konqhtml/pluginopts.cpp b/kcontrol/konqhtml/pluginopts.cpp
new file mode 100644
index 000000000..7fec6f9d3
--- /dev/null
+++ b/kcontrol/konqhtml/pluginopts.cpp
@@ -0,0 +1,659 @@
+// (c) 2002-2003 Leo Savernik, per-domain settings
+// (c) 2001, Daniel Naber, based on javaopts.cpp
+// (c) 2000 Stefan Schimanski <1Stein@gmx.de>, Netscape parts
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <qlayout.h>
+#include <qprogressdialog.h>
+#include <qregexp.h>
+#include <qslider.h>
+#include <qvgroupbox.h>
+#include <qwhatsthis.h>
+
+#include <dcopclient.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kfiledialog.h>
+#include <kiconloader.h>
+#include <klistview.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocio.h>
+#include <kstandarddirs.h>
+#include <kurlrequester.h>
+
+#include "htmlopts.h"
+#include "pluginopts.h"
+#include "policydlg.h"
+
+
+// == class PluginPolicies =====
+
+PluginPolicies::PluginPolicies(KConfig* config, const QString &group, bool global,
+ const QString &domain) :
+ Policies(config,group,global,domain,"plugins.","EnablePlugins") {
+}
+
+PluginPolicies::~PluginPolicies() {
+}
+
+// == class KPluginOptions =====
+
+KPluginOptions::KPluginOptions( KConfig* config, QString group, QWidget *parent,
+ const char *)
+ : KCModule( parent, "kcmkonqhtml" ),
+ m_pConfig( config ),
+ m_groupname( group ),
+ m_nspluginscan (0),
+ global_policies(config,group,true)
+{
+ QVBoxLayout* toplevel = new QVBoxLayout( this, 0, KDialog::spacingHint() );
+
+ /**************************************************************************
+ ******************** Global Settings *************************************
+ *************************************************************************/
+ QVGroupBox* globalGB = new QVGroupBox( i18n( "Global Settings" ), this );
+ toplevel->addWidget( globalGB );
+ 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").arg(QString::null), globalGB);
+ priority = new QSlider(5, 100, 5, 100, Horizontal, globalGB);
+ 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()));
+
+ domainSpecificDlg = new KDialogBase(KDialogBase::Swallow,
+ i18n("Domain-Specific Policies"),KDialogBase::Close,
+ KDialogBase::Close,this,"domainSpecificDlg", true);
+
+ domainSpecific = new PluginDomainListView(config,group,this,domainSpecificDlg);
+ domainSpecific->setMinimumSize(320,200);
+ connect(domainSpecific,SIGNAL(changed(bool)),SLOT(slotChanged()));
+
+ domainSpecificDlg->setMainWidget(domainSpecific);
+
+ /**************************************************************************
+ ********************** WhatsThis? items **********************************
+ *************************************************************************/
+ QWhatsThis::add( enablePluginsGloballyCB, 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. <p>Select a policy and use the controls on "
+ "the right to modify it.");
+ QWhatsThis::add( domainSpecific->listView(), wtstr );
+ QWhatsThis::add( domainSpecific->importButton(), 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.") );
+ QWhatsThis::add( domainSpecific->exportButton(), i18n("Click this button to save the plugin policy to a zipped "
+ "file. The file, named <b>plugin_policy.tgz</b>, will be "
+ "saved to a location of your choice." ) );
+ QWhatsThis::add( domainSpecific, i18n("Here you can set specific plugin policies for any particular "
+ "host or domain. To add a new policy, simply click the <i>New...</i> "
+ "button and supply the necessary information requested by the "
+ "dialog box. To change an existing policy, click on the <i>Change...</i> "
+ "button and choose the new policy from the policy dialog box. Clicking "
+ "on the <i>Delete</i> button will remove the selected policy causing the default "
+ "policy setting to be used for that domain.") );
+#if 0
+ "The <i>Import</i> and <i>Export</i> "
+ "button allows you to easily share your policies with other people by allowing "
+ "you to save and retrieve them from a zipped file.") );
+#endif
+
+/*****************************************************************************/
+
+ QVGroupBox* netscapeGB = new QVGroupBox( i18n( "Netscape Plugins" ), this );
+ toplevel->addWidget( netscapeGB );
+
+ // create Designer made widget
+ m_widget = new NSConfigWidget( netscapeGB, "configwidget" );
+ m_widget->dirEdit->setMode(KFile::ExistingOnly | KFile::LocalOnly | KFile::Directory);
+
+ // setup widgets
+ connect( m_widget->scanAtStartup, SIGNAL(clicked()), SLOT(change()) );
+ connect( m_widget->scanButton, SIGNAL(clicked()), SLOT(scan()) );
+
+ m_changed = false;
+
+ dirInit();
+ pluginInit();
+
+ // Finally do the loading
+ load();
+}
+
+KPluginOptions::~KPluginOptions()
+{
+ delete m_pConfig;
+}
+
+
+void KPluginOptions::updatePLabel(int p) {
+ QString level;
+ p = (100 - p)/5;
+ if (p > 15) {
+ level = i18n("lowest priority", "lowest");
+ } else if (p > 11) {
+ level = i18n("low priority", "low");
+ } else if (p > 7) {
+ level = i18n("medium priority", "medium");
+ } else if (p > 3) {
+ level = i18n("high priority", "high");
+ } else {
+ level = i18n("highest priority", "highest");
+ }
+
+ priorityLabel->setText(i18n("CPU priority for plugins: %1").arg(level));
+}
+
+void KPluginOptions::load()
+{
+ load( false );
+}
+
+void KPluginOptions::load( bool useDefaults )
+{
+
+
+ // *** load ***
+ global_policies.load();
+ bool bPluginGlobal = global_policies.isFeatureEnabled();
+
+ // *** apply to GUI ***
+ enablePluginsGloballyCB->setChecked( bPluginGlobal );
+
+ domainSpecific->initialize(m_pConfig->readListEntry("PluginDomains"));
+
+/****************************************************************************/
+
+ KConfig *config = new KConfig("kcmnspluginrc", true);
+
+ config->setReadDefaults( useDefaults );
+
+ config->setGroup("Misc");
+ m_widget->scanAtStartup->setChecked( config->readBoolEntry( "startkdeScan", false ) );
+
+ m_widget->dirEdit->setURL("");
+ m_widget->dirEdit->setEnabled( false );
+ m_widget->dirRemove->setEnabled( false );
+ m_widget->dirUp->setEnabled( false );
+ m_widget->dirDown->setEnabled( false );
+ enableHTTPOnly->setChecked( config->readBoolEntry("HTTP URLs Only", false) );
+ enableUserDemand->setChecked( config->readBoolEntry("demandLoad", false) );
+ priority->setValue(100 - KCLAMP(config->readNumEntry("Nice Level", 0), 0, 19) * 5);
+ updatePLabel(priority->value());
+
+ dirLoad( config, useDefaults );
+ pluginLoad( config );
+
+ delete config;
+
+ emit changed( useDefaults );
+}
+
+void KPluginOptions::defaults()
+{
+ load( true );
+}
+
+void KPluginOptions::save()
+{
+ global_policies.save();
+
+ domainSpecific->save(m_groupname,"PluginDomains");
+
+ m_pConfig->sync(); // I need a sync here, otherwise "apply" won't work
+ // instantly
+
+ QByteArray data;
+ if ( !kapp->dcopClient()->isAttached() )
+ kapp->dcopClient()->attach();
+ kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "reparseConfiguration()", data );
+
+/*****************************************************************************/
+
+ KConfig *config= new KConfig("kcmnspluginrc", false);
+
+ dirSave( config );
+ pluginSave( config );
+
+ config->setGroup("Misc");
+ config->writeEntry( "startkdeScan", m_widget->scanAtStartup->isChecked() );
+ config->writeEntry( "HTTP URLs Only", enableHTTPOnly->isChecked() );
+ config->writeEntry( "demandLoad", enableUserDemand->isChecked() );
+ config->writeEntry("Nice Level", (int)(100 - priority->value()) / 5);
+ config->sync();
+ delete config;
+
+ change( false );
+}
+
+QString KPluginOptions::quickHelp() const
+{
+ return i18n("<h1>Konqueror Plugins</h1> 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::null, KStdGuiItem::save(), KStdGuiItem::discard() );
+ if ( ret==KMessageBox::Cancel ) {
+ m_widget->scanButton->setEnabled(true);
+ return;
+ }
+ if ( ret==KMessageBox::Yes )
+ save();
+ }
+
+ m_nspluginscan = new KProcIO;
+ QString scanExe = KGlobal::dirs()->findExe("nspluginscan");
+ if (!scanExe) {
+ kdDebug() << "can't find nspluginviewer" << endl;
+ delete m_nspluginscan;
+ m_nspluginscan = 0L;
+
+ 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 QProgressDialog( i18n("Scanning for plugins"), i18n("Cancel"), 100, this );
+ m_progress->setProgress( 5 );
+
+ // start nspluginscan
+ *m_nspluginscan << scanExe << "--verbose";
+ kdDebug() << "Running nspluginscan" << endl;
+ connect(m_nspluginscan, SIGNAL(readReady(KProcIO*)),
+ this, SLOT(progress(KProcIO*)));
+ connect(m_nspluginscan, SIGNAL(processExited(KProcess *)),
+ this, SLOT(scanDone()));
+ connect(m_progress, SIGNAL(cancelled()), this, SLOT(scanDone()));
+
+ m_nspluginscan->start();
+}
+
+void KPluginOptions::progress(KProcIO *proc)
+{
+ QString line;
+ while(proc->readln(line) > 0)
+ ;
+ m_progress->setProgress(line.stripWhiteSpace().toInt());
+}
+
+void KPluginOptions::scanDone()
+{
+ m_progress->setProgress(100);
+ load();
+
+ delete m_progress; m_progress = 0L;
+ m_nspluginscan->deleteLater(); m_nspluginscan = 0L;
+ m_widget->scanButton->setEnabled(true);
+}
+
+/***********************************************************************************/
+
+
+void KPluginOptions::dirInit()
+{
+ m_widget->dirEdit->setCaption(i18n("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->useArtsdsp, SIGNAL(clicked()),SLOT(change()));
+ connect( m_widget->dirEdit,
+ SIGNAL(textChanged(const QString&)),
+ SLOT(dirEdited(const QString &)) );
+
+ connect( m_widget->dirList,
+ SIGNAL(executed(QListBoxItem*)),
+ SLOT(dirSelect(QListBoxItem*)) );
+
+ connect( m_widget->dirList,
+ SIGNAL(selectionChanged(QListBoxItem*)),
+ SLOT(dirSelect(QListBoxItem*)) );
+}
+
+
+void KPluginOptions::dirLoad( KConfig *config, bool useDefault )
+{
+ QStringList paths;
+
+ // read search paths
+
+ config->setGroup("Misc");
+ if ( config->hasKey( "scanPaths" ) && !useDefault )
+ paths = config->readListEntry( "scanPaths" );
+ else {//keep sync with kdebase/nsplugins
+ paths.append("$HOME/.mozilla/plugins");
+ paths.append("$HOME/.netscape/plugins");
+ paths.append("/usr/lib/firefox/plugins");
+ paths.append("/usr/lib64/browser-plugins");
+ paths.append("/usr/lib/browser-plugins");
+ paths.append("/usr/local/netscape/plugins");
+ paths.append("/opt/mozilla/plugins");
+ paths.append("/opt/mozilla/lib/plugins");
+ paths.append("/opt/netscape/plugins");
+ paths.append("/opt/netscape/communicator/plugins");
+ paths.append("/usr/lib/netscape/plugins");
+ paths.append("/usr/lib/netscape/plugins-libc5");
+ paths.append("/usr/lib/netscape/plugins-libc6");
+ paths.append("/usr/lib/mozilla/plugins");
+ paths.append("/usr/lib64/netscape/plugins");
+ paths.append("/usr/lib64/mozilla/plugins");
+ paths.append("$MOZILLA_HOME/plugins");
+
+ }
+
+ // fill list
+ m_widget->dirList->clear();
+ m_widget->dirList->insertStringList( paths );
+
+ // setup other widgets
+ bool useArtsdsp = config->readBoolEntry( "useArtsdsp", false );
+ m_widget->useArtsdsp->setChecked( useArtsdsp );
+}
+
+
+void KPluginOptions::dirSave( KConfig *config )
+{
+ // create stringlist
+ QStringList paths;
+ QListBoxItem *item = m_widget->dirList->firstItem();
+ for ( ; item!=0; item=item->next() )
+ if ( !item->text().isEmpty() )
+ paths << item->text();
+
+ // write entry
+ config->setGroup( "Misc" );
+ config->writeEntry( "scanPaths", paths );
+ config->writeEntry( "useArtsdsp", m_widget->useArtsdsp->isOn() );
+}
+
+
+void KPluginOptions::dirSelect( QListBoxItem *item )
+{
+ m_widget->dirEdit->setEnabled( item!=0 );
+ m_widget->dirRemove->setEnabled( item!=0 );
+
+ unsigned cur = m_widget->dirList->index(m_widget->dirList->selectedItem());
+ m_widget->dirDown->setEnabled( item!=0 && cur<m_widget->dirList->count()-1 );
+ m_widget->dirUp->setEnabled( item!=0 && cur>0 );
+ m_widget->dirEdit->setURL( item!=0 ? item->text() : QString::null );
+ }
+
+
+void KPluginOptions::dirNew()
+{
+ m_widget->dirList->insertItem( QString::null, 0 );
+ m_widget->dirList->setCurrentItem( 0 );
+ dirSelect( m_widget->dirList->selectedItem() );
+ m_widget->dirEdit->setURL(QString::null);
+ m_widget->dirEdit->setFocus();
+ change();
+}
+
+
+void KPluginOptions::dirRemove()
+{
+ m_widget->dirEdit->setURL(QString::null);
+ delete m_widget->dirList->selectedItem();
+ m_widget->dirRemove->setEnabled( false );
+ m_widget->dirUp->setEnabled( false );
+ m_widget->dirDown->setEnabled( false );
+ m_widget->dirEdit->setEnabled( false );
+ change();
+}
+
+
+void KPluginOptions::dirUp()
+{
+ unsigned cur = m_widget->dirList->index(m_widget->dirList->selectedItem());
+ if ( cur>0 ) {
+ QString txt = m_widget->dirList->text(cur-1);
+ m_widget->dirList->removeItem( cur-1 );
+ m_widget->dirList->insertItem( txt, cur );
+
+ m_widget->dirUp->setEnabled( cur-1>0 );
+ m_widget->dirDown->setEnabled( true );
+ change();
+ }
+}
+
+
+void KPluginOptions::dirDown()
+{
+ unsigned cur = m_widget->dirList->index(m_widget->dirList->selectedItem());
+ if ( cur < m_widget->dirList->count()-1 ) {
+ QString txt = m_widget->dirList->text(cur+1);
+ m_widget->dirList->removeItem( cur+1 );
+ m_widget->dirList->insertItem( txt, cur );
+
+ 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->currentText() != txt ) {
+ m_widget->dirList->blockSignals(true);
+ m_widget->dirList->changeItem( txt, m_widget->dirList->currentItem() );
+ m_widget->dirList->blockSignals(false);
+ change();
+ }
+}
+
+
+/***********************************************************************************/
+
+
+void KPluginOptions::pluginInit()
+{
+}
+
+
+void KPluginOptions::pluginLoad( KConfig* /*config*/ )
+{
+ kdDebug() << "-> KPluginOptions::fillPluginList" << endl;
+ m_widget->pluginList->clear();
+ QRegExp version(";version=[^:]*:");
+
+ // open the cache file
+ QFile cachef( locate("data", "nsplugins/cache") );
+ if ( !cachef.exists() || !cachef.open(IO_ReadOnly) ) {
+ kdDebug() << "Could not load plugin cache file!" << endl;
+ return;
+ }
+
+ QTextStream cache(&cachef);
+
+ // root object
+ QListViewItem *root = new QListViewItem( m_widget->pluginList, i18n("Netscape Plugins") );
+ root->setOpen( true );
+ root->setSelectable( false );
+ root->setExpandable( true );
+ root->setPixmap(0, SmallIcon("netscape"));
+
+ // read in cache
+ QString line, plugin;
+ QListViewItem *next = 0;
+ QListViewItem *lastMIME = 0;
+ while ( !cache.atEnd() ) {
+
+ line = cache.readLine();
+ //kdDebug() << line << endl;
+ if (line.isEmpty() || (line.left(1) == "#"))
+ continue;
+
+ if (line.left(1) == "[") {
+
+ plugin = line.mid(1,line.length()-2);
+ //kdDebug() << "plugin=" << plugin << endl;
+
+ // add plugin root item
+ next = new QListViewItem( root, i18n("Plugin"), plugin );
+ next->setOpen( false );
+ next->setSelectable( false );
+ next->setExpandable( true );
+
+ lastMIME = 0;
+
+ continue;
+ }
+
+ QStringList desc = QStringList::split(':', line, TRUE);
+ QString mime = desc[0].stripWhiteSpace();
+ QString name = desc[2];
+ QString suffixes = desc[1];
+
+ if (!mime.isEmpty()) {
+ //kdDebug() << "mime=" << mime << " desc=" << name << " suffix=" << suffixes << endl;
+ lastMIME = new QListViewItem( next, lastMIME, i18n("MIME type"), mime );
+ lastMIME->setOpen( false );
+ lastMIME->setSelectable( false );
+ lastMIME->setExpandable( true );
+
+ QListViewItem *last = new QListViewItem( lastMIME, 0, i18n("Description"), name );
+ last->setOpen( false );
+ last->setSelectable( false );
+ last->setExpandable( false );
+
+ last = new QListViewItem( lastMIME, last, i18n("Suffixes"), suffixes );
+ last->setOpen( false );
+ last->setSelectable( false );
+ last->setExpandable( false );
+ }
+ }
+
+ //kdDebug() << "<- KPluginOptions::fillPluginList" << endl;
+}
+
+
+void KPluginOptions::pluginSave( KConfig* /*config*/ )
+{
+
+}
+
+// == class PluginDomainDialog =====
+
+PluginDomainDialog::PluginDomainDialog(QWidget *parent) :
+ QWidget(parent,"PluginDomainDialog") {
+ setCaption(i18n("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);
+
+ QBoxLayout *hl = new QHBoxLayout(this,0,6);
+ hl->addStretch(10);
+
+ QPushButton *closePB = new KPushButton(KStdGuiItem::close(),this);
+ connect(closePB,SIGNAL(clicked()),SLOT(slotClose()));
+ hl->addWidget(closePB);
+ thisLayout->addLayout(hl);
+}
+
+PluginDomainDialog::~PluginDomainDialog() {
+}
+
+void PluginDomainDialog::setMainWidget(QWidget *widget) {
+ thisLayout->insertWidget(0,widget);
+}
+
+void PluginDomainDialog::slotClose() {
+ hide();
+}
+
+// == class PluginDomainListView =====
+
+PluginDomainListView::PluginDomainListView(KConfig *config,const QString &group,
+ KPluginOptions *options,QWidget *parent,const char *name)
+ : DomainListView(config,i18n( "Doma&in-Specific" ), parent, name),
+ group(group), options(options) {
+}
+
+PluginDomainListView::~PluginDomainListView() {
+}
+
+void PluginDomainListView::setupPolicyDlg(PushButton trigger,PolicyDialog &pDlg,
+ Policies *pol) {
+ QString caption;
+ switch (trigger) {
+ case AddButton:
+ caption = i18n( "New Plugin Policy" );
+ pol->setFeatureEnabled(!options->enablePluginsGloballyCB->isChecked());
+ break;
+ case ChangeButton: caption = i18n( "Change Plugin Policy" ); break;
+ default: ; // inhibit gcc warning
+ }/*end switch*/
+ pDlg.setCaption(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<PluginPolicies *>(pol));
+}
+
+#include "pluginopts.moc"
diff --git a/kcontrol/konqhtml/pluginopts.h b/kcontrol/konqhtml/pluginopts.h
new file mode 100644
index 000000000..46142dcf7
--- /dev/null
+++ b/kcontrol/konqhtml/pluginopts.h
@@ -0,0 +1,163 @@
+//-----------------------------------------------------------------------------
+//
+// Plugin Options
+//
+// (c) 2002 Leo Savernik, per-domain settings
+// (c) 2001, Daniel Naber, based on javaopts.h
+// (c) 2000, Stefan Schimanski <1Stein@gmx.de>, Netscape parts
+//
+//-----------------------------------------------------------------------------
+
+#ifndef __PLUGINOPTS_H__
+#define __PLUGINOPTS_H__
+
+#include <qwidget.h>
+
+#include "domainlistview.h"
+#include "policies.h"
+
+class KConfig;
+class QCheckBox;
+
+#include <kcmodule.h>
+#include "nsconfigwidget.h"
+
+class QBoxLayout;
+class QLabel;
+class QProgressDialog;
+class QSlider;
+class KDialogBase;
+class KPluginOptions;
+class KProcIO;
+
+/** 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(KConfig* config, const QString &group, bool global,
+ const QString &domain = QString::null);
+
+ virtual ~PluginPolicies();
+};
+
+/** Plugin-specific enhancements to the domain list view
+ */
+class PluginDomainListView : public DomainListView {
+ Q_OBJECT
+public:
+ PluginDomainListView(KConfig *config,const QString &group,KPluginOptions *opt,
+ QWidget *parent,const char *name = 0);
+ virtual ~PluginDomainListView();
+
+protected:
+ virtual PluginPolicies *createPolicies();
+ virtual PluginPolicies *copyPolicies(Policies *pol);
+ virtual void setupPolicyDlg(PushButton trigger,PolicyDialog &pDlg,
+ Policies *copy);
+
+private:
+ QString group;
+ KPluginOptions *options;
+};
+
+/**
+ * dialog for embedding a PluginDomainListView widget
+ */
+class PluginDomainDialog : public QWidget {
+ Q_OBJECT
+public:
+
+ PluginDomainDialog(QWidget *parent);
+ virtual ~PluginDomainDialog();
+
+ void setMainWidget(QWidget *widget);
+
+private slots:
+ virtual void slotClose();
+
+private:
+ PluginDomainListView *domainSpecific;
+ QBoxLayout *thisLayout;
+};
+
+class KPluginOptions : public KCModule
+{
+ Q_OBJECT
+
+public:
+ KPluginOptions( KConfig* config, QString group, QWidget* parent = 0, const char* name = 0 );
+ ~KPluginOptions();
+
+ virtual void load();
+ virtual void load( bool useDefaults );
+ virtual void save();
+ virtual void defaults();
+ QString quickHelp() const;
+
+private slots:
+ void slotChanged();
+ void slotTogglePluginsEnabled();
+ void slotShowDomainDlg();
+
+private:
+
+ KConfig* m_pConfig;
+ QString m_groupname;
+
+ QCheckBox *enablePluginsGloballyCB, *enableHTTPOnly, *enableUserDemand;
+
+
+ protected slots:
+ void progress(KProcIO *);
+ void updatePLabel(int);
+ void change() { change( true ); };
+ void change( bool c ) { emit changed(c); m_changed = c; };
+
+ void scan();
+ void scanDone();
+
+ private:
+ NSConfigWidget *m_widget;
+ bool m_changed;
+ QProgressDialog *m_progress;
+ KProcIO* m_nspluginscan;
+ QSlider *priority;
+ QLabel *priorityLabel;
+ PluginPolicies global_policies;
+ PluginDomainListView *domainSpecific;
+ KDialogBase *domainSpecificDlg;
+
+/******************************************************************************/
+ protected:
+ void dirInit();
+ void dirLoad( KConfig *config, bool useDefault = false );
+ void dirSave( KConfig *config );
+
+ protected slots:
+ void dirNew();
+ void dirRemove();
+ void dirUp();
+ void dirDown();
+ void dirEdited(const QString &);
+ void dirSelect( QListBoxItem * );
+
+/******************************************************************************/
+ protected:
+ void pluginInit();
+ void pluginLoad( KConfig *config );
+ void pluginSave( KConfig *config );
+
+ friend class PluginDomainListView;
+};
+
+#endif // __PLUGINOPTS_H__
diff --git a/kcontrol/konqhtml/policies.cpp b/kcontrol/konqhtml/policies.cpp
new file mode 100644
index 000000000..153c80888
--- /dev/null
+++ b/kcontrol/konqhtml/policies.cpp
@@ -0,0 +1,74 @@
+/*
+ Copyright (c) 2002 Leo Savernik <l.savernik@aon.at>
+ Derived from jsopt.cpp, code copied from there is copyrighted to its
+ respective owners.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include <kconfig.h>
+#include <kdebug.h>
+
+#include "policies.h"
+
+// == class Policies ==
+
+Policies::Policies(KConfig* config,const QString &group,
+ bool global,const QString &domain, const QString &prefix,
+ const QString &feature_key) :
+ is_global(global), config(config), groupname(group),
+ prefix(prefix), feature_key(feature_key) {
+
+ if (is_global) {
+ this->prefix = QString::null; // global keys have no prefix
+ }/*end if*/
+ setDomain(domain);
+}
+
+Policies::~Policies() {
+}
+
+void Policies::setDomain(const QString &domain) {
+ if (is_global) return;
+ this->domain = domain.lower();
+ groupname = this->domain; // group is domain in this case
+}
+
+void Policies::load() {
+ config->setGroup(groupname);
+
+ QString key = prefix + feature_key;
+ if (config->hasKey(key))
+ feature_enabled = config->readBoolEntry(key);
+ else
+ feature_enabled = is_global ? true : INHERIT_POLICY;
+}
+
+void Policies::defaults() {
+ feature_enabled = is_global ? true : INHERIT_POLICY;
+}
+
+void Policies::save() {
+ config->setGroup(groupname);
+
+ QString key = prefix + feature_key;
+ if (feature_enabled != INHERIT_POLICY)
+ config->writeEntry(key, (bool)feature_enabled);
+ else
+ config->deleteEntry(key);
+
+ // don't do a config->sync() here for sake of efficiency
+}
diff --git a/kcontrol/konqhtml/policies.h b/kcontrol/konqhtml/policies.h
new file mode 100644
index 000000000..b5643c0bd
--- /dev/null
+++ b/kcontrol/konqhtml/policies.h
@@ -0,0 +1,134 @@
+/*
+ Copyright (c) 2002 Leo Savernik <l.savernik@aon.at>
+ Derived from jsopt.h, code copied from there is copyrighted to its
+ respective owners.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef __POLICIES_H__
+#define __POLICIES_H__
+
+#include <qstring.h>
+
+class KConfig;
+
+// special value for inheriting a global policy
+#define INHERIT_POLICY 32767
+
+/**
+ * @short Contains the basic policies and methods for their manipulation.
+ *
+ * This class provides access to the basic policies that are common
+ * to all features.
+ *
+ * @author Leo Savernik
+ */
+class 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 it contains policies specific to a domain.
+ * @param domain name of the domain this instance is used to configure the
+ * policies for (case insensitive, ignored if global == true)
+ * @param prefix prefix to use for configuration keys. The domain-specific
+ * policies use of the format "&lt;feature&gt;." (note the trailing dot).
+ * Global policies have no prefix, it is ignored if global == true.
+ * @param feature_key key of the "feature enabled" policy. The final
+ * key the policy is stored under will be prefix + featureKey.
+ */
+ Policies(KConfig* config, const QString &group, bool global,
+ const QString &domain, const QString &prefix,
+ const QString &feature_key);
+
+ virtual ~Policies();
+
+ /**
+ * Returns true if this is the global policies object
+ */
+ bool isGlobal() const {
+ return is_global;
+ }
+
+ /** sets a new domain for this policy
+ * @param domain domain name, will be converted to lowercase
+ */
+ void setDomain(const QString &domain);
+
+ /**
+ * Returns whether the "feature enabled" policy is inherited.
+ */
+ bool isFeatureEnabledPolicyInherited() const {
+ return feature_enabled == INHERIT_POLICY;
+ }
+ /** inherits "feature enabled" policy */
+ void inheritFeatureEnabledPolicy() {
+ feature_enabled = INHERIT_POLICY;
+ }
+ /**
+ * Returns whether this feature is enabled.
+ *
+ * This will return an illegal value if isFeatureEnabledPolicyInherited
+ * is true.
+ */
+ bool isFeatureEnabled() const {
+ return (bool)feature_enabled;
+ }
+ /**
+ * Enables/disables this feature
+ * @param on true will enable it, false disable it
+ */
+ void setFeatureEnabled(int on) {
+ feature_enabled = on;
+ }
+
+ /**
+ * (re)loads settings from configuration file given in the constructor.
+ *
+ * Implicitely sets the group given in the constructor. Don't forget to
+ * call this method from derived methods.
+ */
+ virtual void load();
+ /**
+ * saves current settings to the configuration file given in the constructor
+ *
+ * Implicitely sets the group given in the constructor. Don't forget to
+ * call this method from derived methods.
+ */
+ virtual void save();
+ /**
+ * restores the default settings
+ */
+ virtual void defaults();
+
+protected:
+ // true or false or INHERIT_POLICY
+ unsigned int feature_enabled;
+
+ bool is_global;
+ KConfig *config;
+ QString groupname;
+ QString domain;
+ QString prefix;
+ QString feature_key;
+};
+
+#endif // __POLICIES_H__
+
diff --git a/kcontrol/konqhtml/policydlg.cpp b/kcontrol/konqhtml/policydlg.cpp
new file mode 100644
index 000000000..801068d3a
--- /dev/null
+++ b/kcontrol/konqhtml/policydlg.cpp
@@ -0,0 +1,128 @@
+// (C) < 2002 to whoever created and edited this file before
+// (C) 2002 Leo Savernik <l.savernik@aon.at>
+// Generalizing the policy dialog
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qwhatsthis.h>
+#include <qcombobox.h>
+
+#include <klocale.h>
+#include <kbuttonbox.h>
+#include <kmessagebox.h>
+
+#include <qpushbutton.h>
+
+#include "policydlg.h"
+#include "policies.h"
+
+PolicyDialog::PolicyDialog( Policies *policies, QWidget *parent, const char *name )
+ : KDialogBase(parent, name, true, QString::null, Ok|Cancel, Ok, true),
+ policies(policies)
+{
+ QFrame *main = makeMainWidget();
+
+ insertIdx = 1; // index where to insert additional panels
+ topl = new QVBoxLayout(main, 0, spacingHint());
+
+ QGridLayout *grid = new QGridLayout(topl, 2, 2);
+ grid->setColStretch(1, 1);
+
+ QLabel *l = new QLabel(i18n("&Host or domain name:"), main);
+ grid->addWidget(l, 0, 0);
+
+ le_domain = new QLineEdit(main);
+ l->setBuddy( le_domain );
+ grid->addWidget(le_domain, 0, 1);
+ connect( le_domain,SIGNAL(textChanged( const QString & )),
+ SLOT(slotTextChanged( const QString &)));
+
+ QWhatsThis::add(le_domain, 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);
+ grid->addWidget(l_feature_policy, 1, 0);
+
+ cb_feature_policy = new QComboBox(main);
+ l_feature_policy->setBuddy( cb_feature_policy );
+ policy_values << i18n("Use Global") << i18n("Accept") << i18n("Reject");
+ cb_feature_policy->insertStringList(policy_values);
+ grid->addWidget(cb_feature_policy, 1, 1);
+
+ le_domain->setFocus();
+
+ enableButtonOK(!le_domain->text().isEmpty());
+}
+
+PolicyDialog::FeatureEnabledPolicy PolicyDialog::featureEnabledPolicy() const {
+ return (FeatureEnabledPolicy)cb_feature_policy->currentItem();
+}
+
+void PolicyDialog::slotTextChanged( const QString &text)
+{
+ enableButtonOK(!text.isEmpty());
+}
+
+void PolicyDialog::setDisableEdit( bool state, const QString& text )
+{
+ le_domain->setText( text );
+
+ le_domain->setEnabled( state );
+
+ if( state )
+ cb_feature_policy->setFocus();
+}
+
+void PolicyDialog::refresh() {
+ FeatureEnabledPolicy pol;
+
+ if (policies->isFeatureEnabledPolicyInherited())
+ pol = InheritGlobal;
+ else if (policies->isFeatureEnabled())
+ pol = Accept;
+ else
+ pol = Reject;
+ cb_feature_policy->setCurrentItem(pol);
+}
+
+void PolicyDialog::setFeatureEnabledLabel(const QString &text) {
+ l_feature_policy->setText(text);
+}
+
+void PolicyDialog::setFeatureEnabledWhatsThis(const QString &text) {
+ QWhatsThis::add(cb_feature_policy, text);
+}
+
+void PolicyDialog::addPolicyPanel(QWidget *panel) {
+ topl->insertWidget(insertIdx++,panel);
+}
+
+QString PolicyDialog::featureEnabledPolicyText() const {
+ int pol = cb_feature_policy->currentItem();
+ if (pol >= 0 && pol < 3) // Keep in sync with FeatureEnabledPolicy
+ return policy_values[pol];
+ else
+ return QString::null;
+}
+
+void PolicyDialog::accept()
+{
+ if( le_domain->text().isEmpty() )
+ {
+ KMessageBox::information( 0, i18n("You must first enter a domain name.") );
+ return;
+ }
+
+ FeatureEnabledPolicy pol = (FeatureEnabledPolicy)
+ cb_feature_policy->currentItem();
+ if (pol == InheritGlobal) {
+ policies->inheritFeatureEnabledPolicy();
+ } else if (pol == Reject) {
+ policies->setFeatureEnabled(false);
+ } else {
+ policies->setFeatureEnabled(true);
+ }
+ QDialog::accept();
+}
+
+#include "policydlg.moc"
diff --git a/kcontrol/konqhtml/policydlg.h b/kcontrol/konqhtml/policydlg.h
new file mode 100644
index 000000000..6922aa736
--- /dev/null
+++ b/kcontrol/konqhtml/policydlg.h
@@ -0,0 +1,130 @@
+// (C) < 2002 to whoever created and edited this file before
+// (C) 2002 Leo Savernik <l.savernik@aon.at>
+// Generalizing the policy dialog
+
+#ifndef _POLICYDLG_H
+#define _POLICYDLG_H
+
+#include <kdialogbase.h>
+
+#include <qlineedit.h>
+#include <qstringlist.h>
+
+class QLabel;
+class QComboBox;
+class QString;
+class QVBoxLayout;
+class QPushButton;
+
+class Policies;
+
+/**
+ * A dialog for editing domain-specific policies.
+ *
+ * Each dialog must be associated with a relevant Policies instance which
+ * will be updated within this dialog appropriately.
+ *
+ * Additionally you can insert your own widget containing controls for
+ * specific policies with addPolicyPanel.
+ *
+ * @author unknown
+ */
+class PolicyDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ /**
+ * Enumerates the possible return values for the "feature enabled"
+ * policy
+ */
+ enum FeatureEnabledPolicy { InheritGlobal = 0, Accept, Reject };
+
+ /** constructor
+ * @param policies policies object this dialog will write the settings
+ * into. Note that it always reflects the current settings,
+ * even if the dialog has been cancelled.
+ * @param parent parent widget this belongs to
+ * @param name internal name
+ */
+ PolicyDialog(Policies *policies, QWidget *parent = 0, const char *name = 0 );
+
+ virtual ~PolicyDialog() {};
+
+ /*
+ * @return whether this feature should be activated, deactivated or
+ * inherited from the respective global policy.
+ */
+ FeatureEnabledPolicy featureEnabledPolicy() const;
+
+ /**
+ * @return the textual representation of the current "feature enabled"
+ * policy
+ */
+ QString featureEnabledPolicyText() const;
+
+ /*
+ * @return the hostname for which the policy is being set
+ */
+ QString domain() const { return le_domain->text(); }
+
+ /*
+ * Sets the line-edit to be enabled/disabled.
+ *
+ * This method will set the text in the lineedit if the
+ * value is not null.
+ *
+ * @param state @p true to enable the line-edit, otherwise disabled.
+ * @param text the text to be set in the line-edit. Default is NULL.
+ */
+ void setDisableEdit( bool /*state*/, const QString& text = QString::null );
+
+ /**
+ * Sets the label for the "feature enabled" policy
+ * @param text label text
+ */
+ void setFeatureEnabledLabel(const QString &text);
+
+ /**
+ * Sets the "What's This" text for the "feature enabled" policy
+ * combo box.
+ * @param text what's-this text
+ */
+ void setFeatureEnabledWhatsThis(const QString &text);
+
+ /**
+ * Syncs the controls with the current content of the
+ * associated policies object.
+ */
+ void refresh();
+
+ /**
+ * Adds another panel which contains controls for more policies.
+ *
+ * The widget is inserted between the "feature enabled" combo box and
+ * the dialog buttons at the bottom.
+ *
+ * Currently at most one widget can be added.
+ * @param panel pointer to widget to insert. The dialog takes ownership
+ * of it, but does not reparent it.
+ */
+ void addPolicyPanel(QWidget *panel);
+
+protected slots:
+
+ virtual void accept();
+ void slotTextChanged( const QString &text);
+
+private:
+ Policies *policies;
+ QVBoxLayout *topl;
+ int insertIdx;
+ QLineEdit *le_domain;
+ QLabel *l_feature_policy;
+ QComboBox *cb_feature_policy;
+ QWidget *panel;
+ QStringList policy_values;
+ QPushButton *okButton;
+};
+
+#endif
diff --git a/kcontrol/konqhtml/uninstall.desktop b/kcontrol/konqhtml/uninstall.desktop
new file mode 100644
index 000000000..e1e3e1732
--- /dev/null
+++ b/kcontrol/konqhtml/uninstall.desktop
@@ -0,0 +1,2 @@
+[Desktop Entry]
+Hidden=true