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

Start to implement print/printpreview

parent f8726670
......@@ -537,6 +537,28 @@ void SieveEditorMainWidget::slotWordWrap(bool state)
}
}
void SieveEditorMainWidget::slotPrintPreview()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->printPreview();
}
}
}
void SieveEditorMainWidget::slotPrint()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->print();
}
}
}
void SieveEditorMainWidget::slotGeneralPaletteChanged()
{
const QPalette pal = palette();
......
......@@ -82,6 +82,9 @@ public Q_SLOTS:
void slotZoomOut();
void slotZoomReset();
void slotWordWrap(bool);
void slotPrintPreview();
void slotPrint();
Q_SIGNALS:
void updateButtons(bool newScriptAction, bool editScriptAction, bool deleteScriptAction, bool desactivateScriptAction);
......
......@@ -233,6 +233,10 @@ void SieveEditorMainWindow::setupActions()
mWrapTextAction->setCheckable(true);
ac->addAction(QStringLiteral("wordwrap"), mWrapTextAction);
connect(mWrapTextAction, &QAction::triggered, mMainWidget->sieveEditorMainWidget(), &SieveEditorMainWidget::slotWordWrap);
mPrintAction = KStandardAction::print(mMainWidget->sieveEditorMainWidget(), SLOT(slotPrint()), ac);
mPrintPreviewAction = KStandardAction::printPreview(mMainWidget->sieveEditorMainWidget(), SLOT(slotPrintPreview()), ac);
}
void SieveEditorMainWindow::slotRefreshList()
......
......@@ -96,6 +96,8 @@ private:
QAction *mZoomResetAction;
QAction *mDebugSieveScriptAction;
QAction *mWrapTextAction;
QAction *mPrintAction;
QAction *mPrintPreviewAction;
PimCommon::KActionMenuChangeCase *mMenuChangeCaseAction;
QLabel *mStatusBarInfo;
......
......@@ -323,6 +323,16 @@ bool SieveEditorPageWidget::isWordWrap() const
return mSieveEditorWidget->isWordWrap();
}
void SieveEditorPageWidget::print()
{
//TODO
}
void SieveEditorPageWidget::printPreview()
{
//TODO
}
void SieveEditorPageWidget::zoomReset()
{
mSieveEditorWidget->zoomReset();
......
......@@ -82,6 +82,8 @@ public:
void zoomReset();
void wordWrap(bool state);
bool isWordWrap() const;
void print();
void printPreview();
Q_SIGNALS:
void refreshList();
void scriptModified(bool, SieveEditorPageWidget *);
......
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