koeventview.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <qpopupmenu.h>
00025 #include <qcursor.h>
00026
00027 #include <klocale.h>
00028 #include <kdebug.h>
00029 #include <kiconloader.h>
00030 #include <kmessagebox.h>
00031
00032 #include <libkcal/calendar.h>
00033
00034 #include "calprinter.h"
00035
00036 #include "koeventview.h"
00037 using namespace KOrg;
00038 #include "koeventview.moc"
00039
00040 KOEventView::KOEventView(Calendar *cal,QWidget *parent,const char *name)
00041 : KOrg::BaseView(cal,parent,name)
00042 {
00043 }
00044
00045 KOEventView::~KOEventView()
00046 {
00047 }
00048
00049 KOEventPopupMenu *KOEventView::eventPopup()
00050 {
00051 KOEventPopupMenu *eventPopup = new KOEventPopupMenu;
00052
00053 connect (eventPopup,SIGNAL(editEventSignal(Event *)),
00054 SIGNAL(editEventSignal(Event *)));
00055 connect (eventPopup,SIGNAL(showEventSignal(Event *)),
00056 SIGNAL(showEventSignal(Event *)));
00057 connect (eventPopup,SIGNAL(deleteEventSignal(Event *)),
00058 SIGNAL(deleteEventSignal(Event *)));
00059
00060 return eventPopup;
00061 }
00062
00063 void KOEventView::showEventPopup(QPopupMenu *popup,Event *event)
00064 {
00065 mCurrentEvent = event;
00066 if (event) popup->popup(QCursor::pos());
00067 else kdDebug() << "KOEventView::showEventPopup(): No event selected" << endl;
00068 }
00069
00070 void KOEventView::popupShow()
00071 {
00072 emit showEventSignal(mCurrentEvent);
00073 }
00074
00075 void KOEventView::popupEdit()
00076 {
00077 emit editEventSignal(mCurrentEvent);
00078 }
00079
00080 void KOEventView::popupDelete()
00081 {
00082 emit deleteEventSignal(mCurrentEvent);
00083 }
00084
00085 void KOEventView::defaultAction( Incidence *incidence )
00086 {
00087 kdDebug() << "KOEventView::defaultAction()" << endl;
00088
00089 if ( !incidence ) return;
00090
00091 kdDebug() << " type: " << incidence->type() << endl;
00092
00093 if ( incidence->type() == "Event" ) {
00094 Event *event = static_cast<Event *>( incidence );
00095 if (event->isReadOnly()) emit showEventSignal(event);
00096 else emit editEventSignal(event);
00097 }
00098 }
00099
00100 #include "baseview.moc"
00101
This file is part of the documentation for kdelibs Version 3.1.4.