• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

agenttypedialog.cpp

00001 /*
00002     Copyright (c) 2006 Tobias Koenig <tokoe@kde.org>
00003     Copyright (c) 2008 Omat Holding B.V. <info@omat.nl>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2.1 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 #include "agenttypedialog.h"
00020 #include "agentfilterproxymodel.h"
00021 
00022 #include <QObject>
00023 #include <QtGui/QVBoxLayout>
00024 
00025 #include <kdeversion.h>
00026 
00027 #if KDE_IS_VERSION(4,1,85)
00028 #include <kfilterproxysearchline.h>
00029 #endif
00030 
00031 using namespace Akonadi;
00032 
00033 
00034 class AgentTypeDialog::Private
00035 {
00036   public:
00037     AgentTypeWidget *Widget;
00038     AgentType agentType;
00039 };
00040 
00041 AgentTypeDialog::AgentTypeDialog( QWidget *parent )
00042       : KDialog( parent ), d( new Private )
00043 {
00044   setButtons( Ok | Cancel );
00045   QVBoxLayout *layout = new QVBoxLayout( mainWidget() );
00046 
00047   d->Widget = new Akonadi::AgentTypeWidget( mainWidget() );
00048   connect( d->Widget, SIGNAL( activated() ), this, SLOT( accept() ) );
00049 
00050 #if KDE_IS_VERSION(4,1,85)
00051   KFilterProxySearchLine* searchLine = new KFilterProxySearchLine( mainWidget() );
00052   layout->addWidget( searchLine );
00053   searchLine->setProxy( d->Widget->agentFilterProxyModel() );
00054 #endif
00055 
00056   layout->addWidget( d->Widget );
00057 
00058   connect( this, SIGNAL( okClicked() ), this, SLOT( accept() ) );
00059 
00060   resize( 460, 320 );
00061 }
00062 
00063 AgentTypeDialog::~AgentTypeDialog()
00064 {
00065   delete d;
00066 }
00067 
00068 void AgentTypeDialog::done( int result )
00069 {
00070   if ( result == Accepted )
00071     d->agentType = d->Widget->currentAgentType();
00072   else
00073     d->agentType = AgentType();
00074 
00075   KDialog::done( result );
00076 }
00077 
00078 AgentType AgentTypeDialog::agentType() const
00079 {
00080   return d->agentType;
00081 }
00082 
00083 AgentFilterProxyModel* AgentTypeDialog::agentFilterProxyModel() const
00084 {
00085   return d->Widget->agentFilterProxyModel();
00086 }
00087 
00088 #include "agenttypedialog.moc"

akonadi

Skip menu "akonadi"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7.1
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