akonadi
actionstatemanager.cpp
76 void ActionStateManager::updateState( const Collection::List &collections, const Item::List &items )
81 const bool atLeastOneCollectionSelected = ( singleCollectionSelected || multipleCollectionsSelected );
199 enableAction( StandardActionManager::CreateCollection, singleCollectionSelected && // we can create only inside one collection
212 enableAction( StandardActionManager::MoveCollectionsToTrash, atLeastOneCollectionSelected && canMoveCollections && !collectionsAreInTrash );
214 enableAction( StandardActionManager::RestoreCollectionsFromTrash, atLeastOneCollectionSelected && canMoveCollections && collectionsAreInTrash );
220 enableAction( StandardActionManager::CollectionProperties, singleCollectionSelected && // we can only configure one collection at a time
223 enableAction( StandardActionManager::SynchronizeCollections, atLeastOneCollectionCanHaveItems ); // it must be a valid folder collection
225 enableAction( StandardActionManager::SynchronizeCollectionsRecursive, atLeastOneCollectionSelected &&
228 enableAction( StandardActionManager::Paste, singleCollectionSelected && // we can paste only into a single collection
229 PasteHelper::canPaste( QApplication::clipboard()->mimeData(), collection ) ); // there must be data on the clipboard
237 enableAction( StandardActionManager::RemoveFromFavoriteCollections, canRemoveFromFavoriteCollections );
239 enableAction( StandardActionManager::RenameFavoriteCollection, singleCollectionSelected && // we can rename only one collection at a time
277 //updatePluralLabel( StandardActionManager::MoveToTrashRestoreCollectionAlternative, collectionCount );
281 enableAction( StandardActionManager::MoveToTrashRestoreCollection, atLeastOneCollectionSelected && canMoveCollections );
302 enableAction( StandardActionManager::CopyItems, atLeastOneItemSelected ); // we need items to work with
304 enableAction( StandardActionManager::CutItems, atLeastOneItemSelected && // we need items to work with
307 enableAction( StandardActionManager::DeleteItems, atLeastOneItemSelected && // we need items to work with
310 enableAction( StandardActionManager::CopyItemToMenu, atLeastOneItemSelected ); // we need items to work with
312 enableAction( StandardActionManager::MoveItemToMenu, atLeastOneItemSelected && // we need items to work with
315 enableAction( StandardActionManager::MoveItemsToTrash, atLeastOneItemSelected && canDeleteItems && !itemsAreInTrash );
317 enableAction( StandardActionManager::RestoreItemsFromTrash, atLeastOneItemSelected && itemsAreInTrash );
319 enableAction( StandardActionManager::CopyItemToDialog, atLeastOneItemSelected ); // we need items to work with
321 enableAction( StandardActionManager::MoveItemToDialog, atLeastOneItemSelected && // we need items to work with
330 enableAction( StandardActionManager::MoveToTrashRestoreItem, atLeastOneItemSelected && // we need items to work with
382 bool ActionStateManager::hasResourceCapability( const Collection &collection, const QString &capability ) const
384 const Akonadi::AgentInstance instance = AgentManager::self()->instance( collection.resource() );
391 return !( collection.contentMimeTypes() == ( QStringList() << QLatin1String( "inode/directory" ) ) ||
401 QMetaObject::invokeMethod( mReceiver, "enableAction", Qt::DirectConnection, Q_ARG( int, action ), Q_ARG( bool, state ) );
410 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 Jul 13 2013 01:27:30 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:30 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.