-rw-r--r-- | korganizer/mainwindow.cpp | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 877b6f2..145b36c 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -545,7 +545,7 @@ void MainWindow::initActions() | |||
545 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 545 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
546 | } | 546 | } |
547 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 547 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
548 | connect ( selectFilterMenu, SIGNAL( aboutToShow () ), this, SLOT (fillFilterMenu() ) ); | 548 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
549 | 549 | ||
550 | // ****************** | 550 | // ****************** |
551 | QAction *action; | 551 | QAction *action; |
@@ -560,16 +560,15 @@ void MainWindow::initActions() | |||
560 | } else | 560 | } else |
561 | pathString += "iconsmini/"; | 561 | pathString += "iconsmini/"; |
562 | configureAgendaMenu->setCheckable( true ); | 562 | configureAgendaMenu->setCheckable( true ); |
563 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); | 563 | int iii ; |
564 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); | 564 | for ( iii = 1;iii<= 10 ;++iii ){ |
565 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); | 565 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
566 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); | 566 | } |
567 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); | ||
568 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); | ||
569 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); | ||
570 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); | ||
571 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 567 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
572 | 568 | ||
569 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | ||
570 | this, SLOT( showConfigureAgenda( ) ) ); | ||
571 | |||
573 | icon = loadPixmap( pathString + "configure" ); | 572 | icon = loadPixmap( pathString + "configure" ); |
574 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 573 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
575 | action->addTo( actionMenu ); | 574 | action->addTo( actionMenu ); |
@@ -602,16 +601,27 @@ void MainWindow::initActions() | |||
602 | action->addTo( viewMenu ); | 601 | action->addTo( viewMenu ); |
603 | connect( action, SIGNAL( activated() ), | 602 | connect( action, SIGNAL( activated() ), |
604 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 603 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
604 | mToggleNav = action ; | ||
605 | icon = loadPixmap( pathString + "filter" ); | 605 | icon = loadPixmap( pathString + "filter" ); |
606 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 606 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
607 | action->addTo( viewMenu ); | 607 | action->addTo( viewMenu ); |
608 | connect( action, SIGNAL( activated() ), | 608 | connect( action, SIGNAL( activated() ), |
609 | mView, SLOT( toggleFilter() ) ); | 609 | mView, SLOT( toggleFilter() ) ); |
610 | mToggleFilter = action; | ||
610 | icon = loadPixmap( pathString + "allday" ); | 611 | icon = loadPixmap( pathString + "allday" ); |
611 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 612 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
612 | action->addTo( viewMenu ); | 613 | action->addTo( viewMenu ); |
613 | connect( action, SIGNAL( activated() ), | 614 | connect( action, SIGNAL( activated() ), |
614 | mView, SLOT( toggleAllDaySize() ) ); | 615 | mView, SLOT( toggleAllDaySize() ) ); |
616 | mToggleAllday = action; | ||
617 | |||
618 | |||
619 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | ||
620 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | ||
621 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | ||
622 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | ||
623 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | ||
624 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | ||
615 | 625 | ||
616 | viewMenu->insertSeparator(); | 626 | viewMenu->insertSeparator(); |
617 | icon = loadPixmap( pathString + "picker" ); | 627 | icon = loadPixmap( pathString + "picker" ); |
@@ -1720,24 +1730,19 @@ void MainWindow::setCaptionToDates() | |||
1720 | setCaption( i18n("Dates: ") + selDates ); | 1730 | setCaption( i18n("Dates: ") + selDates ); |
1721 | 1731 | ||
1722 | } | 1732 | } |
1723 | // parameter item == 0: reinit | 1733 | void MainWindow::showConfigureAgenda( ) |
1734 | { | ||
1735 | int iii; | ||
1736 | for ( iii = 1;iii<= 10 ;++iii ){ | ||
1737 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | ||
1738 | } | ||
1739 | configureAgendaMenu->setItemChecked( KOPrefs::instance()->mHourSize, true ); | ||
1740 | } | ||
1724 | void MainWindow::configureAgenda( int item ) | 1741 | void MainWindow::configureAgenda( int item ) |
1725 | { | 1742 | { |
1726 | 1743 | if ( KOPrefs::instance()->mHourSize == item ) | |
1727 | KOPrefs *p = KOPrefs::instance(); | ||
1728 | |||
1729 | int i; | ||
1730 | // do not allow 4 for widgets higher than 480 | ||
1731 | // if ( QApplication::desktop()->height() > 480 ) { | ||
1732 | // if ( item == 4 ) | ||
1733 | // item = 6; | ||
1734 | // } | ||
1735 | for ( i = 4; i <= 18; i= i+2 ) | ||
1736 | configureAgendaMenu->setItemChecked( i, false ); | ||
1737 | configureAgendaMenu->setItemChecked( item, true ); | ||
1738 | if ( p->mHourSize == item ) | ||
1739 | return; | 1744 | return; |
1740 | p->mHourSize=item; | 1745 | KOPrefs::instance()->mHourSize=item; |
1741 | mView->viewManager()->agendaView()->updateConfig(); | 1746 | mView->viewManager()->agendaView()->updateConfig(); |
1742 | } | 1747 | } |
1743 | 1748 | ||