Commit 00db14c1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Edit specific code

parent a9699aa0
......@@ -43,6 +43,7 @@
#include <KLocalizedString>
#include <KSharedConfig>
#include <KConfigGroup>
#include <KMessageBox>
#include <QSplitter>
#include <QShortcut>
......@@ -232,21 +233,22 @@ void SieveEditorTextModeWidget::slotEditRule(const QString &selectedText)
KSieveUi::XMLPrintingScriptBuilder psb(2);
parser.setScriptBuilder(&psb);
const bool result = parser.parse();
if (!result) {
//TODO
} else {
if (result) {
QPointer<AutoCreateScriptDialog> dlg = new AutoCreateScriptDialog(this);
dlg->setSieveCapabilities(mSieveCapabilities);
dlg->setSieveImapAccountSettings(mSieveImapAccountSettings);
dlg->setListOfIncludeFile(mListOfIncludeFile);
QString error;
//qDebug() << " psb.result()" << psb.result();
dlg->loadScript(psb.result(), error);
if (dlg->exec()) {
//set text
QString requireModules;
const QString newScript = dlg->script(requireModules);
mTextEdit->insertPlainText(newScript);
}
delete dlg;
} else {
KMessageBox::error(this, i18n("Selected text is not a full sieve script"), i18n("Parsing error"));
}
}
......
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