Commit 455f7f0d authored by Christian Mollekopf's avatar Christian Mollekopf

Moved actions to the appropriate place

parent 3a3bb957
......@@ -327,15 +327,6 @@ void ActionManager::initActions()
/************************** EDIT MENU *********************************/
//Disable a calendar or remove a referenced calendar
QAction *disableAction = mACollection->addAction( QLatin1String("collection_disable"), mCollectionView, SLOT(edit_disable()) );
disableAction->setText( i18n( "Disable Calendar" ) );
//Enable (subscribe) to a calendar.
QAction *enableAction = mACollection->addAction( QLatin1String("collection_enable"), mCollectionView, SLOT(edit_enable()) );
enableAction->setText( i18n( "Enable Calendar" ) );
//TODO: hide option on enabled collections
QAction *pasteAction;
Akonadi::History *history = mCalendarView->history();
if ( mIsPart ) {
......
......@@ -63,6 +63,7 @@
#include <QStyledItemDelegate>
#include <QVBoxLayout>
#include <QStackedWidget>
#include <QAction>
static Akonadi::EntityTreeModel *findEtm(QAbstractItemModel *model)
{
......@@ -552,6 +553,17 @@ AkonadiCollectionView::AkonadiCollectionView( CalendarView *view, bool hasContex
mDefaultCalendar->setEnabled( false );
xmlclient->actionCollection()->addAction( QString::fromLatin1( "set_standard_calendar" ),
mDefaultCalendar );
//Disable a calendar or remove a referenced calendar
QAction *disableAction = xmlclient->actionCollection()->addAction( QLatin1String("collection_disable"), this, SLOT(edit_disable()) );
disableAction->setText( i18n( "Remove from list" ) );
disableAction->setIcon(KIconLoader().loadIcon(QLatin1String("list-remove"), KIconLoader::Small));
//Enable (subscribe) to a calendar.
mEnableAction = xmlclient->actionCollection()->addAction( QLatin1String("collection_enable"), this, SLOT(edit_enable()) );
mEnableAction->setText( i18n( "Add to list permanently" ) );
mEnableAction->setIcon(KIconLoader().loadIcon(QLatin1String("bookmarks"), KIconLoader::Small));
connect( mDefaultCalendar, SIGNAL(triggered(bool)), this, SLOT(setDefaultCalendar()) );
}
}
......@@ -674,6 +686,11 @@ void AkonadiCollectionView::updateMenu()
collection.rights() & Akonadi::Collection::CanCreateItem );
disableStuff = false;
}
if ( collection.isValid() && collection.shouldList(Akonadi::Collection::ListDisplay) ) {
mEnableAction->setEnabled(false);
} else {
mEnableAction->setEnabled(true);
}
}
if ( disableStuff ) {
mDisableColor->setEnabled( false );
......
......@@ -122,6 +122,7 @@ class AkonadiCollectionView : public CalendarViewExtension
KAction *mAssignColor;
KAction *mDisableColor;
KAction *mDefaultCalendar;
QAction *mEnableAction;
bool mNotSendAddRemoveSignal;
bool mWasDefaultCalendar;
bool mHasContextMenu;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment