Diffstat (limited to 'noncore/graphics/drawpad/drawpad.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 58c0d09..ef55268 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "filltool.h" | 22 | #include "filltool.h" |
23 | #include "importdialog.h" | 23 | #include "importdialog.h" |
24 | #include "linetool.h" | 24 | #include "linetool.h" |
25 | #include "newpagedialog.h" | ||
25 | #include "pointtool.h" | 26 | #include "pointtool.h" |
26 | #include "rectangletool.h" | 27 | #include "rectangletool.h" |
27 | #include "texttool.h" | 28 | #include "texttool.h" |
@@ -93,7 +94,7 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
93 | QPEToolBar* pageToolBar = new QPEToolBar(this); | 94 | QPEToolBar* pageToolBar = new QPEToolBar(this); |
94 | 95 | ||
95 | QAction* newPageAction = new QAction(tr("New Page"), Resource::loadIconSet("new"), QString::null, 0, this); | 96 | QAction* newPageAction = new QAction(tr("New Page"), Resource::loadIconSet("new"), QString::null, 0, this); |
96 | connect(newPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(newPage())); | 97 | connect(newPageAction, SIGNAL(activated()), this, SLOT(newPage())); |
97 | newPageAction->addTo(pageToolBar); | 98 | newPageAction->addTo(pageToolBar); |
98 | 99 | ||
99 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); | 100 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); |
@@ -268,6 +269,18 @@ DrawPad::~DrawPad() | |||
268 | } | 269 | } |
269 | } | 270 | } |
270 | 271 | ||
272 | void DrawPad::newPage() | ||
273 | { | ||
274 | QRect rect = m_pDrawPadCanvas->contentsRect(); | ||
275 | |||
276 | NewPageDialog newPageDialog(rect.width(), rect.height(), m_pen.color(), m_brush.color(), this); | ||
277 | |||
278 | if (newPageDialog.exec() == QDialog::Accepted) { | ||
279 | m_pDrawPadCanvas->newPage(newPageDialog.selectedWidth(), newPageDialog.selectedHeight(), | ||
280 | newPageDialog.selectedColor()); | ||
281 | } | ||
282 | } | ||
283 | |||
271 | void DrawPad::clearPage() | 284 | void DrawPad::clearPage() |
272 | { | 285 | { |
273 | QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), | 286 | QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), |
@@ -575,7 +588,7 @@ void DrawPad::exportPage() | |||
575 | 588 | ||
576 | void DrawPad::thumbnailView() | 589 | void DrawPad::thumbnailView() |
577 | { | 590 | { |
578 | ThumbnailView thumbnailView(m_pDrawPadCanvas, this); | 591 | ThumbnailView thumbnailView(this, m_pDrawPadCanvas, this); |
579 | 592 | ||
580 | thumbnailView.showMaximized(); | 593 | thumbnailView.showMaximized(); |
581 | thumbnailView.exec(); | 594 | thumbnailView.exec(); |