• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

SolidModules

kcmsolid.cpp

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2006 Kevin Ottens <ervin@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 
00019 */
00020 
00021 #include "kcmsolid.h"
00022 
00023 
00024 #include <kaboutdata.h>
00025 #include <kdeversion.h>
00026 
00027 #include <QVBoxLayout>
00028 
00029 #include "backendchooser.h"
00030 #include <KPluginFactory>
00031 #include <KPluginLoader>
00032 
00033 
00034 K_PLUGIN_FACTORY(KcmSolidFactory,
00035         registerPlugin<KcmSolid>();
00036         )
00037 K_EXPORT_PLUGIN(KcmSolidFactory("kcm_solid"))
00038 
00039 
00040 KcmSolid::KcmSolid(QWidget *parent, const QVariantList &args)
00041     : KCModule(KcmSolidFactory::componentData(), parent, args),
00042       m_changedChooser(0)
00043 {
00044     KAboutData *about = new KAboutData(
00045         "kcm_solid", 0, ki18n("Solid Configuration Module"),
00046         KDE_VERSION_STRING, KLocalizedString(), KAboutData::License_GPL,
00047         ki18n("Copyright 2006 Kevin Ottens"));
00048     about->addAuthor(ki18n("Kevin Ottens"), KLocalizedString(), "ervin@kde.org");
00049     setAboutData(about);
00050 
00051     setLayout(new QVBoxLayout);
00052     layout()->setMargin(0);
00053     layout()->setSpacing(0);
00054 
00055     m_powerChooser = new BackendChooser(this, "SolidPowerManager");
00056     m_networkChooser = new BackendChooser(this, "SolidNetworkManager");
00057     m_bluetoothChooser = new BackendChooser(this, "SolidBluetoothManager");
00058 
00059     layout()->addWidget(m_powerChooser);
00060     layout()->addWidget(m_networkChooser);
00061     layout()->addWidget(m_bluetoothChooser);
00062 
00063     load();
00064 
00065     connect(m_powerChooser, SIGNAL(changed(bool)),
00066              this, SLOT(slotChooserChanged(bool)));
00067     connect(m_networkChooser, SIGNAL(changed(bool)),
00068              this, SLOT(slotChooserChanged(bool)));
00069     connect(m_bluetoothChooser, SIGNAL(changed(bool)),
00070              this, SLOT(slotChooserChanged(bool)));
00071 
00072 }
00073 
00074 void KcmSolid::load()
00075 {
00076     m_powerChooser->load();
00077     m_networkChooser->load();
00078     m_bluetoothChooser->load();
00079 }
00080 
00081 void KcmSolid::save()
00082 {
00083     m_powerChooser->save();
00084     m_networkChooser->save();
00085     m_bluetoothChooser->save();
00086 }
00087 
00088 void KcmSolid::defaults()
00089 {
00090     m_powerChooser->defaults();
00091     m_networkChooser->defaults();
00092     m_bluetoothChooser->defaults();
00093 }
00094 
00095 void KcmSolid::slotChooserChanged(bool state)
00096 {
00097     if (state)
00098     {
00099         m_changedChooser++;
00100     }
00101     else
00102     {
00103         m_changedChooser--;
00104     }
00105 
00106 
00107     emit changed(m_changedChooser!= 0);
00108 }
00109 
00110 #include "kcmsolid.moc"

SolidModules

Skip menu "SolidModules"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal