author | zautrix <zautrix> | 2005-04-22 17:32:45 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-22 17:32:45 (UTC) |
commit | e6feb1ca0c45397ba7b922198c87fe9b95b7d872 (patch) (unidiff) | |
tree | 61b56d5a17f3eba87fef958d264e2da679496bda | |
parent | 81158fa914f6d0f3aeb049d28d2ecfb5f5c0e261 (diff) | |
download | kdepimpi-e6feb1ca0c45397ba7b922198c87fe9b95b7d872.zip kdepimpi-e6feb1ca0c45397ba7b922198c87fe9b95b7d872.tar.gz kdepimpi-e6feb1ca0c45397ba7b922198c87fe9b95b7d872.tar.bz2 |
fixxxx
-rw-r--r-- | kaddressbook/kabcore.cpp | 38 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 8 |
3 files changed, 42 insertions, 6 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 9c40142..a4f3579 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -360,404 +360,438 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
360 | 360 | ||
361 | connect( mXXPortManager, SIGNAL( modified() ), | 361 | connect( mXXPortManager, SIGNAL( modified() ), |
362 | SLOT( setModified() ) ); | 362 | SLOT( setModified() ) ); |
363 | 363 | ||
364 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), | 364 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), |
365 | SLOT( incrementalSearchJump( const QString& ) ) ); | 365 | SLOT( incrementalSearchJump( const QString& ) ) ); |
366 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), | 366 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), |
367 | mJumpButtonBar, SLOT( recreateButtons() ) ); | 367 | mJumpButtonBar, SLOT( recreateButtons() ) ); |
368 | 368 | ||
369 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), | 369 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), |
370 | SLOT( sendMail( const QString& ) ) ); | 370 | SLOT( sendMail( const QString& ) ) ); |
371 | 371 | ||
372 | 372 | ||
373 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); | 373 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); |
374 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); | 374 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); |
375 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); | 375 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); |
376 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); | 376 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); |
377 | connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog())); | 377 | connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog())); |
378 | 378 | ||
379 | 379 | ||
380 | #ifndef KAB_EMBEDDED | 380 | #ifndef KAB_EMBEDDED |
381 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), | 381 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), |
382 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); | 382 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); |
383 | 383 | ||
384 | connect( mDetails, SIGNAL( browse( const QString& ) ), | 384 | connect( mDetails, SIGNAL( browse( const QString& ) ), |
385 | SLOT( browse( const QString& ) ) ); | 385 | SLOT( browse( const QString& ) ) ); |
386 | 386 | ||
387 | 387 | ||
388 | mAddressBookService = new KAddressBookService( this ); | 388 | mAddressBookService = new KAddressBookService( this ); |
389 | 389 | ||
390 | #endif //KAB_EMBEDDED | 390 | #endif //KAB_EMBEDDED |
391 | 391 | ||
392 | mMessageTimer = new QTimer( this ); | 392 | mMessageTimer = new QTimer( this ); |
393 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); | 393 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); |
394 | mEditorDialog = 0; | 394 | mEditorDialog = 0; |
395 | createAddresseeEditorDialog( this ); | 395 | createAddresseeEditorDialog( this ); |
396 | setModified( false ); | 396 | setModified( false ); |
397 | mBRdisabled = false; | 397 | mBRdisabled = false; |
398 | #ifndef DESKTOP_VERSION | 398 | #ifndef DESKTOP_VERSION |
399 | infrared = 0; | 399 | infrared = 0; |
400 | #endif | 400 | #endif |
401 | //toggleBeamReceive( ); | 401 | //toggleBeamReceive( ); |
402 | mMainWindow->toolBar()->show(); | 402 | mMainWindow->toolBar()->show(); |
403 | // we have a toolbar repainting error on the Zaurus when starting KA/Pi | 403 | // we have a toolbar repainting error on the Zaurus when starting KA/Pi |
404 | QTimer::singleShot( 10, this , SLOT ( updateToolBar())); | 404 | QTimer::singleShot( 10, this , SLOT ( updateToolBar())); |
405 | } | 405 | } |
406 | 406 | ||
407 | void KABCore::updateToolBar() | 407 | void KABCore::updateToolBar() |
408 | { | 408 | { |
409 | static int iii = 0; | 409 | static int iii = 0; |
410 | ++iii; | 410 | ++iii; |
411 | mMainWindow->toolBar()->repaintMe(); | 411 | mMainWindow->toolBar()->repaintMe(); |
412 | if ( iii < 4 ) | 412 | if ( iii < 4 ) |
413 | QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); | 413 | QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); |
414 | } | 414 | } |
415 | KABCore::~KABCore() | 415 | KABCore::~KABCore() |
416 | { | 416 | { |
417 | // save(); | 417 | // save(); |
418 | //saveSettings(); | 418 | //saveSettings(); |
419 | //KABPrefs::instance()->writeConfig(); | 419 | //KABPrefs::instance()->writeConfig(); |
420 | delete AddresseeConfig::instance(); | 420 | delete AddresseeConfig::instance(); |
421 | mAddressBook = 0; | 421 | mAddressBook = 0; |
422 | KABC::StdAddressBook::close(); | 422 | KABC::StdAddressBook::close(); |
423 | 423 | ||
424 | delete syncManager; | 424 | delete syncManager; |
425 | #ifndef DESKTOP_VERSION | 425 | #ifndef DESKTOP_VERSION |
426 | if ( infrared ) | 426 | if ( infrared ) |
427 | delete infrared; | 427 | delete infrared; |
428 | #endif | 428 | #endif |
429 | } | 429 | } |
430 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) | 430 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) |
431 | { | 431 | { |
432 | //qDebug("KA: QCOP message received: %s ", cmsg.data() ); | 432 | //qDebug("KA: QCOP message received: %s ", cmsg.data() ); |
433 | if ( cmsg == "setDocument(QString)" ) { | 433 | if ( cmsg == "setDocument(QString)" ) { |
434 | QDataStream stream( data, IO_ReadOnly ); | 434 | QDataStream stream( data, IO_ReadOnly ); |
435 | QString fileName; | 435 | QString fileName; |
436 | stream >> fileName; | 436 | stream >> fileName; |
437 | recieve( fileName ); | 437 | recieve( fileName ); |
438 | return; | 438 | return; |
439 | } | 439 | } |
440 | } | 440 | } |
441 | void KABCore::toggleBeamReceive( ) | 441 | void KABCore::toggleBeamReceive( ) |
442 | { | 442 | { |
443 | if ( mBRdisabled ) | 443 | if ( mBRdisabled ) |
444 | return; | 444 | return; |
445 | #ifndef DESKTOP_VERSION | 445 | #ifndef DESKTOP_VERSION |
446 | if ( infrared ) { | 446 | if ( infrared ) { |
447 | qDebug("KA: AB disable BeamReceive "); | 447 | qDebug("KA: AB disable BeamReceive "); |
448 | delete infrared; | 448 | delete infrared; |
449 | infrared = 0; | 449 | infrared = 0; |
450 | mActionBR->setChecked(false); | 450 | mActionBR->setChecked(false); |
451 | return; | 451 | return; |
452 | } | 452 | } |
453 | qDebug("KA: AB enable BeamReceive "); | 453 | qDebug("KA: AB enable BeamReceive "); |
454 | mActionBR->setChecked(true); | 454 | mActionBR->setChecked(true); |
455 | 455 | ||
456 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; | 456 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; |
457 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); | 457 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); |
458 | #endif | 458 | #endif |
459 | } | 459 | } |
460 | 460 | ||
461 | 461 | ||
462 | void KABCore::disableBR(bool b) | 462 | void KABCore::disableBR(bool b) |
463 | { | 463 | { |
464 | #ifndef DESKTOP_VERSION | 464 | #ifndef DESKTOP_VERSION |
465 | if ( b ) { | 465 | if ( b ) { |
466 | if ( infrared ) { | 466 | if ( infrared ) { |
467 | toggleBeamReceive( ); | 467 | toggleBeamReceive( ); |
468 | } | 468 | } |
469 | mBRdisabled = true; | 469 | mBRdisabled = true; |
470 | } else { | 470 | } else { |
471 | if ( mBRdisabled ) { | 471 | if ( mBRdisabled ) { |
472 | mBRdisabled = false; | 472 | mBRdisabled = false; |
473 | //toggleBeamReceive( ); | 473 | //toggleBeamReceive( ); |
474 | } | 474 | } |
475 | } | 475 | } |
476 | #endif | 476 | #endif |
477 | 477 | ||
478 | } | 478 | } |
479 | void KABCore::recieve( QString fn ) | 479 | void KABCore::recieve( QString fn ) |
480 | { | 480 | { |
481 | //qDebug("KABCore::recieve "); | 481 | //qDebug("KABCore::recieve "); |
482 | int count = mAddressBook->importFromFile( fn, true ); | 482 | int count = mAddressBook->importFromFile( fn, true ); |
483 | if ( count ) | 483 | if ( count ) |
484 | setModified( true ); | 484 | setModified( true ); |
485 | mViewManager->refreshView(); | 485 | mViewManager->refreshView(); |
486 | message(i18n("%1 contact(s) received!").arg( count )); | 486 | message(i18n("%1 contact(s) received!").arg( count )); |
487 | topLevelWidget()->showMaximized(); | 487 | topLevelWidget()->showMaximized(); |
488 | topLevelWidget()->raise(); | 488 | topLevelWidget()->raise(); |
489 | } | 489 | } |
490 | void KABCore::restoreSettings() | 490 | void KABCore::restoreSettings() |
491 | { | 491 | { |
492 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; | 492 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; |
493 | 493 | ||
494 | bool state; | 494 | bool state; |
495 | 495 | ||
496 | if (mMultipleViewsAtOnce) | 496 | if (mMultipleViewsAtOnce) |
497 | state = KABPrefs::instance()->mDetailsPageVisible; | 497 | state = KABPrefs::instance()->mDetailsPageVisible; |
498 | else | 498 | else |
499 | state = false; | 499 | state = false; |
500 | 500 | ||
501 | mActionDetails->setChecked( state ); | 501 | mActionDetails->setChecked( state ); |
502 | setDetailsVisible( state ); | 502 | setDetailsVisible( state ); |
503 | 503 | ||
504 | state = KABPrefs::instance()->mJumpButtonBarVisible; | 504 | state = KABPrefs::instance()->mJumpButtonBarVisible; |
505 | 505 | ||
506 | mActionJumpBar->setChecked( state ); | 506 | mActionJumpBar->setChecked( state ); |
507 | setJumpButtonBarVisible( state ); | 507 | setJumpButtonBarVisible( state ); |
508 | /*US | 508 | /*US |
509 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; | 509 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; |
510 | if ( splitterSize.count() == 0 ) { | 510 | if ( splitterSize.count() == 0 ) { |
511 | splitterSize.append( width() / 2 ); | 511 | splitterSize.append( width() / 2 ); |
512 | splitterSize.append( width() / 2 ); | 512 | splitterSize.append( width() / 2 ); |
513 | } | 513 | } |
514 | mMiniSplitter->setSizes( splitterSize ); | 514 | mMiniSplitter->setSizes( splitterSize ); |
515 | if ( mExtensionBarSplitter ) { | 515 | if ( mExtensionBarSplitter ) { |
516 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 516 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
517 | if ( splitterSize.count() == 0 ) { | 517 | if ( splitterSize.count() == 0 ) { |
518 | splitterSize.append( width() / 2 ); | 518 | splitterSize.append( width() / 2 ); |
519 | splitterSize.append( width() / 2 ); | 519 | splitterSize.append( width() / 2 ); |
520 | } | 520 | } |
521 | mExtensionBarSplitter->setSizes( splitterSize ); | 521 | mExtensionBarSplitter->setSizes( splitterSize ); |
522 | 522 | ||
523 | } | 523 | } |
524 | */ | 524 | */ |
525 | mViewManager->restoreSettings(); | 525 | mViewManager->restoreSettings(); |
526 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); | 526 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); |
527 | mExtensionManager->restoreSettings(); | 527 | mExtensionManager->restoreSettings(); |
528 | #ifdef DESKTOP_VERSION | 528 | #ifdef DESKTOP_VERSION |
529 | int wid = width(); | 529 | int wid = width(); |
530 | if ( wid < 10 ) | 530 | if ( wid < 10 ) |
531 | wid = 400; | 531 | wid = 400; |
532 | #else | 532 | #else |
533 | int wid = QApplication::desktop()->width(); | 533 | int wid = QApplication::desktop()->width(); |
534 | if ( wid < 640 ) | 534 | if ( wid < 640 ) |
535 | wid = QApplication::desktop()->height(); | 535 | wid = QApplication::desktop()->height(); |
536 | #endif | 536 | #endif |
537 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; | 537 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; |
538 | if ( true /*splitterSize.count() == 0*/ ) { | 538 | if ( true /*splitterSize.count() == 0*/ ) { |
539 | splitterSize.append( wid / 2 ); | 539 | splitterSize.append( wid / 2 ); |
540 | splitterSize.append( wid / 2 ); | 540 | splitterSize.append( wid / 2 ); |
541 | } | 541 | } |
542 | mMiniSplitter->setSizes( splitterSize ); | 542 | mMiniSplitter->setSizes( splitterSize ); |
543 | if ( mExtensionBarSplitter ) { | 543 | if ( mExtensionBarSplitter ) { |
544 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 544 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
545 | if ( true /*splitterSize.count() == 0*/ ) { | 545 | if ( true /*splitterSize.count() == 0*/ ) { |
546 | splitterSize.append( wid / 2 ); | 546 | splitterSize.append( wid / 2 ); |
547 | splitterSize.append( wid / 2 ); | 547 | splitterSize.append( wid / 2 ); |
548 | } | 548 | } |
549 | mExtensionBarSplitter->setSizes( splitterSize ); | 549 | mExtensionBarSplitter->setSizes( splitterSize ); |
550 | 550 | ||
551 | } | 551 | } |
552 | 552 | #ifdef DESKTOP_VERSION | |
553 | 553 | KConfig *config = KABPrefs::instance()->getConfig(); | |
554 | config->setGroup("WidgetLayout"); | ||
555 | QStringList list; | ||
556 | list = config->readListEntry("MainLayout"); | ||
557 | int x,y,w,h; | ||
558 | if ( ! list.isEmpty() ) { | ||
559 | x = list[0].toInt(); | ||
560 | y = list[1].toInt(); | ||
561 | w = list[2].toInt(); | ||
562 | h = list[3].toInt(); | ||
563 | KApplication::testCoords( &x,&y,&w,&h ); | ||
564 | topLevelWidget()->setGeometry(x,y,w,h); | ||
565 | |||
566 | } else { | ||
567 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); | ||
568 | } | ||
569 | #endif | ||
554 | } | 570 | } |
555 | 571 | ||
556 | void KABCore::saveSettings() | 572 | void KABCore::saveSettings() |
557 | { | 573 | { |
558 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); | 574 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); |
559 | if ( mExtensionBarSplitter ) | 575 | if ( mExtensionBarSplitter ) |
560 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 576 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
561 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); | 577 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); |
562 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); | 578 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); |
563 | #ifndef KAB_EMBEDDED | 579 | #ifndef KAB_EMBEDDED |
564 | 580 | ||
565 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 581 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
566 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); | 582 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); |
567 | #endif //KAB_EMBEDDED | 583 | #endif //KAB_EMBEDDED |
568 | mExtensionManager->saveSettings(); | 584 | mExtensionManager->saveSettings(); |
569 | mViewManager->saveSettings(); | 585 | mViewManager->saveSettings(); |
570 | 586 | ||
571 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); | 587 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); |
588 | #ifdef DESKTOP_VERSION | ||
589 | KConfig *config = KABPrefs::instance()->getConfig(); | ||
590 | config->setGroup("WidgetLayout"); | ||
591 | QStringList list ;//= config->readListEntry("MainLayout"); | ||
592 | int x,y,w,h; | ||
593 | QWidget* wid; | ||
594 | wid = topLevelWidget(); | ||
595 | x = wid->geometry().x(); | ||
596 | y = wid->geometry().y(); | ||
597 | w = wid->width(); | ||
598 | h = wid->height(); | ||
599 | list.clear(); | ||
600 | list << QString::number( x ); | ||
601 | list << QString::number( y ); | ||
602 | list << QString::number( w ); | ||
603 | list << QString::number( h ); | ||
604 | config->writeEntry("MainLayout",list ); | ||
605 | #endif | ||
572 | KABPrefs::instance()->writeConfig(); | 606 | KABPrefs::instance()->writeConfig(); |
573 | qDebug("KA: KABCore::saveSettings() "); | 607 | qDebug("KA: KABCore::saveSettings() "); |
574 | } | 608 | } |
575 | 609 | ||
576 | KABC::AddressBook *KABCore::addressBook() const | 610 | KABC::AddressBook *KABCore::addressBook() const |
577 | { | 611 | { |
578 | return mAddressBook; | 612 | return mAddressBook; |
579 | } | 613 | } |
580 | 614 | ||
581 | KConfig *KABCore::config() | 615 | KConfig *KABCore::config() |
582 | { | 616 | { |
583 | #ifndef KAB_EMBEDDED | 617 | #ifndef KAB_EMBEDDED |
584 | return KABPrefs::instance()->config(); | 618 | return KABPrefs::instance()->config(); |
585 | #else //KAB_EMBEDDED | 619 | #else //KAB_EMBEDDED |
586 | return KABPrefs::instance()->getConfig(); | 620 | return KABPrefs::instance()->getConfig(); |
587 | #endif //KAB_EMBEDDED | 621 | #endif //KAB_EMBEDDED |
588 | } | 622 | } |
589 | 623 | ||
590 | KActionCollection *KABCore::actionCollection() const | 624 | KActionCollection *KABCore::actionCollection() const |
591 | { | 625 | { |
592 | return mGUIClient->actionCollection(); | 626 | return mGUIClient->actionCollection(); |
593 | } | 627 | } |
594 | 628 | ||
595 | KABC::Field *KABCore::currentSearchField() const | 629 | KABC::Field *KABCore::currentSearchField() const |
596 | { | 630 | { |
597 | if (mIncSearchWidget) | 631 | if (mIncSearchWidget) |
598 | return mIncSearchWidget->currentField(); | 632 | return mIncSearchWidget->currentField(); |
599 | else | 633 | else |
600 | return 0; | 634 | return 0; |
601 | } | 635 | } |
602 | 636 | ||
603 | QStringList KABCore::selectedUIDs() const | 637 | QStringList KABCore::selectedUIDs() const |
604 | { | 638 | { |
605 | return mViewManager->selectedUids(); | 639 | return mViewManager->selectedUids(); |
606 | } | 640 | } |
607 | 641 | ||
608 | KABC::Resource *KABCore::requestResource( QWidget *parent ) | 642 | KABC::Resource *KABCore::requestResource( QWidget *parent ) |
609 | { | 643 | { |
610 | QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); | 644 | QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); |
611 | 645 | ||
612 | QPtrList<KRES::Resource> kresResources; | 646 | QPtrList<KRES::Resource> kresResources; |
613 | QPtrListIterator<KABC::Resource> resIt( kabcResources ); | 647 | QPtrListIterator<KABC::Resource> resIt( kabcResources ); |
614 | KABC::Resource *resource; | 648 | KABC::Resource *resource; |
615 | while ( ( resource = resIt.current() ) != 0 ) { | 649 | while ( ( resource = resIt.current() ) != 0 ) { |
616 | ++resIt; | 650 | ++resIt; |
617 | if ( !resource->readOnly() ) { | 651 | if ( !resource->readOnly() ) { |
618 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); | 652 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); |
619 | if ( res ) | 653 | if ( res ) |
620 | kresResources.append( res ); | 654 | kresResources.append( res ); |
621 | } | 655 | } |
622 | } | 656 | } |
623 | 657 | ||
624 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); | 658 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); |
625 | return static_cast<KABC::Resource*>( res ); | 659 | return static_cast<KABC::Resource*>( res ); |
626 | } | 660 | } |
627 | 661 | ||
628 | #ifndef KAB_EMBEDDED | 662 | #ifndef KAB_EMBEDDED |
629 | KAboutData *KABCore::createAboutData() | 663 | KAboutData *KABCore::createAboutData() |
630 | #else //KAB_EMBEDDED | 664 | #else //KAB_EMBEDDED |
631 | void KABCore::createAboutData() | 665 | void KABCore::createAboutData() |
632 | #endif //KAB_EMBEDDED | 666 | #endif //KAB_EMBEDDED |
633 | { | 667 | { |
634 | 668 | ||
635 | 669 | ||
636 | QString version; | 670 | QString version; |
637 | #include <../version> | 671 | #include <../version> |
638 | QMessageBox::about( this, "About KAddressbook/Pi", | 672 | QMessageBox::about( this, "About KAddressbook/Pi", |
639 | "KAddressbook/Platform-independent\n" | 673 | "KAddressbook/Platform-independent\n" |
640 | "(KA/Pi) " +version + " - " + | 674 | "(KA/Pi) " +version + " - " + |
641 | #ifdef DESKTOP_VERSION | 675 | #ifdef DESKTOP_VERSION |
642 | "Desktop Edition\n" | 676 | "Desktop Edition\n" |
643 | #else | 677 | #else |
644 | "PDA-Edition\n" | 678 | "PDA-Edition\n" |
645 | "for: Zaurus 5500 / 7x0 / 8x0\n" | 679 | "for: Zaurus 5500 / 7x0 / 8x0\n" |
646 | #endif | 680 | #endif |
647 | 681 | ||
648 | "(c) 2004 Ulf Schenk\n" | 682 | "(c) 2004 Ulf Schenk\n" |
649 | "(c) 2004-2005 Lutz Rogowski\nrogowski@kde.org\n" | 683 | "(c) 2004-2005 Lutz Rogowski\nrogowski@kde.org\n" |
650 | "(c) 1997-2003, The KDE PIM Team\n" | 684 | "(c) 1997-2003, The KDE PIM Team\n" |
651 | "Tobias Koenig Maintainer\n" | 685 | "Tobias Koenig Maintainer\n" |
652 | "Don Sanders Original author\n" | 686 | "Don Sanders Original author\n" |
653 | "Cornelius Schumacher Co-maintainer\n" | 687 | "Cornelius Schumacher Co-maintainer\n" |
654 | "Mike Pilone GUI and framework redesign\n" | 688 | "Mike Pilone GUI and framework redesign\n" |
655 | "Greg Stern DCOP interface\n" | 689 | "Greg Stern DCOP interface\n" |
656 | "Mark Westcot Contact pinning\n" | 690 | "Mark Westcot Contact pinning\n" |
657 | "Michel Boyer de la Giroday LDAP Lookup\n" | 691 | "Michel Boyer de la Giroday LDAP Lookup\n" |
658 | "Steffen Hansen LDAP Lookup" | 692 | "Steffen Hansen LDAP Lookup" |
659 | #ifdef _WIN32_ | 693 | #ifdef _WIN32_ |
660 | "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" | 694 | "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" |
661 | #endif | 695 | #endif |
662 | ); | 696 | ); |
663 | } | 697 | } |
664 | 698 | ||
665 | void KABCore::setContactSelected( const QString &uid ) | 699 | void KABCore::setContactSelected( const QString &uid ) |
666 | { | 700 | { |
667 | KABC::Addressee addr = mAddressBook->findByUid( uid ); | 701 | KABC::Addressee addr = mAddressBook->findByUid( uid ); |
668 | if ( !mDetails->isHidden() ) | 702 | if ( !mDetails->isHidden() ) |
669 | mDetails->setAddressee( addr ); | 703 | mDetails->setAddressee( addr ); |
670 | 704 | ||
671 | if ( !addr.isEmpty() ) { | 705 | if ( !addr.isEmpty() ) { |
672 | emit contactSelected( addr.formattedName() ); | 706 | emit contactSelected( addr.formattedName() ); |
673 | KABC::Picture pic = addr.photo(); | 707 | KABC::Picture pic = addr.photo(); |
674 | if ( pic.isIntern() ) { | 708 | if ( pic.isIntern() ) { |
675 | //US emit contactSelected( pic.data() ); | 709 | //US emit contactSelected( pic.data() ); |
676 | //US instead use: | 710 | //US instead use: |
677 | QPixmap px; | 711 | QPixmap px; |
678 | if (pic.data().isNull() != true) | 712 | if (pic.data().isNull() != true) |
679 | { | 713 | { |
680 | px.convertFromImage(pic.data()); | 714 | px.convertFromImage(pic.data()); |
681 | } | 715 | } |
682 | 716 | ||
683 | emit contactSelected( px ); | 717 | emit contactSelected( px ); |
684 | } | 718 | } |
685 | } | 719 | } |
686 | 720 | ||
687 | 721 | ||
688 | mExtensionManager->setSelectionChanged(); | 722 | mExtensionManager->setSelectionChanged(); |
689 | 723 | ||
690 | // update the actions | 724 | // update the actions |
691 | bool selected = !uid.isEmpty(); | 725 | bool selected = !uid.isEmpty(); |
692 | 726 | ||
693 | if ( mReadWrite ) { | 727 | if ( mReadWrite ) { |
694 | mActionCut->setEnabled( selected ); | 728 | mActionCut->setEnabled( selected ); |
695 | mActionPaste->setEnabled( selected ); | 729 | mActionPaste->setEnabled( selected ); |
696 | } | 730 | } |
697 | 731 | ||
698 | mActionCopy->setEnabled( selected ); | 732 | mActionCopy->setEnabled( selected ); |
699 | mActionDelete->setEnabled( selected ); | 733 | mActionDelete->setEnabled( selected ); |
700 | mActionEditAddressee->setEnabled( selected ); | 734 | mActionEditAddressee->setEnabled( selected ); |
701 | mActionMail->setEnabled( selected ); | 735 | mActionMail->setEnabled( selected ); |
702 | mActionMailVCard->setEnabled( selected ); | 736 | mActionMailVCard->setEnabled( selected ); |
703 | //if (mActionBeam) | 737 | //if (mActionBeam) |
704 | //mActionBeam->setEnabled( selected ); | 738 | //mActionBeam->setEnabled( selected ); |
705 | mActionWhoAmI->setEnabled( selected ); | 739 | mActionWhoAmI->setEnabled( selected ); |
706 | } | 740 | } |
707 | 741 | ||
708 | void KABCore::sendMail() | 742 | void KABCore::sendMail() |
709 | { | 743 | { |
710 | sendMail( mViewManager->selectedEmails().join( ", " ) ); | 744 | sendMail( mViewManager->selectedEmails().join( ", " ) ); |
711 | } | 745 | } |
712 | 746 | ||
713 | void KABCore::sendMail( const QString& emaillist ) | 747 | void KABCore::sendMail( const QString& emaillist ) |
714 | { | 748 | { |
715 | // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " | 749 | // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " |
716 | if (emaillist.contains(",") > 0) | 750 | if (emaillist.contains(",") > 0) |
717 | ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); | 751 | ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); |
718 | else | 752 | else |
719 | ExternalAppHandler::instance()->mailToOneContact( emaillist ); | 753 | ExternalAppHandler::instance()->mailToOneContact( emaillist ); |
720 | } | 754 | } |
721 | 755 | ||
722 | 756 | ||
723 | 757 | ||
724 | void KABCore::mailVCard() | 758 | void KABCore::mailVCard() |
725 | { | 759 | { |
726 | QStringList uids = mViewManager->selectedUids(); | 760 | QStringList uids = mViewManager->selectedUids(); |
727 | if ( !uids.isEmpty() ) | 761 | if ( !uids.isEmpty() ) |
728 | mailVCard( uids ); | 762 | mailVCard( uids ); |
729 | } | 763 | } |
730 | 764 | ||
731 | void KABCore::mailVCard( const QStringList& uids ) | 765 | void KABCore::mailVCard( const QStringList& uids ) |
732 | { | 766 | { |
733 | QStringList urls; | 767 | QStringList urls; |
734 | 768 | ||
735 | // QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); | 769 | // QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); |
736 | 770 | ||
737 | QString dirName = "/tmp/" + KApplication::randomString( 8 ); | 771 | QString dirName = "/tmp/" + KApplication::randomString( 8 ); |
738 | 772 | ||
739 | 773 | ||
740 | 774 | ||
741 | QDir().mkdir( dirName, true ); | 775 | QDir().mkdir( dirName, true ); |
742 | 776 | ||
743 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { | 777 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { |
744 | KABC::Addressee a = mAddressBook->findByUid( *it ); | 778 | KABC::Addressee a = mAddressBook->findByUid( *it ); |
745 | 779 | ||
746 | if ( a.isEmpty() ) | 780 | if ( a.isEmpty() ) |
747 | continue; | 781 | continue; |
748 | 782 | ||
749 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; | 783 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; |
750 | 784 | ||
751 | QString fileName = dirName + "/" + name; | 785 | QString fileName = dirName + "/" + name; |
752 | 786 | ||
753 | QFile outFile(fileName); | 787 | QFile outFile(fileName); |
754 | 788 | ||
755 | if ( outFile.open(IO_WriteOnly) ) { // file opened successfully | 789 | if ( outFile.open(IO_WriteOnly) ) { // file opened successfully |
756 | KABC::VCardConverter converter; | 790 | KABC::VCardConverter converter; |
757 | QString vcard; | 791 | QString vcard; |
758 | 792 | ||
759 | converter.addresseeToVCard( a, vcard ); | 793 | converter.addresseeToVCard( a, vcard ); |
760 | 794 | ||
761 | QTextStream t( &outFile ); // use a text stream | 795 | QTextStream t( &outFile ); // use a text stream |
762 | t.setEncoding( QTextStream::UnicodeUTF8 ); | 796 | t.setEncoding( QTextStream::UnicodeUTF8 ); |
763 | t << vcard; | 797 | t << vcard; |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 4366265..30efbf6 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -14,400 +14,400 @@ | |||
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source ode for Qt in the source distribution. | 22 | without including the source ode for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qevent.h> | 25 | #include <qevent.h> |
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | #include <qptrlist.h> | 27 | #include <qptrlist.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qwhatsthis.h> | 29 | #include <qwhatsthis.h> |
30 | 30 | ||
31 | #include <kglobal.h> | 31 | #include <kglobal.h> |
32 | #include <kdebug.h> | 32 | #include <kdebug.h> |
33 | #include <klocale.h> | 33 | #include <klocale.h> |
34 | 34 | ||
35 | #include <libkcal/vcaldrag.h> | 35 | #include <libkcal/vcaldrag.h> |
36 | #include <libkcal/icaldrag.h> | 36 | #include <libkcal/icaldrag.h> |
37 | #include <libkcal/dndfactory.h> | 37 | #include <libkcal/dndfactory.h> |
38 | #include <libkcal/calendarresources.h> | 38 | #include <libkcal/calendarresources.h> |
39 | #include <libkcal/resourcecalendar.h> | 39 | #include <libkcal/resourcecalendar.h> |
40 | #include <kresources/resourceselectdialog.h> | 40 | #include <kresources/resourceselectdialog.h> |
41 | 41 | ||
42 | #include <kcalendarsystem.h> | 42 | #include <kcalendarsystem.h> |
43 | 43 | ||
44 | #ifndef KORG_NOPLUGINS | 44 | #ifndef KORG_NOPLUGINS |
45 | #include "kocore.h" | 45 | #include "kocore.h" |
46 | #endif | 46 | #endif |
47 | #include "koprefs.h" | 47 | #include "koprefs.h" |
48 | #include "koglobals.h" | 48 | #include "koglobals.h" |
49 | 49 | ||
50 | #include "kodaymatrix.h" | 50 | #include "kodaymatrix.h" |
51 | 51 | ||
52 | // ============================================================================ | 52 | // ============================================================================ |
53 | // D Y N A M I C T I P | 53 | // D Y N A M I C T I P |
54 | // ============================================================================ | 54 | // ============================================================================ |
55 | 55 | ||
56 | DynamicTip::DynamicTip( QWidget * parent ) | 56 | DynamicTip::DynamicTip( QWidget * parent ) |
57 | : QToolTip( parent ) | 57 | : QToolTip( parent ) |
58 | { | 58 | { |
59 | matrix = (KODayMatrix*)parent; | 59 | matrix = (KODayMatrix*)parent; |
60 | } | 60 | } |
61 | 61 | ||
62 | class KODaymatrixWhatsThis :public QWhatsThis | 62 | class KODaymatrixWhatsThis :public QWhatsThis |
63 | { | 63 | { |
64 | public: | 64 | public: |
65 | KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;}; | 65 | KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;}; |
66 | ~KODaymatrixWhatsThis() { ; }; | 66 | ~KODaymatrixWhatsThis() { ; }; |
67 | 67 | ||
68 | protected: | 68 | protected: |
69 | virtual QString text( const QPoint& p ) | 69 | virtual QString text( const QPoint& p ) |
70 | { | 70 | { |
71 | return _view->getWhatsThisText( p ) ; | 71 | return _view->getWhatsThisText( p ) ; |
72 | } | 72 | } |
73 | private: | 73 | private: |
74 | KODayMatrix * _view; | 74 | KODayMatrix * _view; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | void DynamicTip::maybeTip( const QPoint &pos ) | 77 | void DynamicTip::maybeTip( const QPoint &pos ) |
78 | { | 78 | { |
79 | //calculate which cell of the matrix the mouse is in | 79 | //calculate which cell of the matrix the mouse is in |
80 | QRect sz = matrix->frameRect(); | 80 | QRect sz = matrix->frameRect(); |
81 | int dheight = sz.height()*7 / 42; | 81 | int dheight = sz.height()*7 / 42; |
82 | int dwidth = sz.width() / 7; | 82 | int dwidth = sz.width() / 7; |
83 | int row = pos.y()/dheight; | 83 | int row = pos.y()/dheight; |
84 | int col = pos.x()/dwidth; | 84 | int col = pos.x()/dwidth; |
85 | 85 | ||
86 | QRect rct(col*dwidth, row*dheight, dwidth, dheight); | 86 | QRect rct(col*dwidth, row*dheight, dwidth, dheight); |
87 | 87 | ||
88 | // kdDebug() << "DynamicTip::maybeTip matrix cell index [" << | 88 | // kdDebug() << "DynamicTip::maybeTip matrix cell index [" << |
89 | // col << "][" << row << "] => " <<(col+row*7) << endl; | 89 | // col << "][" << row << "] => " <<(col+row*7) << endl; |
90 | 90 | ||
91 | //show holiday names only | 91 | //show holiday names only |
92 | QString str = matrix->getHolidayLabel(col+row*7); | 92 | QString str = matrix->getHolidayLabel(col+row*7); |
93 | if (str.isEmpty()) return; | 93 | if (str.isEmpty()) return; |
94 | tip(rct, str); | 94 | tip(rct, str); |
95 | } | 95 | } |
96 | 96 | ||
97 | 97 | ||
98 | // ============================================================================ | 98 | // ============================================================================ |
99 | // K O D A Y M A T R I X | 99 | // K O D A Y M A T R I X |
100 | // ============================================================================ | 100 | // ============================================================================ |
101 | 101 | ||
102 | const int KODayMatrix::NOSELECTION = -1000; | 102 | const int KODayMatrix::NOSELECTION = -1000; |
103 | const int KODayMatrix::NUMDAYS = 42; | 103 | const int KODayMatrix::NUMDAYS = 42; |
104 | 104 | ||
105 | KODayMatrix::KODayMatrix( QWidget *parent, const char *name ) | 105 | KODayMatrix::KODayMatrix( QWidget *parent, const char *name ) |
106 | : QFrame( parent, name , Qt::WRepaintNoErase ), mCalendar( 0 ) | 106 | : QFrame( parent, name , Qt::WRepaintNoErase ), mCalendar( 0 ) |
107 | 107 | ||
108 | 108 | ||
109 | { | 109 | { |
110 | mLastView = -1; | 110 | mLastView = -1; |
111 | oldW = 0; | 111 | oldW = 0; |
112 | oldH = 0; | 112 | oldH = 0; |
113 | myPix.resize( 150, 120 ); | 113 | myPix.resize( 150, 120 ); |
114 | mRedrawNeeded = true; | 114 | mRedrawNeeded = true; |
115 | mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this); | 115 | mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this); |
116 | mPendingUpdateBeforeRepaint = false; | 116 | mPendingUpdateBeforeRepaint = false; |
117 | mouseDown = false; | 117 | mouseDown = false; |
118 | // initialize dynamic arrays | 118 | // initialize dynamic arrays |
119 | bDays.resize ( NUMDAYS ); | 119 | bDays.resize ( NUMDAYS ); |
120 | pDays.resize ( NUMDAYS ); | 120 | pDays.resize ( NUMDAYS ); |
121 | hDays.resize ( NUMDAYS ); | 121 | hDays.resize ( NUMDAYS ); |
122 | eDays.resize ( NUMDAYS ); | 122 | eDays.resize ( NUMDAYS ); |
123 | days = new QDate[NUMDAYS]; | 123 | days = new QDate[NUMDAYS]; |
124 | daylbls = new QString[NUMDAYS]; | 124 | daylbls = new QString[NUMDAYS]; |
125 | //events = new int[NUMDAYS]; | 125 | //events = new int[NUMDAYS]; |
126 | mToolTip = new DynamicTip(this); | 126 | mToolTip = new DynamicTip(this); |
127 | 127 | ||
128 | // set default values used for drawing the matrix | 128 | // set default values used for drawing the matrix |
129 | mDefaultBackColor = palette().active().base(); | 129 | mDefaultBackColor = palette().active().base(); |
130 | mDefaultTextColor = palette().active().foreground(); | 130 | mDefaultTextColor = palette().active().foreground(); |
131 | mDefaultTextColorShaded = getShadedColor(mDefaultTextColor); | 131 | mDefaultTextColorShaded = getShadedColor(mDefaultTextColor); |
132 | mHolidayColorShaded = getShadedColor(KOPrefs::instance()->mHolidayColor); | 132 | mHolidayColorShaded = getShadedColor(KOPrefs::instance()->mHolidayColor); |
133 | mSelectedDaysColor = QColor("white"); | 133 | mSelectedDaysColor = QColor("white"); |
134 | mTodayMarginWidth = 2; | 134 | mTodayMarginWidth = 2; |
135 | mSelEnd = mSelStart = NOSELECTION; | 135 | mSelEnd = mSelStart = NOSELECTION; |
136 | 136 | ||
137 | setAcceptDrops(true); | 137 | setAcceptDrops(true); |
138 | //setFont( QFont("Arial", 10) ); | 138 | //setFont( QFont("Arial", 10) ); |
139 | 139 | ||
140 | mUpdateTimer = new QTimer( this ); | 140 | mUpdateTimer = new QTimer( this ); |
141 | connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( updateViewTimed() )); | 141 | connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( updateViewTimed() )); |
142 | mRepaintTimer = new QTimer( this ); | 142 | mRepaintTimer = new QTimer( this ); |
143 | connect (mRepaintTimer ,SIGNAL(timeout()), this, SLOT ( repaintViewTimed() )); | 143 | connect (mRepaintTimer ,SIGNAL(timeout()), this, SLOT ( repaintViewTimed() )); |
144 | mDayChanged = false; | 144 | mDayChanged = false; |
145 | updateView(); | 145 | updateView(); |
146 | } | 146 | } |
147 | QString KODayMatrix::getWhatsThisText( QPoint p ) | 147 | QString KODayMatrix::getWhatsThisText( QPoint p ) |
148 | { | 148 | { |
149 | 149 | ||
150 | int tmp = getDayIndexFrom(p.x(), p.y()); | 150 | int tmp = getDayIndexFrom(p.x(), p.y()); |
151 | if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar ) | 151 | if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar ) |
152 | return QString(); | 152 | return QString(); |
153 | QDate mDate = days[tmp]; | 153 | QDate mDate = days[tmp]; |
154 | QPtrList<Event> eventlist = mCalendar->events(mDate); | 154 | QPtrList<Event> eventlist = mCalendar->events(mDate); |
155 | Event *event; | 155 | Event *event; |
156 | QStringList mToolTip; | 156 | QStringList mToolTip; |
157 | for(event=eventlist.first();event != 0;event=eventlist.next()) { | 157 | for(event=eventlist.first();event != 0;event=eventlist.next()) { |
158 | QString mToolTipText; | 158 | QString mToolTipText; |
159 | QString text; | 159 | QString text; |
160 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day | 160 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day |
161 | if (event->isMultiDay()) { | 161 | if (event->isMultiDay()) { |
162 | QString prefix = "<->";multiday = 2; | 162 | QString prefix = "<->";multiday = 2; |
163 | QString time; | 163 | QString time; |
164 | if ( event->doesRecur() ) { | 164 | if ( event->doesRecur() ) { |
165 | if ( event->recursOn( mDate) ) { | 165 | if ( event->recursOn( mDate) ) { |
166 | prefix ="->" ;multiday = 1; | 166 | prefix ="->" ;multiday = 1; |
167 | } | 167 | } |
168 | else { | 168 | else { |
169 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); | 169 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); |
170 | if ( event->recursOn( mDate.addDays( -days)) ) { | 170 | if ( event->recursOn( mDate.addDays( -days)) ) { |
171 | prefix ="<-" ;multiday = 3; | 171 | prefix ="<-" ;multiday = 3; |
172 | } | 172 | } |
173 | } | 173 | } |
174 | } else { | 174 | } else { |
175 | if (mDate == event->dtStart().date()) { | 175 | if (mDate == event->dtStart().date()) { |
176 | prefix ="->" ;multiday = 1; | 176 | prefix ="->" ;multiday = 1; |
177 | } else if (mDate == event->dtEnd().date()) { | 177 | } else if (mDate == event->dtEnd().date()) { |
178 | prefix ="<-" ;multiday = 3; | 178 | prefix ="<-" ;multiday = 3; |
179 | } | 179 | } |
180 | } | 180 | } |
181 | if ( !event->doesFloat() ) { | 181 | if ( !event->doesFloat() ) { |
182 | if ( mDate == event->dtStart().date () ) | 182 | if ( mDate == event->dtStart().date () ) |
183 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; | 183 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; |
184 | else if ( mDate == event->dtEnd().date () ) | 184 | else if ( mDate == event->dtEnd().date () ) |
185 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; | 185 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; |
186 | 186 | ||
187 | } | 187 | } |
188 | text = time + event->summary(); | 188 | text = time + event->summary(); |
189 | mToolTipText += prefix + text; | 189 | mToolTipText += prefix + text; |
190 | } else { | 190 | } else { |
191 | if (event->doesFloat()) { | 191 | if (event->doesFloat()) { |
192 | text = event->summary(); | 192 | text = event->summary(); |
193 | mToolTipText += text; | 193 | mToolTipText += text; |
194 | } | 194 | } |
195 | else { | 195 | else { |
196 | text = KGlobal::locale()->formatTime(event->dtStart().time()); | 196 | text = KGlobal::locale()->formatTime(event->dtStart().time()); |
197 | text += " " + event->summary(); | 197 | text += " " + event->summary(); |
198 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); | 198 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); |
199 | } | 199 | } |
200 | } | 200 | } |
201 | if ( !event->location().isEmpty() ) | 201 | if ( !event->location().isEmpty() ) |
202 | mToolTipText += " (" + event->location() + ")"; | 202 | mToolTipText += " (" + event->location() + ")"; |
203 | //qDebug("TTT: %s ", mToolTipText.latin1()); | 203 | //qDebug("TTT: %s ", mToolTipText.latin1()); |
204 | mToolTip.append( deTag( mToolTipText ) ); | 204 | mToolTip.append( deTag( mToolTipText ) ); |
205 | } | 205 | } |
206 | mToolTip.sort(); | ||
206 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { | 207 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { |
207 | QPtrList<Todo> todolist = mCalendar->todos(mDate); | 208 | QPtrList<Todo> todolist = mCalendar->todos(mDate); |
208 | Todo *todo; | 209 | Todo *todo; |
209 | for(todo=todolist.first();todo != 0;todo=todolist.next()) { | 210 | for(todo=todolist.first();todo != 0;todo=todolist.next()) { |
210 | QString mToolTipText; | 211 | QString mToolTipText; |
211 | if ( !todo->doesFloat() ) | 212 | if ( !todo->doesFloat() ) |
212 | mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" "; | 213 | mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" "; |
213 | mToolTipText += todo->summary(); | 214 | mToolTipText += todo->summary(); |
214 | if ( !todo->location().isEmpty() ) | 215 | if ( !todo->location().isEmpty() ) |
215 | mToolTipText += " (" + todo->location() + ")"; | 216 | mToolTipText += " (" + todo->location() + ")"; |
216 | mToolTipText = deTag( mToolTipText); | 217 | mToolTipText = deTag( mToolTipText); |
217 | mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText; | 218 | mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText; |
218 | mToolTip.append( mToolTipText ); | 219 | mToolTip.append( mToolTipText ); |
219 | } | 220 | } |
220 | } | 221 | } |
221 | mToolTip.sort(); | ||
222 | if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | 222 | if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { |
223 | Journal *j = mCalendar->journal( mDate ); | 223 | Journal *j = mCalendar->journal( mDate ); |
224 | if ( j ) { | 224 | if ( j ) { |
225 | QString mToolTipText = j->description().left(100); | 225 | QString mToolTipText = j->description().left(100); |
226 | if ( j->description().length() > 100 ) | 226 | if ( j->description().length() > 100 ) |
227 | mToolTipText += " ..."; | 227 | mToolTipText += " ..."; |
228 | mToolTipText = deTag( mToolTipText); | 228 | mToolTipText = deTag( mToolTipText); |
229 | mToolTipText = "<b>" + i18n("Journal: ") + "</b>"+ mToolTipText; | 229 | mToolTipText = "<b>" + i18n("Journal: ") + "</b>"+ mToolTipText; |
230 | mToolTip.append( mToolTipText ); | 230 | mToolTip.append( mToolTipText ); |
231 | } | 231 | } |
232 | } | 232 | } |
233 | return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>"); | 233 | return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>"); |
234 | } | 234 | } |
235 | 235 | ||
236 | 236 | ||
237 | QString KODayMatrix::deTag( QString mToolTipText ) | 237 | QString KODayMatrix::deTag( QString mToolTipText ) |
238 | { | 238 | { |
239 | 239 | ||
240 | #if QT_VERSION >= 0x030000 | 240 | #if QT_VERSION >= 0x030000 |
241 | mToolTipText.replace( '<' , "<" ); | 241 | mToolTipText.replace( '<' , "<" ); |
242 | mToolTipText.replace( '>' , ">" ); | 242 | mToolTipText.replace( '>' , ">" ); |
243 | #else | 243 | #else |
244 | if ( mToolTipText.find ('<') >= 0 ) { | 244 | if ( mToolTipText.find ('<') >= 0 ) { |
245 | mToolTipText.replace( QRegExp("<") , "<" ); | 245 | mToolTipText.replace( QRegExp("<") , "<" ); |
246 | } | 246 | } |
247 | if ( mToolTipText.find ('>') >= 0 ) { | 247 | if ( mToolTipText.find ('>') >= 0 ) { |
248 | mToolTipText.replace( QRegExp(">") , ">" ); | 248 | mToolTipText.replace( QRegExp(">") , ">" ); |
249 | } | 249 | } |
250 | #endif | 250 | #endif |
251 | return mToolTipText; | 251 | return mToolTipText; |
252 | } | 252 | } |
253 | void KODayMatrix::setCalendar( Calendar *cal ) | 253 | void KODayMatrix::setCalendar( Calendar *cal ) |
254 | { | 254 | { |
255 | mCalendar = cal; | 255 | mCalendar = cal; |
256 | 256 | ||
257 | setAcceptDrops( mCalendar ); | 257 | setAcceptDrops( mCalendar ); |
258 | 258 | ||
259 | updateEvents(); | 259 | updateEvents(); |
260 | } | 260 | } |
261 | 261 | ||
262 | QColor KODayMatrix::getShadedColor(QColor color) | 262 | QColor KODayMatrix::getShadedColor(QColor color) |
263 | { | 263 | { |
264 | QColor shaded; | 264 | QColor shaded; |
265 | int h=0; | 265 | int h=0; |
266 | int s=0; | 266 | int s=0; |
267 | int v=0; | 267 | int v=0; |
268 | color.hsv(&h,&s,&v); | 268 | color.hsv(&h,&s,&v); |
269 | s = s/4; | 269 | s = s/4; |
270 | v = 192+v/4; | 270 | v = 192+v/4; |
271 | shaded.setHsv(h,s,v); | 271 | shaded.setHsv(h,s,v); |
272 | 272 | ||
273 | return shaded; | 273 | return shaded; |
274 | } | 274 | } |
275 | 275 | ||
276 | KODayMatrix::~KODayMatrix() | 276 | KODayMatrix::~KODayMatrix() |
277 | { | 277 | { |
278 | #if QT_VERSION >= 0x030000 | 278 | #if QT_VERSION >= 0x030000 |
279 | 279 | ||
280 | #else | 280 | #else |
281 | delete mKODaymatrixWhatsThis; | 281 | delete mKODaymatrixWhatsThis; |
282 | #endif | 282 | #endif |
283 | 283 | ||
284 | // delete mKODaymatrixWhatsThis; | 284 | // delete mKODaymatrixWhatsThis; |
285 | delete [] days; | 285 | delete [] days; |
286 | delete [] daylbls; | 286 | delete [] daylbls; |
287 | //delete [] events; | 287 | //delete [] events; |
288 | delete mToolTip; | 288 | delete mToolTip; |
289 | } | 289 | } |
290 | 290 | ||
291 | /* | 291 | /* |
292 | void KODayMatrix::setStartDate(QDate start) | 292 | void KODayMatrix::setStartDate(QDate start) |
293 | { | 293 | { |
294 | updateView(start); | 294 | updateView(start); |
295 | } | 295 | } |
296 | */ | 296 | */ |
297 | 297 | ||
298 | void KODayMatrix::addSelectedDaysTo(DateList& selDays) | 298 | void KODayMatrix::addSelectedDaysTo(DateList& selDays) |
299 | { | 299 | { |
300 | 300 | ||
301 | if (mSelStart == NOSELECTION) { | 301 | if (mSelStart == NOSELECTION) { |
302 | return; | 302 | return; |
303 | } | 303 | } |
304 | 304 | ||
305 | //cope with selection being out of matrix limits at top (< 0) | 305 | //cope with selection being out of matrix limits at top (< 0) |
306 | int i0 = mSelStart; | 306 | int i0 = mSelStart; |
307 | if (i0 < 0) { | 307 | if (i0 < 0) { |
308 | for (int i = i0; i < 0; i++) { | 308 | for (int i = i0; i < 0; i++) { |
309 | selDays.append(days[0].addDays(i)); | 309 | selDays.append(days[0].addDays(i)); |
310 | } | 310 | } |
311 | i0 = 0; | 311 | i0 = 0; |
312 | } | 312 | } |
313 | 313 | ||
314 | //cope with selection being out of matrix limits at bottom (> NUMDAYS-1) | 314 | //cope with selection being out of matrix limits at bottom (> NUMDAYS-1) |
315 | if (mSelEnd > NUMDAYS-1) { | 315 | if (mSelEnd > NUMDAYS-1) { |
316 | for (int i = i0; i <= NUMDAYS-1; i++) { | 316 | for (int i = i0; i <= NUMDAYS-1; i++) { |
317 | selDays.append(days[i]); | 317 | selDays.append(days[i]); |
318 | } | 318 | } |
319 | for (int i = NUMDAYS; i < mSelEnd; i++) { | 319 | for (int i = NUMDAYS; i < mSelEnd; i++) { |
320 | selDays.append(days[0].addDays(i)); | 320 | selDays.append(days[0].addDays(i)); |
321 | } | 321 | } |
322 | 322 | ||
323 | // apply normal routine to selection being entirely within matrix limits | 323 | // apply normal routine to selection being entirely within matrix limits |
324 | } else { | 324 | } else { |
325 | for (int i = i0; i <= mSelEnd; i++) { | 325 | for (int i = i0; i <= mSelEnd; i++) { |
326 | selDays.append(days[i]); | 326 | selDays.append(days[i]); |
327 | } | 327 | } |
328 | } | 328 | } |
329 | } | 329 | } |
330 | 330 | ||
331 | bool KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) | 331 | bool KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) |
332 | { | 332 | { |
333 | mRedrawNeeded = true; | 333 | mRedrawNeeded = true; |
334 | bool noSel = (mSelEnd == NOSELECTION && mSelStart == NOSELECTION ); | 334 | bool noSel = (mSelEnd == NOSELECTION && mSelStart == NOSELECTION ); |
335 | mSelStart = startdate.daysTo(start); | 335 | mSelStart = startdate.daysTo(start); |
336 | if ( mSelStart < 0 ) | 336 | if ( mSelStart < 0 ) |
337 | mSelStart = 0; | 337 | mSelStart = 0; |
338 | mSelEnd = startdate.daysTo(end); | 338 | mSelEnd = startdate.daysTo(end); |
339 | if ( mSelEnd > NUMDAYS-1 ) | 339 | if ( mSelEnd > NUMDAYS-1 ) |
340 | mSelEnd = NUMDAYS-1; | 340 | mSelEnd = NUMDAYS-1; |
341 | if ( mSelEnd < 0 || mSelStart > NUMDAYS-1 ) { | 341 | if ( mSelEnd < 0 || mSelStart > NUMDAYS-1 ) { |
342 | clearSelection(); | 342 | clearSelection(); |
343 | if ( noSel ) | 343 | if ( noSel ) |
344 | return false; | 344 | return false; |
345 | } | 345 | } |
346 | 346 | ||
347 | return true; | 347 | return true; |
348 | } | 348 | } |
349 | void KODayMatrix::clearSelection() | 349 | void KODayMatrix::clearSelection() |
350 | { | 350 | { |
351 | mSelEnd = mSelStart = NOSELECTION; | 351 | mSelEnd = mSelStart = NOSELECTION; |
352 | } | 352 | } |
353 | 353 | ||
354 | 354 | ||
355 | void KODayMatrix::recalculateToday() | 355 | void KODayMatrix::recalculateToday() |
356 | { | 356 | { |
357 | today = -1; | 357 | today = -1; |
358 | for (int i=0; i<NUMDAYS; i++) { | 358 | for (int i=0; i<NUMDAYS; i++) { |
359 | //events[i] = 0; | 359 | //events[i] = 0; |
360 | days[i] = startdate.addDays(i); | 360 | days[i] = startdate.addDays(i); |
361 | daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] )); | 361 | daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] )); |
362 | 362 | ||
363 | // if today is in the currently displayed month, hilight today | 363 | // if today is in the currently displayed month, hilight today |
364 | if (days[i].year() == QDate::currentDate().year() && | 364 | if (days[i].year() == QDate::currentDate().year() && |
365 | days[i].month() == QDate::currentDate().month() && | 365 | days[i].month() == QDate::currentDate().month() && |
366 | days[i].day() == QDate::currentDate().day()) { | 366 | days[i].day() == QDate::currentDate().day()) { |
367 | today = i; | 367 | today = i; |
368 | } | 368 | } |
369 | } | 369 | } |
370 | // qDebug(QString("Today is visible at %1.").arg(today)); | 370 | // qDebug(QString("Today is visible at %1.").arg(today)); |
371 | } | 371 | } |
372 | 372 | ||
373 | void KODayMatrix::updateView() | 373 | void KODayMatrix::updateView() |
374 | { | 374 | { |
375 | updateView(startdate); | 375 | updateView(startdate); |
376 | } | 376 | } |
377 | void KODayMatrix::repaintViewTimed() | 377 | void KODayMatrix::repaintViewTimed() |
378 | { | 378 | { |
379 | mRedrawNeeded = true; | 379 | mRedrawNeeded = true; |
380 | // bDays.fill( false); | 380 | // bDays.fill( false); |
381 | //pDays.fill( false); | 381 | //pDays.fill( false); |
382 | //hDays.fill( false); | 382 | //hDays.fill( false); |
383 | //eDays.fill( false); | 383 | //eDays.fill( false); |
384 | mRepaintTimer->stop(); | 384 | mRepaintTimer->stop(); |
385 | int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday | 385 | int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday |
386 | int i; | 386 | int i; |
387 | for(i = 0; i < NUMDAYS; i++) { | 387 | for(i = 0; i < NUMDAYS; i++) { |
388 | if ( ( (i+startDay) % 7 == 0 ) ) { | 388 | if ( ( (i+startDay) % 7 == 0 ) ) { |
389 | pDays.setBit(i); | 389 | pDays.setBit(i); |
390 | } | 390 | } |
391 | } | 391 | } |
392 | repaint(false); | 392 | repaint(false); |
393 | } | 393 | } |
394 | void KODayMatrix::computeEvent(Event *event, int i ) | 394 | void KODayMatrix::computeEvent(Event *event, int i ) |
395 | { | 395 | { |
396 | QString holiStr = mHolidays[i]; | 396 | QString holiStr = mHolidays[i]; |
397 | if ( event->isHoliday()) { | 397 | if ( event->isHoliday()) { |
398 | pDays.setBit(i); | 398 | pDays.setBit(i); |
399 | hDays.setBit(i); | 399 | hDays.setBit(i); |
400 | if ( !holiStr.isEmpty() ) | 400 | if ( !holiStr.isEmpty() ) |
401 | holiStr += "\n"; | 401 | holiStr += "\n"; |
402 | holiStr += event->summary(); | 402 | holiStr += event->summary(); |
403 | if ( !event->location().isEmpty() ) | 403 | if ( !event->location().isEmpty() ) |
404 | holiStr += " (" + event->location() + ")"; | 404 | holiStr += " (" + event->location() + ")"; |
405 | mHolidays[i] =holiStr ; | 405 | mHolidays[i] =holiStr ; |
406 | eDays.setBit(i); | 406 | eDays.setBit(i); |
407 | } | 407 | } |
408 | if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_T_VIEW && KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) { | 408 | if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_T_VIEW && KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) { |
409 | if ( event->isBirthday()) { | 409 | if ( event->isBirthday()) { |
410 | pDays.setBit(i); | 410 | pDays.setBit(i); |
411 | if ( !holiStr.isEmpty() ) | 411 | if ( !holiStr.isEmpty() ) |
412 | holiStr += "\n"; | 412 | holiStr += "\n"; |
413 | holiStr += i18n("Birthday") + ": "+event->summary(); | 413 | holiStr += i18n("Birthday") + ": "+event->summary(); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index eed023c..3c0259f 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1,382 +1,382 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qpopupmenu.h> | 4 | #include <qpopupmenu.h> |
5 | #include <qpainter.h> | 5 | #include <qpainter.h> |
6 | #include <qwhatsthis.h> | 6 | #include <qwhatsthis.h> |
7 | #include <qpushbutton.h> | 7 | #include <qpushbutton.h> |
8 | #include <qmessagebox.h> | 8 | #include <qmessagebox.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | #include <qtextcodec.h> | 10 | #include <qtextcodec.h> |
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qdir.h> | 12 | #include <qdir.h> |
13 | #include <qapp.h> | 13 | #include <qapp.h> |
14 | #include <qfileinfo.h> | 14 | #include <qfileinfo.h> |
15 | #include <qlabel.h> | 15 | #include <qlabel.h> |
16 | #include <qspinbox.h> | 16 | #include <qspinbox.h> |
17 | #include <qcheckbox.h> | 17 | #include <qcheckbox.h> |
18 | #include <qmap.h> | 18 | #include <qmap.h> |
19 | #include <qwmatrix.h> | 19 | #include <qwmatrix.h> |
20 | #include <qtextbrowser.h> | 20 | #include <qtextbrowser.h> |
21 | #include <qtextstream.h> | 21 | #include <qtextstream.h> |
22 | #ifndef DESKTOP_VERSION | 22 | #ifndef DESKTOP_VERSION |
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | #include <qpe/qpemenubar.h> | 24 | #include <qpe/qpemenubar.h> |
25 | #include <qpe/qpetoolbar.h> | 25 | #include <qpe/qpetoolbar.h> |
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qtopia/alarmserver.h> | 28 | #include <qtopia/alarmserver.h> |
29 | #include <qtopia/qcopenvelope_qws.h> | 29 | #include <qtopia/qcopenvelope_qws.h> |
30 | #include <unistd.h> // for sleep | 30 | #include <unistd.h> // for sleep |
31 | #else | 31 | #else |
32 | #include <qmenubar.h> | 32 | #include <qmenubar.h> |
33 | #include <qtoolbar.h> | 33 | #include <qtoolbar.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | //#include <resource.h> | 35 | //#include <resource.h> |
36 | 36 | ||
37 | #endif | 37 | #endif |
38 | #include <libkcal/calendarlocal.h> | 38 | #include <libkcal/calendarlocal.h> |
39 | #include <libkcal/todo.h> | 39 | #include <libkcal/todo.h> |
40 | #include <libkcal/phoneformat.h> | 40 | #include <libkcal/phoneformat.h> |
41 | #include <libkdepim/ksyncprofile.h> | 41 | #include <libkdepim/ksyncprofile.h> |
42 | #include <libkdepim/phoneaccess.h> | 42 | #include <libkdepim/phoneaccess.h> |
43 | #include <libkcal/kincidenceformatter.h> | 43 | #include <libkcal/kincidenceformatter.h> |
44 | #include <libkdepim/kpimglobalprefs.h> | 44 | #include <libkdepim/kpimglobalprefs.h> |
45 | 45 | ||
46 | #include "calendarview.h" | 46 | #include "calendarview.h" |
47 | #include "koviewmanager.h" | 47 | #include "koviewmanager.h" |
48 | #include "datenavigator.h" | 48 | #include "datenavigator.h" |
49 | #include "koagendaview.h" | 49 | #include "koagendaview.h" |
50 | #include "koagenda.h" | 50 | #include "koagenda.h" |
51 | #include "kodialogmanager.h" | 51 | #include "kodialogmanager.h" |
52 | #include "kdialogbase.h" | 52 | #include "kdialogbase.h" |
53 | #include "kapplication.h" | 53 | #include "kapplication.h" |
54 | #include "kofilterview.h" | 54 | #include "kofilterview.h" |
55 | #include "kstandarddirs.h" | 55 | #include "kstandarddirs.h" |
56 | #include "koprefs.h" | 56 | #include "koprefs.h" |
57 | #include "kfiledialog.h" | 57 | #include "kfiledialog.h" |
58 | #include "koglobals.h" | 58 | #include "koglobals.h" |
59 | #include "kglobal.h" | 59 | #include "kglobal.h" |
60 | #include "ktoolbar.h" | 60 | #include "ktoolbar.h" |
61 | #include "klocale.h" | 61 | #include "klocale.h" |
62 | #include "kconfig.h" | 62 | #include "kconfig.h" |
63 | #include "externalapphandler.h" | 63 | #include "externalapphandler.h" |
64 | #include <kglobalsettings.h> | 64 | #include <kglobalsettings.h> |
65 | 65 | ||
66 | using namespace KCal; | 66 | using namespace KCal; |
67 | #ifndef _WIN32_ | 67 | #ifndef _WIN32_ |
68 | #include <unistd.h> | 68 | #include <unistd.h> |
69 | #else | 69 | #else |
70 | #ifdef _OL_IMPORT_ | 70 | #ifdef _OL_IMPORT_ |
71 | #include "koimportoldialog.h" | 71 | #include "koimportoldialog.h" |
72 | #endif | 72 | #endif |
73 | #endif | 73 | #endif |
74 | #include "mainwindow.h" | 74 | #include "mainwindow.h" |
75 | 75 | ||
76 | 76 | ||
77 | class KOex2phonePrefs : public QDialog | 77 | class KOex2phonePrefs : public QDialog |
78 | { | 78 | { |
79 | public: | 79 | public: |
80 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 80 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
81 | QDialog( parent, name, true ) | 81 | QDialog( parent, name, true ) |
82 | { | 82 | { |
83 | setCaption( i18n("Export to phone options") ); | 83 | setCaption( i18n("Export to phone options") ); |
84 | QVBoxLayout* lay = new QVBoxLayout( this ); | 84 | QVBoxLayout* lay = new QVBoxLayout( this ); |
85 | lay->setSpacing( 3 ); | 85 | lay->setSpacing( 3 ); |
86 | lay->setMargin( 3 ); | 86 | lay->setMargin( 3 ); |
87 | QLabel *lab; | 87 | QLabel *lab; |
88 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 88 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
89 | lab->setAlignment (AlignHCenter ); | 89 | lab->setAlignment (AlignHCenter ); |
90 | QHBox* temphb; | 90 | QHBox* temphb; |
91 | temphb = new QHBox( this ); | 91 | temphb = new QHBox( this ); |
92 | new QLabel( i18n("I/O device: "), temphb ); | 92 | new QLabel( i18n("I/O device: "), temphb ); |
93 | mPhoneDevice = new QLineEdit( temphb); | 93 | mPhoneDevice = new QLineEdit( temphb); |
94 | lay->addWidget( temphb ); | 94 | lay->addWidget( temphb ); |
95 | temphb = new QHBox( this ); | 95 | temphb = new QHBox( this ); |
96 | new QLabel( i18n("Connection: "), temphb ); | 96 | new QLabel( i18n("Connection: "), temphb ); |
97 | mPhoneConnection = new QLineEdit( temphb); | 97 | mPhoneConnection = new QLineEdit( temphb); |
98 | lay->addWidget( temphb ); | 98 | lay->addWidget( temphb ); |
99 | temphb = new QHBox( this ); | 99 | temphb = new QHBox( this ); |
100 | new QLabel( i18n("Model(opt.): "), temphb ); | 100 | new QLabel( i18n("Model(opt.): "), temphb ); |
101 | mPhoneModel = new QLineEdit( temphb); | 101 | mPhoneModel = new QLineEdit( temphb); |
102 | lay->addWidget( temphb ); | 102 | lay->addWidget( temphb ); |
103 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); | 103 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); |
104 | mWriteBackFuture->setChecked( true ); | 104 | mWriteBackFuture->setChecked( true ); |
105 | lay->addWidget( mWriteBackFuture ); | 105 | lay->addWidget( mWriteBackFuture ); |
106 | temphb = new QHBox( this ); | 106 | temphb = new QHBox( this ); |
107 | new QLabel( i18n("Max. weeks in future: ") , temphb ); | 107 | new QLabel( i18n("Max. weeks in future: ") , temphb ); |
108 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); | 108 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); |
109 | mWriteBackFutureWeeks->setValue( 8 ); | 109 | mWriteBackFutureWeeks->setValue( 8 ); |
110 | lay->addWidget( temphb ); | 110 | lay->addWidget( temphb ); |
111 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); | 111 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); |
112 | lab->setAlignment (AlignHCenter ); | 112 | lab->setAlignment (AlignHCenter ); |
113 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 113 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
114 | lay->addWidget( ok ); | 114 | lay->addWidget( ok ); |
115 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 115 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
116 | lay->addWidget( cancel ); | 116 | lay->addWidget( cancel ); |
117 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 117 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
118 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 118 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
119 | resize( 220, 240 ); | 119 | resize( 220, 240 ); |
120 | qApp->processEvents(); | 120 | qApp->processEvents(); |
121 | int dw = QApplication::desktop()->width(); | 121 | int dw = QApplication::desktop()->width(); |
122 | int dh = QApplication::desktop()->height(); | 122 | int dh = QApplication::desktop()->height(); |
123 | move( (dw-width())/2, (dh - height() )/2 ); | 123 | move( (dw-width())/2, (dh - height() )/2 ); |
124 | } | 124 | } |
125 | 125 | ||
126 | public: | 126 | public: |
127 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 127 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
128 | QCheckBox* mWriteBackFuture; | 128 | QCheckBox* mWriteBackFuture; |
129 | QSpinBox* mWriteBackFutureWeeks; | 129 | QSpinBox* mWriteBackFutureWeeks; |
130 | }; | 130 | }; |
131 | 131 | ||
132 | int globalFlagBlockStartup; | 132 | int globalFlagBlockStartup; |
133 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 133 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : |
134 | QMainWindow( parent, name ) | 134 | QMainWindow( parent, name ) |
135 | { | 135 | { |
136 | 136 | ||
137 | mClosed = false; | 137 | mClosed = false; |
138 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 138 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
139 | QString confFile = locateLocal("config","korganizerrc"); | 139 | QString confFile = locateLocal("config","korganizerrc"); |
140 | QFileInfo finf ( confFile ); | 140 | QFileInfo finf ( confFile ); |
141 | bool showWarning = !finf.exists(); | 141 | bool showWarning = !finf.exists(); |
142 | setIcon(SmallIcon( "ko24" ) ); | 142 | setIcon(SmallIcon( "ko24" ) ); |
143 | mBlockAtStartup = true; | 143 | mBlockAtStartup = true; |
144 | mFlagKeyPressed = false; | 144 | mFlagKeyPressed = false; |
145 | setCaption("KO/Pi"); | 145 | setCaption("KO/Pi"); |
146 | KOPrefs *p = KOPrefs::instance(); | 146 | KOPrefs *p = KOPrefs::instance(); |
147 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 147 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
148 | p->mCurrentDisplayedView = 0; | 148 | p->mCurrentDisplayedView = 0; |
149 | if ( p->mHourSize > 22 ) | 149 | if ( p->mHourSize > 22 ) |
150 | p->mHourSize = 22; | 150 | p->mHourSize = 22; |
151 | QMainWindow::ToolBarDock tbd; | 151 | QMainWindow::ToolBarDock tbd; |
152 | if ( p->mToolBarHor ) { | 152 | if ( p->mToolBarHor ) { |
153 | if ( p->mToolBarUp ) | 153 | if ( p->mToolBarUp ) |
154 | tbd = Bottom; | 154 | tbd = Bottom; |
155 | else | 155 | else |
156 | tbd = Top; | 156 | tbd = Top; |
157 | } | 157 | } |
158 | else { | 158 | else { |
159 | if ( p->mToolBarUp ) | 159 | if ( p->mToolBarUp ) |
160 | tbd = Right; | 160 | tbd = Right; |
161 | else | 161 | else |
162 | tbd = Left; | 162 | tbd = Left; |
163 | } | 163 | } |
164 | if ( KOPrefs::instance()->mUseAppColors ) | 164 | if ( KOPrefs::instance()->mUseAppColors ) |
165 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 165 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
166 | globalFlagBlockStartup = 1; | 166 | globalFlagBlockStartup = 1; |
167 | iconToolBar = new QPEToolBar( this ); | 167 | iconToolBar = new QPEToolBar( this ); |
168 | addToolBar (iconToolBar , tbd ); | 168 | addToolBar (iconToolBar , tbd ); |
169 | 169 | ||
170 | #ifdef DESKTOP_VERSION | 170 | #ifdef DESKTOP_VERSION |
171 | if ( KOPrefs::instance()->mShowIconFilter ) | 171 | if ( KOPrefs::instance()->mShowIconFilter ) |
172 | #else | 172 | #else |
173 | if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) | 173 | if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) |
174 | #endif | 174 | #endif |
175 | 175 | ||
176 | { | 176 | { |
177 | if ( p->mToolBarHorF ) { | 177 | if ( p->mToolBarHorF ) { |
178 | if ( p->mToolBarUpF ) | 178 | if ( p->mToolBarUpF ) |
179 | tbd = Bottom; | 179 | tbd = Bottom; |
180 | else | 180 | else |
181 | tbd = Top; | 181 | tbd = Top; |
182 | } | 182 | } |
183 | else { | 183 | else { |
184 | if ( p->mToolBarUpF ) | 184 | if ( p->mToolBarUpF ) |
185 | tbd = Right; | 185 | tbd = Right; |
186 | else | 186 | else |
187 | tbd = Left; | 187 | tbd = Left; |
188 | } | 188 | } |
189 | filterToolBar = new QPEToolBar ( this ); | 189 | filterToolBar = new QPEToolBar ( this ); |
190 | filterMenubar = new QMenuBar( filterToolBar ); | 190 | filterMenubar = new QMenuBar( 0 ); |
191 | QFontMetrics fm ( filterMenubar->font() ); | 191 | QFontMetrics fm ( filterMenubar->font() ); |
192 | 192 | ||
193 | filterPopupMenu = new QPopupMenu( this ); | 193 | filterPopupMenu = new QPopupMenu( this ); |
194 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | 194 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); |
195 | QString addTest = "A"; | 195 | QString addTest = "A"; |
196 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); | 196 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); |
197 | #ifdef DESKTOP_VERSION | 197 | #ifdef DESKTOP_VERSION |
198 | addTest = "AAABBBCCCx"; | 198 | addTest = "AAABBBCCCx"; |
199 | #else | 199 | #else |
200 | addTest = "AAx"; | 200 | addTest = "AAx"; |
201 | #endif | 201 | #endif |
202 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); | 202 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); |
203 | addToolBar (filterToolBar , tbd ); | 203 | addToolBar (filterToolBar , tbd ); |
204 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); | 204 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); |
205 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); | 205 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); |
206 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) | 206 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) |
207 | filterToolBar->hide(); | 207 | filterToolBar->hide(); |
208 | } else { | 208 | } else { |
209 | filterToolBar = 0; | 209 | filterToolBar = 0; |
210 | filterMenubar = 0; | 210 | filterMenubar = 0; |
211 | filterPopupMenu = 0; | 211 | filterPopupMenu = 0; |
212 | } | 212 | } |
213 | if ( p->mShowIconOnetoolbar ) { | 213 | if ( p->mShowIconOnetoolbar ) { |
214 | viewToolBar = iconToolBar ; | 214 | viewToolBar = iconToolBar ; |
215 | navigatorToolBar = iconToolBar ; | 215 | navigatorToolBar = iconToolBar ; |
216 | } else { | 216 | } else { |
217 | #ifndef DESKTOP_VERSION | 217 | #ifndef DESKTOP_VERSION |
218 | setToolBarsMovable( false ); | 218 | setToolBarsMovable( false ); |
219 | #endif | 219 | #endif |
220 | if ( p->mToolBarHorV ) { | 220 | if ( p->mToolBarHorV ) { |
221 | if ( p->mToolBarUpV ) | 221 | if ( p->mToolBarUpV ) |
222 | tbd = Bottom; | 222 | tbd = Bottom; |
223 | else | 223 | else |
224 | tbd = Top; | 224 | tbd = Top; |
225 | } | 225 | } |
226 | else { | 226 | else { |
227 | if ( p->mToolBarUpV ) | 227 | if ( p->mToolBarUpV ) |
228 | tbd = Right; | 228 | tbd = Right; |
229 | else | 229 | else |
230 | tbd = Left; | 230 | tbd = Left; |
231 | } | 231 | } |
232 | viewToolBar = new QPEToolBar( this ); | 232 | viewToolBar = new QPEToolBar( this ); |
233 | addToolBar (viewToolBar , tbd ); | 233 | addToolBar (viewToolBar , tbd ); |
234 | if ( p->mToolBarHorN ) { | 234 | if ( p->mToolBarHorN ) { |
235 | if ( p->mToolBarUpN ) | 235 | if ( p->mToolBarUpN ) |
236 | tbd = Bottom; | 236 | tbd = Bottom; |
237 | else | 237 | else |
238 | tbd = Top; | 238 | tbd = Top; |
239 | } | 239 | } |
240 | else { | 240 | else { |
241 | if ( p->mToolBarUpN ) | 241 | if ( p->mToolBarUpN ) |
242 | tbd = Right; | 242 | tbd = Right; |
243 | else | 243 | else |
244 | tbd = Left; | 244 | tbd = Left; |
245 | } | 245 | } |
246 | navigatorToolBar = new QPEToolBar( this ); | 246 | navigatorToolBar = new QPEToolBar( this ); |
247 | addToolBar (navigatorToolBar , tbd ); | 247 | addToolBar (navigatorToolBar , tbd ); |
248 | } | 248 | } |
249 | 249 | ||
250 | 250 | ||
251 | 251 | ||
252 | mCalendarModifiedFlag = false; | 252 | mCalendarModifiedFlag = false; |
253 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 253 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
254 | splash->setAlignment ( AlignCenter ); | 254 | splash->setAlignment ( AlignCenter ); |
255 | setCentralWidget( splash ); | 255 | setCentralWidget( splash ); |
256 | #ifndef DESKTOP_VERSION | 256 | #ifndef DESKTOP_VERSION |
257 | showMaximized(); | 257 | showMaximized(); |
258 | #endif | 258 | #endif |
259 | 259 | ||
260 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 260 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
261 | setDefaultPreferences(); | 261 | setDefaultPreferences(); |
262 | mCalendar = new CalendarLocal(); | 262 | mCalendar = new CalendarLocal(); |
263 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 263 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
264 | mView->hide(); | 264 | mView->hide(); |
265 | //mView->resize(splash->size() ); | 265 | //mView->resize(splash->size() ); |
266 | initActions(); | 266 | initActions(); |
267 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 267 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
268 | mSyncManager->setBlockSave(false); | 268 | mSyncManager->setBlockSave(false); |
269 | mView->setSyncManager(mSyncManager); | 269 | mView->setSyncManager(mSyncManager); |
270 | #ifndef DESKTOP_VERSION | 270 | #ifndef DESKTOP_VERSION |
271 | iconToolBar->show(); | 271 | iconToolBar->show(); |
272 | qApp->processEvents(); | 272 | qApp->processEvents(); |
273 | #endif | 273 | #endif |
274 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 274 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
275 | int vh = height() ; | 275 | int vh = height() ; |
276 | int vw = width(); | 276 | int vw = width(); |
277 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); | 277 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); |
278 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 278 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
279 | vh -= iconToolBar->height(); | 279 | vh -= iconToolBar->height(); |
280 | } else { | 280 | } else { |
281 | vw -= iconToolBar->height(); | 281 | vw -= iconToolBar->height(); |
282 | } | 282 | } |
283 | //mView->setMaximumSize( splash->size() ); | 283 | //mView->setMaximumSize( splash->size() ); |
284 | //mView->resize( splash->size() ); | 284 | //mView->resize( splash->size() ); |
285 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 285 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
286 | mView->readSettings(); | 286 | mView->readSettings(); |
287 | bool newFile = false; | 287 | bool newFile = false; |
288 | if( !QFile::exists( defaultFileName() ) ) { | 288 | if( !QFile::exists( defaultFileName() ) ) { |
289 | QFileInfo finfo ( defaultFileName() ); | 289 | QFileInfo finfo ( defaultFileName() ); |
290 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); | 290 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); |
291 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; | 291 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; |
292 | finfo.setFile( oldFile ); | 292 | finfo.setFile( oldFile ); |
293 | if (finfo.exists() ) { | 293 | if (finfo.exists() ) { |
294 | KMessageBox::information( this, message); | 294 | KMessageBox::information( this, message); |
295 | mView->openCalendar( oldFile ); | 295 | mView->openCalendar( oldFile ); |
296 | qApp->processEvents(); | 296 | qApp->processEvents(); |
297 | } else { | 297 | } else { |
298 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); | 298 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); |
299 | finfo.setFile( oldFile ); | 299 | finfo.setFile( oldFile ); |
300 | if (finfo.exists() ) { | 300 | if (finfo.exists() ) { |
301 | KMessageBox::information( this, message); | 301 | KMessageBox::information( this, message); |
302 | mView->openCalendar( oldFile ); | 302 | mView->openCalendar( oldFile ); |
303 | qApp->processEvents(); | 303 | qApp->processEvents(); |
304 | } | 304 | } |
305 | } | 305 | } |
306 | mView->saveCalendar( defaultFileName() ); | 306 | mView->saveCalendar( defaultFileName() ); |
307 | newFile = true; | 307 | newFile = true; |
308 | } | 308 | } |
309 | 309 | ||
310 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 310 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
311 | mView->openCalendar( defaultFileName() ); | 311 | mView->openCalendar( defaultFileName() ); |
312 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 312 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
313 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 313 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
314 | 314 | ||
315 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 315 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
316 | KOPrefs::instance()->setAllDefaults(); | 316 | KOPrefs::instance()->setAllDefaults(); |
317 | int count = mView->addCategories(); | 317 | int count = mView->addCategories(); |
318 | } | 318 | } |
319 | processIncidenceSelection( 0 ); | 319 | processIncidenceSelection( 0 ); |
320 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 320 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
321 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 321 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
322 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 322 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
323 | SLOT( slotModifiedChanged( bool ) ) ); | 323 | SLOT( slotModifiedChanged( bool ) ) ); |
324 | 324 | ||
325 | 325 | ||
326 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 326 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
327 | SLOT( disableBR(bool) ) ); | 327 | SLOT( disableBR(bool) ) ); |
328 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 328 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
329 | mView->setModified( false ); | 329 | mView->setModified( false ); |
330 | mBlockAtStartup = false; | 330 | mBlockAtStartup = false; |
331 | mView->setModified( false ); | 331 | mView->setModified( false ); |
332 | setCentralWidget( mView ); | 332 | setCentralWidget( mView ); |
333 | globalFlagBlockStartup = 0; | 333 | globalFlagBlockStartup = 0; |
334 | mView->show(); | 334 | mView->show(); |
335 | delete splash; | 335 | delete splash; |
336 | if ( newFile ) | 336 | if ( newFile ) |
337 | mView->updateConfig(); | 337 | mView->updateConfig(); |
338 | // qApp->processEvents(); | 338 | // qApp->processEvents(); |
339 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 339 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
340 | //fillSyncMenu(); | 340 | //fillSyncMenu(); |
341 | 341 | ||
342 | 342 | ||
343 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 343 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
344 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 344 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
345 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 345 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
346 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 346 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
347 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 347 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
348 | mSyncManager->setDefaultFileName( sentSyncFile()); | 348 | mSyncManager->setDefaultFileName( sentSyncFile()); |
349 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 349 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
350 | mSyncManager->fillSyncMenu(); | 350 | mSyncManager->fillSyncMenu(); |
351 | 351 | ||
352 | 352 | ||
353 | 353 | ||
354 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 354 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
355 | if ( showWarning ) { | 355 | if ( showWarning ) { |
356 | KMessageBox::information( this, | 356 | KMessageBox::information( this, |
357 | "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"); | 357 | "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"); |
358 | qApp->processEvents(); | 358 | qApp->processEvents(); |
359 | mView->dialogManager()->showSyncOptions(); | 359 | mView->dialogManager()->showSyncOptions(); |
360 | } | 360 | } |
361 | 361 | ||
362 | //US listen for result adressed from Ka/Pi | 362 | //US listen for result adressed from Ka/Pi |
363 | #ifndef DESKTOP_VERSION | 363 | #ifndef DESKTOP_VERSION |
364 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 364 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
365 | #endif | 365 | #endif |
366 | #ifndef DESKTOP_VERSION | 366 | #ifndef DESKTOP_VERSION |
367 | infrared = 0; | 367 | infrared = 0; |
368 | #endif | 368 | #endif |
369 | updateFilterToolbar(); | 369 | updateFilterToolbar(); |
370 | updateWeek( mView->startDate() ); | 370 | updateWeek( mView->startDate() ); |
371 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 371 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
372 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 372 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
373 | mBRdisabled = false; | 373 | mBRdisabled = false; |
374 | //toggleBeamReceive(); | 374 | //toggleBeamReceive(); |
375 | } | 375 | } |
376 | MainWindow::~MainWindow() | 376 | MainWindow::~MainWindow() |
377 | { | 377 | { |
378 | //qDebug("MainWindow::~MainWindow() "); | 378 | //qDebug("MainWindow::~MainWindow() "); |
379 | //save toolbar location | 379 | //save toolbar location |
380 | delete mCalendar; | 380 | delete mCalendar; |
381 | delete mSyncManager; | 381 | delete mSyncManager; |
382 | #ifndef DESKTOP_VERSION | 382 | #ifndef DESKTOP_VERSION |
@@ -1091,386 +1091,388 @@ void MainWindow::initActions() | |||
1091 | action->addTo( helpMenu ); | 1091 | action->addTo( helpMenu ); |
1092 | connect( action, SIGNAL( activated() ), | 1092 | connect( action, SIGNAL( activated() ), |
1093 | SLOT( keyBindings() ) ); | 1093 | SLOT( keyBindings() ) ); |
1094 | action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); | 1094 | action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); |
1095 | action->addTo( helpMenu ); | 1095 | action->addTo( helpMenu ); |
1096 | connect( action, SIGNAL( activated() ), | 1096 | connect( action, SIGNAL( activated() ), |
1097 | SLOT( storagehowto() ) ); | 1097 | SLOT( storagehowto() ) ); |
1098 | action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); | 1098 | action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); |
1099 | action->addTo( helpMenu ); | 1099 | action->addTo( helpMenu ); |
1100 | connect( action, SIGNAL( activated() ), | 1100 | connect( action, SIGNAL( activated() ), |
1101 | SLOT( timetrackinghowto() ) ); | 1101 | SLOT( timetrackinghowto() ) ); |
1102 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 1102 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
1103 | action->addTo( helpMenu ); | 1103 | action->addTo( helpMenu ); |
1104 | connect( action, SIGNAL( activated() ), | 1104 | connect( action, SIGNAL( activated() ), |
1105 | SLOT( synchowto() ) ); | 1105 | SLOT( synchowto() ) ); |
1106 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 1106 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
1107 | action->addTo( helpMenu ); | 1107 | action->addTo( helpMenu ); |
1108 | connect( action, SIGNAL( activated() ), | 1108 | connect( action, SIGNAL( activated() ), |
1109 | SLOT( kdesynchowto() ) ); | 1109 | SLOT( kdesynchowto() ) ); |
1110 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 1110 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
1111 | action->addTo( helpMenu ); | 1111 | action->addTo( helpMenu ); |
1112 | connect( action, SIGNAL( activated() ), | 1112 | connect( action, SIGNAL( activated() ), |
1113 | SLOT( multisynchowto() ) ); | 1113 | SLOT( multisynchowto() ) ); |
1114 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 1114 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
1115 | action->addTo( helpMenu ); | 1115 | action->addTo( helpMenu ); |
1116 | connect( action, SIGNAL( activated() ), | 1116 | connect( action, SIGNAL( activated() ), |
1117 | SLOT( aboutAutoSaving() ) ); | 1117 | SLOT( aboutAutoSaving() ) ); |
1118 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 1118 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
1119 | action->addTo( helpMenu ); | 1119 | action->addTo( helpMenu ); |
1120 | connect( action, SIGNAL( activated() ), | 1120 | connect( action, SIGNAL( activated() ), |
1121 | SLOT( aboutKnownBugs() ) ); | 1121 | SLOT( aboutKnownBugs() ) ); |
1122 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 1122 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
1123 | action->addTo( helpMenu ); | 1123 | action->addTo( helpMenu ); |
1124 | connect( action, SIGNAL( activated() ), | 1124 | connect( action, SIGNAL( activated() ), |
1125 | SLOT( usertrans() ) ); | 1125 | SLOT( usertrans() ) ); |
1126 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 1126 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
1127 | action->addTo( helpMenu ); | 1127 | action->addTo( helpMenu ); |
1128 | connect( action, SIGNAL( activated() ), | 1128 | connect( action, SIGNAL( activated() ), |
1129 | SLOT( faq() ) ); | 1129 | SLOT( faq() ) ); |
1130 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 1130 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
1131 | action->addTo( helpMenu ); | 1131 | action->addTo( helpMenu ); |
1132 | connect( action, SIGNAL( activated() ), | 1132 | connect( action, SIGNAL( activated() ), |
1133 | SLOT( licence() ) ); | 1133 | SLOT( licence() ) ); |
1134 | action = new QAction( "about", i18n("About..."), 0, this ); | 1134 | action = new QAction( "about", i18n("About..."), 0, this ); |
1135 | action->addTo( helpMenu ); | 1135 | action->addTo( helpMenu ); |
1136 | connect( action, SIGNAL( activated() ), | 1136 | connect( action, SIGNAL( activated() ), |
1137 | SLOT( about() ) ); | 1137 | SLOT( about() ) ); |
1138 | //menuBar->insertSeparator(); | 1138 | //menuBar->insertSeparator(); |
1139 | 1139 | ||
1140 | // ****************************************************** | 1140 | // ****************************************************** |
1141 | // menubar icons | 1141 | // menubar icons |
1142 | 1142 | ||
1143 | 1143 | ||
1144 | 1144 | ||
1145 | //menuBar->insertItem( iconToolBar ); | 1145 | //menuBar->insertItem( iconToolBar ); |
1146 | //xdays_action | 1146 | //xdays_action |
1147 | if (p-> mShowIconNewEvent) | 1147 | if (p-> mShowIconNewEvent) |
1148 | ne_action->addTo( iconToolBar ); | 1148 | ne_action->addTo( iconToolBar ); |
1149 | if (p->mShowIconNewTodo ) | 1149 | if (p->mShowIconNewTodo ) |
1150 | nt_action->addTo( iconToolBar ); | 1150 | nt_action->addTo( iconToolBar ); |
1151 | if (p-> mShowIconSearch) | 1151 | if (p-> mShowIconSearch) |
1152 | search_action->addTo( iconToolBar ); | 1152 | search_action->addTo( iconToolBar ); |
1153 | if (p-> mShowIconWhatsThis) | 1153 | if (p-> mShowIconWhatsThis) |
1154 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1154 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1155 | if (p-> mShowIconNext) | 1155 | if (p-> mShowIconNext) |
1156 | whatsnext_action->addTo( viewToolBar ); | 1156 | whatsnext_action->addTo( viewToolBar ); |
1157 | if (p-> mShowIconNextDays) | 1157 | if (p-> mShowIconNextDays) |
1158 | xdays_action->addTo( viewToolBar ); | 1158 | xdays_action->addTo( viewToolBar ); |
1159 | if (p-> mShowIconJournal) | 1159 | if (p-> mShowIconJournal) |
1160 | viewjournal_action->addTo( viewToolBar ); | 1160 | viewjournal_action->addTo( viewToolBar ); |
1161 | if (p-> mShowIconDay1) | 1161 | if (p-> mShowIconDay1) |
1162 | day1_action->addTo( viewToolBar ); | 1162 | day1_action->addTo( viewToolBar ); |
1163 | if (p-> mShowIconDay5) | 1163 | if (p-> mShowIconDay5) |
1164 | day5_action->addTo( viewToolBar ); | 1164 | day5_action->addTo( viewToolBar ); |
1165 | if (p-> mShowIconDay7) | 1165 | if (p-> mShowIconDay7) |
1166 | day7_action->addTo( viewToolBar ); | 1166 | day7_action->addTo( viewToolBar ); |
1167 | if (p-> mShowIconDay6) | 1167 | if (p-> mShowIconDay6) |
1168 | day6_action->addTo( viewToolBar ); | 1168 | day6_action->addTo( viewToolBar ); |
1169 | if (p-> mShowIconMonth) | 1169 | if (p-> mShowIconMonth) |
1170 | month_action->addTo( viewToolBar ); | 1170 | month_action->addTo( viewToolBar ); |
1171 | if (p-> mShowIconList) | 1171 | if (p-> mShowIconList) |
1172 | showlist_action->addTo( viewToolBar ); | 1172 | showlist_action->addTo( viewToolBar ); |
1173 | if (p-> mShowIconTodoview) | 1173 | if (p-> mShowIconTodoview) |
1174 | todoview_action->addTo( viewToolBar ); | 1174 | todoview_action->addTo( viewToolBar ); |
1175 | 1175 | ||
1176 | icon = loadPixmap( pathString + "2leftarrowB" ); | 1176 | icon = loadPixmap( pathString + "2leftarrowB" ); |
1177 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); | 1177 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); |
1178 | if (p-> mShowIconBackFast) { | 1178 | if (p-> mShowIconBackFast) { |
1179 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 1179 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
1180 | connect( action, SIGNAL( activated() ), | 1180 | connect( action, SIGNAL( activated() ), |
1181 | mView, SLOT( goPreviousMonth() ) ); | 1181 | mView, SLOT( goPreviousMonth() ) ); |
1182 | action->addTo( navigatorToolBar ); | 1182 | action->addTo( navigatorToolBar ); |
1183 | } | 1183 | } |
1184 | icon = loadPixmap( pathString + "1leftarrowB" ); | 1184 | icon = loadPixmap( pathString + "1leftarrowB" ); |
1185 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); | 1185 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); |
1186 | if (p-> mShowIconBack) { | 1186 | if (p-> mShowIconBack) { |
1187 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 1187 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
1188 | connect( action, SIGNAL( activated() ), | 1188 | connect( action, SIGNAL( activated() ), |
1189 | mView, SLOT( goPrevious() ) ); | 1189 | mView, SLOT( goPrevious() ) ); |
1190 | action->addTo( navigatorToolBar ); | 1190 | action->addTo( navigatorToolBar ); |
1191 | } | 1191 | } |
1192 | icon = loadPixmap( pathString + "today" ); | 1192 | icon = loadPixmap( pathString + "today" ); |
1193 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 1193 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
1194 | if (p-> mShowIconToday) | 1194 | if (p-> mShowIconToday) |
1195 | today_action->addTo( navigatorToolBar ); | 1195 | today_action->addTo( navigatorToolBar ); |
1196 | icon = loadPixmap( pathString + "1rightarrowB" ); | 1196 | icon = loadPixmap( pathString + "1rightarrowB" ); |
1197 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 1197 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
1198 | if (p-> mShowIconForward) { | 1198 | if (p-> mShowIconForward) { |
1199 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 1199 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
1200 | connect( action, SIGNAL( activated() ), | 1200 | connect( action, SIGNAL( activated() ), |
1201 | mView, SLOT( goNext() ) ); | 1201 | mView, SLOT( goNext() ) ); |
1202 | action->addTo( navigatorToolBar ); | 1202 | action->addTo( navigatorToolBar ); |
1203 | } | 1203 | } |
1204 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1204 | icon = loadPixmap( pathString + "2rightarrowB" ); |
1205 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1205 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1206 | if (p-> mShowIconForwardFast) { | 1206 | if (p-> mShowIconForwardFast) { |
1207 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1207 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1208 | connect( action, SIGNAL( activated() ), | 1208 | connect( action, SIGNAL( activated() ), |
1209 | mView, SLOT( goNextMonth() ) ); | 1209 | mView, SLOT( goNextMonth() ) ); |
1210 | action->addTo( navigatorToolBar ); | 1210 | action->addTo( navigatorToolBar ); |
1211 | } | 1211 | } |
1212 | 1212 | ||
1213 | 1213 | ||
1214 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); | 1214 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); |
1215 | 1215 | ||
1216 | 1216 | ||
1217 | if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); | 1217 | if ( p->mShowIconNavigator ) configureToolBarMenu->setItemChecked( 22 , true); |
1218 | if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); | 1218 | if ( p->mShowIconAllday ) configureToolBarMenu->setItemChecked( 24 , true); |
1219 | if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); | 1219 | if ( p->mShowIconFilterview ) configureToolBarMenu->setItemChecked( 26 , true); |
1220 | if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); | 1220 | if ( p->mShowIconToggleFull ) configureToolBarMenu->setItemChecked( 28 , true); |
1221 | 1221 | ||
1222 | if (p-> mShowIconNewEvent) | 1222 | if (p-> mShowIconNewEvent) |
1223 | configureToolBarMenu->setItemChecked( 10, true ); | 1223 | configureToolBarMenu->setItemChecked( 10, true ); |
1224 | if (p->mShowIconNewTodo ) | 1224 | if (p->mShowIconNewTodo ) |
1225 | configureToolBarMenu->setItemChecked( 20, true ); | 1225 | configureToolBarMenu->setItemChecked( 20, true ); |
1226 | if (p-> mShowIconSearch) | 1226 | if (p-> mShowIconSearch) |
1227 | configureToolBarMenu->setItemChecked( 120, true ); | 1227 | configureToolBarMenu->setItemChecked( 120, true ); |
1228 | if (p-> mShowIconList) | 1228 | if (p-> mShowIconList) |
1229 | configureToolBarMenu->setItemChecked( 30, true ); | 1229 | configureToolBarMenu->setItemChecked( 30, true ); |
1230 | if (p-> mShowIconDay1) | 1230 | if (p-> mShowIconDay1) |
1231 | configureToolBarMenu->setItemChecked( 40, true ); | 1231 | configureToolBarMenu->setItemChecked( 40, true ); |
1232 | if (p-> mShowIconDay5) | 1232 | if (p-> mShowIconDay5) |
1233 | configureToolBarMenu->setItemChecked( 50, true ); | 1233 | configureToolBarMenu->setItemChecked( 50, true ); |
1234 | if (p-> mShowIconDay6) | 1234 | if (p-> mShowIconDay6) |
1235 | configureToolBarMenu->setItemChecked( 75, true ); | 1235 | configureToolBarMenu->setItemChecked( 75, true ); |
1236 | if (p-> mShowIconDay7) | 1236 | if (p-> mShowIconDay7) |
1237 | configureToolBarMenu->setItemChecked( 60, true ); | 1237 | configureToolBarMenu->setItemChecked( 60, true ); |
1238 | if (p-> mShowIconMonth) | 1238 | if (p-> mShowIconMonth) |
1239 | configureToolBarMenu->setItemChecked( 70, true ); | 1239 | configureToolBarMenu->setItemChecked( 70, true ); |
1240 | if (p-> mShowIconTodoview) | 1240 | if (p-> mShowIconTodoview) |
1241 | configureToolBarMenu->setItemChecked( 80, true ); | 1241 | configureToolBarMenu->setItemChecked( 80, true ); |
1242 | if (p-> mShowIconBackFast) | 1242 | if (p-> mShowIconBackFast) |
1243 | configureToolBarMenu->setItemChecked( 200, true ); | 1243 | configureToolBarMenu->setItemChecked( 200, true ); |
1244 | if (p-> mShowIconBack) | 1244 | if (p-> mShowIconBack) |
1245 | configureToolBarMenu->setItemChecked( 210, true ); | 1245 | configureToolBarMenu->setItemChecked( 210, true ); |
1246 | if (p-> mShowIconToday) | 1246 | if (p-> mShowIconToday) |
1247 | configureToolBarMenu->setItemChecked( 130, true ); | 1247 | configureToolBarMenu->setItemChecked( 130, true ); |
1248 | if (p-> mShowIconForward) | 1248 | if (p-> mShowIconForward) |
1249 | configureToolBarMenu->setItemChecked( 220, true ); | 1249 | configureToolBarMenu->setItemChecked( 220, true ); |
1250 | if (p-> mShowIconForwardFast) | 1250 | if (p-> mShowIconForwardFast) |
1251 | configureToolBarMenu->setItemChecked( 230, true ); | 1251 | configureToolBarMenu->setItemChecked( 230, true ); |
1252 | if (p-> mShowIconNextDays) | 1252 | if (p-> mShowIconNextDays) |
1253 | configureToolBarMenu->setItemChecked( 100, true ); | 1253 | configureToolBarMenu->setItemChecked( 100, true ); |
1254 | if (p-> mShowIconNext) | 1254 | if (p-> mShowIconNext) |
1255 | configureToolBarMenu->setItemChecked( 110, true ); | 1255 | configureToolBarMenu->setItemChecked( 110, true ); |
1256 | if (p-> mShowIconJournal) | 1256 | if (p-> mShowIconJournal) |
1257 | configureToolBarMenu->setItemChecked( 90, true ); | 1257 | configureToolBarMenu->setItemChecked( 90, true ); |
1258 | if (p-> mShowIconWhatsThis) | 1258 | if (p-> mShowIconWhatsThis) |
1259 | configureToolBarMenu->setItemChecked( 300, true ); | 1259 | configureToolBarMenu->setItemChecked( 300, true ); |
1260 | if (p-> mShowIconWeekNum) | 1260 | if (p-> mShowIconWeekNum) |
1261 | configureToolBarMenu->setItemChecked( 400, true ); | 1261 | configureToolBarMenu->setItemChecked( 400, true ); |
1262 | if (!p-> mShowIconStretch) { | 1262 | if (!p-> mShowIconStretch) { |
1263 | QLabel* dummy = new QLabel( iconToolBar ); | 1263 | QLabel* dummy = new QLabel( iconToolBar ); |
1264 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1264 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1265 | dummy->setMinimumWidth( 0 ); | 1265 | dummy->setMinimumWidth( 0 ); |
1266 | iconToolBar->setStretchableWidget ( dummy ) ; | 1266 | iconToolBar->setStretchableWidget ( dummy ) ; |
1267 | } | 1267 | } |
1268 | else { | 1268 | else { |
1269 | iconToolBar->setHorizontalStretchable (true ); | 1269 | iconToolBar->setHorizontalStretchable (true ); |
1270 | viewToolBar->setHorizontalStretchable (true ); | 1270 | viewToolBar->setHorizontalStretchable (true ); |
1271 | navigatorToolBar->setHorizontalStretchable (true ); | 1271 | navigatorToolBar->setHorizontalStretchable (true ); |
1272 | iconToolBar->setVerticalStretchable (true ); | 1272 | iconToolBar->setVerticalStretchable (true ); |
1273 | viewToolBar->setVerticalStretchable (true ); | 1273 | viewToolBar->setVerticalStretchable (true ); |
1274 | navigatorToolBar->setVerticalStretchable (true ); | 1274 | navigatorToolBar->setVerticalStretchable (true ); |
1275 | configureToolBarMenu->setItemChecked( 5, true ); | 1275 | configureToolBarMenu->setItemChecked( 5, true ); |
1276 | } | 1276 | } |
1277 | if (p-> mShowIconFilter) | 1277 | if (p-> mShowIconFilter) |
1278 | configureToolBarMenu->setItemChecked( 7, true ); | 1278 | configureToolBarMenu->setItemChecked( 7, true ); |
1279 | if (p-> mShowIconOnetoolbar) | 1279 | if (p-> mShowIconOnetoolbar) |
1280 | configureToolBarMenu->setItemChecked( 6, true ); | 1280 | configureToolBarMenu->setItemChecked( 6, true ); |
1281 | 1281 | ||
1282 | 1282 | ||
1283 | if ( filterMenubar ) | 1283 | if ( filterMenubar ) { |
1284 | connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); | 1284 | filterMenubar->reparent(filterToolBar,0,QPoint(0,0) ); |
1285 | connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); | ||
1286 | } | ||
1285 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1287 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1286 | configureAgenda( p->mHourSize ); | 1288 | configureAgenda( p->mHourSize ); |
1287 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1289 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1288 | } | 1290 | } |
1289 | 1291 | ||
1290 | void MainWindow::exportToPhone( int mode ) | 1292 | void MainWindow::exportToPhone( int mode ) |
1291 | { | 1293 | { |
1292 | 1294 | ||
1293 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1295 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1294 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1296 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1295 | KOex2phonePrefs ex2phone; | 1297 | KOex2phonePrefs ex2phone; |
1296 | 1298 | ||
1297 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1299 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1298 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1300 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1299 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1301 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1300 | if ( mode == 1 ) | 1302 | if ( mode == 1 ) |
1301 | ex2phone.setCaption(i18n("Export complete calendar")); | 1303 | ex2phone.setCaption(i18n("Export complete calendar")); |
1302 | if ( mode == 2 ) | 1304 | if ( mode == 2 ) |
1303 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1305 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1304 | 1306 | ||
1305 | if ( !ex2phone.exec() ) { | 1307 | if ( !ex2phone.exec() ) { |
1306 | return; | 1308 | return; |
1307 | } | 1309 | } |
1308 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1310 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1309 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1311 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1310 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1312 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1311 | 1313 | ||
1312 | int inFuture = 0; | 1314 | int inFuture = 0; |
1313 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1315 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1314 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1316 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1315 | QPtrList<Incidence> delSel; | 1317 | QPtrList<Incidence> delSel; |
1316 | if ( mode == 1 ) | 1318 | if ( mode == 1 ) |
1317 | delSel = mCalendar->rawIncidences(); | 1319 | delSel = mCalendar->rawIncidences(); |
1318 | if ( mode == 2 ) | 1320 | if ( mode == 2 ) |
1319 | delSel = mCalendar->incidences(); | 1321 | delSel = mCalendar->incidences(); |
1320 | CalendarLocal* cal = new CalendarLocal(); | 1322 | CalendarLocal* cal = new CalendarLocal(); |
1321 | cal->setLocalTime(); | 1323 | cal->setLocalTime(); |
1322 | Incidence *incidence = delSel.first(); | 1324 | Incidence *incidence = delSel.first(); |
1323 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1325 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1324 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1326 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1325 | while ( incidence ) { | 1327 | while ( incidence ) { |
1326 | if ( incidence->type() != "Journal" ) { | 1328 | if ( incidence->type() != "Journal" ) { |
1327 | bool add = true; | 1329 | bool add = true; |
1328 | if ( inFuture ) { | 1330 | if ( inFuture ) { |
1329 | QDateTime dt; | 1331 | QDateTime dt; |
1330 | if ( incidence->type() == "Todo" ) { | 1332 | if ( incidence->type() == "Todo" ) { |
1331 | Todo * t = (Todo*)incidence; | 1333 | Todo * t = (Todo*)incidence; |
1332 | if ( t->hasDueDate() ) | 1334 | if ( t->hasDueDate() ) |
1333 | dt = t->dtDue(); | 1335 | dt = t->dtDue(); |
1334 | else | 1336 | else |
1335 | dt = cur.addSecs( 62 ); | 1337 | dt = cur.addSecs( 62 ); |
1336 | } | 1338 | } |
1337 | else { | 1339 | else { |
1338 | bool ok; | 1340 | bool ok; |
1339 | dt = incidence->getNextOccurence( cur, &ok ); | 1341 | dt = incidence->getNextOccurence( cur, &ok ); |
1340 | if ( !ok ) | 1342 | if ( !ok ) |
1341 | dt = cur.addSecs( -62 ); | 1343 | dt = cur.addSecs( -62 ); |
1342 | } | 1344 | } |
1343 | if ( dt < cur || dt > end ) { | 1345 | if ( dt < cur || dt > end ) { |
1344 | add = false; | 1346 | add = false; |
1345 | } | 1347 | } |
1346 | } | 1348 | } |
1347 | if ( add ) { | 1349 | if ( add ) { |
1348 | Incidence *in = incidence->clone(); | 1350 | Incidence *in = incidence->clone(); |
1349 | cal->addIncidence( in ); | 1351 | cal->addIncidence( in ); |
1350 | } | 1352 | } |
1351 | } | 1353 | } |
1352 | incidence = delSel.next(); | 1354 | incidence = delSel.next(); |
1353 | } | 1355 | } |
1354 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1356 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1355 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1357 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1356 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1358 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1357 | 1359 | ||
1358 | setCaption( i18n("Writing to phone...")); | 1360 | setCaption( i18n("Writing to phone...")); |
1359 | if ( PhoneFormat::writeToPhone( cal ) ) | 1361 | if ( PhoneFormat::writeToPhone( cal ) ) |
1360 | setCaption( i18n("Export to phone successful!")); | 1362 | setCaption( i18n("Export to phone successful!")); |
1361 | else | 1363 | else |
1362 | setCaption( i18n("Error exporting to phone!")); | 1364 | setCaption( i18n("Error exporting to phone!")); |
1363 | delete cal; | 1365 | delete cal; |
1364 | } | 1366 | } |
1365 | 1367 | ||
1366 | 1368 | ||
1367 | void MainWindow::setDefaultPreferences() | 1369 | void MainWindow::setDefaultPreferences() |
1368 | { | 1370 | { |
1369 | KOPrefs *p = KOPrefs::instance(); | 1371 | KOPrefs *p = KOPrefs::instance(); |
1370 | 1372 | ||
1371 | p->mCompactDialogs = true; | 1373 | p->mCompactDialogs = true; |
1372 | p->mConfirm = true; | 1374 | p->mConfirm = true; |
1373 | // p->mEnableQuickTodo = false; | 1375 | // p->mEnableQuickTodo = false; |
1374 | 1376 | ||
1375 | } | 1377 | } |
1376 | 1378 | ||
1377 | QString MainWindow::resourcePath() | 1379 | QString MainWindow::resourcePath() |
1378 | { | 1380 | { |
1379 | return KGlobal::iconLoader()->iconPath(); | 1381 | return KGlobal::iconLoader()->iconPath(); |
1380 | } | 1382 | } |
1381 | 1383 | ||
1382 | void MainWindow::displayText( QString text ,QString cap ) | 1384 | void MainWindow::displayText( QString text ,QString cap ) |
1383 | { | 1385 | { |
1384 | QDialog dia( this, "name", true ); ; | 1386 | QDialog dia( this, "name", true ); ; |
1385 | dia.setCaption( cap ); | 1387 | dia.setCaption( cap ); |
1386 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1388 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1387 | lay->setSpacing( 3 ); | 1389 | lay->setSpacing( 3 ); |
1388 | lay->setMargin( 3 ); | 1390 | lay->setMargin( 3 ); |
1389 | QTextBrowser tb ( &dia ); | 1391 | QTextBrowser tb ( &dia ); |
1390 | lay->addWidget( &tb ); | 1392 | lay->addWidget( &tb ); |
1391 | tb.setText( text ); | 1393 | tb.setText( text ); |
1392 | #ifdef DESKTOP_VERSION | 1394 | #ifdef DESKTOP_VERSION |
1393 | dia.resize( 640, 480); | 1395 | dia.resize( 640, 480); |
1394 | #else | 1396 | #else |
1395 | dia.showMaximized(); | 1397 | dia.showMaximized(); |
1396 | #endif | 1398 | #endif |
1397 | dia.exec(); | 1399 | dia.exec(); |
1398 | } | 1400 | } |
1399 | 1401 | ||
1400 | void MainWindow::features() | 1402 | void MainWindow::features() |
1401 | { | 1403 | { |
1402 | 1404 | ||
1403 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); | 1405 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1404 | } | 1406 | } |
1405 | 1407 | ||
1406 | void MainWindow::usertrans() | 1408 | void MainWindow::usertrans() |
1407 | { | 1409 | { |
1408 | 1410 | ||
1409 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); | 1411 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1410 | } | 1412 | } |
1411 | 1413 | ||
1412 | void MainWindow::storagehowto() | 1414 | void MainWindow::storagehowto() |
1413 | { | 1415 | { |
1414 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); | 1416 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); |
1415 | } | 1417 | } |
1416 | void MainWindow::timetrackinghowto() | 1418 | void MainWindow::timetrackinghowto() |
1417 | { | 1419 | { |
1418 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); | 1420 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); |
1419 | } | 1421 | } |
1420 | void MainWindow::kdesynchowto() | 1422 | void MainWindow::kdesynchowto() |
1421 | { | 1423 | { |
1422 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1424 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1423 | } | 1425 | } |
1424 | void MainWindow::multisynchowto() | 1426 | void MainWindow::multisynchowto() |
1425 | { | 1427 | { |
1426 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1428 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1427 | } | 1429 | } |
1428 | void MainWindow::synchowto() | 1430 | void MainWindow::synchowto() |
1429 | { | 1431 | { |
1430 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1432 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1431 | } | 1433 | } |
1432 | void MainWindow::faq() | 1434 | void MainWindow::faq() |
1433 | { | 1435 | { |
1434 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1436 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1435 | 1437 | ||
1436 | } | 1438 | } |
1437 | void MainWindow::whatsNew() | 1439 | void MainWindow::whatsNew() |
1438 | { | 1440 | { |
1439 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1441 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1440 | 1442 | ||
1441 | } | 1443 | } |
1442 | void MainWindow::licence() | 1444 | void MainWindow::licence() |
1443 | { | 1445 | { |
1444 | KApplication::showLicence(); | 1446 | KApplication::showLicence(); |
1445 | 1447 | ||
1446 | } | 1448 | } |
1447 | void MainWindow::about() | 1449 | void MainWindow::about() |
1448 | { | 1450 | { |
1449 | QString version; | 1451 | QString version; |
1450 | #include <../version> | 1452 | #include <../version> |
1451 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1453 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1452 | i18n("KOrganizer/Platform-independent\n") + | 1454 | i18n("KOrganizer/Platform-independent\n") + |
1453 | "(KO/Pi) " + version + " - " + | 1455 | "(KO/Pi) " + version + " - " + |
1454 | 1456 | ||
1455 | #ifdef DESKTOP_VERSION | 1457 | #ifdef DESKTOP_VERSION |
1456 | i18n("Desktop Edition\n") + | 1458 | i18n("Desktop Edition\n") + |
1457 | #else | 1459 | #else |
1458 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + | 1460 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + |
1459 | #endif | 1461 | #endif |
1460 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); | 1462 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); |
1461 | } | 1463 | } |
1462 | void MainWindow::keyBindings() | 1464 | void MainWindow::keyBindings() |
1463 | { | 1465 | { |
1464 | QString cap = i18n("KO/Pi Keys + Colors"); | 1466 | QString cap = i18n("KO/Pi Keys + Colors"); |
1465 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1467 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1466 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1468 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1467 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + | 1469 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + |
1468 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + | 1470 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + |
1469 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1471 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1470 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1472 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1471 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1473 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1472 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1474 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1473 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1475 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1474 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ | 1476 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ |
1475 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1477 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1476 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1478 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |