32 #include <calendarsupport/archivedialog.h>
33 #include <calendarsupport/categoryconfig.h>
34 #include <calendarsupport/utils.h>
36 #include <incidenceeditor-ng/categoryeditdialog.h>
37 #include <incidenceeditor-ng/incidencedialog.h>
38 #include <incidenceeditor-ng/incidencedialogfactory.h>
40 #include <Akonadi/Item>
41 #include <Akonadi/TagManagementDialog>
43 #include <KCalCore/Visitor>
45 #include <KCMultiDialog>
51 class KODialogManager::DialogManagerVisitor :
public KCalCore::Visitor
54 DialogManagerVisitor() : mDialogManager( 0 ) {}
56 bool act( KCalCore::IncidenceBase::Ptr incidence,
KODialogManager *manager )
58 mDialogManager = manager;
59 return incidence->accept( *
this, incidence );
67 :
QObject(), mMainView( mainView )
72 mFilterEditDialog = 0;
73 mCategoryEditDialog = 0;
78 delete mOptionsDialog;
80 delete mArchiveDialog;
81 delete mFilterEditDialog;
82 delete mCategoryEditDialog;
87 if ( !mOptionsDialog ) {
88 mOptionsDialog =
new KCMultiDialog( mMainView );
104 for ( mit = modules.
begin(); mit != modules.
end(); ++mit ) {
105 mOptionsDialog->addModule( *mit );
109 mOptionsDialog->show();
110 mOptionsDialog->raise();
115 createCategoryEditor();
116 mCategoryEditDialog->exec();
121 if ( !mSearchDialog ) {
124 connect( mSearchDialog, SIGNAL(showIncidenceSignal(Akonadi::Item)),
125 mMainView, SLOT(showIncidence(Akonadi::Item)) );
126 connect( mSearchDialog, SIGNAL(editIncidenceSignal(Akonadi::Item)),
127 mMainView, SLOT(editIncidence(Akonadi::Item)) );
128 connect( mSearchDialog, SIGNAL(deleteIncidenceSignal(Akonadi::Item)),
129 mMainView, SLOT(deleteIncidence(Akonadi::Item)) );
132 mSearchDialog->show();
133 mSearchDialog->raise();
138 if ( !mArchiveDialog ) {
141 connect( mArchiveDialog, SIGNAL(eventsDeleted()),
142 mMainView, SLOT(updateView()) );
143 connect( mArchiveDialog, SIGNAL(autoArchivingSettingsModified()),
144 mMainView, SLOT(slotAutoArchivingSettingsModified()) );
146 mArchiveDialog->show();
147 mArchiveDialog->raise();
155 createCategoryEditor();
156 if ( !mFilterEditDialog ) {
158 connect( mFilterEditDialog, SIGNAL(filterChanged()),
159 mMainView, SLOT(updateFilter()) );
160 connect( mFilterEditDialog, SIGNAL(editCategories()),
161 mCategoryEditDialog, SLOT(show()) );
163 connect( mCategoryEditDialog, SIGNAL(categoryConfigChanged()),
164 mFilterEditDialog, SLOT(updateCategoryConfig()) );
167 mFilterEditDialog->show();
168 mFilterEditDialog->raise();
173 const KCalCore::Incidence::Ptr incidence = CalendarSupport::incidence( item );
178 IncidenceEditorNG::IncidenceDialog *dialog =
179 IncidenceEditorNG::IncidenceDialogFactory::create(
189 if ( dialog && view ) {
196 createCategoryEditor();
197 connect( editor, SIGNAL(deleteIncidenceSignal(Akonadi::Item)),
198 mMainView, SLOT(deleteIncidence(Akonadi::Item)) );
200 connect( editor, SIGNAL(dialogClose(Akonadi::Item)),
201 mMainView, SLOT(dialogClosing(Akonadi::Item)) );
202 connect( editor, SIGNAL(deleteAttendee(Akonadi::Item)),
203 mMainView, SIGNAL(cancelAttendees(Akonadi::Item)) );
208 if ( mSearchDialog ) {
213 void KODialogManager::createCategoryEditor()
215 if ( mCategoryEditDialog == 0 ) {
216 mCategoryEditDialog =
new Akonadi::TagManagementDialog(mMainView);
218 mCategoryEditDialog->setModal(
true );
void connectTypeAhead(IncidenceEditorNG::IncidenceDialog *editor, KOEventView *view)
virtual Akonadi::IncidenceChanger * incidenceChanger() const
virtual void setTypeAheadReceiver(QObject *o)
This is the class to add/edit a calendar filter.
IncidenceEditorNG::IncidenceDialog * createDialog(const Akonadi::Item &item)
KOEventView is the abstract base class from which all other calendar views for event data are derived...
void showFilterEditDialog(QList< KCalCore::CalFilter * > *filters)
void showCategoryEditDialog()
void append(const T &value)
This is the main calendar widget.
Akonadi::ETMCalendar::Ptr calendar() const
KODialogManager(CalendarView *)
void restoreOverrideCursor()
void updateSearchDialog()
virtual ~KODialogManager()
void connectEditor(IncidenceEditorNG::IncidenceDialog *editor)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
This class manages the dialogs used by the calendar view.