diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 4aed2c8219774f5d797760606b8489a92ddc5163 (patch) | |
tree | 3f8c130f7d269626bf6a9447407ef6c35954426a /kcontrol/ebrowsing/main.cpp | |
download | tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/ebrowsing/main.cpp')
-rw-r--r-- | kcontrol/ebrowsing/main.cpp | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/kcontrol/ebrowsing/main.cpp b/kcontrol/ebrowsing/main.cpp new file mode 100644 index 000000000..8c7ab1e5d --- /dev/null +++ b/kcontrol/ebrowsing/main.cpp @@ -0,0 +1,131 @@ +/* + * main.cpp + * + * Copyright (c) 2000 Yves Arrouye <[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 <qlayout.h> +#include <qmap.h> +#include <qtabwidget.h> + +#include <dcopclient.h> +#include <kdialog.h> +#include <kurifilter.h> +#include <kgenericfactory.h> + +#include "filteropts.h" +#include "main.h" + +typedef KGenericFactory<KURIFilterModule, QWidget> KURIFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_kurifilt, KURIFactory("kcmkurifilt") ) + +class FilterOptions; + +KURIFilterModule::KURIFilterModule(QWidget *parent, const char *name, const QStringList &) + :KCModule(KURIFactory::instance(), parent, name) +{ + + filter = KURIFilter::self(); + + setQuickHelp( i18n("<h1>Enhanced Browsing</h1> In this module you can configure some enhanced browsing" + " features of KDE. <h2>Internet Keywords</h2>Internet Keywords let you" + " type in the name of a brand, a project, a celebrity, etc... and go to the" + " relevant location. For example you can just type" + " \"KDE\" or \"K Desktop Environment\" in Konqueror to go to KDE's homepage." + "<h2>Web Shortcuts</h2>Web Shortcuts are a quick way of using Web search engines. For example, type \"altavista:frobozz\"" + " or \"av:frobozz\" and Konqueror will do a search on AltaVista for \"frobozz\"." + " Even easier: just press Alt+F2 (if you have not" + " changed this shortcut) and enter the shortcut in the KDE Run Command dialog.")); + + QVBoxLayout *layout = new QVBoxLayout(this); + +#if 0 + opts = new FilterOptions(this); + tab->addTab(opts, i18n("&Filters")); + connect(opts, SIGNAL(changed(bool)), SIGNAL(changed(bool))); +#endif + + modules.setAutoDelete(true); + + QMap<QString,KCModule*> helper; + QPtrListIterator<KURIFilterPlugin> it = filter->pluginsIterator(); + for (; it.current(); ++it) + { + KCModule *module = it.current()->configModule(this, 0); + if (module) + { + modules.append(module); + helper.insert(it.current()->configName(), module); + connect(module, SIGNAL(changed(bool)), SIGNAL(changed(bool))); + } + } + + if (modules.count() > 1) + { + QTabWidget *tab = new QTabWidget(this); + + QMapIterator<QString,KCModule*> it2; + for (it2 = helper.begin(); it2 != helper.end(); ++it2) + { + tab->addTab(it2.data(), it2.key()); + } + + tab->showPage(modules.first()); + widget = tab; + } + else if (modules.count() == 1) + { + widget = modules.first(); + layout->setMargin(-KDialog::marginHint()); + } + + layout->addWidget(widget); +} + +void KURIFilterModule::load() +{ + QPtrListIterator<KCModule> it(modules); + for (; it.current(); ++it) + { + it.current()->load(); + } +} + +void KURIFilterModule::save() +{ + QPtrListIterator<KCModule> it(modules); + for (; it.current(); ++it) + { + it.current()->save(); + } +} + +void KURIFilterModule::defaults() +{ + QPtrListIterator<KCModule> it(modules); + for (; it.current(); ++it) + { + it.current()->defaults(); + } +} + +#include "main.moc" |