• Skip to content
  • Skip to link menu
KDE 4.3 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   layout->setMargin(0);
00047 
00048   d->Widget = new Akonadi::AgentTypeWidget( mainWidget() );
00049   connect( d->Widget, SIGNAL( activated() ), this, SLOT( accept() ) );
00050 
00051 #if KDE_IS_VERSION(4,1,85)
00052   KFilterProxySearchLine* searchLine = new KFilterProxySearchLine( mainWidget() );
00053   layout->addWidget( searchLine );
00054   searchLine->setProxy( d->Widget->agentFilterProxyModel() );
00055 #endif
00056 
00057   layout->addWidget( d->Widget );
00058 
00059   connect( this, SIGNAL( okClicked() ), this, SLOT( accept() ) );
00060 
00061   resize( 460, 320 );
00062 }
00063 
00064 AgentTypeDialog::~AgentTypeDialog()
00065 {
00066   delete d;
00067 }
00068 
00069 void AgentTypeDialog::done( int result )
00070 {
00071   if ( result == Accepted )
00072     d->agentType = d->Widget->currentAgentType();
00073   else
00074     d->agentType = AgentType();
00075 
00076   KDialog::done( result );
00077 }
00078 
00079 AgentType AgentTypeDialog::agentType() const
00080 {
00081   return d->agentType;
00082 }
00083 
00084 AgentFilterProxyModel* AgentTypeDialog::agentFilterProxyModel() const
00085 {
00086   return d->Widget->agentFilterProxyModel();
00087 }
00088 
00089 #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
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.6.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