Commit 87489dc2 authored by Laurent Montel's avatar Laurent Montel 😁

Use KSieveUi::ManageSieveWidget::ScriptInfo

parent 6293e6ba
......@@ -120,9 +120,9 @@ void SieveEditorMainWidget::slotScriptRenamed(const QUrl &oldUrl, const QUrl &ne
updateStackedWidget();
}
void SieveEditorMainWidget::slotCreateScriptPage(const QUrl &url, const QStringList &capabilities, bool isNewScript, const KSieveUi::SieveImapAccountSettings &sieveImapAccountSettings)
void SieveEditorMainWidget::slotCreateScriptPage(const KSieveUi::ManageSieveWidget::ScriptInfo &info, bool isNewScript)
{
QWidget *page = hasExistingPage(url);
QWidget *page = hasExistingPage(info.currentUrl);
if (page) {
mTabWidget->setCurrentWidget(page);
} else {
......@@ -135,8 +135,8 @@ void SieveEditorMainWidget::slotCreateScriptPage(const QUrl &url, const QStringL
connect(editor, &SieveEditorPageWidget::copyAvailable, this, &SieveEditorMainWidget::copyAvailable);
connect(editor, &SieveEditorPageWidget::sieveEditorTabCurrentChanged, this, &SieveEditorMainWidget::sieveEditorTabCurrentChanged);
editor->setIsNewScript(isNewScript);
editor->loadScript(url, capabilities, sieveImapAccountSettings);
mTabWidget->addTab(editor, url.fileName());
editor->loadScript(info.currentUrl, info.currentCapabilities, info.sieveImapAccountSettings);
mTabWidget->addTab(editor, info.currentUrl.fileName());
mTabWidget->setCurrentWidget(editor);
if (isNewScript) {
editor->uploadScript(false, true);
......
......@@ -23,6 +23,7 @@
#include <QSplitter>
#include <QUrl>
#include "ksieveui/sieveeditorwidget.h"
#include <KSieveUi/ManageSieveWidget>
class QTabWidget;
class QStackedWidget;
class SieveEditorTabWidget;
......@@ -30,6 +31,7 @@ class SieveEditorScriptManagerWidget;
class SieveEditorPageWidget;
class SieveEditorEmptyTabWidgetLabel;
class KActionCollection;
class SieveEditorMainWidget : public QSplitter
{
Q_OBJECT
......@@ -101,7 +103,7 @@ Q_SIGNALS:
void sieveEditorTabCurrentChanged();
private Q_SLOTS:
void slotCreateScriptPage(const QUrl &url, const QStringList &capabilities, bool isNewScript, const KSieveUi::SieveImapAccountSettings &sieveImapAccountSettings);
void slotCreateScriptPage(const KSieveUi::ManageSieveWidget::ScriptInfo &info, bool isNewScript);
void slotScriptDeleted(const QUrl &url);
void slotScriptRenamed(const QUrl &oldUrl, const QUrl &newUrl);
void slotScriptModified(bool modified, SieveEditorPageWidget *page);
......
......@@ -55,12 +55,12 @@ void SieveEditorScriptManagerWidget::slotUpdateButtons(QTreeWidgetItem *item)
void SieveEditorScriptManagerWidget::slotEditScript(const KSieveUi::ManageSieveWidget::ScriptInfo &info)
{
Q_EMIT createScriptPage(info.currentUrl, info.currentCapabilities, false, info.sieveImapAccountSettings);
Q_EMIT createScriptPage(info, false);
}
void SieveEditorScriptManagerWidget::slotNewScript(const KSieveUi::ManageSieveWidget::ScriptInfo &info)
{
Q_EMIT createScriptPage(info.currentUrl, info.currentCapabilities, true, info.sieveImapAccountSettings);
Q_EMIT createScriptPage(info, true);
}
void SieveEditorScriptManagerWidget::slotCreateNewScript()
......
......@@ -42,7 +42,7 @@ public:
void refreshList();
Q_SIGNALS:
void createScriptPage(const QUrl &url, const QStringList &capabilities, bool isNewScript, const KSieveUi::SieveImapAccountSettings &sieveImapAccountSettings);
void createScriptPage(const KSieveUi::ManageSieveWidget::ScriptInfo &info, bool isNewScript);
void updateButtons(bool newScriptAction, bool editScriptAction, bool deleteScriptAction, bool desactivateScriptAction);
void scriptDeleted(const QUrl &url);
void serverSieveFound(bool hasServerSieve);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment