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

KCal Library

  • 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 <klocale.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  {}
43  QTreeWidget *mListView;
44 };
45 //@endcond
46 
47 ConfirmSaveDialog::ConfirmSaveDialog( const QString &destination,
48  QWidget *parent )
49  : KDialog( parent ), d( new KCal::ConfirmSaveDialog::Private )
50 {
51  setCaption( i18n( "Confirm Save" ) );
52  setModal( true );
53  setButtons( Ok | Cancel );
54  setDefaultButton( Ok );
55  QFrame *topFrame = new QFrame( this );
56  setMainWidget( topFrame );
57 
58  QBoxLayout *topLayout = new QVBoxLayout( topFrame );
59 
60  QLabel *label = new QLabel(
61  i18n( "You have requested to save the following objects to '%1':",
62  destination ), topFrame );
63  topLayout->addWidget( label );
64 
65  QStringList headers;
66  headers << i18n( "Operation" )
67  << i18n( "Type" )
68  << i18n( "Summary" )
69  << i18n( "UID" );
70 
71  d->mListView = new QTreeWidget( topFrame );
72  d->mListView->setColumnCount( 4 );
73  d->mListView->setHeaderLabels( headers );
74 
75  topLayout->addWidget( d->mListView );
76 }
77 
78 ConfirmSaveDialog::~ConfirmSaveDialog()
79 {
80  delete d;
81 }
82 
83 void ConfirmSaveDialog::addIncidences( const Incidence::List &incidences,
84  const QString &operation )
85 {
86  Incidence::List::ConstIterator it;
87  for ( it = incidences.begin(); it != incidences.end(); ++it ) {
88  Incidence *i = *it;
89  QTreeWidgetItem *item = new QTreeWidgetItem( d->mListView );
90  item->setText( 0, operation );
91  item->setText( 1, i->type() );
92  item->setText( 2, i->summary() );
93  item->setText( 3, i->uid() );
94  }
95 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Fri Mar 8 2013 21:51:50 by doxygen 1.8.3.1 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
  • Related Pages

kdepimlibs-4.10.0 API Reference

Skip menu "kdepimlibs-4.10.0 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