• Skip to content
  • Skip to link menu
KDE 4.2 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     setButtons(Apply | Default);
00051 
00052     setLayout(new QVBoxLayout);
00053     layout()->setMargin(0);
00054     layout()->setSpacing(0);
00055 
00056     m_powerChooser = new BackendChooser(this, "SolidPowerManager");
00057     m_networkChooser = new BackendChooser(this, "SolidNetworkManager");
00058     m_bluetoothChooser = new BackendChooser(this, "SolidBluetoothManager");
00059 
00060     layout()->addWidget(m_powerChooser);
00061     layout()->addWidget(m_networkChooser);
00062     layout()->addWidget(m_bluetoothChooser);
00063 
00064     load();
00065 
00066     connect(m_powerChooser, SIGNAL(changed(bool)),
00067              this, SLOT(slotChooserChanged(bool)));
00068     connect(m_networkChooser, SIGNAL(changed(bool)),
00069              this, SLOT(slotChooserChanged(bool)));
00070     connect(m_bluetoothChooser, SIGNAL(changed(bool)),
00071              this, SLOT(slotChooserChanged(bool)));
00072 
00073 }
00074 
00075 void KcmSolid::load()
00076 {
00077     m_powerChooser->load();
00078     m_networkChooser->load();
00079     m_bluetoothChooser->load();
00080 }
00081 
00082 void KcmSolid::save()
00083 {
00084     m_powerChooser->save();
00085     m_networkChooser->save();
00086     m_bluetoothChooser->save();
00087 }
00088 
00089 void KcmSolid::defaults()
00090 {
00091     m_powerChooser->defaults();
00092     m_networkChooser->defaults();
00093     m_bluetoothChooser->defaults();
00094 }
00095 
00096 void KcmSolid::slotChooserChanged(bool state)
00097 {
00098     if (state)
00099     {
00100         m_changedChooser++;
00101     }
00102     else
00103     {
00104         m_changedChooser--;
00105     }
00106 
00107 
00108     emit changed(m_changedChooser!= 0);
00109 }
00110 
00111 #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
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
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