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