Commit e4d3f14e authored by Laurent Montel's avatar Laurent Montel 😁

Add option to wordwrap text

parent b5348d89
......@@ -514,6 +514,17 @@ void SieveEditorMainWidget::slotZoomReset()
}
}
void SieveEditorMainWidget::slotWordWrap(bool state)
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->wordWrap(state);
}
}
}
void SieveEditorMainWidget::slotGeneralPaletteChanged()
{
const QPalette pal = palette();
......
......@@ -80,6 +80,7 @@ public Q_SLOTS:
void slotZoomIn();
void slotZoomOut();
void slotZoomReset();
void slotWordWrap(bool);
Q_SIGNALS:
void updateButtons(bool newScriptAction, bool editScriptAction, bool deleteScriptAction, bool desactivateScriptAction);
......
......@@ -227,6 +227,12 @@ void SieveEditorMainWindow::setupActions()
mDebugSieveScriptAction = ac->addAction(QStringLiteral("debug_sieve"), mMainWidget->sieveEditorMainWidget(), SLOT(slotDebugSieveScript()));
mDebugSieveScriptAction->setText(i18n("Debug Sieve Script..."));
ac->setDefaultShortcut(mDebugSieveScriptAction, QKeySequence(Qt::CTRL + Qt::Key_D));
mWrapTextAction = new QAction(i18n("Wordwarp"), this);
mWrapTextAction->setCheckable(true);
ac->addAction(QStringLiteral("wordwrap"), mWrapTextAction);
connect(mWrapTextAction, SIGNAL(triggered(bool)), mMainWidget->sieveEditorMainWidget(), SLOT(slotWordWrap(bool)));
}
void SieveEditorMainWindow::slotRefreshList()
......
......@@ -95,6 +95,7 @@ private:
QAction *mZoomOutAction;
QAction *mZoomResetAction;
QAction *mDebugSieveScriptAction;
QAction *mWrapTextAction;
PimCommon::KActionMenuChangeCase *mMenuChangeCaseAction;
QLabel *mStatusBarInfo;
......
......@@ -312,6 +312,11 @@ void SieveEditorPageWidget::zoomOut()
mSieveEditorWidget->zoomOut();
}
void SieveEditorPageWidget::wordWrap(bool state)
{
mSieveEditorWidget->wordWrap(state);
}
void SieveEditorPageWidget::zoomReset()
{
mSieveEditorWidget->zoomReset();
......
......@@ -80,6 +80,7 @@ public:
void openBookmarkUrl(const QUrl &url);
void debugSieveScript();
void zoomReset();
void wordWrap(bool state);
Q_SIGNALS:
void refreshList();
void scriptModified(bool, SieveEditorPageWidget *);
......
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="sieveeditor" version="14">
<kpartgui name="sieveeditor" version="15">
<MenuBar>
<Menu name="file" >
<Action name="add_server_sieve" />
......@@ -23,6 +23,8 @@
<Separator/>
<Action name="gotoline" />
<Separator/>
<Action name="wordwrap" />
<Separator/>
<Action name="comment_code" />
<Action name="uncomment_code" />
<Separator/>
......
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