akonadi
actionstatemanager.cpp
72 void ActionStateManager::updateState( const Collection::List &collections, const Item::List &items )
77 const bool atLeastOneCollectionSelected = (singleCollectionSelected || multipleCollectionsSelected);
196 enableAction( StandardActionManager::CreateCollection, singleCollectionSelected && // we can create only inside one collection
209 enableAction( StandardActionManager::MoveCollectionsToTrash, atLeastOneCollectionSelected && canMoveCollections && !collectionsAreInTrash );
211 enableAction( StandardActionManager::RestoreCollectionsFromTrash, atLeastOneCollectionSelected && canMoveCollections && collectionsAreInTrash );
217 enableAction( StandardActionManager::CollectionProperties, singleCollectionSelected && // we can only configure one collection at a time
220 enableAction( StandardActionManager::SynchronizeCollections, atLeastOneCollectionCanHaveItems ); // it must be a valid folder collection
222 enableAction( StandardActionManager::SynchronizeCollectionsRecursive, atLeastOneCollectionSelected &&
225 enableAction( StandardActionManager::Paste, singleCollectionSelected && // we can paste only into a single collection
226 PasteHelper::canPaste( QApplication::clipboard()->mimeData(), collection ) ); // there must be data on the clipboard
234 enableAction( StandardActionManager::RemoveFromFavoriteCollections, canRemoveFromFavoriteCollections );
236 enableAction( StandardActionManager::RenameFavoriteCollection, singleCollectionSelected && // we can rename only one collection at a time
274 //updatePluralLabel( StandardActionManager::MoveToTrashRestoreCollectionAlternative, collectionCount );
278 enableAction( StandardActionManager::MoveToTrashRestoreCollection, atLeastOneCollectionSelected && canMoveCollections );
298 enableAction( StandardActionManager::CopyItems, atLeastOneItemSelected ); // we need items to work with
300 enableAction( StandardActionManager::CutItems, atLeastOneItemSelected && // we need items to work with
303 enableAction( StandardActionManager::DeleteItems, atLeastOneItemSelected && // we need items to work with
306 enableAction( StandardActionManager::CopyItemToMenu, atLeastOneItemSelected ); // we need items to work with
308 enableAction( StandardActionManager::MoveItemToMenu, atLeastOneItemSelected && // we need items to work with
311 enableAction( StandardActionManager::MoveItemsToTrash, atLeastOneItemSelected && canDeleteItems && !itemsAreInTrash );
313 enableAction( StandardActionManager::RestoreItemsFromTrash, atLeastOneItemSelected && itemsAreInTrash );
315 enableAction( StandardActionManager::CopyItemToDialog, atLeastOneItemSelected ); // we need items to work with
317 enableAction( StandardActionManager::MoveItemToDialog, atLeastOneItemSelected && // we need items to work with
326 enableAction( StandardActionManager::MoveToTrashRestoreItem, atLeastOneItemSelected && // we need items to work with
377 bool ActionStateManager::hasResourceCapability( const Collection &collection, const QString &capability ) const
379 const Akonadi::AgentInstance instance = AgentManager::self()->instance( collection.resource() );
386 return !( collection.contentMimeTypes() == ( QStringList() << QLatin1String( "inode/directory" ) ) ||
395 QMetaObject::invokeMethod( mReceiver, "enableAction", Qt::DirectConnection, Q_ARG( int, action ), Q_ARG( bool, state ) );
403 QMetaObject::invokeMethod( mReceiver, "updatePluralLabel", Qt::DirectConnection, Q_ARG( int, action ), Q_ARG( int, count ) );
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jan 5 2013 19:46:01 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jan 5 2013 19:46:01 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.