pluginpage.cpp

00001 /*  This file is part of the KDE project
00002     Copyright (C) 2003 Matthias Kretz <kretz@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 version 2 as published by the Free Software Foundation.
00007 
00008     This library is distributed in the hope that it will be useful,
00009     but WITHOUT ANY WARRANTY; without even the implied warranty of
00010     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011     Library General Public License for more details.
00012 
00013     You should have received a copy of the GNU Library General Public License
00014     along with this library; see the file COPYING.LIB.  If not, write to
00015     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016     Boston, MA 02110-1301, USA.
00017 
00018 */
00019 
00020 #include "ksettings/pluginpage.h"
00021 #include "kpluginselector.h"
00022 #include <qlayout.h>
00023 #include <kdialog.h>
00024 #include "ksettings/dispatcher.h"
00025 
00026 namespace KSettings
00027 {
00028 
00029 class PluginPage::PluginPagePrivate
00030 {
00031     public:
00032         PluginPagePrivate()
00033             : selwid( 0 )
00034         {
00035         }
00036 
00037         KPluginSelector * selwid;
00038 };
00039 
00040     PluginPage::PluginPage( QWidget * parent, const char * name, const QStringList & args )
00041     : KCModule( parent, name, args )
00042     , d( new PluginPagePrivate )
00043 {
00044     ( new QVBoxLayout( this, 0, KDialog::spacingHint() ) )->setAutoAdd( true );
00045     d->selwid = new KPluginSelector( this );
00046     connect( d->selwid, SIGNAL( changed( bool ) ), this, SIGNAL( changed( bool ) ) );
00047 }
00048 
00049     PluginPage::PluginPage( KInstance * instance, QWidget * parent, const QStringList & args )
00050     : KCModule( instance, parent, args )
00051     , d( new PluginPagePrivate )
00052 {
00053     ( new QVBoxLayout( this, 0, KDialog::spacingHint() ) )->setAutoAdd( true );
00054     d->selwid = new KPluginSelector( this );
00055     connect( d->selwid, SIGNAL( changed( bool ) ), this, SIGNAL( changed( bool ) ) );
00056     connect( d->selwid, SIGNAL( configCommitted( const QCString & ) ),
00057             Dispatcher::self(), SLOT( reparseConfiguration( const QCString & ) ) );
00058 }
00059 
00060 PluginPage::~PluginPage()
00061 {
00062     delete d;
00063 }
00064 
00065 KPluginSelector * PluginPage::pluginSelector()
00066 {
00067     return d->selwid;
00068 }
00069 
00070 void PluginPage::load()
00071 {
00072     d->selwid->load();
00073 }
00074 
00075 void PluginPage::save()
00076 {
00077     d->selwid->save();
00078 }
00079 
00080 void PluginPage::defaults()
00081 {
00082     d->selwid->defaults();
00083 }
00084 
00085 } //namespace
00086 
00087 #include "pluginpage.moc"
00088 // vim: sw=4 sts=4 et
KDE Home | KDE Accessibility Home | Description of Access Keys