• Skip to content
  • Skip to link menu
KDE 4.8 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • 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 #include <klineedit.h>
00029 
00030 using namespace Akonadi;
00031 
00032 
00033 class AgentTypeDialog::Private
00034 {
00035   public:
00036     AgentTypeWidget *Widget;
00037     AgentType agentType;
00038 };
00039 
00040 AgentTypeDialog::AgentTypeDialog( QWidget *parent )
00041       : KDialog( parent ), d( new Private )
00042 {
00043   setButtons( Ok | Cancel );
00044   QVBoxLayout *layout = new QVBoxLayout( mainWidget() );
00045   layout->setMargin(0);
00046 
00047   d->Widget = new Akonadi::AgentTypeWidget( mainWidget() );
00048   connect( d->Widget, SIGNAL(activated()), this, SLOT(accept()) );
00049 
00050   KFilterProxySearchLine* searchLine = new KFilterProxySearchLine( mainWidget() );
00051   layout->addWidget( searchLine );
00052   searchLine->setProxy( d->Widget->agentFilterProxyModel() );
00053 
00054   layout->addWidget( d->Widget );
00055 
00056   connect( this, SIGNAL(okClicked()), this, SLOT(accept()) );
00057 
00058   resize( 460, 320 );
00059 
00060   searchLine->lineEdit()->setFocus();
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
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.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