libkcal
confirmsavedialog.cppGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "confirmsavedialog.h"
00022
00023 #include <klistview.h>
00024 #include <klocale.h>
00025
00026 #include <qlayout.h>
00027 #include <qframe.h>
00028 #include <qlabel.h>
00029
00030 using namespace KCal;
00031
00032 ConfirmSaveDialog::ConfirmSaveDialog( const QString &destination,
00033 QWidget *parent, const char *name )
00034 : KDialogBase( parent, name, true, i18n("Confirm Save"), Ok | Cancel )
00035 {
00036 QFrame *topFrame = makeMainWidget();
00037
00038 QBoxLayout *topLayout = new QVBoxLayout( topFrame );
00039 topLayout->setSpacing( spacingHint() );
00040
00041 QLabel *label = new QLabel(
00042 i18n("You have requested to save the following objects to '%1':")
00043 .arg( destination ), topFrame );
00044 topLayout->addWidget( label );
00045
00046 mListView = new KListView( topFrame );
00047 mListView->addColumn( i18n("Operation") );
00048 mListView->addColumn( i18n("Type") );
00049 mListView->addColumn( i18n("Summary") );
00050 mListView->addColumn( i18n("UID") );
00051 topLayout->addWidget( mListView );
00052 }
00053
00054 void ConfirmSaveDialog::addIncidences( const Incidence::List &incidences,
00055 const QString &operation )
00056 {
00057 Incidence::List::ConstIterator it;
00058 for( it = incidences.begin(); it != incidences.end(); ++it ) {
00059 Incidence *i = *it;
00060 KListViewItem *item = new KListViewItem( mListView );
00061 item->setText( 0, operation );
00062 item->setText( 1, i->type() );
00063 item->setText( 2, i->summary() );
00064 item->setText( 3, i->uid() );
00065 }
00066 }
|