• Skip to content
  • Skip to link menu
KDE 4.4 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 #include <kfilterproxysearchline.h>
00028 
00029 using namespace Akonadi;
00030 
00031 
00032 class AgentTypeDialog::Private
00033 {
00034   public:
00035     AgentTypeWidget *Widget;
00036     AgentType agentType;
00037 };
00038 
00039 AgentTypeDialog::AgentTypeDialog( QWidget *parent )
00040       : KDialog( parent ), d( new Private )
00041 {
00042   setButtons( Ok | Cancel );
00043   QVBoxLayout *layout = new QVBoxLayout( mainWidget() );
00044   layout->setMargin(0);
00045 
00046   d->Widget = new Akonadi::AgentTypeWidget( mainWidget() );
00047   connect( d->Widget, SIGNAL( activated() ), this, SLOT( accept() ) );
00048 
00049   KFilterProxySearchLine* searchLine = new KFilterProxySearchLine( mainWidget() );
00050   layout->addWidget( searchLine );
00051   searchLine->setProxy( d->Widget->agentFilterProxyModel() );
00052 
00053   layout->addWidget( d->Widget );
00054 
00055   connect( this, SIGNAL( okClicked() ), this, SLOT( accept() ) );
00056 
00057   resize( 460, 320 );
00058 }
00059 
00060 AgentTypeDialog::~AgentTypeDialog()
00061 {
00062   delete d;
00063 }
00064 
00065 void AgentTypeDialog::done( int result )
00066 {
00067   if ( result == Accepted )
00068     d->agentType = d->Widget->currentAgentType();
00069   else
00070     d->agentType = AgentType();
00071 
00072   KDialog::done( result );
00073 }
00074 
00075 AgentType AgentTypeDialog::agentType() const
00076 {
00077   return d->agentType;
00078 }
00079 
00080 AgentFilterProxyModel* AgentTypeDialog::agentFilterProxyModel() const
00081 {
00082   return d->Widget->agentFilterProxyModel();
00083 }
00084 
00085 #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
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.6.2-20100208
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