summaryrefslogtreecommitdiffstats
path: root/kcontrol/kio/kcookiesmain.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /kcontrol/kio/kcookiesmain.cpp
downloadtdebase-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/kio/kcookiesmain.cpp')
-rw-r--r--kcontrol/kio/kcookiesmain.cpp99
1 files changed, 99 insertions, 0 deletions
diff --git a/kcontrol/kio/kcookiesmain.cpp b/kcontrol/kio/kcookiesmain.cpp
new file mode 100644
index 000000000..f25a28011
--- /dev/null
+++ b/kcontrol/kio/kcookiesmain.cpp
@@ -0,0 +1,99 @@
+// kcookiesmain.cpp - Cookies configuration
+//
+// First version of cookies configuration by Waldo Bastian <[email protected]>
+// This dialog box created by David Faure <[email protected]>
+
+#include <qlayout.h>
+#include <qtabwidget.h>
+
+#include <klocale.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <dcopref.h>
+
+#include "kcookiesmain.h"
+#include "kcookiespolicies.h"
+#include "kcookiesmanagement.h"
+
+KCookiesMain::KCookiesMain(QWidget *parent)
+ : KCModule(parent, "kcmkio")
+{
+ management = 0;
+ bool managerOK = true;
+
+ DCOPReply reply = DCOPRef( "kded", "kded" ).call( "loadModule",
+ QCString( "kcookiejar" ) );
+
+ if( !reply.isValid() )
+ {
+ managerOK = false;
+ kdDebug(7103) << "kcm_kio: KDED could not load KCookiejar!" << endl;
+ KMessageBox::sorry(0, i18n("Unable to start the cookie handler service.\n"
+ "You will not be able to manage the cookies that "
+ "are stored on your computer."));
+ }
+
+ QVBoxLayout *layout = new QVBoxLayout(this);
+ tab = new QTabWidget(this);
+ layout->addWidget(tab);
+
+ policies = new KCookiesPolicies(this);
+ tab->addTab(policies, i18n("&Policy"));
+ connect(policies, SIGNAL(changed(bool)), SIGNAL(changed(bool)));
+
+ if( managerOK )
+ {
+ management = new KCookiesManagement(this);
+ tab->addTab(management, i18n("&Management"));
+ connect(management, SIGNAL(changed(bool)), SIGNAL(changed(bool)));
+ }
+}
+
+KCookiesMain::~KCookiesMain()
+{
+}
+
+void KCookiesMain::load()
+{
+ policies->load();
+ if( management )
+ management->load();
+}
+
+void KCookiesMain::save()
+{
+ policies->save();
+ if ( management )
+ management->save();
+}
+
+void KCookiesMain::defaults()
+{
+ KCModule* module = static_cast<KCModule*>(tab->currentPage());
+
+ if ( module == policies )
+ policies->defaults();
+ else if( management )
+ management->defaults();
+}
+
+QString KCookiesMain::quickHelp() const
+{
+ return i18n("<h1>Cookies</h1> Cookies contain information that Konqueror"
+ " (or other KDE applications using the HTTP protocol) stores on your"
+ " computer, initiated by a remote Internet server. This means that"
+ " a web server can store information about you and your browsing activities"
+ " on your machine for later use. You might consider this an invasion of"
+ " privacy. <p> However, cookies are useful in certain situations. For example, they"
+ " are often used by Internet shops, so you can 'put things into a shopping basket'."
+ " Some sites require you have a browser that supports cookies. <p>"
+ " Because most people want a compromise between privacy and the benefits cookies offer,"
+ " KDE offers you the ability to customize the way it handles cookies. So you might want"
+ " to set KDE's default policy to ask you whenever a server wants to set a cookie,"
+ " allowing you to decide. For your favorite shopping web sites that you trust, you might"
+ " want to set the policy to accept, then you can access the web sites without being prompted"
+ " every time KDE receives a cookie." );
+}
+
+#include "kcookiesmain.moc"