• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/kopete

  • sources
  • kde-4.12
  • kdenetwork
  • kopete
  • kopete
  • config
  • plugins
kopetepluginconfig.cpp
Go to the documentation of this file.
1 /*
2  kopetepluginconfig.cpp - Configure the Kopete plugins
3 
4  Copyright (c) 2003 by Martijn Klingens <klingens@kde.org>
5  Copyright (c) 2006 by MichaĆ«l Larouche <larouche@kde.org>
6  Copyright (c) 2007 by Will Stephenson <wstephenson@kde.org>
7 
8  Kopete (c) 2001-2007 by the Kopete developers <kopete-devel@kde.org>
9 
10  *************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  *************************************************************************
18 */
19 
20 #include "kopetepluginconfig.h"
21 
22 // Qt includes
23 #include <QtCore/QByteArray>
24 #include <QtGui/QVBoxLayout>
25 
26 // KDE includes
27 #include <kdebug.h>
28 #include <klocale.h>
29 #include <kpluginselector.h>
30 #include <kpluginfactory.h>
31 #include <ksettings/dispatcher.h>
32 #include <KPluginInfo>
33 
34 // Kopete includes
35 #include "kopetepluginmanager.h"
36 
37 K_PLUGIN_FACTORY( KopetePluginConfigFactory,
38  registerPlugin<KopetePluginConfig>(); )
39 K_EXPORT_PLUGIN( KopetePluginConfigFactory("kcm_kopete_pluginconfig") )
40 
41 KopetePluginConfig::KopetePluginConfig( QWidget *parent, const QVariantList &args )
42 : KCModule(KopetePluginConfigFactory::componentData(), parent, args)
43 {
44  m_pluginSelector = new KPluginSelector( this );
45 
46  QVBoxLayout *mainLayout = new QVBoxLayout(this);
47  mainLayout->setMargin(0);
48  mainLayout->addWidget( m_pluginSelector );
49 
50  connect( m_pluginSelector, SIGNAL(changed(bool)), this, SLOT(changed()) );
51  connect( m_pluginSelector, SIGNAL(configCommitted(QByteArray)),
52  this, SLOT(reparseConfiguration(QByteArray)) );
53 
54  m_pluginSelector->addPlugins( Kopete::PluginManager::self()->availablePlugins( "Plugins" ),
55  KPluginSelector::ReadConfigFile, i18n( "General Plugins" ), "Plugins" );
56  m_pluginSelector->load();
57 }
58 
59 KopetePluginConfig::~KopetePluginConfig()
60 {
61 }
62 
63 void KopetePluginConfig::reparseConfiguration(const QByteArray&conf)
64 {
65  KSettings::Dispatcher::reparseConfiguration(conf);
66 }
67 
68 void KopetePluginConfig::load()
69 {
70  m_pluginSelector->load();
71 
72  KCModule::load();
73 }
74 
75 void KopetePluginConfig::defaults()
76 {
77  m_pluginSelector->defaults();
78 }
79 
80 void KopetePluginConfig::save()
81 {
82  m_pluginSelector->save();
83  Kopete::PluginManager::self()->loadAllPlugins();
84 
85  KCModule::save();
86 }
87 
88 #include "kopetepluginconfig.moc"
89 
90 // vim: set noet ts=4 sts=4 sw=4:
91 
K_PLUGIN_FACTORY
K_PLUGIN_FACTORY(KopetePluginConfigFactory, registerPlugin< KopetePluginConfig >();) KopetePluginConfig
Definition: kopetepluginconfig.cpp:37
KopetePluginConfig::load
virtual void load()
Definition: kopetepluginconfig.cpp:68
QWidget
KopetePluginConfig
Plugin selector.
Definition: kopetepluginconfig.h:32
kopetepluginconfig.h
KopetePluginConfig::reparseConfiguration
void reparseConfiguration(const QByteArray &conf)
Definition: kopetepluginconfig.cpp:63
KopetePluginConfig::~KopetePluginConfig
~KopetePluginConfig()
Definition: kopetepluginconfig.cpp:59
KopetePluginConfig::save
virtual void save()
Definition: kopetepluginconfig.cpp:80
KopetePluginConfig::defaults
virtual void defaults()
Definition: kopetepluginconfig.cpp:75
KCModule
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/kopete

Skip menu "kopete/kopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal