-rw-r--r-- | core/pim/datebook/datebook.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index 47be523..3e18374 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp | |||
@@ -536,132 +536,132 @@ void DateBook::showDay( int year, int month, int day ) | |||
536 | void DateBook::initDay() | 536 | void DateBook::initDay() |
537 | { | 537 | { |
538 | if ( !dayView ) { | 538 | if ( !dayView ) { |
539 | dayView = new DateBookDay( ampm, onMonday, db, views, "day view" ); | 539 | dayView = new DateBookDay( ampm, onMonday, db, views, "day view" ); |
540 | views->addWidget( dayView, DAY ); | 540 | views->addWidget( dayView, DAY ); |
541 | dayView->setStartViewTime( startTime ); | 541 | dayView->setStartViewTime( startTime ); |
542 | dayView->setJumpToCurTime( bJumpToCurTime ); | 542 | dayView->setJumpToCurTime( bJumpToCurTime ); |
543 | dayView->setRowStyle( rowStyle ); | 543 | dayView->setRowStyle( rowStyle ); |
544 | connect( this, SIGNAL( newEvent() ), | 544 | connect( this, SIGNAL( newEvent() ), |
545 | dayView, SLOT( redraw() ) ); | 545 | dayView, SLOT( redraw() ) ); |
546 | connect( dayView, SIGNAL( newEvent() ), | 546 | connect( dayView, SIGNAL( newEvent() ), |
547 | this, SLOT( fileNew() ) ); | 547 | this, SLOT( fileNew() ) ); |
548 | connect( dayView, SIGNAL( removeEvent( const Event & ) ), | 548 | connect( dayView, SIGNAL( removeEvent( const Event & ) ), |
549 | this, SLOT( removeEvent( const Event & ) ) ); | 549 | this, SLOT( removeEvent( const Event & ) ) ); |
550 | connect( dayView, SIGNAL( editEvent( const Event & ) ), | 550 | connect( dayView, SIGNAL( editEvent( const Event & ) ), |
551 | this, SLOT( editEvent( const Event & ) ) ); | 551 | this, SLOT( editEvent( const Event & ) ) ); |
552 | connect( dayView, SIGNAL( duplicateEvent( const Event & ) ), | 552 | connect( dayView, SIGNAL( duplicateEvent( const Event & ) ), |
553 | this, SLOT( duplicateEvent( const Event & ) ) ); | 553 | this, SLOT( duplicateEvent( const Event & ) ) ); |
554 | connect( dayView, SIGNAL( beamEvent( const Event & ) ), | 554 | connect( dayView, SIGNAL( beamEvent( const Event & ) ), |
555 | this, SLOT( beamEvent( const Event & ) ) ); | 555 | this, SLOT( beamEvent( const Event & ) ) ); |
556 | connect( dayView, SIGNAL(sigNewEvent(const QString &)), | 556 | connect( dayView, SIGNAL(sigNewEvent(const QString &)), |
557 | this, SLOT(slotNewEventFromKey(const QString &)) ); | 557 | this, SLOT(slotNewEventFromKey(const QString &)) ); |
558 | } | 558 | } |
559 | } | 559 | } |
560 | 560 | ||
561 | void DateBook::initWeek() | 561 | void DateBook::initWeek() |
562 | { | 562 | { |
563 | if ( !weekView ) { | 563 | if ( !weekView ) { |
564 | weekView = new DateBookWeek( ampm, onMonday, db, views, "week view" ); | 564 | weekView = new DateBookWeek( ampm, onMonday, db, views, "week view" ); |
565 | weekView->setStartViewTime( startTime ); | 565 | weekView->setStartViewTime( startTime ); |
566 | views->addWidget( weekView, WEEK ); | 566 | views->addWidget( weekView, WEEK ); |
567 | connect( weekView, SIGNAL( showDate( int, int, int ) ), | 567 | connect( weekView, SIGNAL( showDate( int, int, int ) ), |
568 | this, SLOT( showDay( int, int, int ) ) ); | 568 | this, SLOT( showDay( int, int, int ) ) ); |
569 | connect( this, SIGNAL( newEvent() ), | 569 | connect( this, SIGNAL( newEvent() ), |
570 | weekView, SLOT( redraw() ) ); | 570 | weekView, SLOT( redraw() ) ); |
571 | } | 571 | } |
572 | //But also get it right: the year that we display can be different | 572 | //But also get it right: the year that we display can be different |
573 | //from the year of the current date. So, first find the year | 573 | //from the year of the current date. So, first find the year |
574 | //number of the current week. | 574 | //number of the current week. |
575 | 575 | ||
576 | int yearNumber, totWeeks; | 576 | int yearNumber, totWeeks; |
577 | calcWeek( currentDate(), totWeeks, yearNumber, onMonday ); | 577 | calcWeek( currentDate(), totWeeks, yearNumber, onMonday ); |
578 | 578 | ||
579 | QDate d = QDate( yearNumber, 12, 31 ); | 579 | QDate d = QDate( yearNumber, 12, 31 ); |
580 | calcWeek( d, totWeeks, yearNumber, onMonday ); | 580 | calcWeek( d, totWeeks, yearNumber, onMonday ); |
581 | 581 | ||
582 | while ( totWeeks == 1 ) { | 582 | while ( totWeeks == 1 ) { |
583 | d = d.addDays( -1 ); | 583 | d = d.addDays( -1 ); |
584 | calcWeek( d, totWeeks, yearNumber, onMonday ); | 584 | calcWeek( d, totWeeks, yearNumber, onMonday ); |
585 | } | 585 | } |
586 | if ( totWeeks != weekView->totalWeeks() ) | 586 | if ( totWeeks != weekView->totalWeeks() ) |
587 | weekView->setTotalWeeks( totWeeks ); | 587 | weekView->setTotalWeeks( totWeeks ); |
588 | } | 588 | } |
589 | void DateBook::initWeekLst() { | 589 | void DateBook::initWeekLst() { |
590 | if ( !weekLstView ) { | 590 | if ( !weekLstView ) { |
591 | weekLstView = new DateBookWeekLst( ampm, onMonday, db, | 591 | weekLstView = new DateBookWeekLst( ampm, onMonday, db, |
592 | views, "weeklst view" ); | 592 | views, "weeklst view" ); |
593 | views->addWidget( weekLstView, WEEKLST ); | 593 | views->addWidget( weekLstView, WEEKLST ); |
594 | 594 | ||
595 | //weekLstView->setStartViewTime( startTime ); | 595 | //weekLstView->setStartViewTime( startTime ); |
596 | connect( weekLstView, SIGNAL( showDate( int, int, int ) ), | 596 | connect( weekLstView, SIGNAL( showDate( int, int, int ) ), |
597 | this, SLOT( showDay( int, int, int ) ) ); | 597 | this, SLOT( showDay( int, int, int ) ) ); |
598 | connect( weekLstView, SIGNAL( addEvent( const QDateTime &, | 598 | connect( weekLstView, SIGNAL( addEvent( const QDateTime &, |
599 | const QDateTime &, | 599 | const QDateTime &, |
600 | const QString & ) ), | 600 | const QString & , const QString &) ), |
601 | this, SLOT( slotNewEntry( const QDateTime &, | 601 | this, SLOT( slotNewEntry( const QDateTime &, |
602 | const QDateTime &, | 602 | const QDateTime &, |
603 | const QString & ) ) ); | 603 | const QString & , const QString &) ) ); |
604 | connect( this, SIGNAL( newEvent() ), | 604 | connect( this, SIGNAL( newEvent() ), |
605 | weekLstView, SLOT( redraw() ) ); | 605 | weekLstView, SLOT( redraw() ) ); |
606 | connect( weekLstView, SIGNAL( editEvent( const Event & ) ), | 606 | connect( weekLstView, SIGNAL( editEvent( const Event & ) ), |
607 | this, SLOT( editEvent( const Event & ) ) ); | 607 | this, SLOT( editEvent( const Event & ) ) ); |
608 | } | 608 | } |
609 | } | 609 | } |
610 | 610 | ||
611 | 611 | ||
612 | void DateBook::initMonth() | 612 | void DateBook::initMonth() |
613 | { | 613 | { |
614 | if ( !monthView ) { | 614 | if ( !monthView ) { |
615 | monthView = new DateBookMonth( views, "month view", FALSE, db ); | 615 | monthView = new DateBookMonth( views, "month view", FALSE, db ); |
616 | views->addWidget( monthView, MONTH ); | 616 | views->addWidget( monthView, MONTH ); |
617 | connect( monthView, SIGNAL( dateClicked( int, int, int ) ), | 617 | connect( monthView, SIGNAL( dateClicked( int, int, int ) ), |
618 | this, SLOT( showDay( int, int, int ) ) ); | 618 | this, SLOT( showDay( int, int, int ) ) ); |
619 | connect( this, SIGNAL( newEvent() ), | 619 | connect( this, SIGNAL( newEvent() ), |
620 | monthView, SLOT( redraw() ) ); | 620 | monthView, SLOT( redraw() ) ); |
621 | qApp->processEvents(); | 621 | qApp->processEvents(); |
622 | } | 622 | } |
623 | } | 623 | } |
624 | 624 | ||
625 | void DateBook::loadSettings() | 625 | void DateBook::loadSettings() |
626 | { | 626 | { |
627 | { | 627 | { |
628 | Config config( "qpe" ); | 628 | Config config( "qpe" ); |
629 | config.setGroup("Time"); | 629 | config.setGroup("Time"); |
630 | ampm = config.readBoolEntry( "AMPM", TRUE ); | 630 | ampm = config.readBoolEntry( "AMPM", TRUE ); |
631 | onMonday = config.readBoolEntry( "MONDAY" ); | 631 | onMonday = config.readBoolEntry( "MONDAY" ); |
632 | } | 632 | } |
633 | 633 | ||
634 | { | 634 | { |
635 | Config config("DateBook"); | 635 | Config config("DateBook"); |
636 | config.setGroup("Main"); | 636 | config.setGroup("Main"); |
637 | startTime = config.readNumEntry("startviewtime", 8); | 637 | startTime = config.readNumEntry("startviewtime", 8); |
638 | aPreset = config.readBoolEntry("alarmpreset"); | 638 | aPreset = config.readBoolEntry("alarmpreset"); |
639 | presetTime = config.readNumEntry("presettime"); | 639 | presetTime = config.readNumEntry("presettime"); |
640 | bJumpToCurTime = config.readBoolEntry("jumptocurtime"); | 640 | bJumpToCurTime = config.readBoolEntry("jumptocurtime"); |
641 | rowStyle = config.readNumEntry("rowstyle"); | 641 | rowStyle = config.readNumEntry("rowstyle"); |
642 | } | 642 | } |
643 | } | 643 | } |
644 | 644 | ||
645 | void DateBook::saveSettings() | 645 | void DateBook::saveSettings() |
646 | { | 646 | { |
647 | Config config( "qpe" ); | 647 | Config config( "qpe" ); |
648 | Config configDB( "DateBook" ); | 648 | Config configDB( "DateBook" ); |
649 | configDB.setGroup( "Main" ); | 649 | configDB.setGroup( "Main" ); |
650 | configDB.writeEntry("startviewtime",startTime); | 650 | configDB.writeEntry("startviewtime",startTime); |
651 | configDB.writeEntry("alarmpreset",aPreset); | 651 | configDB.writeEntry("alarmpreset",aPreset); |
652 | configDB.writeEntry("presettime",presetTime); | 652 | configDB.writeEntry("presettime",presetTime); |
653 | configDB.writeEntry("jumptocurtime", bJumpToCurTime); | 653 | configDB.writeEntry("jumptocurtime", bJumpToCurTime); |
654 | configDB.writeEntry("rowstyle", rowStyle); | 654 | configDB.writeEntry("rowstyle", rowStyle); |
655 | } | 655 | } |
656 | 656 | ||
657 | void DateBook::newDefaultView(QAction *a) { | 657 | void DateBook::newDefaultView(QAction *a) { |
658 | int val=DAY; | 658 | int val=DAY; |
659 | if (a->text() == "Day") val=DAY; | 659 | if (a->text() == "Day") val=DAY; |
660 | if (a->text() == "Week") val=WEEK; | 660 | if (a->text() == "Week") val=WEEK; |
661 | if (a->text() == "WeekLst") val=WEEKLST; | 661 | if (a->text() == "WeekLst") val=WEEKLST; |
662 | if (a->text() == "Month") val=MONTH; | 662 | if (a->text() == "Month") val=MONTH; |
663 | 663 | ||
664 | Config configDB( "DateBook" ); | 664 | Config configDB( "DateBook" ); |
665 | configDB.setGroup( "Main" ); | 665 | configDB.setGroup( "Main" ); |
666 | configDB.writeEntry("defaultview",val); | 666 | configDB.writeEntry("defaultview",val); |
667 | } | 667 | } |