2 This file is part of kdepim.
4 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #include "confirmsavedialog.h"
23 #include <klistview.h>
32 ConfirmSaveDialog::ConfirmSaveDialog( const QString
&destination
,
33 QWidget
*parent
, const char *name
)
34 : KDialogBase( parent
, name
, true, i18n("Confirm Save"), Ok
| Cancel
)
36 QFrame
*topFrame
= makeMainWidget();
38 QBoxLayout
*topLayout
= new QVBoxLayout( topFrame
);
39 topLayout
->setSpacing( spacingHint() );
41 QLabel
*label
= new QLabel(
42 i18n("You have requested to save the following objects to '%1':")
43 .arg( destination
), topFrame
);
44 topLayout
->addWidget( label
);
46 mListView
= new KListView( 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
);
54 void ConfirmSaveDialog::addIncidences( const Incidence::List
&incidences
,
55 const QString
&operation
)
57 Incidence::List::ConstIterator it
;
58 for( it
= incidences
.begin(); it
!= incidences
.end(); ++it
) {
60 KListViewItem
*item
= new KListViewItem( mListView
);
61 item
->setText( 0, operation
);
62 item
->setText( 1, i
->type() );
63 item
->setText( 2, i
->summary() );
64 item
->setText( 3, i
->uid() );