Allow specializations to decide when re-indexing is necessary.
[kdepim.git] / incidenceeditor-ng / incidenceattachmenteditor.cpp
blob1f66348e82027d7dd33c73a9a0949cff244a51df
1 /*
2 Copyright (C) 2010 Bertjan Broeksema b.broeksema@home.nl
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "incidenceattachmenteditor.h"
22 #include <QtCore/QPointer>
24 #include "attachmenticonview.h"
25 #include "ui_incidenceattachmenteditor.h"
27 using namespace IncidenceEditorsNG;
29 IncidenceAttachmentEditor::IncidenceAttachmentEditor( QWidget *parent )
30 : IncidenceEditor( parent )
31 , mUi( new Ui::IncidenceAttachmentEditor )
33 mUi->setupUi( this );
34 mUi->mAddButton->setIcon( KIcon( "list-add" ) );
35 mUi->mRemoveButton->setIcon( KIcon( "list-remove" ) );
37 setupAttachmentIconView();
39 connect( mUi->mAddButton, SIGNAL(clicked()), SLOT(slotAddAttachment()) );
40 connect( mUi->mRemoveButton, SIGNAL(clicked()), SLOT(slotRemoveAttachment()) );
43 void IncidenceAttachmentEditor::load( KCal::Incidence::ConstPtr incidence )
48 void IncidenceAttachmentEditor::save( KCal::Incidence::Ptr incidence )
53 bool IncidenceAttachmentEditor::isDirty() const
55 return false;
58 void IncidenceAttachmentEditor::slotAddAttachment()
60 // //AttachmentIconItem *item = new AttachmentIconItem( 0, mAttachments );
61 //
62 // QPointer<AttachmentEditDialog> dlg = new AttachmentEditDialog( mAttachmentView );
63 // dlg->setCaption( i18nc( "@title", "Add Attachment" ) );
64 // if ( dlg->exec() == KDialog::Rejected ) {
65 // delete item;
66 // }
67 // delete dlg;
70 void IncidenceAttachmentEditor::slotRemoveAttachment()
75 void IncidenceAttachmentEditor::setupAttachmentIconView()
77 mAttachmentView = new AttachmentIconView( this );
78 mAttachmentView->setWhatsThis( i18nc( "@info:whatsthis",
79 "Displays items (files, mail, etc.) that "
80 "have been associated with this event or to-do." ) );
82 QGridLayout *layout = new QGridLayout( mUi->mAttachmentViewPlaceHolder );
83 layout->addWidget( mAttachmentView );