Diffstat (limited to 'noncore/graphics/drawpad/drawpad.cpp') (more/less context) (ignore 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 @@ #include "filltool.h" #include "importdialog.h" #include "linetool.h" +#include "newpagedialog.h" #include "pointtool.h" #include "rectangletool.h" #include "texttool.h" @@ -93,7 +94,7 @@ DrawPad::DrawPad(QWidget* parent, const char* name) QPEToolBar* pageToolBar = new QPEToolBar(this); QAction* newPageAction = new QAction(tr("New Page"), Resource::loadIconSet("new"), QString::null, 0, this); - connect(newPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(newPage())); + connect(newPageAction, SIGNAL(activated()), this, SLOT(newPage())); newPageAction->addTo(pageToolBar); QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); @@ -268,6 +269,18 @@ DrawPad::~DrawPad() } } +void DrawPad::newPage() +{ + QRect rect = m_pDrawPadCanvas->contentsRect(); + + NewPageDialog newPageDialog(rect.width(), rect.height(), m_pen.color(), m_brush.color(), this); + + if (newPageDialog.exec() == QDialog::Accepted) { + m_pDrawPadCanvas->newPage(newPageDialog.selectedWidth(), newPageDialog.selectedHeight(), + newPageDialog.selectedColor()); + } +} + void DrawPad::clearPage() { QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), @@ -575,7 +588,7 @@ void DrawPad::exportPage() void DrawPad::thumbnailView() { - ThumbnailView thumbnailView(m_pDrawPadCanvas, this); + ThumbnailView thumbnailView(this, m_pDrawPadCanvas, this); thumbnailView.showMaximized(); thumbnailView.exec(); |