akonadi
actionstatemanager.cpp
78 void 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
384 bool 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));
Moves the selected items to trash and marks them as deleted, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:163
Helper type for MoveToTrashRestoreItem, do not create directly. Use this to override texts of the res...
Definition: standardactionmanager.h:169
Menu allowing to move item into a collection.
Definition: standardactionmanager.h:148
Creates an collection.
Definition: standardactionmanager.h:134
Moves the selected collection to trash and marks it as deleted, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:162
void updateState(const Collection::List &collections, const Item::List &items)
Updates the states according to the selected collections and items.
Definition: actionstatemanager.cpp:78
Copies the selected items.
Definition: standardactionmanager.h:139
Copy a collection into another collection, select the target in a dialog.
Definition: standardactionmanager.h:157
Provides the resource properties.
Definition: standardactionmanager.h:154
bool contains(const QString &str, Qt::CaseSensitivity cs) const
static QString virtualMimeType()
Returns the mimetype used for virtual collections.
Definition: collection.cpp:202
Cuts the selected items.
Definition: standardactionmanager.h:150
An Attribute that stores the special collection type of a collection.
Definition: specialcollectionattribute_p.h:39
Can create new subcollections in this collection.
Definition: collection.h:92
Restores the selected items from trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:165
Restores the selected collection from trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:164
Helper type for MoveToTrashRestoreCollection, do not create directly. Use this to override texts of t...
Definition: standardactionmanager.h:167
Paste collections or items.
Definition: standardactionmanager.h:140
int count(const T &value) const
Collection parentCollection() const
Returns the parent collection of this object.
Definition: entity.cpp:185
QClipboard * clipboard()
Provides collection properties.
Definition: standardactionmanager.h:138
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
Remove the collection from the favorite collections model.
Definition: standardactionmanager.h:144
Copy an item into a collection, select the target in a dialog.
Definition: standardactionmanager.h:159
Add the collection to the favorite collections model.
Definition: standardactionmanager.h:143
bool isEmpty() const
QStringList capabilities() const
Returns the list of supported capabilities of the agent type.
Definition: agenttype.cpp:76
Synchronizes collections in a recursive way.
Definition: standardactionmanager.h:161
Menu allowing to quickly copy a collection into another collection.
Definition: standardactionmanager.h:146
T & first()
Rights rights() const
Returns the rights the user has on the collection.
Definition: collection.cpp:99
Cuts the selected collections.
Definition: standardactionmanager.h:151
void setReceiver(QObject *receiver)
Sets the receiver object that will actually update the states.
Definition: actionstatemanager.cpp:73
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
An Attribute that marks that an entity was marked as deleted.
Definition: entitydeletedattribute.h:49
Menu allowing to quickly copy an item into a collection.
Definition: standardactionmanager.h:147
Synchronizes the selected resources.
Definition: standardactionmanager.h:155
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
Deletes the selected resources.
Definition: standardactionmanager.h:153
Copies the selected collections.
Definition: standardactionmanager.h:135
bool hasAttribute(const QByteArray &name) const
Returns true if the entity has an attribute of the given type name, false otherwise.
Definition: entity.cpp:148
QStringList contentMimeTypes() const
Returns a list of possible content mimetypes, e.g.
Definition: collection.cpp:115
static AgentManager * self()
Returns the global instance of the agent manager.
Definition: agentmanager.cpp:377
Move Item to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:168
Creates a new resource.
Definition: standardactionmanager.h:152
QString resource() const
Returns the identifier of the resource owning the collection.
Definition: collection.cpp:207
Move an item into a collection, select the target in a dialog.
Definition: standardactionmanager.h:160
Move a collection into another collection, select the target in a dialog.
Definition: standardactionmanager.h:158
Synchronizes collections.
Definition: standardactionmanager.h:137
Move Collection to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:166
Deletes the selected items.
Definition: standardactionmanager.h:141
Deletes the selected collections.
Definition: standardactionmanager.h:136
Menu allowing to move a collection into another collection.
Definition: standardactionmanager.h:149
Rename the collection of the favorite collections model.
Definition: standardactionmanager.h:145
virtual ~ActionStateManager()
Destroys the action state manager.
Definition: actionstatemanager.cpp:69
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.