• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • akonadi
agenttypedialog.cpp
1 /*
2  Copyright (c) 2006 Tobias Koenig <tokoe@kde.org>
3  Copyright (c) 2008 Omat Holding B.V. <info@omat.nl>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #include "agenttypedialog.h"
20 #include "agentfilterproxymodel.h"
21 
22 #include <QObject>
23 #include <QVBoxLayout>
24 
25 #include <kdeversion.h>
26 
27 #include <kfilterproxysearchline.h>
28 #include <klineedit.h>
29 
30 using namespace Akonadi;
31 
32 
33 class AgentTypeDialog::Private
34 {
35  public:
36  AgentTypeWidget *Widget;
37  AgentType agentType;
38 };
39 
40 AgentTypeDialog::AgentTypeDialog( QWidget *parent )
41  : KDialog( parent ), d( new Private )
42 {
43  setButtons( Ok | Cancel );
44  QVBoxLayout *layout = new QVBoxLayout( mainWidget() );
45  layout->setMargin( 0 );
46 
47  d->Widget = new Akonadi::AgentTypeWidget( mainWidget() );
48  connect( d->Widget, SIGNAL(activated()), this, SLOT(accept()) );
49 
50  KFilterProxySearchLine* searchLine = new KFilterProxySearchLine( mainWidget() );
51  layout->addWidget( searchLine );
52  searchLine->setProxy( d->Widget->agentFilterProxyModel() );
53 
54  layout->addWidget( d->Widget );
55 
56  connect( this, SIGNAL(okClicked()), this, SLOT(accept()) );
57 
58  resize( 460, 320 );
59 
60  searchLine->lineEdit()->setFocus();
61 }
62 
63 AgentTypeDialog::~AgentTypeDialog()
64 {
65  delete d;
66 }
67 
68 void AgentTypeDialog::done( int result )
69 {
70  if ( result == Accepted ) {
71  d->agentType = d->Widget->currentAgentType();
72  } else {
73  d->agentType = AgentType();
74  }
75 
76  KDialog::done( result );
77 }
78 
79 AgentType AgentTypeDialog::agentType() const
80 {
81  return d->agentType;
82 }
83 
84 AgentFilterProxyModel* AgentTypeDialog::agentFilterProxyModel() const
85 {
86  return d->Widget->agentFilterProxyModel();
87 }
88 
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:31 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

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

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal