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

KCal Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kcal
confirmsavedialog.cpp
1 /*
2  This file is part of the kcal library.
3 
4  Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #include "confirmsavedialog.h"
23 
24 #include <klocalizedstring.h>
25 
26 #include <QBoxLayout>
27 #include <QLabel>
28 #include <QVBoxLayout>
29 #include <QTreeWidget>
30 
31 using namespace KCal;
32 
37 //@cond PRIVATE
38 class KCal::ConfirmSaveDialog::Private
39 {
40  public:
41  Private()
42  : mListView( 0 )
43  {}
44  QTreeWidget *mListView;
45 };
46 //@endcond
47 
48 ConfirmSaveDialog::ConfirmSaveDialog( const QString &destination,
49  QWidget *parent )
50  : KDialog( parent ), d( new KCal::ConfirmSaveDialog::Private )
51 {
52  setCaption( i18n( "Confirm Save" ) );
53  setModal( true );
54  setButtons( Ok | Cancel );
55  setDefaultButton( Ok );
56  QFrame *topFrame = new QFrame( this );
57  setMainWidget( topFrame );
58 
59  QBoxLayout *topLayout = new QVBoxLayout( topFrame );
60 
61  QLabel *label = new QLabel(
62  i18n( "You have requested to save the following objects to '%1':",
63  destination ), topFrame );
64  topLayout->addWidget( label );
65 
66  QStringList headers;
67  headers << i18n( "Operation" )
68  << i18n( "Type" )
69  << i18n( "Summary" )
70  << i18n( "UID" );
71 
72  d->mListView = new QTreeWidget( topFrame );
73  d->mListView->setColumnCount( 4 );
74  d->mListView->setHeaderLabels( headers );
75 
76  topLayout->addWidget( d->mListView );
77 }
78 
79 ConfirmSaveDialog::~ConfirmSaveDialog()
80 {
81  delete d;
82 }
83 
84 void ConfirmSaveDialog::addIncidences( const Incidence::List &incidences,
85  const QString &operation )
86 {
87  Incidence::List::ConstIterator it;
88  for ( it = incidences.begin(); it != incidences.end(); ++it ) {
89  Incidence *i = *it;
90  QTreeWidgetItem *item = new QTreeWidgetItem( d->mListView );
91  item->setText( 0, operation );
92  item->setText( 1, i->type() );
93  item->setText( 2, i->summary() );
94  item->setText( 3, i->uid() );
95  }
96 }
KCal::IncidenceBase::uid
QString uid() const
Returns the unique id (uid) for the incidence.
Definition: incidencebase.cpp:184
KCal::IncidenceBase::type
virtual QByteArray type() const =0
Prints the type of Incidence as a string.
KCal::Incidence
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:68
KCal::ListBase
This class provides a template for lists of pointers.
Definition: listbase.h:44
KCal::Incidence::summary
QString summary() const
Returns the incidence summary.
Definition: incidence.cpp:424
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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