-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() menuBar1->setMaximumSize( menuBar1->sizeHint( )); } connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); - connect ( selectFilterMenu, SIGNAL( aboutToShow () ), this, SLOT (fillFilterMenu() ) ); + connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); // ****************** QAction *action; @@ -560,16 +560,15 @@ void MainWindow::initActions() } else pathString += "iconsmini/"; configureAgendaMenu->setCheckable( true ); - configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); - configureAgendaMenu->insertItem(i18n("Small"), 6 ); - configureAgendaMenu->insertItem(i18n("Medium"), 8 ); - configureAgendaMenu->insertItem(i18n("Normal"), 10 ); - configureAgendaMenu->insertItem(i18n("Large"), 12 ); - configureAgendaMenu->insertItem(i18n("Big"), 14 ); - configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); - configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); + int iii ; + for ( iii = 1;iii<= 10 ;++iii ){ + configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); + } //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); + connect( configureAgendaMenu, SIGNAL( aboutToShow()), + this, SLOT( showConfigureAgenda( ) ) ); + icon = loadPixmap( pathString + "configure" ); action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); action->addTo( actionMenu ); @@ -602,16 +601,27 @@ void MainWindow::initActions() action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleDateNavigatorWidget() ) ); + mToggleNav = action ; icon = loadPixmap( pathString + "filter" ); action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleFilter() ) ); + mToggleFilter = action; icon = loadPixmap( pathString + "allday" ); action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( toggleAllDaySize() ) ); + mToggleAllday = action; + + + connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), + mToggleNav, SLOT( setEnabled ( bool ) ) ); + connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), + mToggleFilter, SLOT( setEnabled ( bool ) ) ); + connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), + mToggleAllday, SLOT( setEnabled ( bool ) ) ); viewMenu->insertSeparator(); icon = loadPixmap( pathString + "picker" ); @@ -1720,24 +1730,19 @@ void MainWindow::setCaptionToDates() setCaption( i18n("Dates: ") + selDates ); } -// parameter item == 0: reinit +void MainWindow::showConfigureAgenda( ) +{ + int iii; + for ( iii = 1;iii<= 10 ;++iii ){ + configureAgendaMenu->setItemChecked( (iii+1)*2, false ); + } + configureAgendaMenu->setItemChecked( KOPrefs::instance()->mHourSize, true ); +} void MainWindow::configureAgenda( int item ) { - - KOPrefs *p = KOPrefs::instance(); - - int i; - // do not allow 4 for widgets higher than 480 - // if ( QApplication::desktop()->height() > 480 ) { -// if ( item == 4 ) -// item = 6; -// } - for ( i = 4; i <= 18; i= i+2 ) - configureAgendaMenu->setItemChecked( i, false ); - configureAgendaMenu->setItemChecked( item, true ); - if ( p->mHourSize == item ) + if ( KOPrefs::instance()->mHourSize == item ) return; - p->mHourSize=item; + KOPrefs::instance()->mHourSize=item; mView->viewManager()->agendaView()->updateConfig(); } |