Akonadi
collectiondialog.cpp
41 CollectionDialogPrivate(QAbstractItemModel *customModel, CollectionDialog *parent, CollectionDialog::CollectionDialogOptions options)
105 mParent->connect(filterCollectionLineEdit, &QLineEdit::textChanged, mParent, [this](const QString &str) {
109 mParent->connect(mView->selectionModel(), &QItemSelectionModel::selectionChanged, mParent, [this]() {
112 mParent->connect(mView, qOverload<const QModelIndex &>(&QAbstractItemView::doubleClicked), mParent, [this]() {
117 mParent->connect(mSelectionHandler, &AsyncSelectionHandler::collectionAvailable, mParent, [this](const QModelIndex &index) {
207 mButtonBox->button(QDialogButtonBox::Ok)->setEnabled(!mView->selectionModel()->selectedIndexes().isEmpty());
220 void CollectionDialogPrivate::changeCollectionDialogOptions(CollectionDialog::CollectionDialogOptions options)
222 mAllowToCreateNewChildCollection = (options & CollectionDialog::AllowToCreateNewChildCollection);
224 mNewSubfolderButton = mButtonBox->addButton(i18n("&New Subfolder..."), QDialogButtonBox::NoRole);
226 mNewSubfolderButton->setToolTip(i18n("Create a new subfolder under the currently selected folder"));
234 mParent->connect(mRightsFilterModel, &EntityRightsFilterModel::rowsInserted, mView, &EntityTreeView::expandAll, Qt::UniqueConnection);
239 bool CollectionDialogPrivate::canCreateCollection(const Akonadi::Collection &parentCollection) const
264 QInputDialog::getText(mParent, i18nc("@title:window", "New Folder"), i18nc("@label:textbox, name of a thing", "Name"), {}, {}, &ok);
285 QMessageBox::critical(mParent, i18n("Folder creation failed"), i18n("Could not create folder: %1", job->errorString()));
301 CollectionDialog::CollectionDialog(CollectionDialogOptions options, QAbstractItemModel *model, QWidget *parent)
328 const auto collection = index.model()->data(index, EntityTreeModel::CollectionRole).value<Collection>();
A model for collections and items together.
Definition: entitytreemodel.h:305
void doubleClicked(const QModelIndex &index)
A view to show an item/collection tree provided by an EntityTreeModel.
Definition: entitytreeview.h:59
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
bool isValid() const const
QStringList mimeTypeFilter() const
Returns the mime types any of which the selected collection(s) shall support.
Definition: collectiondialog.cpp:354
virtual void reject()
CaseInsensitive
void result(KJob *job)
virtual QVariant data(const QModelIndex &index, int role) const const=0
T value() const const
bool contains(const QString &str, Qt::CaseSensitivity cs) const const
QString trimmed() const const
void append(const T &value)
void clicked(bool checked)
QAbstractItemView::SelectionMode selectionMode() const
Returns the selection mode.
Definition: collectiondialog.cpp:388
Collection::Rights accessRightsFilter() const
Sets the access rights that the listed collections shall match with.
Definition: collectiondialog.cpp:367
QIcon fromTheme(const QString &name)
@ Display
Only retrieve collections for display, taking the local preference and enabled into account.
Definition: collectionfetchscope.h:97
A proxy model that filters entities by access rights.
Definition: entityrightsfiltermodel.h:47
void setDefaultCollection(const Collection &collection)
Sets the collection that shall be selected by default.
Definition: collectiondialog.cpp:378
void changeCollectionDialogOptions(CollectionDialogOptions options)
Change collection dialog options.
Definition: collectiondialog.cpp:393
NoDragDrop
A proxy model that filters collections by mime type.
Definition: collectionfilterproxymodel.h:43
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
bool useFolderByDefault() const
Definition: collectiondialog.cpp:404
void expandAll()
CollectionDialog(QWidget *parent=nullptr)
Creates a new collection dialog.
Definition: collectiondialog.cpp:289
void setUseFolderByDefault(bool b)
Definition: collectiondialog.cpp:398
QString i18n(const char *text, const TYPE &arg...)
NoRole
void setMimeTypeFilter(const QStringList &mimeTypes)
Sets the mime types any of which the selected collection(s) shall support.
Definition: collectiondialog.cpp:338
Akonadi::Collection selectedCollection() const
Returns the selected collection if the selection mode is QAbstractItemView::SingleSelection.
Definition: collectiondialog.cpp:309
void textChanged(const QString &text)
bool isEmpty() const const
void accepted()
QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode, const QString &text, bool *ok, Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
virtual void accept()
UniqueConnection
SingleSelection
void setContentMimeTypes(const QStringList &types)
Sets the list of possible content mime types.
Definition: collection.cpp:245
KSharedConfigPtr config()
bool isValid() const const
KGuiItem ok()
selectedIndexes
~CollectionDialog() override
Destroys the collection dialog.
void rowsInserted(const QModelIndex &parent, int first, int last)
void rejected()
void setAccessRightsFilter(Collection::Rights rights)
Sets the access rights that the listed collections shall match with.
Definition: collectiondialog.cpp:359
void setSelectionMode(QAbstractItemView::SelectionMode mode)
Sets the selection mode.
Definition: collectiondialog.cpp:383
QString name(StandardShortcut id)
void setDescription(const QString &text)
Sets the text that will be shown in the dialog.
Definition: collectiondialog.cpp:372
void setContentMimeTypes(const QStringList &mimetypes)
Allow to specify collection content mimetype when we create new one.
Definition: collectiondialog.cpp:409
QString i18nc(const char *context, const char *text, const TYPE &arg...)
void setParentCollection(const Collection &parent)
Set the parent collection of this object.
Definition: collection.cpp:204
Job that creates a new collection in the Akonadi storage.
Definition: collectioncreatejob.h:39
virtual QString errorString() const
int error() const
Akonadi::Collection::List selectedCollections() const
Returns the list of selected collections.
Definition: collectiondialog.cpp:321
void setName(const QString &name)
Sets the i18n'ed name of the collection.
Definition: collection.cpp:221
QMessageBox::StandardButton critical(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
const QAbstractItemModel * model() const const
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jun 27 2022 04:01:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jun 27 2022 04:01:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.