akonadi
actionstatemanager.cpp
78void ActionStateManager::updateState(const Collection::List &collections, const Item::List &items)
83 const bool atLeastOneCollectionSelected = (singleCollectionSelected || multipleCollectionsSelected);
201 enableAction(StandardActionManager::CreateCollection, singleCollectionSelected && // we can create only inside one collection
214 enableAction(StandardActionManager::MoveCollectionsToTrash, atLeastOneCollectionSelected && canMoveCollections && !collectionsAreInTrash);
216 enableAction(StandardActionManager::RestoreCollectionsFromTrash, atLeastOneCollectionSelected && canMoveCollections && collectionsAreInTrash);
222 enableAction(StandardActionManager::CollectionProperties, singleCollectionSelected && // we can only configure one collection at a time
225 enableAction(StandardActionManager::SynchronizeCollections, atLeastOneCollectionCanHaveItems); // it must be a valid folder collection
227 enableAction(StandardActionManager::SynchronizeCollectionsRecursive, atLeastOneCollectionSelected &&
230 enableAction(StandardActionManager::Paste, singleCollectionSelected && // we can paste only into a single collection
231 PasteHelper::canPaste(QApplication::clipboard()->mimeData(), collection)); // there must be data on the clipboard
239 enableAction(StandardActionManager::RemoveFromFavoriteCollections, canRemoveFromFavoriteCollections);
241 enableAction(StandardActionManager::RenameFavoriteCollection, singleCollectionSelected && // we can rename only one collection at a time
279 //updatePluralLabel( StandardActionManager::MoveToTrashRestoreCollectionAlternative, collectionCount );
283 enableAction(StandardActionManager::MoveToTrashRestoreCollection, atLeastOneCollectionSelected && canMoveCollections);
304 enableAction(StandardActionManager::CopyItems, atLeastOneItemSelected); // we need items to work with
306 enableAction(StandardActionManager::CutItems, atLeastOneItemSelected && // we need items to work with
309 enableAction(StandardActionManager::DeleteItems, atLeastOneItemSelected && // we need items to work with
312 enableAction(StandardActionManager::CopyItemToMenu, atLeastOneItemSelected); // we need items to work with
314 enableAction(StandardActionManager::MoveItemToMenu, atLeastOneItemSelected && // we need items to work with
317 enableAction(StandardActionManager::MoveItemsToTrash, atLeastOneItemSelected && canDeleteItems && !itemsAreInTrash);
319 enableAction(StandardActionManager::RestoreItemsFromTrash, atLeastOneItemSelected && itemsAreInTrash);
321 enableAction(StandardActionManager::CopyItemToDialog, atLeastOneItemSelected); // we need items to work with
323 enableAction(StandardActionManager::MoveItemToDialog, atLeastOneItemSelected && // we need items to work with
332 enableAction(StandardActionManager::MoveToTrashRestoreItem, atLeastOneItemSelected && // we need items to work with
384bool ActionStateManager::hasResourceCapability(const Collection &collection, const QString &capability) const
393 return !(collection.contentMimeTypes() == (QStringList() << QLatin1String("inode/directory")) ||
403 QMetaObject::invokeMethod(mReceiver, "enableAction", Qt::DirectConnection, Q_ARG(int, action), Q_ARG(bool, state));
412 QMetaObject::invokeMethod(mReceiver, "updatePluralLabel", Qt::DirectConnection, Q_ARG(int, action), Q_ARG(int, count));
421 QMetaObject::invokeMethod(mReceiver, "updateAlternatingAction", Qt::DirectConnection, Q_ARG(int, action));
void setReceiver(QObject *receiver)
Sets the receiver object that will actually update the states.
Definition actionstatemanager.cpp:73
void updateState(const Collection::List &collections, const Item::List &items)
Updates the states according to the selected collections and items.
Definition actionstatemanager.cpp:78
static AgentManager * self()
Returns the global instance of the agent manager.
Definition agentmanager.cpp:377
AgentInstance instance(const QString &identifier) const
Returns the agent instance with the given identifier or an invalid agent instance if the identifier d...
Definition agentmanager.cpp:401
QStringList capabilities() const
Returns the list of supported capabilities of the agent type.
Definition agenttype.cpp:76
static QString virtualMimeType()
Returns the mimetype used for virtual collections.
Definition collection.cpp:202
An Attribute that marks that an entity was marked as deleted.
Definition entitydeletedattribute.h:50
An Attribute that stores the special collection type of a collection.
Definition specialcollectionattribute_p.h:40
@ MoveToTrashRestoreItem
Move Item to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition standardactionmanager.h:168
@ RemoveFromFavoriteCollections
Remove the collection from the favorite collections model.
Definition standardactionmanager.h:144
@ CopyCollectionToDialog
Copy a collection into another collection, select the target in a dialog.
Definition standardactionmanager.h:157
@ MoveCollectionToDialog
Move a collection into another collection, select the target in a dialog.
Definition standardactionmanager.h:158
@ CopyItemToMenu
Menu allowing to quickly copy an item into a collection.
Definition standardactionmanager.h:147
@ RenameFavoriteCollection
Rename the collection of the favorite collections model.
Definition standardactionmanager.h:145
@ MoveToTrashRestoreCollection
Move Collection to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition standardactionmanager.h:166
@ CopyCollectionToMenu
Menu allowing to quickly copy a collection into another collection.
Definition standardactionmanager.h:146
@ AddToFavoriteCollections
Add the collection to the favorite collections model.
Definition standardactionmanager.h:143
@ SynchronizeCollectionsRecursive
Synchronizes collections in a recursive way.
Definition standardactionmanager.h:161
@ MoveItemsToTrash
Moves the selected items to trash and marks them as deleted, needs EntityDeletedAttribute.
Definition standardactionmanager.h:163
@ MoveToTrashRestoreCollectionAlternative
Helper type for MoveToTrashRestoreCollection, do not create directly. Use this to override texts of t...
Definition standardactionmanager.h:167
@ RestoreItemsFromTrash
Restores the selected items from trash, needs EntityDeletedAttribute.
Definition standardactionmanager.h:165
@ MoveToTrashRestoreItemAlternative
Helper type for MoveToTrashRestoreItem, do not create directly. Use this to override texts of the res...
Definition standardactionmanager.h:169
@ RestoreCollectionsFromTrash
Restores the selected collection from trash, needs EntityDeletedAttribute.
Definition standardactionmanager.h:164
@ MoveCollectionToMenu
Menu allowing to move a collection into another collection.
Definition standardactionmanager.h:149
@ MoveItemToDialog
Move an item into a collection, select the target in a dialog.
Definition standardactionmanager.h:160
@ CopyItemToDialog
Copy an item into a collection, select the target in a dialog.
Definition standardactionmanager.h:159
@ MoveCollectionsToTrash
Moves the selected collection to trash and marks it as deleted, needs EntityDeletedAttribute.
Definition standardactionmanager.h:162
bool canPaste(const QMimeData *mimeData, const Collection &collection)
Check whether the given mime data can be pasted into the given collection.
Definition pastehelper.cpp:223
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.