Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
PIM Sieve Editor
Commits
29691e9c
Commit
29691e9c
authored
May 16, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start to implement print/printpreview
parent
a9afda53
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
0 deletions
+43
-0
src/sieveeditormainwidget.cpp
src/sieveeditormainwidget.cpp
+22
-0
src/sieveeditormainwidget.h
src/sieveeditormainwidget.h
+3
-0
src/sieveeditormainwindow.cpp
src/sieveeditormainwindow.cpp
+4
-0
src/sieveeditormainwindow.h
src/sieveeditormainwindow.h
+2
-0
src/sieveeditorpagewidget.cpp
src/sieveeditorpagewidget.cpp
+10
-0
src/sieveeditorpagewidget.h
src/sieveeditorpagewidget.h
+2
-0
No files found.
src/sieveeditormainwidget.cpp
View file @
29691e9c
...
...
@@ -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
();
...
...
src/sieveeditormainwidget.h
View file @
29691e9c
...
...
@@ -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
);
...
...
src/sieveeditormainwindow.cpp
View file @
29691e9c
...
...
@@ -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
()
...
...
src/sieveeditormainwindow.h
View file @
29691e9c
...
...
@@ -96,6 +96,8 @@ private:
QAction
*
mZoomResetAction
;
QAction
*
mDebugSieveScriptAction
;
QAction
*
mWrapTextAction
;
QAction
*
mPrintAction
;
QAction
*
mPrintPreviewAction
;
PimCommon
::
KActionMenuChangeCase
*
mMenuChangeCaseAction
;
QLabel
*
mStatusBarInfo
;
...
...
src/sieveeditorpagewidget.cpp
View file @
29691e9c
...
...
@@ -323,6 +323,16 @@ bool SieveEditorPageWidget::isWordWrap() const
return
mSieveEditorWidget
->
isWordWrap
();
}
void
SieveEditorPageWidget
::
print
()
{
//TODO
}
void
SieveEditorPageWidget
::
printPreview
()
{
//TODO
}
void
SieveEditorPageWidget
::
zoomReset
()
{
mSieveEditorWidget
->
zoomReset
();
...
...
src/sieveeditorpagewidget.h
View file @
29691e9c
...
...
@@ -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
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment