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 #include <kxmlguiclient.h>
00032 #include <kxmlguifactory.h>
00033
00034 #include <libkcal/calendar.h>
00035
00036
00037 #include "kocore.h"
00038 #include "koeventview.h"
00039 #include "koeventpopupmenu.h"
00040
00041 using namespace KOrg;
00042 #include "koeventview.moc"
00043
00044
00045
00046 KOEventView::KOEventView(Calendar *cal,QWidget *parent,const char *name)
00047 : KOrg::BaseView(cal,parent,name)
00048 {
00049 }
00050
00051
00052
00053 KOEventView::~KOEventView()
00054 {
00055 }
00056
00057
00058
00059 KOEventPopupMenu *KOEventView::eventPopup()
00060 {
00061 KOEventPopupMenu *eventPopup = new KOEventPopupMenu;
00062
00063 connect(eventPopup,SIGNAL(editIncidenceSignal(Incidence *)),
00064 SIGNAL(editIncidenceSignal(Incidence *)));
00065 connect(eventPopup,SIGNAL(showIncidenceSignal(Incidence *)),
00066 SIGNAL(showIncidenceSignal(Incidence *)));
00067 connect(eventPopup,SIGNAL(deleteIncidenceSignal(Incidence *)),
00068 SIGNAL(deleteIncidenceSignal(Incidence *)));
00069 connect(eventPopup,SIGNAL(toggleAlarmSignal(Incidence *)),
00070 SIGNAL(toggleAlarmSignal(Incidence*)));
00071
00072 return eventPopup;
00073 }
00074
00075 QPopupMenu *KOEventView::newEventPopup()
00076 {
00077 KXMLGUIClient *client = KOCore::self()->xmlguiClient();
00078 if ( !client ) {
00079 kdError() << "KOEventView::newEventPopup(): no xmlGuiClient." << endl;
00080 return 0;
00081 }
00082 if ( !client->factory() ) {
00083 kdError() << "KOEventView::newEventPopup(): no factory" << endl;
00084 return 0;
00085 }
00086
00087 return static_cast<QPopupMenu*>
00088 ( client->factory()->container( "rmb_selection_popup", client ) );
00089 }
00090
00091
00092 void KOEventView::popupShow()
00093 {
00094 emit showIncidenceSignal(mCurrentIncidence);
00095 }
00096
00097
00098
00099 void KOEventView::popupEdit()
00100 {
00101 emit editIncidenceSignal(mCurrentIncidence);
00102 }
00103
00104
00105
00106 void KOEventView::popupDelete()
00107 {
00108 emit deleteIncidenceSignal(mCurrentIncidence);
00109 }
00110
00111
00112
00113 void KOEventView::showNewEventPopup()
00114 {
00115 QPopupMenu *popup = newEventPopup();
00116 if ( !popup ) {
00117 kdError() << "KOEventView::showNewEventPopup(): popup creation failed"
00118 << endl;
00119 return;
00120 }
00121
00122 popup->popup( QCursor::pos() );
00123 }
00124
00125
00126
00127 void KOEventView::defaultAction( Incidence *incidence )
00128 {
00129 kdDebug(5850) << "KOEventView::defaultAction()" << endl;
00130
00131 if ( !incidence ) return;
00132
00133 kdDebug(5850) << " type: " << incidence->type() << endl;
00134
00135 if ( incidence->isReadOnly() )
00136 emit showIncidenceSignal(incidence);
00137 else
00138 emit editIncidenceSignal(incidence);
00139 }
00140
00141
00142
00143 #include "baseview.moc"
00144
This file is part of the documentation for korganizer Library Version 3.3.2.