summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
authorzautrix <zautrix>2005-09-19 00:01:34 (UTC)
committer zautrix <zautrix>2005-09-19 00:01:34 (UTC)
commitd73247ed44cab687a0d94a96ea7b3cf604b80ba0 (patch) (unidiff)
tree7e72ac8e0239163cfec8df67c0053e0cb3a8dd2f /korganizer/mainwindow.cpp
parent2d346e4052fd726e657daee4ac3f2bcc7103f5fb (diff)
downloadkdepimpi-d73247ed44cab687a0d94a96ea7b3cf604b80ba0.zip
kdepimpi-d73247ed44cab687a0d94a96ea7b3cf604b80ba0.tar.gz
kdepimpi-d73247ed44cab687a0d94a96ea7b3cf604b80ba0.tar.bz2
wn
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index fb0b4ad..1776dcc 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -376,118 +376,115 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
376 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 376 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
377 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 377 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
378 mSyncManager->setDefaultFileName( sentSyncFile()); 378 mSyncManager->setDefaultFileName( sentSyncFile());
379 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 379 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
380 mSyncManager->fillSyncMenu(); 380 mSyncManager->fillSyncMenu();
381 381
382 382
383 383
384 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 384 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
385 if ( showWarning ) { 385 if ( showWarning ) {
386 KMessageBox::information( this, 386 KMessageBox::information( this,
387 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 387 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
388 //qApp->processEvents(); 388 //qApp->processEvents();
389 mView->dialogManager()->showSyncOptions(); 389 mView->dialogManager()->showSyncOptions();
390 } 390 }
391 391
392 //US listen for result adressed from Ka/Pi 392 //US listen for result adressed from Ka/Pi
393 393
394#ifndef DESKTOP_VERSION 394#ifndef DESKTOP_VERSION
395 infrared = 0; 395 infrared = 0;
396#endif 396#endif
397 updateFilterToolbar(); 397 updateFilterToolbar();
398 updateWeek( mView->startDate() ); 398 updateWeek( mView->startDate() );
399 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 399 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
400 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 400 SLOT( updateWeekNum( const KCal::DateList & ) ) );
401 mBRdisabled = false; 401 mBRdisabled = false;
402 //toggleBeamReceive(); 402 //toggleBeamReceive();
403 403
404 setCaption(i18n("Loading calendar files ... please wait" )); 404 setCaption(i18n("Loading calendar files ... please wait" ));
405 mSaveDelay = 0; 405 mSaveDelay = 0;
406 QTimer::singleShot( 1, this, SLOT ( loadDataAfterStart() )); 406 QTimer::singleShot( 1, this, SLOT ( loadDataAfterStart() ));
407} 407}
408MainWindow::~MainWindow() 408MainWindow::~MainWindow()
409{ 409{
410 //qDebug("MainWindow::~MainWindow() "); 410 //qDebug("MainWindow::~MainWindow() ");
411 //save toolbar location 411 //save toolbar location
412 delete mCalendar; 412 delete mCalendar;
413 delete mSyncManager; 413 delete mSyncManager;
414#ifndef DESKTOP_VERSION 414#ifndef DESKTOP_VERSION
415 if ( infrared ) 415 if ( infrared )
416 delete infrared; 416 delete infrared;
417#endif 417#endif
418 418
419 419
420} 420}
421 421
422void MainWindow::loadDataAfterStart() 422void MainWindow::loadDataAfterStart()
423{ 423{
424
425 qDebug("KO: Start loading files..." ); 424 qDebug("KO: Start loading files..." );
426 QTime neededSaveTime = QDateTime::currentDateTime().time(); 425 QTime neededSaveTime = QDateTime::currentDateTime().time();
427 mView->loadCalendars(); 426 mView->loadCalendars();
428 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 427 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
429 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 428 qDebug("KO: Calendar loading time: %d ms",msNeeded );
430 //QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); 429 //QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
431 mView->setModified( false ); 430 mView->setModified( false );
432 mBlockAtStartup = false; 431 mBlockAtStartup = false;
433 mView->setModified( false ); 432 mView->setModified( false );
434 connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); 433 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
435 processIncidenceSelection( 0 ); 434 processIncidenceSelection( 0 );
436 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 435 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
437 SLOT( processIncidenceSelection( Incidence * ) ) ); 436 SLOT( processIncidenceSelection( Incidence * ) ) );
438 connect( mView, SIGNAL( modifiedChanged( bool ) ), 437 connect( mView, SIGNAL( modifiedChanged( bool ) ),
439 SLOT( slotModifiedChanged( bool ) ) ); 438 SLOT( slotModifiedChanged( bool ) ) );
440
441#ifndef DESKTOP_VERSION 439#ifndef DESKTOP_VERSION
442 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 440 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
443 connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& ))); 441 connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& )));
444 disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& ))); 442 disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& )));
445 ((QPEApplication*) qApp)->showMainWidget( this );
446 if ( !mCStringMess.isEmpty() ) 443 if ( !mCStringMess.isEmpty() )
447 recieve( mCStringMess, mByteData ); 444 recieve( mCStringMess, mByteData );
448#endif 445#endif
449 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); 446 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
450} 447}
451 448
452void MainWindow::slotResetFocus() 449void MainWindow::slotResetFocus()
453{ 450{
454 //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); 451 //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar);
455 mFocusLoop = 3; 452 mFocusLoop = 3;
456 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); 453 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() ));
457} 454}
458void MainWindow::slotResetFocusLoop() 455void MainWindow::slotResetFocusLoop()
459{ 456{
460 --mFocusLoop; 457 --mFocusLoop;
461 QWidget* fw = mView->viewManager()->currentView(); 458 QWidget* fw = mView->viewManager()->currentView();
462 if ( fw ) { 459 if ( fw ) {
463 //qDebug("loop "); 460 //qDebug("loop ");
464 fw->setFocus(); 461 fw->setFocus();
465 if ( qApp->focusWidget() != fw && mFocusLoop > 0 ) 462 if ( qApp->focusWidget() != fw && mFocusLoop > 0 )
466 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); 463 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() ));
467 } 464 }
468 465
469} 466}
470void MainWindow::disableBR(bool b) 467void MainWindow::disableBR(bool b)
471{ 468{
472#ifndef DESKTOP_VERSION 469#ifndef DESKTOP_VERSION
473 if ( b ) { 470 if ( b ) {
474 if ( infrared ) { 471 if ( infrared ) {
475 toggleBeamReceive(); 472 toggleBeamReceive();
476 mBRdisabled = true; 473 mBRdisabled = true;
477 } 474 }
478 mBRdisabled = true; 475 mBRdisabled = true;
479 } else { 476 } else {
480 if ( mBRdisabled ) { 477 if ( mBRdisabled ) {
481 mBRdisabled = false; 478 mBRdisabled = false;
482 //makes no sense,because other cal ap is probably running 479 //makes no sense,because other cal ap is probably running
483 // toggleBeamReceive(); 480 // toggleBeamReceive();
484 } 481 }
485 } 482 }
486#endif 483#endif
487 484
488} 485}
489bool MainWindow::beamReceiveEnabled() 486bool MainWindow::beamReceiveEnabled()
490{ 487{
491#ifndef DESKTOP_VERSION 488#ifndef DESKTOP_VERSION
492 return ( infrared != 0 ); 489 return ( infrared != 0 );
493#endif 490#endif