summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewerdialog.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 0763825..2e936f3 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -199,97 +199,99 @@ void KOEventViewerDialog::setJournal(Journal *j)
199 //findButton( Close )->setFocus(); 199 //findButton( Close )->setFocus();
200 if ( !mSyncMode ) { 200 if ( !mSyncMode ) {
201 findButton( User1 )->setText( i18n("Agenda")); 201 findButton( User1 )->setText( i18n("Agenda"));
202 } 202 }
203} 203}
204 204
205void KOEventViewerDialog::addText(QString text) 205void KOEventViewerDialog::addText(QString text)
206{ 206{
207 mEventViewer->addText(text); 207 mEventViewer->addText(text);
208 mEventViewer->setFocus(); 208 mEventViewer->setFocus();
209 //findButton( Close )->setFocus(); 209 //findButton( Close )->setFocus();
210} 210}
211void KOEventViewerDialog::editIncidence() 211void KOEventViewerDialog::editIncidence()
212{ 212{
213 sendSignalViewerClosed = false; 213 sendSignalViewerClosed = false;
214 if ( mSyncMode ) { 214 if ( mSyncMode ) {
215 mSyncResult = 2; 215 mSyncResult = 2;
216 accept(); 216 accept();
217 return; 217 return;
218 } 218 }
219 if ( mIncidence ){ 219 if ( mIncidence ){
220 close(); 220 close();
221 emit editIncidence( mIncidence ); 221 emit editIncidence( mIncidence );
222 } 222 }
223} 223}
224void KOEventViewerDialog::showIncidence() 224void KOEventViewerDialog::showIncidence()
225{ 225{
226 sendSignalViewerClosed = false; 226 sendSignalViewerClosed = false;
227 if ( mSyncMode ) { 227 if ( mSyncMode ) {
228 mSyncResult = 1; 228 mSyncResult = 1;
229 accept(); 229 accept();
230 return; 230 return;
231 } 231 }
232 232
233 if ( mIncidence ){ 233 if ( mIncidence ){
234 QDate date; 234 QDate date;
235 if ( mIncidence->type() == "Todo" ) { 235 if ( mIncidence->type() == "Todo" ) {
236 /* 236 /*
237 if ( ((Todo*)mIncidence)->hasDueDate() ) 237 if ( ((Todo*)mIncidence)->hasDueDate() )
238 date = ((Todo*)mIncidence)->dtDue().date(); 238 date = ((Todo*)mIncidence)->dtDue().date();
239 else { 239 else {
240 globalFlagBlockAgenda = 2; 240 globalFlagBlockAgenda = 2;
241 emit showAgendaView( false ); 241 emit showAgendaView( false );
242 return; 242 return;
243 } 243 }
244 */ 244 */
245 ((Todo*)mIncidence)->setCompleted( true ); 245 ((Todo*)mIncidence)->setCompleted( true );
246 ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() ); 246 ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() );
247 emit todoCompleted(((Todo*)mIncidence)); 247 emit todoCompleted(((Todo*)mIncidence));
248 mEventViewer->setTodo((Todo*)mIncidence);
249 return;
248 } else { 250 } else {
249 date = mIncidence->dtStart().date(); 251 date = mIncidence->dtStart().date();
250 globalFlagBlockAgenda = 1; 252 globalFlagBlockAgenda = 1;
251 emit showAgendaView( false ); 253 emit showAgendaView( false );
252 globalFlagBlockAgenda = 2; 254 globalFlagBlockAgenda = 2;
253 emit jumpToTime( date ); 255 emit jumpToTime( date );
254 } 256 }
255 close(); 257 close();
256 } 258 }
257} 259}
258void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) 260void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
259{ 261{
260 switch ( e->key() ) { 262 switch ( e->key() ) {
261 263
262 case Qt::Key_A : 264 case Qt::Key_A :
263 case Qt::Key_L : 265 case Qt::Key_L :
264 showIncidence(); 266 showIncidence();
265 break; 267 break;
266 case Qt::Key_E : 268 case Qt::Key_E :
267 case Qt::Key_R : 269 case Qt::Key_R :
268 editIncidence(); 270 editIncidence();
269 break; 271 break;
270 case Qt::Key_C: 272 case Qt::Key_C:
271 case Qt::Key_Escape: 273 case Qt::Key_Escape:
272 sendSignalViewerClosed = true; 274 sendSignalViewerClosed = true;
273 close(); 275 close();
274 break; 276 break;
275 case Qt::Key_I: 277 case Qt::Key_I:
276#ifndef DESKTOP_VERSION 278#ifndef DESKTOP_VERSION
277 sendSignalViewerClosed = true; 279 sendSignalViewerClosed = true;
278 close(); 280 close();
279#else 281#else
280 sendSignalViewerClosed = true; 282 sendSignalViewerClosed = true;
281 slotViewerClosed(); 283 slotViewerClosed();
282 //accept(); 284 //accept();
283#endif 285#endif
284 break; 286 break;
285 default: 287 default:
286 KDialogBase::keyPressEvent ( e ); 288 KDialogBase::keyPressEvent ( e );
287 break; 289 break;
288 } 290 }
289 291
290} 292}
291void KOEventViewerDialog::hideEvent ( QHideEvent * e ) 293void KOEventViewerDialog::hideEvent ( QHideEvent * e )
292{ 294{
293 KDialogBase::hideEvent ( e ); 295 KDialogBase::hideEvent ( e );
294 QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) ); 296 QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) );
295} 297}