libkcal

confirmsavedialog.cpp
1/*
2 This file is part of libkcal.
3
4 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program 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
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19*/
20
21#include "confirmsavedialog.h"
22
23#include <tdelistview.h>
24#include <tdelocale.h>
25
26#include <tqlayout.h>
27#include <tqframe.h>
28#include <tqlabel.h>
29
30using namespace KCal;
31
32ConfirmSaveDialog::ConfirmSaveDialog( const TQString &destination,
33 TQWidget *parent, const char *name )
34 : KDialogBase( parent, name, true, i18n("Confirm Save"), Ok | Cancel )
35{
36 TQFrame *topFrame = makeMainWidget();
37
38 TQBoxLayout *topLayout = new TQVBoxLayout( topFrame );
39 topLayout->setSpacing( spacingHint() );
40
41 TQLabel *label = new TQLabel(
42 i18n("You have requested to save the following objects to '%1':")
43 .arg( destination ), topFrame );
44 topLayout->addWidget( label );
45
46 mListView = new TDEListView( topFrame );
47 mListView->addColumn( i18n("Operation") );
48 mListView->addColumn( i18n("Type") );
49 mListView->addColumn( i18n("Summary") );
50 mListView->addColumn( i18n("UID") );
51 topLayout->addWidget( mListView );
52}
53
54void ConfirmSaveDialog::addIncidences( const Incidence::List &incidences,
55 const TQString &operation )
56{
57 Incidence::List::ConstIterator it;
58 for( it = incidences.begin(); it != incidences.end(); ++it ) {
59 Incidence *i = *it;
60 TDEListViewItem *item = new TDEListViewItem( mListView );
61 item->setText( 0, operation );
62 item->setText( 1, i->type() );
63 item->setText( 2, i->summary() );
64 item->setText( 3, i->uid() );
65 }
66}
TQString uid() const
Return the unique id for the event.
This class provides the base class common to all calendar components.
Definition: incidence.h:48
TQString summary() const
Return short summary.
Definition: incidence.cpp:293
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition: alarm.h:38