-rw-r--r-- | korganizer/mainwindow.cpp | 171 |
1 files changed, 99 insertions, 72 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 23537a6..a5d8824 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -655,4 +655,9 @@ void MainWindow::initActions() QPopupMenu *viewMenu = new QPopupMenu( this ); QPopupMenu *actionMenu = new QPopupMenu( this ); +#ifdef DESKTOP_VERSION + mCurrentItemMenu = actionMenu; +#else + mCurrentItemMenu = new QPopupMenu ( this ); +#endif QPopupMenu *importMenu = new QPopupMenu( this ); QPopupMenu *importMenu_X = new QPopupMenu( this ); @@ -766,16 +771,25 @@ void MainWindow::initActions() connect( configureAgendaMenu, SIGNAL( aboutToShow()), this, SLOT( showConfigureAgenda( ) ) ); + icon = loadPixmap( pathString + "today" ); + QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); + today_action->addTo( actionMenu ); + connect( today_action, SIGNAL( activated() ), + mView, SLOT( goToday() ) ); + + icon = loadPixmap( pathString + "picker" ); + QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); + dPickerAction->addTo( actionMenu ); + connect( dPickerAction, SIGNAL( activated() ), + mView, SLOT( showDatePicker() ) ); + + icon = loadPixmap( pathString + "search" ); + QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); + search_action->addTo( actionMenu ); + connect( search_action, SIGNAL( activated() ), + mView->dialogManager(), SLOT( showSearchDialog() ) ); - icon = loadPixmap( pathString + "configure" ); - action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); - action->addTo( actionMenu ); - connect( action, SIGNAL( activated() ), - mView, SLOT( edit_options() ) ); - icon = loadPixmap( pathString + "configure" ); - action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); - action->addTo( actionMenu ); - connect( action, SIGNAL( activated() ), - mView, SLOT( edit_global_options() ) ); actionMenu->insertSeparator(); + + action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); @@ -783,5 +797,4 @@ void MainWindow::initActions() connect( action, SIGNAL( activated() ), mView, SLOT( undo_delete() ) ); - actionMenu->insertSeparator(); icon = loadPixmap( pathString + "newevent" ); @@ -793,4 +806,45 @@ void MainWindow::initActions() configureToolBarMenu->insertItem(i18n("Week Number"), 400); configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); + +#ifndef DESKTOP_VERSION + actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); +#endif + mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); + mShowAction->addTo( mCurrentItemMenu ); + connect( mShowAction, SIGNAL( activated() ), + mView, SLOT( showIncidence() ) ); + + mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); + mEditAction->addTo( mCurrentItemMenu ); + connect( mEditAction, SIGNAL( activated() ), + mView, SLOT( editIncidence() ) ); + + mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); + mDeleteAction->addTo( mCurrentItemMenu ); + connect( mDeleteAction, SIGNAL( activated() ), + mView, SLOT( deleteIncidence() ) ); + + + mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); + mCloneAction->addTo( mCurrentItemMenu ); + connect( mCloneAction, SIGNAL( activated() ), + mView, SLOT( cloneIncidence() ) ); + mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); + mMoveAction->addTo( mCurrentItemMenu ); + connect( mMoveAction, SIGNAL( activated() ), + mView, SLOT( moveIncidence() ) ); + mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); + mBeamAction->addTo(mCurrentItemMenu ); + connect( mBeamAction, SIGNAL( activated() ), + mView, SLOT( beamIncidence() ) ); + mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); + mCancelAction->addTo( mCurrentItemMenu ); + connect( mCancelAction, SIGNAL( activated() ), + mView, SLOT( toggleCancelIncidence() ) ); +#ifdef DESKTOP_VERSION + actionMenu->insertSeparator(); +#endif + + QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); ne_action->addTo( actionMenu ); @@ -804,10 +858,5 @@ void MainWindow::initActions() mView, SLOT( newTodo() ) ); - icon = loadPixmap( pathString + "today" ); - QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); - today_action->addTo( viewMenu ); - connect( today_action, SIGNAL( activated() ), - mView, SLOT( goToday() ) ); - viewMenu->insertSeparator(); + // *********************** @@ -856,11 +905,6 @@ void MainWindow::initActions() // configureAgendaMenu, 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 ); + + dPickerAction->addTo( iconToolBar ); viewMenu->insertSeparator(); @@ -961,57 +1005,38 @@ void MainWindow::initActions() mView, SLOT( newSubTodo() ) ); - actionMenu->insertSeparator(); - - mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); - mShowAction->addTo( actionMenu ); - connect( mShowAction, SIGNAL( activated() ), - mView, SLOT( showIncidence() ) ); + action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, + this ); + action->addTo( actionMenu ); + connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); - mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); - mEditAction->addTo( actionMenu ); - connect( mEditAction, SIGNAL( activated() ), - mView, SLOT( editIncidence() ) ); + + configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); - mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); - mDeleteAction->addTo( actionMenu ); - connect( mDeleteAction, SIGNAL( activated() ), - mView, SLOT( deleteIncidence() ) ); - mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); - mCloneAction->addTo( actionMenu ); - connect( mCloneAction, SIGNAL( activated() ), - mView, SLOT( cloneIncidence() ) ); - mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); - mMoveAction->addTo( actionMenu ); - connect( mMoveAction, SIGNAL( activated() ), - mView, SLOT( moveIncidence() ) ); - mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); - mBeamAction->addTo( actionMenu ); - connect( mBeamAction, SIGNAL( activated() ), - mView, SLOT( beamIncidence() ) ); - mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); - mCancelAction->addTo( actionMenu ); - connect( mCancelAction, SIGNAL( activated() ), - mView, SLOT( toggleCancelIncidence() ) ); - actionMenu->insertSeparator(); - - action = new QAction( "purge_completed", i18n("Purge Completed"), 0, + action = new QAction( "manage cat", i18n("Edit category list..."), 0, this ); - action->addTo( actionMenu ); - connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); + action->addTo( actionMenu ); + connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); - icon = loadPixmap( pathString + "search" ); - QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); - configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); - search_action->addTo( actionMenu ); - connect( search_action, SIGNAL( activated() ), - mView->dialogManager(), SLOT( showSearchDialog() ) ); + action = new QAction( "manage cat", i18n("Manage new categories..."), 0, + this ); + action->addTo( actionMenu ); + connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); - + actionMenu->insertSeparator(); + icon = loadPixmap( pathString + "configure" ); + action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); + action->addTo( actionMenu ); + connect( action, SIGNAL( activated() ), + mView, SLOT( edit_options() ) ); + icon = loadPixmap( pathString + "configure" ); + action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); + action->addTo( actionMenu ); + connect( action, SIGNAL( activated() ), + mView, SLOT( edit_global_options() ) ); if ( KOPrefs::instance()->mShowFullMenu ) { - actionMenu->insertSeparator(); actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); @@ -1125,9 +1150,5 @@ void MainWindow::initActions() importMenu->insertItem( i18n("Print"), beamMenu_X ); #endif - importMenu->insertSeparator(); - action = new QAction( "manage cat", i18n("Manage new categories..."), 0, - this ); - action->addTo( importMenu ); - connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); + importMenu->insertSeparator(); action = new QAction( "beam all", i18n("Save"), 0, @@ -1715,4 +1736,8 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) void MainWindow::enableIncidenceActions( bool enabled ) { + +#ifndef DESKTOP_VERSION + mCurrentItemMenu->setEnabled( enabled ); +#else mShowAction->setEnabled( enabled ); mEditAction->setEnabled( enabled ); @@ -1723,4 +1748,5 @@ void MainWindow::enableIncidenceActions( bool enabled ) mBeamAction->setEnabled( enabled ); mCancelAction->setEnabled( enabled ); +#endif } @@ -2275,4 +2301,5 @@ void MainWindow::configureToolBar( int item ) p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); // initActions(); + setCaption ( i18n("Toolbar changes needs a restart!") ); } void MainWindow::setCaption ( const QString & c ) |