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

Edit specific code

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