summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-31 12:27:06 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-31 12:27:06 (GMT)
commitc62dd4794741fb2c52b75e21a7b064ada9b616b9 (patch)
tree53f20bc77add147048ca93c98e246a04922ea2cf
parentd9d83a1388028fe311487e6b8321368f342eaa73 (diff)
Start to implement rename script
-rw-r--r--src/ksieveui/widgets/managesievewidget.cpp23
-rw-r--r--src/ksieveui/widgets/managesievewidget.h1
2 files changed, 24 insertions, 0 deletions
diff --git a/src/ksieveui/widgets/managesievewidget.cpp b/src/ksieveui/widgets/managesievewidget.cpp
index 4d56502..ddfd5ed 100644
--- a/src/ksieveui/widgets/managesievewidget.cpp
+++ b/src/ksieveui/widgets/managesievewidget.cpp
@@ -164,6 +164,7 @@ void ManageSieveWidget::slotContextMenuRequested(const QPoint &p)
// script items:
menu.addAction(i18n("Edit Script..."), this, &ManageSieveWidget::slotEditScript);
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete Script"), this, &ManageSieveWidget::slotDeleteScript);
+ menu.addAction(QIcon::fromTheme(QStringLiteral("edit-rename")), i18n("Rename Script"), this, &ManageSieveWidget::slotRenameScript);
if (itemIsActived(item)) {
menu.addSeparator();
menu.addAction(i18n("Deactivate Script"), this, &ManageSieveWidget::slotDeactivateScript);
@@ -359,6 +360,28 @@ void ManageSieveWidget::clear()
d->mTreeView->clear();
}
+void ManageSieveWidget::slotRenameScript()
+{
+ QTreeWidgetItem *currentItem = d->mTreeView->currentItem();
+ if (!isFileNameItem(currentItem)) {
+ return;
+ }
+ QTreeWidgetItem *parent = currentItem->parent();
+ if (!parent) {
+ return;
+ }
+
+ if (!mUrls.count(parent)) {
+ return;
+ }
+
+ QUrl u = mUrls[parent];
+ if (u.isEmpty()) {
+ return;
+ }
+ //TODO
+}
+
void ManageSieveWidget::slotDeleteScript()
{
QTreeWidgetItem *currentItem = d->mTreeView->currentItem();
diff --git a/src/ksieveui/widgets/managesievewidget.h b/src/ksieveui/widgets/managesievewidget.h
index 45849a8..75862eb 100644
--- a/src/ksieveui/widgets/managesievewidget.h
+++ b/src/ksieveui/widgets/managesievewidget.h
@@ -72,6 +72,7 @@ private Q_SLOTS:
void slotCancelFetch();
public Q_SLOTS:
+ void slotRenameScript();
void slotGotList(KManageSieve::SieveJob *job, bool success, const QStringList &listScript, const QString &activeScript);
void slotNewScript();
void slotEditScript();