Akonadi
collectiondialog.cpp
42 CollectionDialogPrivate(QAbstractItemModel *customModel, CollectionDialog *parent, CollectionDialog::CollectionDialogOptions options)
107 mParent->connect(filterCollectionLineEdit, &QLineEdit::textChanged, mParent, [this](const QString &str) {
111 mParent->connect(mView->selectionModel(), &QItemSelectionModel::selectionChanged, mParent, [this]() {
114 mParent->connect(mView, qOverload<const QModelIndex &>(&QAbstractItemView::doubleClicked), mParent, [this]() {
119 mParent->connect(mSelectionHandler, &AsyncSelectionHandler::collectionAvailable, mParent, [this](const QModelIndex &index) {
209 mButtonBox->button(QDialogButtonBox::Ok)->setEnabled(!mView->selectionModel()->selectedIndexes().isEmpty());
222void CollectionDialogPrivate::changeCollectionDialogOptions(CollectionDialog::CollectionDialogOptions options)
224 mAllowToCreateNewChildCollection = (options & CollectionDialog::AllowToCreateNewChildCollection);
226 mNewSubfolderButton = mButtonBox->addButton(i18nc("@action:button", "&New Subfolder..."), QDialogButtonBox::NoRole);
228 mNewSubfolderButton->setToolTip(i18nc("@info:tooltip", "Create a new subfolder under the currently selected folder"));
236 mParent->connect(mRightsFilterModel, &EntityRightsFilterModel::rowsInserted, mView, &EntityTreeView::expandAll, Qt::UniqueConnection);
241bool CollectionDialogPrivate::canCreateCollection(const Akonadi::Collection &parentCollection) const
266 QInputDialog::getText(mParent, i18nc("@title:window", "New Folder"), i18nc("@label:textbox, name of a thing", "Name"), {}, {}, &ok);
287 QMessageBox::critical(mParent, i18nc("@title:window", "Folder Creation Failed"), i18n("Could not create folder: %1", job->errorString()));
303CollectionDialog::CollectionDialog(CollectionDialogOptions options, QAbstractItemModel *model, QWidget *parent)
330 const auto collection = index.model()->data(index, EntityTreeModel::CollectionRole).value<Collection>();
Job that creates a new collection in the Akonadi storage.
Definition collectioncreatejob.h:41
void setContentMimeTypes(const QStringList &mimetypes)
Allow to specify collection content mimetype when we create new one.
Definition collectiondialog.cpp:411
void setUseFolderByDefault(bool b)
Definition collectiondialog.cpp:400
Akonadi::Collection selectedCollection() const
Returns the selected collection if the selection mode is QAbstractItemView::SingleSelection.
Definition collectiondialog.cpp:311
~CollectionDialog() override
Destroys the collection dialog.
void changeCollectionDialogOptions(CollectionDialogOptions options)
Change collection dialog options.
Definition collectiondialog.cpp:395
QAbstractItemView::SelectionMode selectionMode() const
Returns the selection mode.
Definition collectiondialog.cpp:390
void setDefaultCollection(const Collection &collection)
Sets the collection that shall be selected by default.
Definition collectiondialog.cpp:380
void setSelectionMode(QAbstractItemView::SelectionMode mode)
Sets the selection mode.
Definition collectiondialog.cpp:385
void setAccessRightsFilter(Collection::Rights rights)
Sets the access rights that the listed collections shall match with.
Definition collectiondialog.cpp:361
QStringList mimeTypeFilter() const
Returns the mime types any of which the selected collection(s) shall support.
Definition collectiondialog.cpp:356
void setMimeTypeFilter(const QStringList &mimeTypes)
Sets the mime types any of which the selected collection(s) shall support.
Definition collectiondialog.cpp:340
void setDescription(const QString &text)
Sets the text that will be shown in the dialog.
Definition collectiondialog.cpp:374
CollectionDialog(QWidget *parent=nullptr)
Creates a new collection dialog.
Definition collectiondialog.cpp:291
Collection::Rights accessRightsFilter() const
Sets the access rights that the listed collections shall match with.
Definition collectiondialog.cpp:369
Akonadi::Collection::List selectedCollections() const
Returns the list of selected collections.
Definition collectiondialog.cpp:323
bool useFolderByDefault() const
Definition collectiondialog.cpp:406
@ Display
Only retrieve collections for display, taking the local preference and enabled into account.
Definition collectionfetchscope.h:97
A proxy model that filters collections by mime type.
Definition collectionfilterproxymodel.h:44
void setExcludeVirtualCollections(bool exclude)
Sets whether we want virtual collections to be filtered or not.
Definition collectionfilterproxymodel.cpp:134
void setParentCollection(const Collection &parent)
Set the parent collection of this object.
Definition collection.cpp:204
void setName(const QString &name)
Sets the i18n'ed name of the collection.
Definition collection.cpp:221
void setContentMimeTypes(const QStringList &types)
Sets the list of possible content mime types.
Definition collection.cpp:245
A proxy model that filters entities by access rights.
Definition entityrightsfiltermodel.h:48
A view to show an item/collection tree provided by an EntityTreeModel.
Definition entitytreeview.h:60
void setModel(QAbstractItemModel *model) override
Definition entitytreeview.cpp:195
void setCollectionMonitored(const Collection &collection, bool monitored=true)
Sets whether the specified collection shall be monitored for changes.
Definition monitor.cpp:48
void fetchCollection(bool enable)
Enables automatic fetching of changed collections from the Akonadi storage.
Definition monitor.cpp:193
virtual QString errorString() const
int error() const
void result(KJob *job)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
Helper integration between Akonadi and Qt.
QString name(GameStandardAction id)
void catchReturnKey(QObject *lineEdit)
KGuiItem ok()
void clicked(bool checked)
void setIcon(const QIcon &icon)
virtual QVariant data(const QModelIndex &index, int role) const const=0
void rowsInserted(const QModelIndex &parent, int first, int last)
NoDragDrop
SingleSelection
void doubleClicked(const QModelIndex &index)
void setDragDropMode(DragDropMode behavior)
QItemSelectionModel * selectionModel() const const
void setCurrentIndex(const QModelIndex &index)
virtual void accept()
virtual void reject()
NoRole
void accepted()
QPushButton * addButton(StandardButton button)
QPushButton * button(StandardButton which) const const
void rejected()
QIcon fromTheme(const QString &name)
QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode, const QString &text, bool *ok, Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
selectedIndexes
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
void textChanged(const QString &text)
void append(QList< T > &&value)
bool isEmpty() const const
StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons, StandardButton defaultButton)
bool isValid() const const
const QAbstractItemModel * model() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void setObjectName(QAnyStringView name)
bool isValid() const const
void setFilterCaseSensitivity(Qt::CaseSensitivity cs)
void setRecursiveFilteringEnabled(bool recursive)
void setFilterFixedString(const QString &pattern)
virtual void setSourceModel(QAbstractItemModel *sourceModel) override
bool isEmpty() const const
QString trimmed() const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
CaseInsensitive
UniqueConnection
void expandAll()
QHeaderView * header() const const
T value() const const
void setEnabled(bool)
void hide()
void resize(const QSize &)
void setToolTip(const QString &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.