summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-09 21:22:38 (UTC)
committer zautrix <zautrix>2004-09-09 21:22:38 (UTC)
commit10eb314475b75a162582e8138d465890dbd21806 (patch) (unidiff)
tree9045f8a02113eedf2f2c59d239e4e43b41c2cdc5
parent5b0e3c87bbe32aacd51f6faff5446ed3838a68e0 (diff)
downloadkdepimpi-10eb314475b75a162582e8138d465890dbd21806.zip
kdepimpi-10eb314475b75a162582e8138d465890dbd21806.tar.gz
kdepimpi-10eb314475b75a162582e8138d465890dbd21806.tar.bz2
Fixed closing of event viewer
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp1
-rw-r--r--korganizer/koeventviewerdialog.cpp1
2 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index d34e6a9..948047a 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -49,97 +49,96 @@
49#ifndef KORG_NOKABC 49#ifndef KORG_NOKABC
50#include <kabc/stdaddressbook.h> 50#include <kabc/stdaddressbook.h>
51#define size count 51#define size count
52#endif 52#endif
53 53
54#ifdef DESKTOP_VERSION 54#ifdef DESKTOP_VERSION
55#include <kabc/addresseedialog.h> 55#include <kabc/addresseedialog.h>
56#else //DESKTOP_VERSION 56#else //DESKTOP_VERSION
57#include <externalapphandler.h> 57#include <externalapphandler.h>
58#include <qtopia/qcopenvelope_qws.h> 58#include <qtopia/qcopenvelope_qws.h>
59#endif //DESKTOP_VERSION 59#endif //DESKTOP_VERSION
60 60
61KOEventViewer::KOEventViewer(QWidget *parent,const char *name) 61KOEventViewer::KOEventViewer(QWidget *parent,const char *name)
62 : QTextBrowser(parent,name) 62 : QTextBrowser(parent,name)
63{ 63{
64 mSyncMode = false; 64 mSyncMode = false;
65 mColorMode = 0; 65 mColorMode = 0;
66} 66}
67 67
68KOEventViewer::~KOEventViewer() 68KOEventViewer::~KOEventViewer()
69{ 69{
70} 70}
71 71
72void KOEventViewer::setSource(const QString& n) 72void KOEventViewer::setSource(const QString& n)
73{ 73{
74 74
75 if ( n.left(3) == "uid" ) 75 if ( n.left(3) == "uid" )
76#ifdef DESKTOP_VERSION 76#ifdef DESKTOP_VERSION
77 { 77 {
78 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 78 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
79 KABC::AddressBook::Iterator it; 79 KABC::AddressBook::Iterator it;
80 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 80 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
81 // LR I do not understand, why the uid string is different on zaurus and desktop 81 // LR I do not understand, why the uid string is different on zaurus and desktop
82 QString uid = "uid://"+(*it).uid(); 82 QString uid = "uid://"+(*it).uid();
83 83
84 //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); 84 //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1());
85 if (n == uid ) { 85 if (n == uid ) {
86 //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); 86 //qDebug("found %s ",(*it).mobileHomePhone().latin1() );
87 QDialog dia( this,"dia123", true ); 87 QDialog dia( this,"dia123", true );
88 dia.setCaption( i18n("Details of attendee") ); 88 dia.setCaption( i18n("Details of attendee") );
89 QVBoxLayout lay ( &dia ); 89 QVBoxLayout lay ( &dia );
90 KPIM::AddresseeView av ( &dia ); 90 KPIM::AddresseeView av ( &dia );
91 av.setAddressee( (*it) ); 91 av.setAddressee( (*it) );
92 lay.addWidget( &av ); 92 lay.addWidget( &av );
93 if ( QApplication::desktop()->width() < 480 ) 93 if ( QApplication::desktop()->width() < 480 )
94 dia.resize( 220, 240); 94 dia.resize( 220, 240);
95 else { 95 else {
96 dia.resize( 400,400); 96 dia.resize( 400,400);
97
98 } 97 }
99 dia.exec(); 98 dia.exec();
100 break; 99 break;
101 } 100 }
102 } 101 }
103 return; 102 return;
104 } 103 }
105#else 104#else
106 { 105 {
107 if ( "uid:organizer" == n ) { 106 if ( "uid:organizer" == n ) {
108 ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); 107 ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),"");
109 return; 108 return;
110 } 109 }
111 QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); 110 QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
112 if (attendees.count()) { 111 if (attendees.count()) {
113 Attendee *a; 112 Attendee *a;
114 for(a=attendees.first();a;a=attendees.next()) { 113 for(a=attendees.first();a;a=attendees.next()) {
115 if ( "uid:"+a->uid() == n ) { 114 if ( "uid:"+a->uid() == n ) {
116 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); 115 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid());
117 return; 116 return;
118 } 117 }
119 } 118 }
120 } 119 }
121 return; 120 return;
122 } 121 }
123 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 122 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
124 // the result should now arrive through method insertAttendees 123 // the result should now arrive through method insertAttendees
125 //QString uid = "uid:"+(*it).uid(); 124 //QString uid = "uid:"+(*it).uid();
126#endif 125#endif
127 if ( n.left(6) == "mailto" ) { 126 if ( n.left(6) == "mailto" ) {
128 // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); 127 // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1());
129#ifndef DESKTOP_VERSION 128#ifndef DESKTOP_VERSION
130 QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); 129 QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" );
131 e << n.mid(7); 130 e << n.mid(7);
132#endif 131#endif
133 132
134 } 133 }
135 134
136 135
137#ifndef KORG_NODCOP 136#ifndef KORG_NODCOP
138 kdDebug() << "KOEventViewer::setSource(): " << n << endl; 137 kdDebug() << "KOEventViewer::setSource(): " << n << endl;
139 QString tmpStr; 138 QString tmpStr;
140 if (n.startsWith("mailto:")) { 139 if (n.startsWith("mailto:")) {
141 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); 140 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null);
142 //emit showIncidence(n); 141 //emit showIncidence(n);
143 return; 142 return;
144 } else if (n.startsWith("uid:")) { 143 } else if (n.startsWith("uid:")) {
145 DCOPClient *client = KApplication::kApplication()->dcopClient(); 144 DCOPClient *client = KApplication::kApplication()->dcopClient();
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index be183eb..68c0e1a 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -182,58 +182,59 @@ void KOEventViewerDialog::editIncidence()
182 hide(); 182 hide();
183#endif 183#endif
184 emit editIncidence( mIncidence ); 184 emit editIncidence( mIncidence );
185 } 185 }
186} 186}
187void KOEventViewerDialog::showIncidence() 187void KOEventViewerDialog::showIncidence()
188{ 188{
189 189
190 if ( mSyncMode ) { 190 if ( mSyncMode ) {
191 mSyncResult = 1; 191 mSyncResult = 1;
192 accept(); 192 accept();
193 return; 193 return;
194 } 194 }
195 195
196 if ( mIncidence ){ 196 if ( mIncidence ){
197#ifndef DESKTOP_VERSION 197#ifndef DESKTOP_VERSION
198 hide(); 198 hide();
199#endif 199#endif
200 QDate date; 200 QDate date;
201 if ( mIncidence->type() == "Todo" ) { 201 if ( mIncidence->type() == "Todo" ) {
202 if ( ((Todo*)mIncidence)->hasDueDate() ) 202 if ( ((Todo*)mIncidence)->hasDueDate() )
203 date = ((Todo*)mIncidence)->dtDue().date(); 203 date = ((Todo*)mIncidence)->dtDue().date();
204 else { 204 else {
205 globalFlagBlockAgenda = 2; 205 globalFlagBlockAgenda = 2;
206 emit showAgendaView( false ); 206 emit showAgendaView( false );
207 return; 207 return;
208 } 208 }
209 } else 209 } else
210 date = mIncidence->dtStart().date(); 210 date = mIncidence->dtStart().date();
211 globalFlagBlockAgenda = 1; 211 globalFlagBlockAgenda = 1;
212 emit showAgendaView( false ); 212 emit showAgendaView( false );
213 globalFlagBlockAgenda = 2; 213 globalFlagBlockAgenda = 2;
214 emit jumpToTime( date ); 214 emit jumpToTime( date );
215 } 215 }
216} 216}
217void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) 217void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
218{ 218{
219 switch ( e->key() ) { 219 switch ( e->key() ) {
220 220
221 case Qt::Key_A : 221 case Qt::Key_A :
222 case Qt::Key_L : 222 case Qt::Key_L :
223 showIncidence(); 223 showIncidence();
224 break; 224 break;
225 case Qt::Key_E : 225 case Qt::Key_E :
226 case Qt::Key_R : 226 case Qt::Key_R :
227 editIncidence(); 227 editIncidence();
228 break; 228 break;
229 case Qt::Key_C: 229 case Qt::Key_C:
230 case Qt::Key_Escape:
230 close(); 231 close();
231 break; 232 break;
232 case Qt::Key_I: 233 case Qt::Key_I:
233 accept(); 234 accept();
234 break; 235 break;
235 default: 236 default:
236 break; 237 break;
237 } 238 }
238 239
239} 240}