Libksieve
managesievewidget.cpp
60 connect(d->mTreeView, &ManageSieveTreeView::customContextMenuRequested, this, &ManageSieveWidget::slotContextMenuRequested);
62 connect(d->mTreeView, &ManageSieveTreeView::itemDoubleClicked, this, &ManageSieveWidget::slotDoubleClicked);
63 connect(d->mTreeView, &ManageSieveTreeView::itemSelectionChanged, this, &ManageSieveWidget::slotUpdateButtons);
64 connect(d->mTreeView, &ManageSieveTreeView::itemChanged, this, &ManageSieveWidget::slotItemChanged);
65 connect(this, &ManageSieveWidget::updateSieveSettingsDone, this, &ManageSieveWidget::updateSieveSettingsFinished);
67 connect(PimCommon::NetworkManager::self(), &PimCommon::NetworkManager::networkStatusChanged, this, &ManageSieveWidget::slotSystemNetworkOnlineStateChanged);
74 disconnect(d->mTreeView, &ManageSieveTreeView::itemSelectionChanged, this, &ManageSieveWidget::slotUpdateButtons);
148 menu.addAction(QIcon::fromTheme(QStringLiteral("edit-rename")), i18n("Rename Script…"), this, &ManageSieveWidget::slotRenameScript);
150 menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete Script"), this, &ManageSieveWidget::slotDeleteScript);
159 menu.addAction(QIcon::fromTheme(QStringLiteral("document-new")), i18n("New Script…"), this, &ManageSieveWidget::slotNewScript);
161 menu.addAction(KStandardGuiItem::cancel().icon(), KStandardGuiItem::cancel().text(), this, &ManageSieveWidget::slotCancelFetch);
224 QInputDialog::getText(this, i18n("New Sieve Script"), i18n("Please enter a name for the new Sieve script:"), QLineEdit::Normal, i18n("unnamed"), &ok);
228 KMessageBox::error(this, i18n("Empty name is not a valid name"), i18nc("@title:window", "New Script"));
234 KMessageBox::error(this, i18n("You cannot use protected name."), i18nc("@title:window", "New Script"));
246 KMessageBox::error(this, i18n("Script name already used \"%1\".", name), i18nc("@title:window", "New Script"));
252 const QStringList currentCapabilities = currentItem->data(0, SIEVE_SERVER_CAPABILITIES).toStringList();
253 const auto sieveimapaccountsettings = currentItem->data(0, SIEVE_SERVER_IMAP_SETTINGS).value<KSieveCore::SieveImapAccountSettings>();
258 newItem->setFlags(newItem->flags() & (Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable));
288 const auto sieveimapaccountsettings = parent->data(0, SIEVE_SERVER_IMAP_SETTINGS).value<KSieveCore::SieveImapAccountSettings>();
289 const QStringList currentCapabilities = parent->data(0, SIEVE_SERVER_CAPABILITIES).toStringList();
327 connect(job, &KSieveCore::GenerateGlobalScriptJob::success, this, &ManageSieveWidget::slotRefresh);
328 connect(job, &KSieveCore::GenerateGlobalScriptJob::error, this, &ManageSieveWidget::slotGenerateGlobalScriptError);
335void ManageSieveWidget::changeActiveScript(QTreeWidgetItem *item, bool activate, bool deleteScript)
380 qCWarning(LIBKSIEVEUI_LOG) << "MManageSieveWidget::slotGenerateGlobalScriptError: error: " << errorStr;
426 const QString newName = QInputDialog::getText(this, i18n("Rename Script"), i18n("Script Name:"), QLineEdit::Normal, currentItem->text(0));
445 connect(job, &KSieveCore::RenameScriptJob::finished, this, &ManageSieveWidget::slotRenameFinished);
450void ManageSieveWidget::slotRenameFinished(const QUrl &oldUrl, const QUrl &newUrl, const QString &errorStr, bool success)
452 qCDebug(LIBKSIEVEUI_LOG) << " void ManageSieveWidget::slotRenameResult(KManageSieve::SieveJob *job, bool success)" << success;
464 qCDebug(LIBKSIEVEUI_LOG) << " void ManageSieveWidget::slotRenameResult(KManageSieve::SieveJob *job, bool success)" << success;
540void ManageSieveWidget::slotGotList(KManageSieve::SieveJob *job, bool success, const QStringList &listScript, const QString &activeScript)
542 // qCDebug(LIBKSIEVEUI_LOG) << "void ManageSieveWidget::slotGotList(KManageSieve::SieveJob *job, bool success, const QStringList &listScript, const QString
574 item->setFlags(item->flags() & (Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable));
587 bool hasKep14EditorMode = KSieveCore::Util::hasKep14Support(sieveCapabilities, listScript, activeScript);
595 connect(parseJob, &KSieveCore::ParseUserScriptJob::finished, this, &ManageSieveWidget::setActiveScripts);
598 } else if (KSieveCore::Util::hasKep14CapabilitySupport(sieveCapabilities)) { // We don't have user script but server support kep14
607 QVariant::fromValue(job->property("sieveimapaccountsettings").value<KSieveCore::SieveImapAccountSettings>()));
656void ManageSieveWidget::enableDisableActions(bool &newScriptAction, bool &editScriptAction, bool &deleteScriptAction, bool &desactivateScriptAction)
static SieveJob * deactivate(const QUrl &url)
Deactivates the script with the given sieve url.
Definition sievejob.cpp:340
void result(KManageSieve::SieveJob *job, bool success, const QString &script, bool active)
This signal is emitted for all kind of jobs when they have finished.
QStringList sieveCapabilities() const
Returns the sieve capabilities of the IMAP server.
Definition sievejob.cpp:254
static SieveJob * del(const QUrl &url)
Deletes the script with the given sieve url.
Definition sievejob.cpp:327
static SieveJob * rename(const QUrl &url, const QString &newName)
Rename the script with the given sieve url and new name newName.
Definition sievejob.cpp:352
static SieveJob * activate(const QUrl &url)
Activates the script with the given sieve url.
Definition sievejob.cpp:380
The SieveImapAccountSettings class.
Definition sieveimapaccountsettings.h:18
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
ButtonCode warningContinueCancel(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
Continue
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
KSIEVECORE_EXPORT bool hasKep14Support(const QStringList &sieveCapabilities, const QStringList &availableScripts, const QString &activeScript)
Checks if a server has KEP:14 support.
Definition util.cpp:63
KSIEVECORE_EXPORT bool isKep14ProtectedName(const QString &scriptName)
Is the given scriptName a protected KEP:14 name, that a normal user should not touch directly.
Definition util.cpp:94
QString name(StandardAction id)
KGuiItem cancel()
KGuiItem ok()
KGuiItem del()
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)
Normal
bool isEmpty() const const
void clear()
const_iterator constBegin() const const
const_iterator constEnd() const const
bool contains(const Key &key) const const
iterator insert(const Key &key, const T &value)
QList< Key > keys() const const
size_type remove(const Key &key)
Q_EMITQ_EMIT
const QObjectList & children() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
QObject * parent() const const
QVariant property(const char *name) const const
bool isEmpty() const const
QString trimmed() const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
void sort(Qt::CaseSensitivity cs)
Unchecked
ItemIsUserCheckable
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
singleShot
void itemSelectionChanged()
Qt::CheckState checkState(int column) const const
QTreeWidgetItem * child(int index) const const
int childCount() const const
virtual QVariant data(int column, int role) const const
Qt::ItemFlags flags() const const
QTreeWidgetItem * parent() const const
void setCheckState(int column, Qt::CheckState state)
void setFlags(Qt::ItemFlags flags)
void setText(int column, const QString &text)
QString text(int column) const const
RemoveFilename
QUrl adjusted(FormattingOptions options) const const
bool isEmpty() const const
QString path(ComponentFormattingOptions options) const const
void setPath(const QString &path, ParsingMode mode)
QVariant fromValue(T &&value)
bool isValid() const const
bool toBool() const const
int toInt(bool *ok) const const
QStringList toStringList() const const
T value() const const
QList< QAction * > actions() const const
enabled
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.