diff options
Diffstat (limited to 'kcontrol/konqhtml')
38 files changed, 6589 insertions, 0 deletions
diff --git a/kcontrol/konqhtml/CMakeLists.txt b/kcontrol/konqhtml/CMakeLists.txt new file mode 100644 index 000000000..26cd535f5 --- /dev/null +++ b/kcontrol/konqhtml/CMakeLists.txt @@ -0,0 +1,53 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/libkonq + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + +##### other data ################################ + +install( FILES + tdehtml_behavior.desktop tdehtml_java_js.desktop + tdehtml_fonts.desktop tdehtml_filter.desktop + tdehtml_userinterface.desktop + DESTINATION ${XDG_APPS_INSTALL_DIR} ) + +install( + FILES uninstall.desktop + DESTINATION ${APPS_INSTALL_DIR}/Settings/WebBrowsing + RENAME nsplugin.desktop ) + +install( + FILES uninstall.desktop + DESTINATION ${APPS_INSTALL_DIR}/Settings/WebBrowsing + RENAME tdehtml_appearance.desktop ) + +##### kcm_konqhtml (module) ##################### + +tde_add_kpart( kcm_konqhtml AUTOMOC + SOURCES + userInterOpts.ui userInterOpts_impl.cpp userInterConfig.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 filteropts.cpp + LINK tdehtml-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/kcontrol/konqhtml/Makefile.am b/kcontrol/konqhtml/Makefile.am new file mode 100644 index 000000000..c1f276444 --- /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 = userInterOpts.ui userInterOpts_impl.cpp \ + userInterConfig.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 filteropts.cpp + +kcm_konqhtml_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +kcm_konqhtml_la_LIBADD = -ltdehtml -ltdeui + +xdg_apps_DATA = tdehtml_behavior.desktop tdehtml_java_js.desktop tdehtml_fonts.desktop tdehtml_filter.desktop tdehtml_userinterface.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/tdehtml_appearance.desktop diff --git a/kcontrol/konqhtml/appearance.cpp b/kcontrol/konqhtml/appearance.cpp new file mode 100644 index 000000000..30272c3f6 --- /dev/null +++ b/kcontrol/konqhtml/appearance.cpp @@ -0,0 +1,417 @@ + +#include <tqfontdatabase.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqvgroupbox.h> +#include <tqwhatsthis.h> + +#include <dcopclient.h> + +#include <tdeapplication.h> +#include <kcharsets.h> +#include <tdeconfig.h> +#include <kdebug.h> +#include <kdialog.h> +#include <tdefontcombo.h> +#include <tdeglobal.h> +#include <tdehtmldefaults.h> +#include <tdelocale.h> +#include <knuminput.h> + +#if defined Q_WS_X11 && !defined K_WS_QTONLY +#include <X11/Xlib.h> +#endif + + +#include "appearance.moc" + +KAppearanceOptions::KAppearanceOptions(TDEConfig *config, TQString group, TQWidget *parent, const char *) + : TDECModule( 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.")); + + TQString wtstr; + + TQGridLayout *lay = new TQGridLayout(this, 1 ,1 , 0, KDialog::spacingHint()); + int r = 0; + int E = 0, M = 1, W = 3; //CT 3 (instead 2) allows smaller color buttons + + TQGroupBox* gb = new TQGroupBox( 1, Qt::Horizontal, i18n("Font Si&ze"), this ); + lay->addMultiCellWidget(gb, r, r, E, W); + + TQWhatsThis::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, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( slotMinimumFontSize( int ) ) ); + connect( m_minSize, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( changed() ) ); + TQWhatsThis::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, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( slotFontSize( int ) ) ); + connect( m_MedSize, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( changed() ) ); + TQWhatsThis::add( m_MedSize, + i18n("This is the relative font size Konqueror uses " + "to display web sites.") ); + + TQStringList emptyList; + + TQLabel* label = new TQLabel( i18n("S&tandard font:"), this ); + lay->addWidget( label , ++r, E); + + m_pFonts[0] = new TDEFontCombo( 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."); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( m_pFonts[0], wtstr ); + + connect( m_pFonts[0], TQT_SIGNAL( activated(const TQString&) ), + TQT_SLOT( slotStandardFont(const TQString&) ) ); + connect( m_pFonts[0], TQT_SIGNAL( activated(const TQString&) ), + TQT_SLOT(changed() ) ); + connect( m_pFonts[0]->lineEdit(), TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT( slotStandardFont(const TQString&) ) ); + connect( m_pFonts[0], TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT(changed() ) ); + + label = new TQLabel( i18n( "&Fixed font:"), this ); + lay->addWidget( label, ++r, E ); + + m_pFonts[1] = new TDEFontCombo( 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."); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( m_pFonts[1], wtstr ); + + connect( m_pFonts[1], TQT_SIGNAL( activated(const TQString&) ), + TQT_SLOT( slotFixedFont(const TQString&) ) ); + connect( m_pFonts[1], TQT_SIGNAL( activated(const TQString&) ), + TQT_SLOT(changed() ) ); + connect( m_pFonts[1]->lineEdit(), TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT( slotFixedFont(const TQString&) ) ); + connect( m_pFonts[1], TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT(changed() ) ); + + label = new TQLabel( i18n( "S&erif font:" ), this ); + lay->addWidget( label, ++r, E ); + + m_pFonts[2] = new TDEFontCombo( 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." ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( m_pFonts[2], wtstr ); + + connect( m_pFonts[2], TQT_SIGNAL( activated( const TQString& ) ), + TQT_SLOT( slotSerifFont( const TQString& ) ) ); + connect( m_pFonts[2], TQT_SIGNAL( activated( const TQString& ) ), + TQT_SLOT( changed() ) ); + connect( m_pFonts[2]->lineEdit(), TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT( slotSerifFont(const TQString&) ) ); + connect( m_pFonts[2], TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT(changed() ) ); + + label = new TQLabel( i18n( "Sa&ns serif font:" ), this ); + lay->addWidget( label, ++r, E ); + + m_pFonts[3] = new TDEFontCombo( 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." ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( m_pFonts[3], wtstr ); + + connect( m_pFonts[3], TQT_SIGNAL( activated( const TQString& ) ), + TQT_SLOT( slotSansSerifFont( const TQString& ) ) ); + connect( m_pFonts[3], TQT_SIGNAL( activated( const TQString& ) ), + TQT_SLOT( changed() ) ); + connect( m_pFonts[3]->lineEdit(), TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT( slotSansSerifFont(const TQString&) ) ); + connect( m_pFonts[3], TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT(changed() ) ); + + + label = new TQLabel( i18n( "C&ursive font:" ), this ); + lay->addWidget( label, ++r, E ); + + m_pFonts[4] = new TDEFontCombo( 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." ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( m_pFonts[4], wtstr ); + + connect( m_pFonts[4], TQT_SIGNAL( activated( const TQString& ) ), + TQT_SLOT( slotCursiveFont( const TQString& ) ) ); + connect( m_pFonts[4], TQT_SIGNAL( activated( const TQString& ) ), + TQT_SLOT( changed() ) ); + connect( m_pFonts[4]->lineEdit(), TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT( slotCursiveFont(const TQString&) ) ); + connect( m_pFonts[4], TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT(changed() ) ); + + + label = new TQLabel( i18n( "Fantas&y font:" ), this ); + lay->addWidget( label, ++r, E ); + + m_pFonts[5] = new TDEFontCombo( 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." ); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( m_pFonts[5], wtstr ); + + connect( m_pFonts[5], TQT_SIGNAL( activated( const TQString& ) ), + TQT_SLOT( slotFantasyFont( const TQString& ) ) ); + connect( m_pFonts[5], TQT_SIGNAL( activated( const TQString& ) ), + TQT_SLOT( changed() ) ); + connect( m_pFonts[5]->lineEdit(), TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT( slotFantasyFont(const TQString&) ) ); + connect( m_pFonts[5], TQT_SIGNAL( textChanged(const TQString&) ), + TQT_SLOT(changed() ) ); + + + label = new TQLabel( i18n( "Font &size adjustment for this encoding:" ), this ); + lay->addWidget( label, ++r, M ); + + m_pFontSizeAdjust = new TQSpinBox( -5, 5, 1, this ); + label->setBuddy( m_pFontSizeAdjust ); + lay->addMultiCellWidget( m_pFontSizeAdjust, r, r, M+1, W ); + + connect( m_pFontSizeAdjust, TQT_SIGNAL( valueChanged( int ) ), + TQT_SLOT( slotFontSizeAdjust( int ) ) ); + connect( m_pFontSizeAdjust, TQT_SIGNAL( valueChanged( int ) ), + TQT_SLOT( changed() ) ); + + label = new TQLabel( i18n( "Default encoding:"), this ); + //++r; + //lay->addMultiCellWidget( label, r, r, E, E+1); + lay->addWidget( label, ++r, E); + + m_pEncoding = new TQComboBox( false, this ); + label->setBuddy( m_pEncoding ); + encodings = TDEGlobal::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."); + TQWhatsThis::add( label, wtstr ); + TQWhatsThis::add( m_pEncoding, wtstr ); + + connect( m_pEncoding, TQT_SIGNAL( activated(const TQString& ) ), + TQT_SLOT( slotEncoding(const TQString&) ) ); + connect( m_pEncoding, TQT_SIGNAL( activated(const TQString& ) ), + TQT_SLOT( changed() ) ); + + ++r; lay->setRowStretch(r, 8); + + TQFontDatabase 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 TQString& n ) +{ + fonts[0] = n; +} + + +void KAppearanceOptions::slotFixedFont(const TQString& n ) +{ + fonts[1] = n; +} + + +void KAppearanceOptions::slotSerifFont( const TQString& n ) +{ + fonts[2] = n; +} + + +void KAppearanceOptions::slotSansSerifFont( const TQString& n ) +{ + fonts[3] = n; +} + + +void KAppearanceOptions::slotCursiveFont( const TQString& n ) +{ + fonts[4] = n; +} + + +void KAppearanceOptions::slotFantasyFont( const TQString& n ) +{ + fonts[5] = n; +} + +void KAppearanceOptions::slotFontSizeAdjust( int value ) +{ + fonts[6] = TQString::number( value ); +} + +void KAppearanceOptions::slotEncoding(const TQString& n) +{ + encodingName = n; +} + +void KAppearanceOptions::load() +{ + load( false ); +} + +void KAppearanceOptions::load( bool useDefaults ) +{ + TDEConfig tdehtmlrc("tdehtmlrc", true, false); + m_pConfig->setReadDefaults( useDefaults ); + + tdehtmlrc.setReadDefaults( useDefaults ); + +#define SET_GROUP(x) m_pConfig->setGroup(x); tdehtmlrc.setGroup(x) +#define READ_NUM(x,y) m_pConfig->readNumEntry(x, tdehtmlrc.readNumEntry(x, y)) +#define READ_ENTRY(x,y) m_pConfig->readEntry(x, tdehtmlrc.readEntry(x, y)) +#define READ_LIST(x) m_pConfig->readListEntry(x, tdehtmlrc.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 = TQStringList(); + defaultFonts.append( READ_ENTRY( "StandardFont", TDEGlobalSettings::generalFont().family() ) ); + defaultFonts.append( READ_ENTRY( "FixedFont", TDEGlobalSettings::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( TQString("0") ); // default font size adjustment + + if (m_pConfig->hasKey("Fonts")) + fonts = m_pConfig->readListEntry( "Fonts" ); + else + fonts = tdehtmlrc.readListEntry( "Fonts" ); + while (fonts.count() < 7) + fonts.append(TQString::null); + + encodingName = READ_ENTRY( "DefaultEncoding", TQString::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++ ) { + TQString ff = fonts[f]; + if (ff.isEmpty()) + ff = defaultFonts[f]; + m_pFonts[f]->setCurrentFont(ff); + } + + int i = 0; + for ( TQStringList::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(); + + TQByteArray 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..3c5131abf --- /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 <tqwidget.h> +#include <tqmap.h> + +#include <tdecmodule.h> + +class TQSpinBox; +class TDEFontCombo; + +class KAppearanceOptions : public TDECModule +{ + Q_OBJECT +public: + KAppearanceOptions(TDEConfig *config, TQString group, TQWidget *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 TQString& n); + void slotFixedFont(const TQString& n); + void slotSerifFont( const TQString& n ); + void slotSansSerifFont( const TQString& n ); + void slotCursiveFont( const TQString& n ); + void slotFantasyFont( const TQString& n ); + void slotEncoding( const TQString& n); + void slotFontSizeAdjust( int value ); + +private: + void updateGUI(); + +private: + + TDEConfig *m_pConfig; + TQString m_groupname; + TQStringList m_families; + + KIntNumInput* m_minSize; + KIntNumInput* m_MedSize; + KIntNumInput* m_pageDPI; + TDEFontCombo* m_pFonts[6]; + TQComboBox* m_pEncoding; + TQSpinBox *m_pFontSizeAdjust; + + int fSize; + int fMinSize; + TQStringList encodings; + TQStringList fonts; + TQStringList defaultFonts; + TQString encodingName; +}; + +#endif // __APPEARANCE_H__ diff --git a/kcontrol/konqhtml/domainlistview.cpp b/kcontrol/konqhtml/domainlistview.cpp new file mode 100644 index 000000000..fcddac791 --- /dev/null +++ b/kcontrol/konqhtml/domainlistview.cpp @@ -0,0 +1,230 @@ +/* + Copyright (c) 2002 Leo Savernik <[email protected]> + 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 <tqlayout.h> +#include <tqpushbutton.h> +#include <tqwhatsthis.h> + +#include <tdeconfig.h> +#include <tdelistview.h> +#include <tdelocale.h> +#include <tdemessagebox.h> + +#include "domainlistview.h" +#include "policies.h" +#include "policydlg.h" + +DomainListView::DomainListView(TDEConfig *config,const TQString &title, + TQWidget *parent,const char *name) : + TQGroupBox(title, parent, name), config(config) { + setColumnLayout(0, Qt::Vertical); + layout()->setSpacing(0); + layout()->setMargin(0); + TQGridLayout* thisLayout = new TQGridLayout(layout()); + thisLayout->setAlignment(Qt::AlignTop); + thisLayout->setSpacing(KDialog::spacingHint()); + thisLayout->setMargin(KDialog::marginHint()); + + domainSpecificLV = new TDEListView(this); + domainSpecificLV->addColumn(i18n("Host/Domain")); + domainSpecificLV->addColumn(i18n("Policy"), 100); + connect(domainSpecificLV,TQT_SIGNAL(doubleClicked(TQListViewItem *)), TQT_SLOT(changePressed())); + connect(domainSpecificLV,TQT_SIGNAL(returnPressed(TQListViewItem *)), TQT_SLOT(changePressed())); + connect(domainSpecificLV, TQT_SIGNAL( executed( TQListViewItem *)), TQT_SLOT( updateButton())); + connect(domainSpecificLV, TQT_SIGNAL(selectionChanged()), TQT_SLOT(updateButton())); + thisLayout->addMultiCellWidget(domainSpecificLV, 0, 5, 0, 0); + + addDomainPB = new TQPushButton(i18n("&New..."), this); + thisLayout->addWidget(addDomainPB, 0, 1); + connect(addDomainPB, TQT_SIGNAL(clicked()), TQT_SLOT(addPressed())); + + changeDomainPB = new TQPushButton( i18n("Chan&ge..."), this); + thisLayout->addWidget(changeDomainPB, 1, 1); + connect(changeDomainPB, TQT_SIGNAL(clicked()), this, TQT_SLOT(changePressed())); + + deleteDomainPB = new TQPushButton(i18n("De&lete"), this); + thisLayout->addWidget(deleteDomainPB, 2, 1); + connect(deleteDomainPB, TQT_SIGNAL(clicked()), this, TQT_SLOT(deletePressed())); + + importDomainPB = new TQPushButton(i18n("&Import..."), this); + thisLayout->addWidget(importDomainPB, 3, 1); + connect(importDomainPB, TQT_SIGNAL(clicked()), this, TQT_SLOT(importPressed())); + importDomainPB->setEnabled(false); + importDomainPB->hide(); + + exportDomainPB = new TQPushButton(i18n("&Export..."), this); + thisLayout->addWidget(exportDomainPB, 4, 1); + connect(exportDomainPB, TQT_SIGNAL(clicked()), this, TQT_SLOT(exportPressed())); + exportDomainPB->setEnabled(false); + exportDomainPB->hide(); + + TQSpacerItem* spacer = new TQSpacerItem(20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding); + thisLayout->addItem(spacer, 5, 1); + + TQWhatsThis::add( addDomainPB, i18n("Click on this button to manually add a host or domain " + "specific policy.") ); + TQWhatsThis::add( changeDomainPB, i18n("Click on this button to change the policy for the " + "host or domain selected in the list box.") ); + TQWhatsThis::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() +{ + TQListViewItem *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() ) { + TQListViewItem* index = new TQListViewItem( 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() +{ + TQListViewItem *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() +{ + TQListViewItem *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 TQStringList &domainList) +{ + domainSpecificLV->clear(); + domainPolicies.clear(); +// JavaPolicies pol(m_pConfig,m_groupname,false); + for (TQStringList::ConstIterator it = domainList.begin(); + it != domainList.end(); ++it) { + TQString domain = *it; + Policies *pol = createPolicies(); + pol->setDomain(domain); + pol->load(); + + TQString policy; + if (pol->isFeatureEnabledPolicyInherited()) + policy = i18n("Use Global"); + else if (pol->isFeatureEnabled()) + policy = i18n("Accept"); + else + policy = i18n("Reject"); + TQListViewItem *index = + new TQListViewItem( domainSpecificLV, domain, policy ); + + domainPolicies[index] = pol; + } +} + +void DomainListView::save(const TQString &group, const TQString &domainListKey) { + TQStringList domainList; + DomainPolicyMap::Iterator it = domainPolicies.begin(); + for (; it != domainPolicies.end(); ++it) { + TQListViewItem *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..f5844071e --- /dev/null +++ b/kcontrol/konqhtml/domainlistview.h @@ -0,0 +1,209 @@ +/* + Copyright (c) 2002 Leo Savernik <[email protected]> + 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 <tqgroupbox.h> +#include <tqmap.h> + +class TQListViewItem; +class TQPushButton; +class TQStringList; + +class TDEConfig; +class TDEListView; + +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 TQGroupBox { + 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(TDEConfig *config,const TQString &title,TQWidget *parent, + const char *name = 0); + + virtual ~DomainListView(); + + /** + * clears the list view. + */ +// void clear(); + + /** + * returns the list view displaying the domains + */ + TDEListView *listView() const { return domainSpecificLV; } + + /** + * returns the add push-button. + * + * Note: The add button already contains a default "what's this" text. + */ + TQPushButton *addButton() const { return addDomainPB; } + + /** + * returns the change push-button. + * + * Note: The change button already contains a default "what's this" text. + */ + TQPushButton *changeButton() const { return changeDomainPB; } + + /** + * returns the delete push-button. + * + * Note: The delete button already contains a default "what's this" text. + */ + TQPushButton *deleteButton() const { return deleteDomainPB; } + + /** + * returns the import push-button. + */ + TQPushButton *importButton() const { return importDomainPB; } + + /** + * returns the export push-button. + */ + TQPushButton *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 TQStringList &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 TQString &group, const TQString &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: + + TDEConfig *config; + + TDEListView *domainSpecificLV; + + TQPushButton* addDomainPB; + TQPushButton* changeDomainPB; + TQPushButton* deleteDomainPB; + TQPushButton* importDomainPB; + TQPushButton* exportDomainPB; + + typedef TQMap<TQListViewItem*, 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..9a2ae9efe --- /dev/null +++ b/kcontrol/konqhtml/filteropts.cpp @@ -0,0 +1,327 @@ +/* + Copyright (C) 2005 Ivor Hewitt <[email protected]> + + 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 <tdeconfig.h> +#include <tdelocale.h> +#include <tdeglobal.h> +#include <tdeaboutdata.h> +#include <tdefiledialog.h> +#include <dcopclient.h> + +#include <tqlayout.h> +#include <tqlistbox.h> +#include <tqpushbutton.h> +#include <tqgroupbox.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqlineedit.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqwhatsthis.h> +#include <tqregexp.h> + +#include "filteropts.h" +#include "filteropts.moc" + +KCMFilter::KCMFilter(TDEConfig *config, TQString group, + TQWidget *parent, const char * ) + : TDECModule( parent, "kcmkonqhtml" ), + mConfig( config ), + mGroupname( group ), + mSelCount(0) +{ + setButtons(Default|Apply|Help); + + TQVBoxLayout *topLayout = new TQVBoxLayout(this, 0, KDialog::spacingHint()); + + mEnableCheck = new TQCheckBox(i18n("Enable filters"), this); + topLayout->addWidget( mEnableCheck ); + + mKillCheck = new TQCheckBox(i18n("Hide filtered images"), this); + topLayout->addWidget( mKillCheck ); + + TQGroupBox *topBox = new TQGroupBox( 1, Qt::Horizontal, i18n("URL Expressions to Filter"), this ); + topLayout->addWidget( topBox ); + + mListBox = new TQListBox( topBox ); + mListBox->setSelectionMode(TQListBox::Extended); + new TQLabel( i18n("Expression (e.g. http://www.site.com/ad/*):"), topBox); + mString = new TQLineEdit( topBox ); + + TQHBox *buttonBox = new TQHBox( topBox ); + buttonBox->setSpacing( KDialog::spacingHint() ); + + mInsertButton = new TQPushButton( i18n("Insert"), buttonBox ); + connect( mInsertButton, TQT_SIGNAL( clicked() ), TQT_SLOT( insertFilter() ) ); + mUpdateButton = new TQPushButton( i18n("Update"), buttonBox ); + connect( mUpdateButton, TQT_SIGNAL( clicked() ), TQT_SLOT( updateFilter() ) ); + mRemoveButton = new TQPushButton( i18n("Remove"), buttonBox ); + connect( mRemoveButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeFilter() ) ); + + mImportButton = new TQPushButton(i18n("Import..."),buttonBox); + connect( mImportButton, TQT_SIGNAL( clicked() ), TQT_SLOT( importFilters() ) ); + mExportButton = new TQPushButton(i18n("Export..."),buttonBox); + connect( mExportButton, TQT_SIGNAL( clicked() ), TQT_SLOT( exportFilters() ) ); + + connect( mEnableCheck, TQT_SIGNAL( clicked()), this, TQT_SLOT( slotEnableChecked())); + connect( mKillCheck, TQT_SIGNAL( clicked()), this, TQT_SLOT( slotKillChecked())); + connect( mListBox, TQT_SIGNAL( selectionChanged ()),this, TQT_SLOT( slotItemSelected())); + +/* + * Whats this items + */ + TQWhatsThis::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.")); + TQWhatsThis::add( mKillCheck, i18n("When enabled blocked images will be removed from the page completely " + "otherwise a placeholder 'blocked' image will be used.")); + TQWhatsThis::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.")); + TQWhatsThis::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() +{ + TQString inFile = KFileDialog::getOpenFileName(); + if (inFile.length() > 0) + { + TQFile f(inFile); + if ( f.open( IO_ReadOnly ) ) + { + TQTextStream ts( &f ); + TQStringList paths; + TQString 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] == '/') + { + TQString inside = line.mid(1, line.length()-2); + TQRegExp rx(inside); + if (!rx.isValid()) + continue; + } + else + { + TQRegExp rx(line); + rx.setWildcard(true); + if (!rx.isValid()) + continue; + } + } + + if (!line.isEmpty() && mListBox->findItem(line, TQt::CaseSensitive|TQt::ExactMatch) == 0) + paths.append(line); + } + f.close(); + + mListBox->insertStringList( paths ); + emit changed(true); + } + } +} + +void KCMFilter::exportFilters() +{ + TQString outFile = KFileDialog::getSaveFileName(); + if (outFile.length() > 0) + { + TQFile f(outFile); + if ( f.open( IO_WriteOnly ) ) + { + TQTextStream ts( &f ); + ts.setEncoding( TQTextStream::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 ) + { + TQString key = "Filter-" + TQString::number(i); + mConfig->writeEntry(key, mListBox->text(i)); + } + mConfig->writeEntry("Count",mListBox->count()); + + mConfig->sync(); + DCOPClient::mainClient()->send("konqueror*","KonquerorIface","reparseConfiguration()",TQByteArray()); + +} +void KCMFilter::load() +{ + load( false ); +} + +void KCMFilter::load( bool useDefaults ) +{ + TQStringList paths; + + mConfig->setReadDefaults( useDefaults ); + + mConfig->setGroup( mGroupname ); + mEnableCheck->setChecked( mConfig->readBoolEntry("Enabled",false)); + mKillCheck->setChecked( mConfig->readBoolEntry("Shrink",false)); + + TQMap<TQString,TQString> entryMap = mConfig->entryMap( mGroupname ); + TQMap<TQString,TQString>::ConstIterator it; + int num = mConfig->readNumEntry("Count",0); + for (int i=0; i<num; ++i) + { + TQString key = "Filter-" + TQString::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(); +} + +TQString 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..eba3dad7d --- /dev/null +++ b/kcontrol/konqhtml/filteropts.h @@ -0,0 +1,74 @@ +/* + Copyright (C) 2005 Ivor Hewitt <[email protected]> + + 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 <tdecmodule.h> + +class TQListBox; +class TQPushButton; +class TQLineEdit; +class TQListBoxItem; +class TQCheckBox; + +class TDEConfig; + +class KCMFilter : public TDECModule +{ + Q_OBJECT +public: + KCMFilter( TDEConfig* config, TQString group, TQWidget* parent = 0, const char* name = 0 ); + ~KCMFilter(); + + void load(); + void load( bool useDefaults ); + void save(); + void defaults(); + TQString 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(); + TQListBox *mListBox; + TQLineEdit *mString; + TQCheckBox *mEnableCheck; + TQCheckBox *mKillCheck; + TQPushButton *mInsertButton; + TQPushButton *mUpdateButton; + TQPushButton *mRemoveButton; + TQPushButton *mImportButton; + TQPushButton *mExportButton; + + TDEConfig *mConfig; + TQString mGroupname; + int mSelCount; +}; + +#endif diff --git a/kcontrol/konqhtml/htmlopts.cpp b/kcontrol/konqhtml/htmlopts.cpp new file mode 100644 index 000000000..99bdb25a4 --- /dev/null +++ b/kcontrol/konqhtml/htmlopts.cpp @@ -0,0 +1,381 @@ +//// +// "Misc Options" Tab for KFM configuration +// +// (c) Sven Radej 1998 +// (c) David Faure 1998 +// (c) 2001 Waldo Bastian <[email protected]> +// +// -------------------------------------------------------------- +// - 2013/10/16 Michele Calgaro +// Move some options to the 'advancedTabDialog' dialog + +#include <tqlayout.h>//CT - 12Nov1998 +#include <tqwhatsthis.h> +#include <tqvgroupbox.h> +#include <tqlabel.h> +#include <tqpushbutton.h> + +#include "htmlopts.h" + +#include <konq_defaults.h> // include default values directly from konqueror +#include <tdeglobalsettings.h> // get default for DEFAULT_CHANGECURSOR +#include <tdelocale.h> +#include <kdialog.h> +#include <knuminput.h> +#include <kseparator.h> + +#include <tdeapplication.h> +#include <dcopclient.h> + + +#include "htmlopts.moc" + +enum UnderlineLinkType { UnderlineAlways=0, UnderlineNever=1, UnderlineHover=2 }; +enum AnimationsType { AnimationsAlways=0, AnimationsNever=1, AnimationsLoopOnce=2 }; +enum SmoothScrollingType { SmoothScrollingAlways=0, SmoothScrollingNever=1, SmoothScrollingWhenEfficient=2 }; +//----------------------------------------------------------------------------- + +KMiscHTMLOptions::KMiscHTMLOptions(TDEConfig *config, TQString group, TQWidget *parent, const char *) + : TDECModule( parent, "kcmkonqhtml" ), m_pConfig(config), m_groupname(group) +{ + int row = 0; + TQGridLayout *lay = new TQGridLayout(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.")); + + TQVGroupBox *bgBookmarks = new TQVGroupBox( i18n("Boo&kmarks"), this ); + m_pAdvancedAddBookmarkCheckBox = new TQCheckBox(i18n( "Ask for name and folder when adding bookmarks" ), bgBookmarks); + TQWhatsThis::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, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); + + m_pOnlyMarkedBookmarksCheckBox = new TQCheckBox(i18n( "Show only marked bookmarks in bookmark toolbar" ), bgBookmarks); + TQWhatsThis::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, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); + + lay->addMultiCellWidget( bgBookmarks, row, row, 0, 1 ); + row++; + + // Form completion + + TQVGroupBox *bgForm = new TQVGroupBox( i18n("Form Com&pletion"), this ); + m_pFormCompletionCheckBox = new TQCheckBox(i18n( "Enable com&pletion of forms" ), bgForm); + TQWhatsThis::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, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); + + m_pMaxFormCompletionItems = new KIntNumInput( bgForm ); + m_pMaxFormCompletionItems->setLabel( i18n( "&Maximum completions:" ) ); + m_pMaxFormCompletionItems->setRange( 0, 100 ); + TQWhatsThis::add( m_pMaxFormCompletionItems, + i18n( "Here you can select how many values Konqueror will remember for a form field." ) ); + connect(m_pMaxFormCompletionItems, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotChanged())); + + lay->addMultiCellWidget( bgForm, row, row, 0, 1 ); + row++; + + // Mouse behavior + + TQVGroupBox *bgMouse = new TQVGroupBox( i18n("Mouse Beha&vior"), this ); + + m_cbCursor = new TQCheckBox(i18n("Chan&ge cursor over links"), bgMouse ); + TQWhatsThis::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, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); + + m_pOpenMiddleClick = new TQCheckBox( i18n ("M&iddle click opens URL in selection" ), bgMouse ); + TQWhatsThis::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, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); + + m_pBackRightClick = new TQCheckBox( i18n( "Right click goes &back in history" ), bgMouse ); + TQWhatsThis::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, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); + + lay->addMultiCellWidget( bgMouse, row, row, 0, 1 ); + row++; + + // Misc + + m_pAutoLoadImagesCheckBox = new TQCheckBox( i18n( "A&utomatically load images"), this ); + TQWhatsThis::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, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); + lay->addMultiCellWidget( m_pAutoLoadImagesCheckBox, row, row, 0, 1 ); + row++; + + m_pEnableFavIconCheckBox = new TQCheckBox( i18n( "Enable &favicons"), this ); + TQWhatsThis::add( m_pEnableFavIconCheckBox, i18n( "If this box is checked, Konqueror will automatically load and display favicon images that are associated with a web page. These images appear in the Location bar. Otherwise a generic image will appear." ) ); + connect(m_pEnableFavIconCheckBox, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); + lay->addMultiCellWidget( m_pEnableFavIconCheckBox, row, row, 0, 1 ); + row++; + + m_pUnfinishedImageFrameCheckBox = new TQCheckBox( i18n( "Dra&w frame around not completely loaded images"), this ); + TQWhatsThis::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, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged())); + lay->addMultiCellWidget( m_pUnfinishedImageFrameCheckBox, row, row, 0, 1 ); + row++; + + m_pAutoRedirectCheckBox = new TQCheckBox( i18n( "Allow automatic delayed &reloading/redirecting"), this ); + TQWhatsThis::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, TQT_SIGNAL(clicked()), TQT_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++; + + TQLabel *label = new TQLabel( i18n("Und&erline links:"), this); + m_pUnderlineCombo = new TQComboBox( 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++; + TQString 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>"); + TQWhatsThis::add( label, whatsThis); + TQWhatsThis::add( m_pUnderlineCombo, whatsThis); + connect(m_pUnderlineCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged())); + + + + label = new TQLabel( i18n("A&nimations:"), this); + m_pAnimationsCombo = new TQComboBox( 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></ul>"); + TQWhatsThis::add( label, whatsThis); + TQWhatsThis::add( m_pAnimationsCombo, whatsThis); + connect(m_pAnimationsCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged())); + + label = new TQLabel( i18n("Sm&ooth scrolling"), this); + m_pSmoothScrollingCombo = new TQComboBox( false, this ); + label->setBuddy(m_pSmoothScrollingCombo); + m_pSmoothScrollingCombo->insertItem(i18n("SmoothScrolling","Enabled"), SmoothScrollingAlways); + m_pSmoothScrollingCombo->insertItem(i18n("SmoothScrolling","Disabled"), SmoothScrollingNever); + // not implemented: m_pSmoothScrollingCombo->insertItem(i18n("SmoothScrolling","WhenEfficient"), SmoothScrollingWhenEfficient); + lay->addWidget(label, row, 0); + lay->addWidget(m_pSmoothScrollingCombo, row, 1); + row++; + whatsThis = i18n("Determines whether Konqueror should use smooth steps to scroll HTML pages, or whole steps:<br>" + "<ul><li><b>Always</b>: Always use smooth steps when scrolling.</li>" + "<li><b>Never</b>: Never use smooth scrolling, scroll with whole steps instead.</li>" + // not implemented: "<li><b>When Efficient</b>: Only use smooth scrolling on pages where it can be achieved with moderate usage of system resources.</li>" + "</ul>"); + TQWhatsThis::add( label, whatsThis); + TQWhatsThis::add( m_pSmoothScrollingCombo, whatsThis); + connect(m_pSmoothScrollingCombo, TQT_SIGNAL(activated(int)), TQT_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 ) +{ + TDEConfig tdehtmlrc("tdehtmlrc", true, false); + tdehtmlrc.setReadDefaults( useDefaults ); + m_pConfig->setReadDefaults( useDefaults ); + +#define SET_GROUP(x) m_pConfig->setGroup(x); tdehtmlrc.setGroup(x) +#define READ_BOOL(x,y) m_pConfig->readBoolEntry(x, tdehtmlrc.readBoolEntry(x, y)) +#define READ_ENTRY(x) m_pConfig->readEntry(x, tdehtmlrc.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 bEnableFavIcon = READ_BOOL( "EnableFavicon", true ); + bool bUnfinishedImageFrame = READ_BOOL( "UnfinishedImageFrame", true ); + TQString strAnimations = READ_ENTRY( "ShowAnimations" ).lower(); + + bool bAutoRedirect = m_pConfig->readBoolEntry( "AutoDelayedActions", true ); + + // *** apply to GUI *** + m_cbCursor->setChecked( changeCursor ); + m_pAutoLoadImagesCheckBox->setChecked( bAutoLoadImages ); + m_pEnableFavIconCheckBox->setChecked( bEnableFavIcon ); + 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() ); + + TDEConfig config("kbookmarkrc", true, false); + config.setReadDefaults( useDefaults ); + config.setGroup("Bookmarks"); + m_pAdvancedAddBookmarkCheckBox->setChecked( config.readBoolEntry("AdvancedAddBookmarkDialog", false) ); + m_pOnlyMarkedBookmarksCheckBox->setChecked( config.readBoolEntry("FilteredToolbar", false) ); + + TDEConfig kdeglobals("kdeglobals", true, false); + kdeglobals.setReadDefaults( useDefaults ); + kdeglobals.setGroup("KDE"); + bool smoothScrolling = kdeglobals.readBoolEntry("SmoothScrolling", DEFAULT_SMOOTHSCROLL); + if (smoothScrolling) + m_pSmoothScrollingCombo->setCurrentItem( SmoothScrollingAlways ); + else + m_pSmoothScrollingCombo->setCurrentItem( SmoothScrollingNever ); + + 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( "EnableFavicon", m_pEnableFavIconCheckBox->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->sync(); + + TDEConfig config("kbookmarkrc", false, false); + config.setGroup("Bookmarks"); + config.writeEntry("AdvancedAddBookmarkDialog", m_pAdvancedAddBookmarkCheckBox->isChecked()); + config.writeEntry("FilteredToolbar", m_pOnlyMarkedBookmarksCheckBox->isChecked()); + config.sync(); + + TDEConfig kdeglobals("kdeglobals", false, false); + kdeglobals.setGroup("KDE"); + switch(m_pSmoothScrollingCombo->currentItem()) + { + case SmoothScrollingAlways: + kdeglobals.writeEntry( "SmoothScrolling", true ); + break; + case SmoothScrollingNever: + kdeglobals.writeEntry( "SmoothScrolling", false ); + break; + // case SmoothScrollingWhenEfficient: + // kdeglobals.writeEntry( "SmoothScrolling", somethingelse ); + // break; + } + kdeglobals.sync(); + + TQByteArray 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); +} + + diff --git a/kcontrol/konqhtml/htmlopts.h b/kcontrol/konqhtml/htmlopts.h new file mode 100644 index 000000000..bdfa3cd81 --- /dev/null +++ b/kcontrol/konqhtml/htmlopts.h @@ -0,0 +1,72 @@ +// +// +// "Misc Options" Tab for KFM configuration +// +// (c) Sven Radej 1998 +// (c) David Faure 1998 +// +// -------------------------------------------------------------- +// - 2013/10/16 Michele Calgaro +// Move some options to the 'advancedTabDialog' dialog + +#ifndef __KMISCHTML_OPTIONS_H +#define __KMISCHTML_OPTIONS_H + +#include <tqstrlist.h> +#include <tqcheckbox.h> +#include <tqlineedit.h> +#include <tqcombobox.h> + + +//----------------------------------------------------------------------------- +// The "Misc Options" Tab for the HTML view contains : + +// Change cursor over links +// Underline links +// AutoLoad Images +// Smooth Scrolling +// ... there is room for others :)) + + +#include <tqstring.h> +#include <tdeconfig.h> +#include <tdecmodule.h> +class TQRadioButton; +class KIntNumInput; + +class KMiscHTMLOptions : public TDECModule +{ + Q_OBJECT + +public: + KMiscHTMLOptions(TDEConfig *config, TQString group, TQWidget *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(); + +private: + TDEConfig* m_pConfig; + TQString m_groupname; + + TQComboBox* m_pUnderlineCombo; + TQComboBox* m_pAnimationsCombo; + TQComboBox* m_pSmoothScrollingCombo; + TQCheckBox* m_cbCursor; + TQCheckBox* m_pAutoLoadImagesCheckBox; + TQCheckBox* m_pEnableFavIconCheckBox; + TQCheckBox* m_pUnfinishedImageFrameCheckBox; + TQCheckBox* m_pAutoRedirectCheckBox; + TQCheckBox* m_pOpenMiddleClick; + TQCheckBox* m_pBackRightClick; + TQCheckBox* m_pFormCompletionCheckBox; + TQCheckBox* m_pAdvancedAddBookmarkCheckBox; + TQCheckBox* m_pOnlyMarkedBookmarksCheckBox; + KIntNumInput* m_pMaxFormCompletionItems; +}; + +#endif diff --git a/kcontrol/konqhtml/javaopts.cpp b/kcontrol/konqhtml/javaopts.cpp new file mode 100644 index 000000000..6a702559e --- /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 <tdelistview.h> +#include <kurlrequester.h> +#include <kdebug.h> +#include <klineedit.h> +#include <tdelocale.h> +#include <tdehtml_settings.h> +#include <knuminput.h> + +#include <tqlayout.h> +#include <tqwhatsthis.h> +#include <tqvgroupbox.h> +#include <tqlabel.h> + +#include "htmlopts.h" +#include "policydlg.h" +#include "javaopts.h" + +// == class JavaPolicies ===== + +JavaPolicies::JavaPolicies(TDEConfig* config, const TQString &group, bool global, + const TQString &domain) : + Policies(config,group,global,domain,"java.","EnableJava") { +} + +JavaPolicies::JavaPolicies() : Policies(0,TQString::null,false, + TQString::null,TQString::null,TQString::null) { +} + +JavaPolicies::~JavaPolicies() { +} + +// == class KJavaOptions ===== + +KJavaOptions::KJavaOptions( TDEConfig* config, TQString group, + TQWidget *parent, const char *name ) + : TDECModule( parent, name ), + _removeJavaScriptDomainAdvice(false), + m_pConfig( config ), + m_groupname( group ), + java_global_policies(config,group,true), + _removeJavaDomainSettings(false) +{ + TQVBoxLayout* toplevel = new TQVBoxLayout( this, 10, 5 ); + + /*************************************************************************** + ********************* Global Settings ************************************* + **************************************************************************/ + TQVGroupBox* globalGB = new TQVGroupBox( i18n( "Global Settings" ), this ); + toplevel->addWidget( globalGB ); + enableJavaGloballyCB = new TQCheckBox( i18n( "Enable Ja&va globally" ), globalGB ); + connect( enableJavaGloballyCB, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotChanged() ) ); + connect( enableJavaGloballyCB, TQT_SIGNAL( clicked() ), this, TQT_SLOT( toggleJavaControls() ) ); + + + /*************************************************************************** + ***************** Domain Specific Settings ******************************** + **************************************************************************/ + domainSpecific = new JavaDomainListView(m_pConfig,m_groupname,this,this); + connect(domainSpecific,TQT_SIGNAL(changed(bool)),TQT_SLOT(slotChanged())); + toplevel->addWidget( domainSpecific, 2 ); + + /*************************************************************************** + ***************** Java Runtime Settings *********************************** + **************************************************************************/ + TQVGroupBox* javartGB = new TQVGroupBox( i18n( "Java Runtime Settings" ), this ); + toplevel->addWidget( javartGB ); + + TQWidget* checkboxes = new TQWidget( javartGB ); + TQGridLayout* grid = new TQGridLayout( checkboxes, 2, 2 ); + + javaSecurityManagerCB = new TQCheckBox( i18n("&Use security manager" ), checkboxes ); + grid->addWidget( javaSecurityManagerCB, 0, 0 ); + connect( javaSecurityManagerCB, TQT_SIGNAL(toggled( bool )), this, TQT_SLOT(slotChanged()) ); + + useKioCB = new TQCheckBox( i18n("Use &TDEIO"), checkboxes ); + grid->addWidget( useKioCB, 0, 1 ); + connect( useKioCB, TQT_SIGNAL(toggled( bool )), this, TQT_SLOT(slotChanged()) ); + + enableShutdownCB = new TQCheckBox( i18n("Shu&tdown applet server when inactive"), checkboxes ); + grid->addWidget( enableShutdownCB, 1, 0 ); + connect( enableShutdownCB, TQT_SIGNAL(toggled( bool )), this, TQT_SLOT(slotChanged()) ); + connect( enableShutdownCB, TQT_SIGNAL(clicked()), this, TQT_SLOT(toggleJavaControls()) ); + + TQHBox* secondsHB = new TQHBox( javartGB ); + serverTimeoutSB = new KIntNumInput( secondsHB ); + serverTimeoutSB->setRange( 0, 1000, 5 ); + serverTimeoutSB->setLabel( i18n("App&let server timeout:"), AlignLeft ); + serverTimeoutSB->setSuffix(i18n(" sec")); + connect(serverTimeoutSB, TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(slotChanged())); + + TQHBox* pathHB = new TQHBox( javartGB ); + pathHB->setSpacing( 10 ); + TQLabel* pathLA = new TQLabel( i18n( "&Path to Java executable, or 'java':" ), + pathHB ); + pathED = new KURLRequester( pathHB ); + connect( pathED, TQT_SIGNAL(textChanged( const TQString& )), this, TQT_SLOT(slotChanged()) ); + pathLA->setBuddy( pathED ); + + TQHBox* addArgHB = new TQHBox( javartGB ); + addArgHB->setSpacing( 10 ); + TQLabel* addArgLA = new TQLabel( i18n( "Additional Java a&rguments:" ), addArgHB ); + addArgED = new TQLineEdit( addArgHB ); + connect( addArgED, TQT_SIGNAL(textChanged( const TQString& )), this, TQT_SLOT(slotChanged()) ); + addArgLA->setBuddy( addArgED ); + + /*************************************************************************** + ********************** WhatsThis? items *********************************** + **************************************************************************/ + TQWhatsThis::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.") ); + TQString 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."); + TQWhatsThis::add( domainSpecific->listView(), wtstr ); +#if 0 + TQWhatsThis::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.") ); + TQWhatsThis::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 + TQWhatsThis::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 + + TQWhatsThis::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." ) ); + + TQWhatsThis::add( useKioCB, i18n( "Enabling this will cause the jvm to use TDEIO for network transport ") ); + + TQWhatsThis::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).") ); + + TQWhatsThis::add( addArgED, i18n("If you want special arguments to be passed to the virtual machine, enter them here.") ); + + TQString 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."); + TQWhatsThis::add( serverTimeoutSB, shutdown); + TQWhatsThis::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) + TQString sJavaPath = m_pConfig->readPathEntry( "JavaPath", PATH_JAVA ); +#else + TQString sJavaPath = m_pConfig->readPathEntry( "JavaPath", "/usr/bin/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(TDEConfig *config,const TQString &group, + KJavaOptions *options,TQWidget *parent,const char *name) + : DomainListView(config,i18n( "Doma&in-Specific" ), parent, name), + group(group), options(options) { +} + +JavaDomainListView::~JavaDomainListView() { +} + +void JavaDomainListView::updateDomainListLegacy(const TQStringList &domainConfig) +{ + domainSpecificLV->clear(); + JavaPolicies pol(config,group,false); + pol.defaults(); + for ( TQStringList::ConstIterator it = domainConfig.begin(); + it != domainConfig.end(); ++it) + { + TQString domain; + TDEHTMLSettings::KJavaScriptAdvice javaAdvice; + TDEHTMLSettings::KJavaScriptAdvice javaScriptAdvice; + TDEHTMLSettings::splitDomainAdvice(*it, domain, javaAdvice, javaScriptAdvice); + if (javaAdvice != TDEHTMLSettings::KJavaScriptDunno) { + TQListViewItem* index = new TQListViewItem( domainSpecificLV, domain, + i18n(TDEHTMLSettings::adviceToStr(javaAdvice)) ); + pol.setDomain(domain); + pol.setFeatureEnabled(javaAdvice != TDEHTMLSettings::KJavaScriptReject); + domainPolicies[index] = new JavaPolicies(pol); + } + } +} + +void JavaDomainListView::setupPolicyDlg(PushButton trigger,PolicyDialog &pDlg, + Policies *pol) { + TQString 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..ea854aed3 --- /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 <tdecmodule.h> + +#include "domainlistview.h" +#include "policies.h" + +class KColorButton; +class TDEConfig; +class TDEListView; +class KURLRequester; +class KIntNumInput; + +class TQCheckBox; +class TQComboBox; +class TQLineEdit; +class TQListViewItem; +class TQRadioButton; + +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(TDEConfig* config, const TQString &group, bool global, + const TQString &domain = TQString::null); + + /** empty constructur to make TQMap 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(TDEConfig *config,const TQString &group,KJavaOptions *opt, + TQWidget *parent,const char *name = 0); + virtual ~JavaDomainListView(); + + /** remnant for importing pre KDE 3.2 settings + */ + void updateDomainListLegacy(const TQStringList &domainConfig); + +protected: + virtual JavaPolicies *createPolicies(); + virtual JavaPolicies *copyPolicies(Policies *pol); + virtual void setupPolicyDlg(PushButton trigger,PolicyDialog &pDlg, + Policies *copy); + +private: + TQString group; + KJavaOptions *options; +}; + +class KJavaOptions : public TDECModule +{ + Q_OBJECT + +public: + KJavaOptions( TDEConfig* config, TQString group, TQWidget* 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: + + TDEConfig* m_pConfig; + TQString m_groupname; + JavaPolicies java_global_policies; + + TQCheckBox* enableJavaGloballyCB; + TQCheckBox* javaSecurityManagerCB; + TQCheckBox* useKioCB; + TQCheckBox* enableShutdownCB; + KIntNumInput* serverTimeoutSB; + TQLineEdit* 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..da5af132d --- /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 <tqlayout.h> +#include <tqwhatsthis.h> +#include <tqvgroupbox.h> +#include <tdeconfig.h> +#include <tdelistview.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 <tdelocale.h> + +#include "jsopts.h" + +#include "jsopts.moc" + +// == class KJavaScriptOptions ===== + +KJavaScriptOptions::KJavaScriptOptions( TDEConfig* config, TQString group, TQWidget *parent, + const char *name ) : + TDECModule( parent, name ), + _removeJavaScriptDomainAdvice(false), + m_pConfig( config ), m_groupname( group ), + js_global_policies(config,group,true,TQString::null), + _removeECMADomainSettings(false) +{ + TQVBoxLayout* toplevel = new TQVBoxLayout( this, 10, 5 ); + + // the global checkbox + TQGroupBox* globalGB = new TQGroupBox( 2, Qt::Vertical, i18n( "Global Settings" ), this ); + toplevel->addWidget( globalGB ); + + enableJavaScriptGloballyCB = new TQCheckBox( i18n( "Ena&ble JavaScript globally" ), globalGB ); + TQWhatsThis::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, TQT_SIGNAL( clicked() ), TQT_SLOT( changed() ) ); + connect( enableJavaScriptGloballyCB, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotChangeJSEnabled() ) ); + + reportErrorsCB = new TQCheckBox( i18n( "Report &errors" ), globalGB ); + TQWhatsThis::add( reportErrorsCB, i18n("Enables the reporting of errors that occur when JavaScript " + "code is executed.") ); + connect( reportErrorsCB, TQT_SIGNAL( clicked() ), TQT_SLOT( changed() ) ); + + jsDebugWindow = new TQCheckBox( i18n( "Enable debu&gger" ), globalGB ); + TQWhatsThis::add( jsDebugWindow, i18n( "Enables builtin JavaScript debugger." ) ); + connect( jsDebugWindow, TQT_SIGNAL( clicked() ), TQT_SLOT( changed() ) ); + + // the domain-specific listview + domainSpecific = new JSDomainListView(m_pConfig,m_groupname,this,this); + connect(domainSpecific,TQT_SIGNAL(changed(bool)),TQT_SLOT(changed())); + toplevel->addWidget( domainSpecific, 2 ); + + TQWhatsThis::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.") ); + + TQString 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."); + TQWhatsThis::add( domainSpecific->listView(), wtstr ); + + TQWhatsThis::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.") ); + TQWhatsThis::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, TQT_SIGNAL(changed()), TQT_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(TDEConfig *config,const TQString &group, + KJavaScriptOptions *options, TQWidget *parent,const char *name) + : DomainListView(config,i18n( "Do&main-Specific" ), parent, name), + group(group), options(options) { +} + +JSDomainListView::~JSDomainListView() { +} + +void JSDomainListView::updateDomainListLegacy(const TQStringList &domainConfig) +{ + domainSpecificLV->clear(); + JSPolicies pol(config,group,false); + pol.defaults(); + for (TQStringList::ConstIterator it = domainConfig.begin(); + it != domainConfig.end(); ++it) { + TQString domain; + TDEHTMLSettings::KJavaScriptAdvice javaAdvice; + TDEHTMLSettings::KJavaScriptAdvice javaScriptAdvice; + TDEHTMLSettings::splitDomainAdvice(*it, domain, javaAdvice, javaScriptAdvice); + if (javaScriptAdvice != TDEHTMLSettings::KJavaScriptDunno) { + TQListViewItem *index = + new TQListViewItem( domainSpecificLV, domain, + i18n(TDEHTMLSettings::adviceToStr(javaScriptAdvice)) ); + + pol.setDomain(domain); + pol.setFeatureEnabled(javaScriptAdvice != TDEHTMLSettings::KJavaScriptReject); + domainPolicies[index] = new JSPolicies(pol); + } + } +} + +void JSDomainListView::setupPolicyDlg(PushButton trigger,PolicyDialog &pDlg, + Policies *pol) { + JSPolicies *jspol = static_cast<JSPolicies *>(pol); + TQString 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..000f7f770 --- /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 <tdecmodule.h> + +#include "domainlistview.h" +#include "jspolicies.h" + +class KColorButton; +class TDEConfig; +class KURLRequester; +class TQCheckBox; +class TQComboBox; +class TQLineEdit; +class TQListViewItem; +class TQRadioButton; +class TQSpinBox; +class TQButtonGroup; + +class PolicyDialog; + +class KJavaScriptOptions; + +/** JavaScript-specific enhancements to the domain list view + */ +class JSDomainListView : public DomainListView { + Q_OBJECT +public: + JSDomainListView(TDEConfig *config,const TQString &group,KJavaScriptOptions *opt, + TQWidget *parent,const char *name = 0); + virtual ~JSDomainListView(); + + /** remnant for importing pre KDE 3.2 settings + */ + void updateDomainListLegacy(const TQStringList &domainConfig); + +protected: + virtual JSPolicies *createPolicies(); + virtual JSPolicies *copyPolicies(Policies *pol); + virtual void setupPolicyDlg(PushButton trigger,PolicyDialog &pDlg, + Policies *copy); + +private: + TQString group; + KJavaScriptOptions *options; +}; + +class KJavaScriptOptions : public TDECModule +{ + Q_OBJECT +public: + KJavaScriptOptions( TDEConfig* config, TQString group, TQWidget* 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: + + TDEConfig *m_pConfig; + TQString m_groupname; + JSPolicies js_global_policies; + TQCheckBox *enableJavaScriptGloballyCB; + TQCheckBox *reportErrorsCB; + TQCheckBox *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..1debc0ace --- /dev/null +++ b/kcontrol/konqhtml/jspolicies.cpp @@ -0,0 +1,407 @@ +/* + Copyright (c) 2002 Leo Savernik <[email protected]> + 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 <tqbuttongroup.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqwhatsthis.h> + +#include <tdeconfig.h> +#include <kdebug.h> +#include <tdelocale.h> + +#include "jspolicies.h" + +// == class JSPolicies == + +JSPolicies::JSPolicies(TDEConfig* config,const TQString &group, + bool global,const TQString &domain) : + Policies(config,group,global,domain,"javascript.","EnableJavaScript") { +} + +JSPolicies::JSPolicies() : Policies(0,TQString::null,false, + TQString::null,TQString::null,TQString::null) { +} + +JSPolicies::~JSPolicies() { +} + +void JSPolicies::load() { + Policies::load(); + + TQString key; + +// enableJavaScriptDebugCB->setChecked( m_pConfig->readBoolEntry("EnableJavaScriptDebug",false)); +// enableDebugOutputCB->setChecked( m_pConfig->readBoolEntry("EnableJSDebugOutput") ); + key = prefix + "WindowOpenPolicy"; + window_open = config->readUnsignedNumEntry(key, + is_global ? TDEHTMLSettings::KJSWindowOpenSmart : INHERIT_POLICY); + + key = prefix + "WindowResizePolicy"; + window_resize = config->readUnsignedNumEntry(key, + is_global ? TDEHTMLSettings::KJSWindowResizeAllow : INHERIT_POLICY); + + key = prefix + "WindowMovePolicy"; + window_move = config->readUnsignedNumEntry(key, + is_global ? TDEHTMLSettings::KJSWindowMoveAllow : INHERIT_POLICY); + + key = prefix + "WindowFocusPolicy"; + window_focus = config->readUnsignedNumEntry(key, + is_global ? TDEHTMLSettings::KJSWindowFocusAllow : INHERIT_POLICY); + + key = prefix + "WindowStatusPolicy"; + window_status = config->readUnsignedNumEntry(key, + is_global ? TDEHTMLSettings::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 ? TDEHTMLSettings::KJSWindowOpenSmart : INHERIT_POLICY; + window_resize = is_global ? TDEHTMLSettings::KJSWindowResizeAllow : INHERIT_POLICY; + window_move = is_global ? TDEHTMLSettings::KJSWindowMoveAllow : INHERIT_POLICY; + window_focus = is_global ? TDEHTMLSettings::KJSWindowFocusAllow : INHERIT_POLICY; + window_status = is_global ? TDEHTMLSettings::KJSWindowStatusAllow : INHERIT_POLICY; +} + +void JSPolicies::save() { + Policies::save(); + + TQString 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 TQString &title, + TQWidget* parent) : + TQGroupBox(title, parent, "jspoliciesframe"), + policies(policies) { + + bool is_per_domain = !policies->isGlobal(); + + setColumnLayout(0, Qt::Vertical); + layout()->setSpacing(0); + layout()->setMargin(0); + TQGridLayout *this_layout = new TQGridLayout(layout(),5,10+is_per_domain*2); + this_layout->setAlignment(Qt::AlignTop); + this_layout->setSpacing(3); + this_layout->setMargin(11); + + TQString wtstr; // what's this description + int colIdx; // column index + + // === window.open ================================ + colIdx = 0; + TQLabel *label = new TQLabel(i18n("Open new windows:"),this); + this_layout->addWidget(label,0,colIdx++); + + js_popup = new TQButtonGroup(this); + js_popup->setExclusive(true); + js_popup->setHidden(true); + + TQRadioButton* policy_btn; + if (is_per_domain) { + policy_btn = new TQRadioButton(i18n("Use global"), this); + TQWhatsThis::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 TQSpacerItem(10,0),0,colIdx++); + }/*end if*/ + + policy_btn = new TQRadioButton(i18n("Allow"), this); + TQWhatsThis::add(policy_btn,i18n("Accept all popup window requests.")); + js_popup->insert(policy_btn,TDEHTMLSettings::KJSWindowOpenAllow); + this_layout->addWidget(policy_btn,0,colIdx++); + this_layout->addItem(new TQSpacerItem(10,0),0,colIdx++); + + policy_btn = new TQRadioButton(i18n("Ask"), this); + TQWhatsThis::add(policy_btn,i18n("Prompt every time a popup window is requested.")); + js_popup->insert(policy_btn,TDEHTMLSettings::KJSWindowOpenAsk); + this_layout->addWidget(policy_btn,0,colIdx++); + this_layout->addItem(new TQSpacerItem(10,0),0,colIdx++); + + policy_btn = new TQRadioButton(i18n("Deny"), this); + TQWhatsThis::add(policy_btn,i18n("Reject all popup window requests.")); + js_popup->insert(policy_btn,TDEHTMLSettings::KJSWindowOpenDeny); + this_layout->addWidget(policy_btn,0,colIdx++); + this_layout->addItem(new TQSpacerItem(10,0),0,colIdx++); + + policy_btn = new TQRadioButton(i18n("Smart"), this); + TQWhatsThis::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,TDEHTMLSettings::KJSWindowOpenSmart); + this_layout->addWidget(policy_btn,0,colIdx++); + this_layout->addItem(new TQSpacerItem(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."); + TQWhatsThis::add(label, wtstr); + connect(js_popup, TQT_SIGNAL(clicked(int)), TQT_SLOT(setWindowOpenPolicy(int))); + + // === window.resizeBy/resizeTo ================================ + colIdx = 0; + label = new TQLabel(i18n("Resize window:"),this); + this_layout->addWidget(label,1,colIdx++); + + js_resize = new TQButtonGroup(this); + js_resize->setExclusive(true); + js_resize->setHidden(true); + + if (is_per_domain) { + policy_btn = new TQRadioButton(i18n("Use global"), this); + TQWhatsThis::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 TQSpacerItem(10,0),0,colIdx++); + }/*end if*/ + + policy_btn = new TQRadioButton(i18n("Allow"), this); + TQWhatsThis::add(policy_btn,i18n("Allow scripts to change the window size.")); + js_resize->insert(policy_btn,TDEHTMLSettings::KJSWindowResizeAllow); + this_layout->addWidget(policy_btn,1,colIdx++); + this_layout->addItem(new TQSpacerItem(10,0),0,colIdx++); + + policy_btn = new TQRadioButton(i18n("Ignore"), this); + TQWhatsThis::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,TDEHTMLSettings::KJSWindowResizeIgnore); + this_layout->addWidget(policy_btn,1,colIdx++); + this_layout->addItem(new TQSpacerItem(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."); + TQWhatsThis::add(label, wtstr); + connect(js_resize, TQT_SIGNAL(clicked(int)), TQT_SLOT(setWindowResizePolicy(int))); + + // === window.moveBy/moveTo ================================ + colIdx = 0; + label = new TQLabel(i18n("Move window:"),this); + this_layout->addWidget(label,2,colIdx++); + + js_move = new TQButtonGroup(this); + js_move->setExclusive(true); + js_move->setHidden(true); + + if (is_per_domain) { + policy_btn = new TQRadioButton(i18n("Use global"), this); + TQWhatsThis::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 TQSpacerItem(10,0),0,colIdx++); + }/*end if*/ + + policy_btn = new TQRadioButton(i18n("Allow"), this); + TQWhatsThis::add(policy_btn,i18n("Allow scripts to change the window position.")); + js_move->insert(policy_btn,TDEHTMLSettings::KJSWindowMoveAllow); + this_layout->addWidget(policy_btn,2,colIdx++); + this_layout->addItem(new TQSpacerItem(10,0),0,colIdx++); + + policy_btn = new TQRadioButton(i18n("Ignore"), this); + TQWhatsThis::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,TDEHTMLSettings::KJSWindowMoveIgnore); + this_layout->addWidget(policy_btn,2,colIdx++); + this_layout->addItem(new TQSpacerItem(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."); + TQWhatsThis::add(label, wtstr); + connect(js_move, TQT_SIGNAL(clicked(int)), TQT_SLOT(setWindowMovePolicy(int))); + + // === window.focus ================================ + colIdx = 0; + label = new TQLabel(i18n("Focus window:"),this); + this_layout->addWidget(label,3,colIdx++); + + js_focus = new TQButtonGroup(this); + js_focus->setExclusive(true); + js_focus->setHidden(true); + + if (is_per_domain) { + policy_btn = new TQRadioButton(i18n("Use global"), this); + TQWhatsThis::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 TQSpacerItem(10,0),0,colIdx++); + }/*end if*/ + + policy_btn = new TQRadioButton(i18n("Allow"), this); + TQWhatsThis::add( policy_btn,i18n("Allow scripts to focus the window.") ); + js_focus->insert(policy_btn,TDEHTMLSettings::KJSWindowFocusAllow); + this_layout->addWidget(policy_btn,3,colIdx++); + this_layout->addItem(new TQSpacerItem(10,0),0,colIdx++); + + policy_btn = new TQRadioButton(i18n("Ignore"), this); + TQWhatsThis::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,TDEHTMLSettings::KJSWindowFocusIgnore); + this_layout->addWidget(policy_btn,3,colIdx++); + this_layout->addItem(new TQSpacerItem(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."); + TQWhatsThis::add(label, wtstr); + connect(js_focus, TQT_SIGNAL(clicked(int)), TQT_SLOT(setWindowFocusPolicy(int))); + + // === window.status ================================ + colIdx = 0; + label = new TQLabel(i18n("Modify status bar text:"),this); + this_layout->addWidget(label,4,colIdx++); + + js_statusbar = new TQButtonGroup(this); + js_statusbar->setExclusive(true); + js_statusbar->setHidden(true); + + if (is_per_domain) { + policy_btn = new TQRadioButton(i18n("Use global"), this); + TQWhatsThis::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 TQSpacerItem(10,0),0,colIdx++); + }/*end if*/ + + policy_btn = new TQRadioButton(i18n("Allow"), this); + TQWhatsThis::add(policy_btn,i18n("Allow scripts to change the text of the status bar.")); + js_statusbar->insert(policy_btn,TDEHTMLSettings::KJSWindowStatusAllow); + this_layout->addWidget(policy_btn,4,colIdx++); + this_layout->addItem(new TQSpacerItem(10,0),0,colIdx++); + + policy_btn = new TQRadioButton(i18n("Ignore"), this); + TQWhatsThis::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,TDEHTMLSettings::KJSWindowStatusIgnore); + this_layout->addWidget(policy_btn,4,colIdx++); + this_layout->addItem(new TQSpacerItem(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."); + TQWhatsThis::add(label, wtstr); + connect(js_statusbar, TQT_SIGNAL(clicked(int)), TQT_SLOT(setWindowStatusPolicy(int))); +} + +JSPoliciesFrame::~JSPoliciesFrame() { +} + +void JSPoliciesFrame::refresh() { + TQRadioButton *button; + button = static_cast<TQRadioButton *>(js_popup->find( + policies->window_open)); + if (button != 0) button->setChecked(true); + button = static_cast<TQRadioButton *>(js_resize->find( + policies->window_resize)); + if (button != 0) button->setChecked(true); + button = static_cast<TQRadioButton *>(js_move->find( + policies->window_move)); + if (button != 0) button->setChecked(true); + button = static_cast<TQRadioButton *>(js_focus->find( + policies->window_focus)); + if (button != 0) button->setChecked(true); + button = static_cast<TQRadioButton *>(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..3291dedab --- /dev/null +++ b/kcontrol/konqhtml/jspolicies.h @@ -0,0 +1,270 @@ +/* + Copyright (c) 2002 Leo Savernik <[email protected]> + 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 <tqgroupbox.h> +#include <tqstring.h> + +#include <tdehtml_settings.h> + +#include "policies.h" + +class TDEConfig; +class TQRadioButton; +class TQButtonGroup; + +// 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(TDEConfig* config, const TQString &group, bool global, + const TQString &domain = TQString::null); + + /** + * dummy constructor to make TQMap 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. + */ + TDEHTMLSettings::KJSWindowOpenPolicy windowOpenPolicy() const { + return (TDEHTMLSettings::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. + */ + TDEHTMLSettings::KJSWindowResizePolicy windowResizePolicy() const { + return (TDEHTMLSettings::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. + */ + TDEHTMLSettings::KJSWindowMovePolicy windowMovePolicy() const { + return (TDEHTMLSettings::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. + */ + TDEHTMLSettings::KJSWindowFocusPolicy windowFocusPolicy() const { + return (TDEHTMLSettings::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. + */ + TDEHTMLSettings::KJSWindowStatusPolicy windowStatusPolicy() const { + return (TDEHTMLSettings::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 TDEHTMLSettings::KJSWindowOpenPolicy or INHERIT_POLICY + unsigned int window_open; + // one of TDEHTMLSettings::KJSWindowResizePolicy or INHERIT_POLICY + unsigned int window_resize; + // one of TDEHTMLSettings::KJSWindowMovePolicy or INHERIT_POLICY + unsigned int window_move; + // one of TDEHTMLSettings::KJSWindowFocusPolicy or INHERIT_POLICY + unsigned int window_focus; + // one of TDEHTMLSettings::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 TQGroupBox { + 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 TQString &title, + TQWidget* 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; + TQButtonGroup *js_popup; + TQButtonGroup *js_resize; + TQButtonGroup *js_move; + TQButtonGroup *js_focus; + TQButtonGroup *js_statusbar; +}; + + +#endif // __JSPOLICIES_H__ + diff --git a/kcontrol/konqhtml/khttpoptdlg.cpp b/kcontrol/konqhtml/khttpoptdlg.cpp new file mode 100644 index 000000000..7272e6e93 --- /dev/null +++ b/kcontrol/konqhtml/khttpoptdlg.cpp @@ -0,0 +1,81 @@ +// File khttpoptdlg.cpp by Jacek Konieczny <[email protected]> +// Port to KControl by David Faure <[email protected]> + +#include <tqlayout.h> //CT + +#include <tdelocale.h> +#include <tdeglobal.h> +#include "khttpoptdlg.h" + + +KHTTPOptions::KHTTPOptions(TDEConfig *config, TQString group, TQWidget *parent, const char *name) + : TDECModule( parent, name ), m_pConfig(config), m_groupname(group) +{ + TQVBoxLayout *lay = new TQVBoxLayout(this, 10, 5); + + lay->addWidget( new TQLabel(i18n("Accept languages:"), this) ); + + le_languages = new TQLineEdit(this); + lay->addWidget( le_languages ); + connect(le_languages, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotChanged())); + + lay->addSpacing(10); + lay->addWidget( new TQLabel(i18n("Accept character sets:"), this) ); + + le_charsets = new TQLineEdit(this); + lay->addWidget( le_charsets ); + connect(le_charsets, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotChanged())); + + lay->addStretch(10); + + // defaultCharsets = TQString("utf-8 ")+klocale->charset()+" iso-8859-1"; + defaultCharsets = TQString("utf-8 ")+" iso-8859-1"; // TODO + + // finaly read the options + load(); +} + +void KHTTPOptions::load() +{ + load( false ); +} + +void KHTTPOptions::load( bool useDefaults ) +{ + TQString tmp; + + m_pConfig->setReadDefaults( useDefaults ); + + m_pConfig->setGroup( "Browser Settings/HTTP" ); + tmp = m_pConfig->readEntry( "AcceptLanguages",TDEGlobal::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..d4e17af56 --- /dev/null +++ b/kcontrol/konqhtml/khttpoptdlg.h @@ -0,0 +1,49 @@ +// khttpoptdlg.h - extra HTTP configuration by Jacek Konieczy <[email protected]> +#ifndef __KHTTPOPTDLG_H +#define __KHTTPOPTDLG_H + +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqcheckbox.h> +#include <tqstring.h> + +#include <tdecmodule.h> +#include <tdeconfig.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 TDECModule +{ +Q_OBJECT + public: + KHTTPOptions(TDEConfig *config, TQString group, TQWidget *parent = 0L, const char *name = 0L); + + virtual void load(); + virtual void load( bool useDefaults ); + virtual void save(); + virtual void defaults(); + + private: + + TDEConfig *m_pConfig; + TQString m_groupname; + + // Acceptable languages "LANG" - locale selected languages + TQLabel *lb_languages; + TQLineEdit *le_languages; + + // Acceptable charsets "CHARSET" - locale selected charset + TQLabel *lb_charsets; + TQLineEdit *le_charsets; + + TQString 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..a752a3a88 --- /dev/null +++ b/kcontrol/konqhtml/main.cpp @@ -0,0 +1,190 @@ +/* + * main.cpp + * + * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <[email protected]> + * Copyright (c) 2000 Daniel Molkentin <[email protected]> + * + * 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 <tdeapplication.h> +#include <dcopclient.h> +#include <tqtabwidget.h> +#include <tqlayout.h> + +#include "jsopts.h" +#include "javaopts.h" +#include "pluginopts.h" +#include "appearance.h" +#include "htmlopts.h" +#include "filteropts.h" +#include "userInterConfig.h" + +#include "main.h" +#include <tdeaboutdata.h> +#include "main.moc" + +extern "C" +{ + KDE_EXPORT TDECModule *create_tdehtml_behavior(TQWidget *parent, const char *name) + { + TDEConfig *c = new TDEConfig( "konquerorrc", false, false ); + return new KMiscHTMLOptions(c, "HTML Settings", parent, name); + } + + KDE_EXPORT TDECModule *create_tdehtml_fonts(TQWidget *parent, const char *name) + { + TDEConfig *c = new TDEConfig( "konquerorrc", false, false ); + return new KAppearanceOptions(c, "HTML Settings", parent, name); + } + + KDE_EXPORT TDECModule *create_tdehtml_java_js(TQWidget *parent, const char* /*name*/) + { + TDEConfig *c = new TDEConfig( "konquerorrc", false, false ); + return new KJSParts(c, parent, "kcmkonqhtml"); + } + + KDE_EXPORT TDECModule *create_tdehtml_plugins(TQWidget *parent, const char *name) + { + TDEConfig *c = new TDEConfig( "konquerorrc", false, false ); + return new KPluginOptions(c, "Java/JavaScript Settings", parent, name); + } + + KDE_EXPORT TDECModule *create_tdehtml_filter(TQWidget *parent, const char *name ) + { + TDEConfig *c = new TDEConfig( "tdehtmlrc", false, false ); + return new KCMFilter(c, "Filter Settings", parent, name); + } + + KDE_EXPORT TDECModule *create_tdehtml_userinterface(TQWidget *parent, const char *name ) + { + TDEConfig *c = new TDEConfig( "konquerorrc", false, false ); + return new userInterConfig(c, "FMSettings", parent, name); + } +} + + +KJSParts::KJSParts(TDEConfig *config, TQWidget *parent, const char *name) + : TDECModule(parent, name), mConfig(config) +{ + TDEAboutData *about = + new TDEAboutData(I18N_NOOP("kcmkonqhtml"), I18N_NOOP("Konqueror Browsing Control Module"), + 0, 0, TDEAboutData::License_GPL, + I18N_NOOP("(c) 1999 - 2001 The Konqueror Developers")); + + about->addAuthor("Waldo Bastian",0,"[email protected]"); + about->addAuthor("David Faure",0,"[email protected]"); + about->addAuthor("Matthias Kalle Dalheimer",0,"[email protected]"); + about->addAuthor("Lars Knoll",0,"[email protected]"); + about->addAuthor("Dirk Mueller",0,"[email protected]"); + about->addAuthor("Daniel Molkentin",0,"[email protected]"); + about->addAuthor("Wynn Wilkes",0,"[email protected]"); + + about->addCredit("Leo Savernik",I18N_NOOP("JavaScript access controls\n" + "Per-domain policies extensions"), + "[email protected]"); + + setAboutData( about ); + + TQVBoxLayout *layout = new TQVBoxLayout(this); + tab = new TQTabWidget(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, TQT_SIGNAL( changed( bool ) ), TQT_SIGNAL( changed( bool ) ) ); + + javascript = new KJavaScriptOptions( config, "Java/JavaScript Settings", this, name ); + tab->addTab( javascript, i18n( "Java&Script" ) ); + connect( javascript, TQT_SIGNAL( changed( bool ) ), TQT_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 + TQByteArray data; + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "reparseConfiguration()", data ); +} + + +void KJSParts::defaults() +{ + javascript->defaults(); + java->defaults(); +} + +TQString 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." ); +} + +TQString KJSParts::handbookSection() const +{ + int index = tab->currentPageIndex(); + if (index == 0) { + return "kbrowse-java"; + } + else if (index == 1) { + return "kbrowse-javascript"; + } + else { + return TQString::null; + } +} diff --git a/kcontrol/konqhtml/main.h b/kcontrol/konqhtml/main.h new file mode 100644 index 000000000..69a324be8 --- /dev/null +++ b/kcontrol/konqhtml/main.h @@ -0,0 +1,62 @@ +/* + * main.h + * + * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <[email protected]> + * Copyright (c) 2000 Daniel Molkentin <[email protected]> + * + * 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 <tdecmodule.h> + +class KJavaOptions; +class KJavaScriptOptions; + +class TQTabWidget; + +class KJSParts : public TDECModule +{ + Q_OBJECT + +public: + + KJSParts(TDEConfig *config,TQWidget *parent, const char *name); + virtual ~KJSParts(); + + void load(); + void save(); + void defaults(); + TQString quickHelp() const; + + virtual TQString handbookSection() const; + + +private: + TQTabWidget *tab; + + KJavaScriptOptions *javascript; + KJavaOptions *java; + + TDEConfig *mConfig; +}; + +#endif diff --git a/kcontrol/konqhtml/nsconfigwidget.ui b/kcontrol/konqhtml/nsconfigwidget.ui new file mode 100644 index 000000000..f3525430e --- /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 <[email protected]></author> +<widget class="TQWidget"> + <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="TQTabWidget"> + <property name="name"> + <cstring>TabWidget2</cstring> + </property> + <widget class="TQWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <attribute name="title"> + <string>Scan</string> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLayoutWidget"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQPushButton"> + <property name="name"> + <cstring>scanButton</cstring> + </property> + <property name="text"> + <string>&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="TQCheckBox"> + <property name="name"> + <cstring>scanAtStartup</cstring> + </property> + <property name="text"> + <string>Scan for new plugins at &TDE startup</string> + </property> + <property name="whatsThis" stdset="0"> + <string>If this option is enabled, TDE 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 TDE startup. You might want to disable this option, especially if you seldom install plugins.</string> + </property> + </widget> + <widget class="TQGroupBox"> + <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="TQPushButton" row="1" column="2"> + <property name="name"> + <cstring>dirRemove</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>&Remove</string> + </property> + </widget> + <widget class="TQPushButton" row="0" column="2"> + <property name="name"> + <cstring>dirNew</cstring> + </property> + <property name="text"> + <string>&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="TQPushButton" row="3" column="2"> + <property name="name"> + <cstring>dirDown</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Do&wn</string> + </property> + </widget> + <widget class="TQPushButton" row="2" column="2"> + <property name="name"> + <cstring>dirUp</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>&Up</string> + </property> + </widget> + <widget class="TDEListBox" 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="TQWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <attribute name="title"> + <string>Plugins</string> + </attribute> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQListView" 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 TDE has found.</string> + </property> + </widget> + <widget class="TQCheckBox" row="0" column="0"> + <property name="name"> + <cstring>useArtsdsp</cstring> + </property> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="text"> + <string>Use a&rtsdsp to pipe plugin sound through aRts</string> + </property> + </widget> + </grid> + </widget> + </widget> + </vbox> +</widget> +<includes> + <include location="global" impldecl="in declaration">tdelocale.h</include> + <include location="global" impldecl="in declaration">kurlrequester.h</include> + <include location="global" impldecl="in declaration">tdelistbox.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>tqwidget.h</includehint> + <includehint>kurlrequester.h</includehint> + <includehint>klineedit.h</includehint> + <includehint>kpushbutton.h</includehint> + <includehint>tdelistbox.h</includehint> +</includehints> +</UI> diff --git a/kcontrol/konqhtml/pluginopts.cpp b/kcontrol/konqhtml/pluginopts.cpp new file mode 100644 index 000000000..f8e1ad10a --- /dev/null +++ b/kcontrol/konqhtml/pluginopts.cpp @@ -0,0 +1,661 @@ +// (c) 2002-2003 Leo Savernik, per-domain settings +// (c) 2001, Daniel Naber, based on javaopts.cpp +// (c) 2000 Stefan Schimanski <[email protected]>, Netscape parts + + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#include <tqlayout.h> +#include <tqprogressdialog.h> +#include <tqregexp.h> +#include <tqslider.h> +#include <tqvgroupbox.h> +#include <tqwhatsthis.h> + +#include <dcopclient.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdefiledialog.h> +#include <kiconloader.h> +#include <tdelistview.h> +#include <tdelocale.h> +#include <tdemessagebox.h> +#include <kprocio.h> +#include <kstandarddirs.h> +#include <kurlrequester.h> + +#include "htmlopts.h" +#include "pluginopts.h" +#include "policydlg.h" + + +// == class PluginPolicies ===== + +PluginPolicies::PluginPolicies(TDEConfig* config, const TQString &group, bool global, + const TQString &domain) : + Policies(config,group,global,domain,"plugins.","EnablePlugins") { +} + +PluginPolicies::~PluginPolicies() { +} + +// == class KPluginOptions ===== + +KPluginOptions::KPluginOptions( TDEConfig* config, TQString group, TQWidget *parent, + const char *) + : TDECModule( parent, "kcmkonqhtml" ), + m_pConfig( config ), + m_groupname( group ), + m_nspluginscan (0), + global_policies(config,group,true) +{ + TQVBoxLayout* toplevel = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); + + /************************************************************************** + ******************** Global Settings ************************************* + *************************************************************************/ + TQVGroupBox* globalGB = new TQVGroupBox( i18n( "Global Settings" ), this ); + toplevel->addWidget( globalGB ); + enablePluginsGloballyCB = new TQCheckBox( i18n( "&Enable plugins globally" ), globalGB ); + enableHTTPOnly = new TQCheckBox( i18n( "Only allow &HTTP and HTTPS URLs for plugins" ), globalGB ); + enableUserDemand = new TQCheckBox( i18n( "&Load plugins on demand only" ), globalGB ); + priorityLabel = new TQLabel(i18n("CPU priority for plugins: %1").arg(TQString()), globalGB); + priority = new TQSlider(5, 100, 5, 100, Qt::Horizontal, globalGB); + connect( enablePluginsGloballyCB, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotChanged() ) ); + connect( enablePluginsGloballyCB, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotTogglePluginsEnabled() ) ); + connect( enableHTTPOnly, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotChanged() ) ); + connect( enableUserDemand, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotChanged() ) ); + connect( priority, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT( slotChanged() ) ); + connect( priority, TQT_SIGNAL( valueChanged(int) ), this, TQT_SLOT( updatePLabel(int) ) ); + + TQFrame *hrule = new TQFrame(globalGB); + hrule->setFrameStyle(TQFrame::HLine | TQFrame::Sunken); + hrule->setSizePolicy(TQSizePolicy::MinimumExpanding,TQSizePolicy::Fixed); + + /************************************************************************** + ********************* Domain-specific Settings *************************** + *************************************************************************/ + TQPushButton *domainSpecPB = new TQPushButton(i18n("Domain-Specific Settin&gs"), + globalGB); + domainSpecPB->setSizePolicy(TQSizePolicy::Fixed,TQSizePolicy::Fixed); + connect(domainSpecPB,TQT_SIGNAL(clicked()),TQT_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,TQT_SIGNAL(changed(bool)),TQT_SLOT(slotChanged())); + + domainSpecificDlg->setMainWidget(domainSpecific); + + /************************************************************************** + ********************** WhatsThis? items ********************************** + *************************************************************************/ + TQWhatsThis::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.") ); + + TQString 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."); + TQWhatsThis::add( domainSpecific->listView(), wtstr ); + TQWhatsThis::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.") ); + TQWhatsThis::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." ) ); + TQWhatsThis::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 + +/*****************************************************************************/ + + TQVGroupBox* netscapeGB = new TQVGroupBox( 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, TQT_SIGNAL(clicked()), TQT_SLOT(change()) ); + connect( m_widget->scanButton, TQT_SIGNAL(clicked()), TQT_SLOT(scan()) ); + + m_changed = false; + + dirInit(); + pluginInit(); + + // Finally do the loading + load(); +} + +KPluginOptions::~KPluginOptions() +{ + delete m_pConfig; +} + + +void KPluginOptions::updatePLabel(int p) { + TQString 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")); + +/****************************************************************************/ + + TDEConfig *config = new TDEConfig("kcmnspluginrc", true); + + config->setReadDefaults( useDefaults ); + + config->setGroup("Misc"); + m_widget->scanAtStartup->setChecked( config->readBoolEntry( "starttdeScan", 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 + + TQByteArray data; + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "reparseConfiguration()", data ); + +/*****************************************************************************/ + + TDEConfig *config= new TDEConfig("kcmnspluginrc", false); + + dirSave( config ); + pluginSave( config ); + + config->setGroup("Misc"); + config->writeEntry( "starttdeScan", 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 ); +} + +TQString 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."), TQString(), KStdGuiItem::save(), KStdGuiItem::discard() ); + if ( ret==KMessageBox::Cancel ) { + m_widget->scanButton->setEnabled(true); + return; + } + if ( ret==KMessageBox::Yes ) + save(); + } + + m_nspluginscan = new KProcIO; + TQString scanExe = TDEGlobal::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 TQProgressDialog( 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, TQT_SIGNAL(readReady(KProcIO*)), + this, TQT_SLOT(progress(KProcIO*))); + connect(m_nspluginscan, TQT_SIGNAL(processExited(TDEProcess *)), + this, TQT_SLOT(scanDone())); + connect(m_progress, TQT_SIGNAL(cancelled()), this, TQT_SLOT(scanDone())); + + m_nspluginscan->start(); +} + +void KPluginOptions::progress(KProcIO *proc) +{ + TQString 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, TQT_SIGNAL(clicked()), TQT_SLOT(dirNew())); + connect( m_widget->dirRemove, TQT_SIGNAL(clicked()), TQT_SLOT(dirRemove())); + connect( m_widget->dirUp, TQT_SIGNAL(clicked()), TQT_SLOT(dirUp())); + connect( m_widget->dirDown, TQT_SIGNAL(clicked()), TQT_SLOT(dirDown()) ); + connect( m_widget->useArtsdsp, TQT_SIGNAL(clicked()),TQT_SLOT(change())); + connect( m_widget->dirEdit, + TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(dirEdited(const TQString &)) ); + + connect( m_widget->dirList, + TQT_SIGNAL(executed(TQListBoxItem*)), + TQT_SLOT(dirSelect(TQListBoxItem*)) ); + + connect( m_widget->dirList, + TQT_SIGNAL(selectionChanged(TQListBoxItem*)), + TQT_SLOT(dirSelect(TQListBoxItem*)) ); +} + + +void KPluginOptions::dirLoad( TDEConfig *config, bool useDefault ) +{ + TQStringList paths; + + // read search paths + + config->setGroup("Misc"); + if ( config->hasKey( "scanPaths" ) && !useDefault ) + paths = config->readListEntry( "scanPaths" ); + else {//keep sync with tdebase/nsplugins + paths.append("$HOME/.mozilla/plugins"); + paths.append("$HOME/.netscape/plugins"); + paths.append("/usr/lib/iceweasel/plugins"); + paths.append("/usr/lib/iceape/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( TDEConfig *config ) +{ + // create stringlist + TQStringList paths; + TQListBoxItem *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( TQListBoxItem *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() : TQString() ); + } + + +void KPluginOptions::dirNew() +{ + m_widget->dirList->insertItem( TQString(), 0 ); + m_widget->dirList->setCurrentItem( 0 ); + dirSelect( m_widget->dirList->selectedItem() ); + m_widget->dirEdit->setURL(TQString()); + m_widget->dirEdit->setFocus(); + change(); +} + + +void KPluginOptions::dirRemove() +{ + m_widget->dirEdit->setURL(TQString()); + 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 ) { + TQString 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 ) { + TQString 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 TQString &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( TDEConfig* /*config*/ ) +{ + kdDebug() << "-> KPluginOptions::fillPluginList" << endl; + m_widget->pluginList->clear(); + TQRegExp version(";version=[^:]*:"); + + // open the cache file + TQFile cachef( locate("data", "nsplugins/cache") ); + if ( !cachef.exists() || !cachef.open(IO_ReadOnly) ) { + kdDebug() << "Could not load plugin cache file!" << endl; + return; + } + + TQTextStream cache(&cachef); + + // root object + TQListViewItem *root = new TQListViewItem( m_widget->pluginList, i18n("Netscape Plugins") ); + root->setOpen( true ); + root->setSelectable( false ); + root->setExpandable( true ); + root->setPixmap(0, SmallIcon("netscape")); + + // read in cache + TQString line, plugin; + TQListViewItem *next = 0; + TQListViewItem *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 TQListViewItem( root, i18n("Plugin"), plugin ); + next->setOpen( false ); + next->setSelectable( false ); + next->setExpandable( true ); + + lastMIME = 0; + + continue; + } + + TQStringList desc = TQStringList::split(':', line, TRUE); + TQString mime = desc[0].stripWhiteSpace(); + TQString name = desc[2]; + TQString suffixes = desc[1]; + + if (!mime.isEmpty()) { + //kdDebug() << "mime=" << mime << " desc=" << name << " suffix=" << suffixes << endl; + lastMIME = new TQListViewItem( next, lastMIME, i18n("MIME type"), mime ); + lastMIME->setOpen( false ); + lastMIME->setSelectable( false ); + lastMIME->setExpandable( true ); + + TQListViewItem *last = new TQListViewItem( lastMIME, 0, i18n("Description"), name ); + last->setOpen( false ); + last->setSelectable( false ); + last->setExpandable( false ); + + last = new TQListViewItem( lastMIME, last, i18n("Suffixes"), suffixes ); + last->setOpen( false ); + last->setSelectable( false ); + last->setExpandable( false ); + } + } + + //kdDebug() << "<- KPluginOptions::fillPluginList" << endl; +} + + +void KPluginOptions::pluginSave( TDEConfig* /*config*/ ) +{ + +} + +// == class PluginDomainDialog ===== + +PluginDomainDialog::PluginDomainDialog(TQWidget *parent) : + TQWidget(parent,"PluginDomainDialog") { + setCaption(i18n("Domain-Specific Policies")); + + thisLayout = new TQVBoxLayout(this); + thisLayout->addSpacing(6); + TQFrame *hrule = new TQFrame(this); + hrule->setFrameStyle(TQFrame::HLine | TQFrame::Sunken); + thisLayout->addWidget(hrule); + thisLayout->addSpacing(6); + + TQBoxLayout *hl = new TQHBoxLayout(this,0,6); + hl->addStretch(10); + + TQPushButton *closePB = new KPushButton(KStdGuiItem::close(),this); + connect(closePB,TQT_SIGNAL(clicked()),TQT_SLOT(slotClose())); + hl->addWidget(closePB); + thisLayout->addLayout(hl); +} + +PluginDomainDialog::~PluginDomainDialog() { +} + +void PluginDomainDialog::setMainWidget(TQWidget *widget) { + thisLayout->insertWidget(0,widget); +} + +void PluginDomainDialog::slotClose() { + hide(); +} + +// == class PluginDomainListView ===== + +PluginDomainListView::PluginDomainListView(TDEConfig *config,const TQString &group, + KPluginOptions *options,TQWidget *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) { + TQString 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..efd3e0157 --- /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 <[email protected]>, Netscape parts +// +//----------------------------------------------------------------------------- + +#ifndef __PLUGINOPTS_H__ +#define __PLUGINOPTS_H__ + +#include <tqwidget.h> + +#include "domainlistview.h" +#include "policies.h" + +class TDEConfig; +class TQCheckBox; + +#include <tdecmodule.h> +#include "nsconfigwidget.h" + +class TQBoxLayout; +class TQLabel; +class TQProgressDialog; +class TQSlider; +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(TDEConfig* config, const TQString &group, bool global, + const TQString &domain = TQString::null); + + virtual ~PluginPolicies(); +}; + +/** Plugin-specific enhancements to the domain list view + */ +class PluginDomainListView : public DomainListView { + Q_OBJECT +public: + PluginDomainListView(TDEConfig *config,const TQString &group,KPluginOptions *opt, + TQWidget *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: + TQString group; + KPluginOptions *options; +}; + +/** + * dialog for embedding a PluginDomainListView widget + */ +class PluginDomainDialog : public TQWidget { + Q_OBJECT +public: + + PluginDomainDialog(TQWidget *parent); + virtual ~PluginDomainDialog(); + + void setMainWidget(TQWidget *widget); + +private slots: + virtual void slotClose(); + +private: + PluginDomainListView *domainSpecific; + TQBoxLayout *thisLayout; +}; + +class KPluginOptions : public TDECModule +{ + Q_OBJECT + +public: + KPluginOptions( TDEConfig* config, TQString group, TQWidget* parent = 0, const char* name = 0 ); + ~KPluginOptions(); + + virtual void load(); + virtual void load( bool useDefaults ); + virtual void save(); + virtual void defaults(); + TQString quickHelp() const; + +private slots: + void slotChanged(); + void slotTogglePluginsEnabled(); + void slotShowDomainDlg(); + +private: + + TDEConfig* m_pConfig; + TQString m_groupname; + + TQCheckBox *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; + TQProgressDialog *m_progress; + KProcIO* m_nspluginscan; + TQSlider *priority; + TQLabel *priorityLabel; + PluginPolicies global_policies; + PluginDomainListView *domainSpecific; + KDialogBase *domainSpecificDlg; + +/******************************************************************************/ + protected: + void dirInit(); + void dirLoad( TDEConfig *config, bool useDefault = false ); + void dirSave( TDEConfig *config ); + + protected slots: + void dirNew(); + void dirRemove(); + void dirUp(); + void dirDown(); + void dirEdited(const TQString &); + void dirSelect( TQListBoxItem * ); + +/******************************************************************************/ + protected: + void pluginInit(); + void pluginLoad( TDEConfig *config ); + void pluginSave( TDEConfig *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..1e1de227e --- /dev/null +++ b/kcontrol/konqhtml/policies.cpp @@ -0,0 +1,74 @@ +/* + Copyright (c) 2002 Leo Savernik <[email protected]> + 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 <tdeconfig.h> +#include <kdebug.h> + +#include "policies.h" + +// == class Policies == + +Policies::Policies(TDEConfig* config,const TQString &group, + bool global,const TQString &domain, const TQString &prefix, + const TQString &feature_key) : + is_global(global), config(config), groupname(group), + prefix(prefix), feature_key(feature_key) { + + if (is_global) { + this->prefix = TQString::null; // global keys have no prefix + }/*end if*/ + setDomain(domain); +} + +Policies::~Policies() { +} + +void Policies::setDomain(const TQString &domain) { + if (is_global) return; + this->domain = domain.lower(); + groupname = this->domain; // group is domain in this case +} + +void Policies::load() { + config->setGroup(groupname); + + TQString 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); + + TQString 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..df2a97750 --- /dev/null +++ b/kcontrol/konqhtml/policies.h @@ -0,0 +1,134 @@ +/* + Copyright (c) 2002 Leo Savernik <[email protected]> + 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 <tqstring.h> + +class TDEConfig; + +// 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 "<feature>." (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(TDEConfig* config, const TQString &group, bool global, + const TQString &domain, const TQString &prefix, + const TQString &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 TQString &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; + TDEConfig *config; + TQString groupname; + TQString domain; + TQString prefix; + TQString feature_key; +}; + +#endif // __POLICIES_H__ + diff --git a/kcontrol/konqhtml/policydlg.cpp b/kcontrol/konqhtml/policydlg.cpp new file mode 100644 index 000000000..9409023c1 --- /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 <[email protected]> +// Generalizing the policy dialog + +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqwhatsthis.h> +#include <tqcombobox.h> + +#include <tdelocale.h> +#include <kbuttonbox.h> +#include <tdemessagebox.h> + +#include <tqpushbutton.h> + +#include "policydlg.h" +#include "policies.h" + +PolicyDialog::PolicyDialog( Policies *policies, TQWidget *parent, const char *name ) + : KDialogBase(parent, name, true, TQString::null, Ok|Cancel, Ok, true), + policies(policies) +{ + TQFrame *main = makeMainWidget(); + + insertIdx = 1; // index where to insert additional panels + topl = new TQVBoxLayout(main, 0, spacingHint()); + + TQGridLayout *grid = new TQGridLayout(topl, 2, 2); + grid->setColStretch(1, 1); + + TQLabel *l = new TQLabel(i18n("&Host or domain name:"), main); + grid->addWidget(l, 0, 0); + + le_domain = new TQLineEdit(main); + l->setBuddy( le_domain ); + grid->addWidget(le_domain, 0, 1); + connect( le_domain,TQT_SIGNAL(textChanged( const TQString & )), + TQT_SLOT(slotTextChanged( const TQString &))); + + TQWhatsThis::add(le_domain, i18n("Enter the name of a host (like www.trinitydesktop.org) " + "or a domain, starting with a dot (like .trinitydesktop.org or .org)") ); + + l_feature_policy = new TQLabel(main); + grid->addWidget(l_feature_policy, 1, 0); + + cb_feature_policy = new TQComboBox(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 TQString &text) +{ + enableButtonOK(!text.isEmpty()); +} + +void PolicyDialog::setDisableEdit( bool state, const TQString& 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 TQString &text) { + l_feature_policy->setText(text); +} + +void PolicyDialog::setFeatureEnabledWhatsThis(const TQString &text) { + TQWhatsThis::add(cb_feature_policy, text); +} + +void PolicyDialog::addPolicyPanel(TQWidget *panel) { + topl->insertWidget(insertIdx++,panel); +} + +TQString 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 TQString::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); + } + TQDialog::accept(); +} + +#include "policydlg.moc" diff --git a/kcontrol/konqhtml/policydlg.h b/kcontrol/konqhtml/policydlg.h new file mode 100644 index 000000000..e4a176fb3 --- /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 <[email protected]> +// Generalizing the policy dialog + +#ifndef _POLICYDLG_H +#define _POLICYDLG_H + +#include <kdialogbase.h> + +#include <tqlineedit.h> +#include <tqstringlist.h> + +class TQLabel; +class TQComboBox; +class TQString; +class TQVBoxLayout; +class TQPushButton; + +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, TQWidget *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 + */ + TQString featureEnabledPolicyText() const; + + /* + * @return the hostname for which the policy is being set + */ + TQString 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 TQString& text = TQString::null ); + + /** + * Sets the label for the "feature enabled" policy + * @param text label text + */ + void setFeatureEnabledLabel(const TQString &text); + + /** + * Sets the "What's This" text for the "feature enabled" policy + * combo box. + * @param text what's-this text + */ + void setFeatureEnabledWhatsThis(const TQString &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(TQWidget *panel); + +protected slots: + + virtual void accept(); + void slotTextChanged( const TQString &text); + +private: + Policies *policies; + TQVBoxLayout *topl; + int insertIdx; + TQLineEdit *le_domain; + TQLabel *l_feature_policy; + TQComboBox *cb_feature_policy; + TQWidget *panel; + TQStringList policy_values; + TQPushButton *okButton; +}; + +#endif diff --git a/kcontrol/konqhtml/tdehtml_behavior.desktop b/kcontrol/konqhtml/tdehtml_behavior.desktop new file mode 100644 index 000000000..3028e6073 --- /dev/null +++ b/kcontrol/konqhtml/tdehtml_behavior.desktop @@ -0,0 +1,231 @@ +[Desktop Entry] +Type=Application +X-DocPath=kcontrol/tdehtml/index.html#kbrowse-html +Icon=konqueror +Exec=tdecmshell tdehtml_behavior + + +X-TDE-Library=konqhtml +X-TDE-FactoryName=tdehtml_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;TDE;X-TDE-settings-webbrowsing; diff --git a/kcontrol/konqhtml/tdehtml_filter.desktop b/kcontrol/konqhtml/tdehtml_filter.desktop new file mode 100644 index 000000000..cc0bd11ac --- /dev/null +++ b/kcontrol/konqhtml/tdehtml_filter.desktop @@ -0,0 +1,145 @@ +[Desktop Entry] +Type=Application +X-DocPath=kcontrol/tdehtml/index.html#tdehtml-adblock +Icon=filter +Exec=tdecmshell tdehtml_filter + +X-TDE-Library=konqhtml +X-TDE-FactoryName=tdehtml_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;TDE;X-TDE-settings-webbrowsing; diff --git a/kcontrol/konqhtml/tdehtml_fonts.desktop b/kcontrol/konqhtml/tdehtml_fonts.desktop new file mode 100644 index 000000000..21e3be974 --- /dev/null +++ b/kcontrol/konqhtml/tdehtml_fonts.desktop @@ -0,0 +1,230 @@ +[Desktop Entry] +Type=Application +X-DocPath=kcontrol/tdehtml/index.html#kbrowse-appearance +Icon=font-x-generic +Exec=tdecmshell tdehtml_fonts + + +X-TDE-Library=konqhtml +X-TDE-FactoryName=tdehtml_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;TDE;X-TDE-settings-webbrowsing; diff --git a/kcontrol/konqhtml/tdehtml_java_js.desktop b/kcontrol/konqhtml/tdehtml_java_js.desktop new file mode 100644 index 000000000..7bdea12ca --- /dev/null +++ b/kcontrol/konqhtml/tdehtml_java_js.desktop @@ -0,0 +1,211 @@ +[Desktop Entry] +Type=Application +X-DocPath=kcontrol/tdehtml/index.html +Icon=konqueror +Exec=tdecmshell tdehtml_java_js + + +X-TDE-Library=konqhtml +X-TDE-FactoryName=tdehtml_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;TDE;X-TDE-settings-webbrowsing; diff --git a/kcontrol/konqhtml/tdehtml_userinterface.desktop b/kcontrol/konqhtml/tdehtml_userinterface.desktop new file mode 100644 index 000000000..fdd3edad1 --- /dev/null +++ b/kcontrol/konqhtml/tdehtml_userinterface.desktop @@ -0,0 +1,18 @@ +[Desktop Entry] +Type=Application +X-DocPath=kcontrol/tdehtml/index.html#userinterface +Icon=konqueror +Exec=tdecmshell tdehtml_userinterface + + +X-TDE-Library=konqhtml +X-TDE-FactoryName=tdehtml_userinterface + +Name=User Interface +Name[it]=Interfaccia utente +Comment=Configure user interface options +Comment[it]=Configura opzioni dell'interfaccia utente +Keywords=konqueror;kfm;user;interface;tabbed;browsing; +Keywords[it]=konqueror;kfm;utente;interfaccia;linguette;navigazione; + +Categories=Qt;TDE;X-TDE-settings-webbrowsing; 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 diff --git a/kcontrol/konqhtml/userInterConfig.cpp b/kcontrol/konqhtml/userInterConfig.cpp new file mode 100644 index 000000000..4e18c6d38 --- /dev/null +++ b/kcontrol/konqhtml/userInterConfig.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2005 Stefan Nikolaus <[email protected]> + * + * 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 <tqlayout.h> +#include <tqtimer.h> + +#include <tdelocale.h> +#include <kdebug.h> + +#include "userInterOpts_impl.h" +#include "main.h" + +#include "userInterConfig.h" +#include "userInterConfig.moc" + +userInterConfig::userInterConfig(TDEConfig *config, TQString groupName, + TQWidget *parent, const char *name) + : TDECModule(parent, "kcmkonqhtml") +{ + TQVBoxLayout *layout = new TQVBoxLayout(this); + m_widget = new userInterOpts(config, groupName, this, name); + layout->addWidget(m_widget); + layout->addStretch(); + + connect(m_widget, TQT_SIGNAL(changed()), + this, TQT_SLOT(changed())); + + load(); + TQTimer::singleShot(0, this, TQT_SLOT(notChanged())); +} + +void userInterConfig::notChanged() +{ + emit changed(false); +} + +void userInterConfig::load() +{ + m_widget->load(); + TDECModule::load(); +} + +void userInterConfig::save() +{ + m_widget->save(); + TDECModule::save(); +} + +void userInterConfig::defaults() +{ + m_widget->defaults(); + TDECModule::defaults(); + + // TDEConfigDialogManager may queue an changed(false) signal, + // so we make sure, that the module is labeled as changed, + // while we manage some of the widgets ourselves + TQTimer::singleShot(0, this, TQT_SLOT(changed())); +} diff --git a/kcontrol/konqhtml/userInterConfig.h b/kcontrol/konqhtml/userInterConfig.h new file mode 100644 index 000000000..b87879e45 --- /dev/null +++ b/kcontrol/konqhtml/userInterConfig.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2005 Stefan Nikolaus <[email protected]> + * + * 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 __USER_INTER_CONFIG_H__ +#define __USER_INTER_CONFIG_H__ + +#include <tdecmodule.h> + +class userInterOpts; + +class userInterConfig : public TDECModule +{ + Q_OBJECT + +public: + userInterConfig(TDEConfig *config, TQString group, + TQWidget *parent = 0, const char *name = 0); + + void load(); + void save(); + void defaults(); + +public slots: + void notChanged(); + +private: + userInterOpts *m_widget; +}; + +#endif // __USER_INTER_CONFIG_H__ diff --git a/kcontrol/konqhtml/userInterOpts.ui b/kcontrol/konqhtml/userInterOpts.ui new file mode 100644 index 000000000..8a6ebc3fe --- /dev/null +++ b/kcontrol/konqhtml/userInterOpts.ui @@ -0,0 +1,195 @@ +<!DOCTYPE UI><UI version="3.1" stdsetdef="1"> +<class>userInterOptsBase</class> +<widget class="TQWidget"> + <property name="name"> + <cstring>userInterOptsBase</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="TQGroupBox"> + <property name="name"> + <cstring>m_group_1</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>4</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Tabbed Browsing</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLayoutWidget"> + <property name="name"> + <cstring>layout</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>m_pShowMMBInTabs</cstring> + </property> + <property name="text"> + <string>Open &links in new tab instead of in new window</string> + </property> + <property name="whatsThis" stdset="0"> + <string>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.</string> + </property> + </widget> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>m_pDynamicTabbarHide</cstring> + </property> + <property name="text"> + <string>&Hide the tab bar when only one tab is open</string> + </property> + <property name="whatsThis" stdset="0"> + <string>This will display the tab bar only if there are two or more tabs. Otherwise it will always be displayed.</string> + </property> + </widget> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>m_pDynamicTabbarCycle</cstring> + </property> + <property name="text"> + <string>C&ycle tabs with mouse wheel</string> + </property> + <property name="whatsThis" stdset="0"> + <string>This will cycle through tabs when there are two or more tabs using the mouse wheel.</string> + </property> + </widget> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>m_pNewTabsInBackground</cstring> + </property> + <property name="text"> + <string>O&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="TQCheckBox"> + <property name="name"> + <cstring>m_pOpenAfterCurrentPage</cstring> + </property> + <property name="text"> + <string>Open &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="TQCheckBox"> + <property name="name"> + <cstring>m_pTabConfirm</cstring> + </property> + <property name="text"> + <string>Confirm &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="TQCheckBox"> + <property name="name"> + <cstring>m_pPermanentCloseButton</cstring> + </property> + <property name="text"> + <string>&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="TQCheckBox"> + <property name="name"> + <cstring>m_pHoverCloseButton</cstring> + </property> + <property name="text"> + <string>&Show close button instead of website icon with mouse hover</string> + </property> + <property name="whatsThis" stdset="0"> + <string>This will display a close button inside each tab instead of websites' icons when the mouse pointer hovers the icon.</string> + </property> + </widget> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>m_pPopupsWithinTabs</cstring> + </property> + <property name="text"> + <string>Open pop&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="TQCheckBox"> + <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 TDE 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> + <widget class="TQCheckBox"> + <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> + </vbox> + </widget> + </grid> + </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>16</height> + </size> + </property> + </spacer> + </vbox> +</widget> +<layoutdefaults spacing="3" margin="6"/> +<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> +</UI> diff --git a/kcontrol/konqhtml/userInterOpts_impl.cpp b/kcontrol/konqhtml/userInterOpts_impl.cpp new file mode 100644 index 000000000..efe3c7343 --- /dev/null +++ b/kcontrol/konqhtml/userInterOpts_impl.cpp @@ -0,0 +1,127 @@ +/* + * userInterOpts.cpp + * + * Copyright (c) 2002 Aaron J. Seigo <[email protected]> + * + * 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 <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqslider.h> + +#include <tdeapplication.h> +#include <dcopclient.h> +#include <kcolorbutton.h> +#include <tdelocale.h> +#include <tdeconfig.h> + +#include "main.h" +#include "userInterOpts_impl.h" +#include "userInterOpts_impl.moc" + +userInterOpts::userInterOpts(TDEConfig *config, TQString groupName, + TQWidget* parent, const char* name) + : userInterOptsBase(parent, name), m_pConfig(config), m_groupName(groupName) +{ + // connections + connect(m_pShowMMBInTabs, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + connect(m_pDynamicTabbarHide, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + connect(m_pDynamicTabbarCycle, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + connect(m_pNewTabsInBackground, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + connect(m_pOpenAfterCurrentPage, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + connect(m_pTabConfirm, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + connect(m_pPermanentCloseButton, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + connect(m_pHoverCloseButton, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + connect(m_pKonquerorTabforExternalURL, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + connect(m_pPopupsWithinTabs, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); + connect(m_pTabCloseActivatePrevious, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChanged())); +} + +void userInterOpts::load() +{ + load(false); +} + +void userInterOpts::load(bool useDefaults) +{ + m_pConfig->setReadDefaults(useDefaults); + m_pConfig->setGroup(m_groupName); + + m_pShowMMBInTabs->setChecked( m_pConfig->readBoolEntry( "MMBOpensTab", false ) ); + m_pDynamicTabbarHide->setChecked( !(m_pConfig->readBoolEntry( "AlwaysTabbedMode", false )) ); + m_pDynamicTabbarCycle->setChecked( m_pConfig->readBoolEntry( "TabsCycleWheel", true ) ); + m_pNewTabsInBackground->setChecked( ! (m_pConfig->readBoolEntry( "NewTabsInFront", false )) ); + m_pOpenAfterCurrentPage->setChecked( m_pConfig->readBoolEntry( "OpenAfterCurrentPage", false ) ); + m_pPermanentCloseButton->setChecked( m_pConfig->readBoolEntry( "PermanentCloseButton", false ) ); + m_pHoverCloseButton->setChecked( m_pConfig->readBoolEntry( "HoverCloseButton", false ) ); + m_pKonquerorTabforExternalURL->setChecked( m_pConfig->readBoolEntry( "KonquerorTabforExternalURL", false ) ); + m_pPopupsWithinTabs->setChecked( m_pConfig->readBoolEntry( "PopupsWithinTabs", false ) ); + m_pTabCloseActivatePrevious->setChecked( m_pConfig->readBoolEntry( "TabCloseActivatePrevious", false ) ); + + m_pConfig->setGroup("Notification Messages"); + m_pTabConfirm->setChecked( !m_pConfig->hasKey("MultipleTabConfirm") ); + + if ( m_pPermanentCloseButton->isChecked() ) + m_pHoverCloseButton->setEnabled(false); + else + m_pHoverCloseButton->setEnabled(true); +} + +void userInterOpts::save() +{ + m_pConfig->setGroup(m_groupName); + + m_pConfig->writeEntry( "MMBOpensTab", (m_pShowMMBInTabs->isChecked()) ); + m_pConfig->writeEntry( "AlwaysTabbedMode", ( !(m_pDynamicTabbarHide->isChecked())) ); + m_pConfig->writeEntry( "TabsCycleWheel", (m_pDynamicTabbarCycle->isChecked()) ); + m_pConfig->writeEntry( "NewTabsInFront", !(m_pNewTabsInBackground->isChecked()) ); + m_pConfig->writeEntry( "OpenAfterCurrentPage", m_pOpenAfterCurrentPage->isChecked() ); + m_pConfig->writeEntry( "PermanentCloseButton", m_pPermanentCloseButton->isChecked() ); + m_pConfig->writeEntry( "HoverCloseButton", m_pHoverCloseButton->isChecked() ); + m_pConfig->writeEntry( "KonquerorTabforExternalURL", m_pKonquerorTabforExternalURL->isChecked() ); + m_pConfig->writeEntry( "PopupsWithinTabs", m_pPopupsWithinTabs->isChecked() ); + m_pConfig->writeEntry( "TabCloseActivatePrevious", m_pTabCloseActivatePrevious->isChecked() ); + m_pConfig->sync(); + + // It only matters whether the key is present, its value has no meaning + m_pConfig->setGroup("Notification Messages"); + if ( m_pTabConfirm->isChecked() ) m_pConfig->deleteEntry( "MultipleTabConfirm" ); + else m_pConfig->writeEntry( "MultipleTabConfirm", true ); + + TQByteArray data; + if ( !TDEApplication::kApplication()->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + TDEApplication::kApplication()->dcopClient()->send( "konqueror*", "KonquerorIface", "reparseConfiguration()", data ); + + if ( m_pPermanentCloseButton->isChecked() ) + m_pHoverCloseButton->setEnabled(false); + else + m_pHoverCloseButton->setEnabled(true); +} + +void userInterOpts::defaults() +{ + load(true); +} + +void userInterOpts::slotChanged() +{ + emit changed(); +} + + diff --git a/kcontrol/konqhtml/userInterOpts_impl.h b/kcontrol/konqhtml/userInterOpts_impl.h new file mode 100644 index 000000000..763b640b9 --- /dev/null +++ b/kcontrol/konqhtml/userInterOpts_impl.h @@ -0,0 +1,49 @@ +/* + * userInterOpts_impl.h + * + * Copyright (c) 2002 Aaron J. Seigo <[email protected]> + * + * 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 __USERINTERFACE_OPTIONS_IMPL_H +#define __USERINTERFACE_OPTIONS_IMPL_H + +#include "userInterOpts.h" + +class userInterOpts : public userInterOptsBase +{ + Q_OBJECT + + public: + userInterOpts(TDEConfig *config, TQString groupName, + TQWidget* parent =0, const char* name =0); + + void load(); + void load(bool useDefaults); + void save(); + void defaults(); + + signals: + void changed(); + + protected: + TDEConfig *m_pConfig; + TQString m_groupName; + + private slots: + void slotChanged(); +}; + +#endif |