Fix crash if key bindings specified in profile cannot be found. Improve
[personal-kdebase.git] / apps / konqueror / settings / kio / main.cpp
blob6b8b92491a892a5b6edc90e4598181ff97cff656
1 // (c) Torben Weis 1998
2 // (c) David Faure 1998
3 /*
4 * main.cpp for lisa,reslisa,kio_lan and kio_rlan kcm module
6 * Copyright (C) 2000,2001 Alexander Neundorf <neundorf@kde.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 // Own
24 #include "main.h"
26 // Qt
27 #include <QtCore/QFile>
28 #include <QtGui/QLabel>
29 #include <QtGui/QLayout>
30 #include <QtGui/QTabWidget>
32 // KDE
33 #include <kcmoduleloader.h>
34 #include <klocale.h>
35 #include <kcomponentdata.h>
36 #include <kgenericfactory.h>
38 // Local
39 #include "kcookiesmain.h"
40 #include "netpref.h"
41 #include "smbrodlg.h"
42 #include "useragentdlg.h"
43 #include "kproxydlg.h"
44 #include "cache.h"
45 #include "bookmarks.h"
47 K_PLUGIN_FACTORY(KioConfigFactory,
48 registerPlugin<LanBrowser>("lanbrowser");
49 registerPlugin<UserAgentDlg>("useragent");
50 registerPlugin<SMBRoOptions>("smb");
51 registerPlugin<KIOPreferences>("netpref");
52 registerPlugin<KProxyDialog>("proxy");
53 registerPlugin<KCookiesMain>("cookie");
54 registerPlugin<CacheConfigModule>("cache");
55 registerPlugin<BookmarksConfigModule>("bookmarks");
57 K_EXPORT_PLUGIN(KioConfigFactory("kcmkio"))
59 LanBrowser::LanBrowser(QWidget *parent, const QVariantList &)
60 : KCModule(KioConfigFactory::componentData(), parent)
61 , layout(this)
62 , tabs(this)
64 setQuickHelp( i18n("<h1>Local Network Browsing</h1>Here you setup your "
65 "<b>\"Network Neighborhood\"</b>. You "
66 "can use either the LISa daemon and the lan:/ ioslave, or the "
67 "ResLISa daemon and the rlan:/ ioslave.<br /><br />"
68 "About the <b>LAN ioslave</b> configuration:<br /> If you select it, the "
69 "ioslave, <i>if available</i>, will check whether the host "
70 "supports this service when you open this host. Please note "
71 "that paranoid people might consider even this to be an attack.<br />"
72 "<i>Always</i> means that you will always see the links for the "
73 "services, regardless of whether they are actually offered by the host. "
74 "<i>Never</i> means that you will never have the links to the services. "
75 "In both cases you will not contact the host, so nobody will ever regard "
76 "you as an attacker.<br /><br />More information about <b>LISa</b> "
77 "can be found at <a href=\"http://lisa-home.sourceforge.net\">"
78 "the LISa Homepage</a> or contact Alexander Neundorf "
79 "&lt;<a href=\"mailto:neundorf@kde.org\">neundorf@kde.org</a>&gt;."));
81 layout.setMargin(0);
82 layout.addWidget(&tabs);
84 smbPage = new SMBRoOptions(&tabs, QVariantList(), componentData());
85 tabs.addTab(smbPage, i18n("&Windows Shares"));
86 connect(smbPage,SIGNAL(changed(bool)), SLOT( changed() ));
88 lisaPage = KCModuleLoader::loadModule("kcmlisa", KCModuleLoader::None,&tabs);
89 if (lisaPage)
91 tabs.addTab(lisaPage,i18n("&LISa Daemon"));
92 connect(lisaPage,SIGNAL(changed()), SLOT( changed() ));
95 // resLisaPage = KCModuleLoader::loadModule("kcmreslisa", KCModuleLoader::None,&tabs);
96 // if (resLisaPage)
97 // {
98 // tabs.addTab(resLisaPage,i18n("R&esLISa Daemon"));
99 // connect(resLisaPage,SIGNAL(changed()), SLOT( changed() ));
100 // }
102 kioLanPage = KCModuleLoader::loadModule("kcmkiolan", KCModuleLoader::None, &tabs);
103 if (kioLanPage)
105 tabs.addTab(kioLanPage,i18n("lan:/ Iosla&ve"));
106 connect(kioLanPage,SIGNAL(changed()), SLOT( changed() ));
109 setButtons(Apply|Help);
112 void LanBrowser::load()
114 smbPage->load();
115 if (lisaPage)
116 lisaPage->load();
117 // if (resLisaPage)
118 // resLisaPage->load();
119 if (kioLanPage)
120 kioLanPage->load();
121 emit changed(false);
124 void LanBrowser::save()
126 smbPage->save();
127 // if (resLisaPage)
128 // resLisaPage->save();
129 if (kioLanPage)
130 kioLanPage->save();
131 if (lisaPage)
132 lisaPage->save();
133 emit changed(false);
136 #include "main.moc"