-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 @@ -536,49 +536,48 @@ void MainWindow::initActions() menuBar->insertItem( i18n("File"), importMenu ); menuBar->insertItem( i18n("View"), viewMenu ); menuBar->insertItem( i18n("Actions"), actionMenu ); menuBar->insertItem( i18n("Synchronize"), syncMenu ); menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); menuBar->insertItem( i18n("Filter"),selectFilterMenu ); menuBar->insertItem( i18n("Help"), helpMenu ); //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 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; QIconSet icon; // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); configureToolBarMenu->setCheckable( true ); QString pathString = ""; if ( !p->mToolBarMiniIcons ) { if ( QApplication::desktop()->width() < 480 ) pathString += "icons16/"; } 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 ); connect( action, SIGNAL( activated() ), mView, SLOT( edit_options() ) ); actionMenu->insertSeparator(); action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); action->addTo( actionMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( undo_delete() ) ); actionMenu->insertSeparator(); @@ -593,34 +592,45 @@ void MainWindow::initActions() mView, SLOT( newEvent() ) ); icon = loadPixmap( pathString + "newtodo" ); configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); nt_action->addTo( actionMenu ); connect( nt_action, SIGNAL( activated() ), mView, SLOT( newTodo() ) ); icon = loadPixmap( pathString + "navi" ); action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 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" ); action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); action->addTo( viewMenu ); connect( action, SIGNAL( activated() ), mView, SLOT( showDatePicker() ) ); action->addTo( iconToolBar ); viewMenu->insertSeparator(); icon = loadPixmap( pathString + "list" ); configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); @@ -1711,42 +1721,37 @@ void MainWindow::setCaptionToDates() else { QString addString; if ( mView->startDate() == QDateTime::currentDateTime().date() ) addString = i18n("Today"); else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) addString = i18n("Tomorrow"); if ( !addString.isEmpty() ) selDates = addString+", "+selDates ; } 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(); } void MainWindow::saveCalendar() { QString fn = KOPrefs::instance()->mLastSaveFile; fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); if ( fn == "" ) return; QFileInfo info; info.setFile( fn ); |