author | leseb <leseb> | 2002-06-07 20:30:30 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-06-07 20:30:30 (UTC) |
commit | 9dcd598f9b815511cae884d26b18e3c8913b9fcf (patch) (side-by-side diff) | |
tree | 4b18e7fa7c864b2dca4da76bc89c2a975e80a73c /noncore/graphics/drawpad/drawpad.cpp | |
parent | 640d964cfdc7467f6cacb513087cd3acda2c04f0 (diff) | |
download | opie-9dcd598f9b815511cae884d26b18e3c8913b9fcf.zip opie-9dcd598f9b815511cae884d26b18e3c8913b9fcf.tar.gz opie-9dcd598f9b815511cae884d26b18e3c8913b9fcf.tar.bz2 |
Make progress in thumbnail view
Diffstat (limited to 'noncore/graphics/drawpad/drawpad.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index b325323..58c0d09 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp @@ -37,8 +37,9 @@ #include <qpe/resource.h> #include <qaction.h> #include <qfile.h> +#include <qmessagebox.h> #include <qpainter.h> #include <qspinbox.h> #include <qtoolbutton.h> #include <qtooltip.h> @@ -65,9 +66,9 @@ DrawPad::DrawPad(QWidget* parent, const char* name) QPopupMenu *toolsPopupMenu = new QPopupMenu(menuBar); QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this); - connect(deleteAllAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(deleteAll())); + connect(deleteAllAction, SIGNAL(activated()), this, SLOT(deleteAll())); deleteAllAction->addTo(toolsPopupMenu); toolsPopupMenu->insertSeparator(); @@ -95,13 +96,13 @@ DrawPad::DrawPad(QWidget* parent, const char* name) connect(newPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(newPage())); newPageAction->addTo(pageToolBar); QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); - connect(clearPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(clearPage())); + connect(clearPageAction, SIGNAL(activated()), this, SLOT(clearPage())); clearPageAction->addTo(pageToolBar); QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadIconSet("trash"), QString::null, 0, this); - connect(deletePageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(deletePage())); + connect(deletePageAction, SIGNAL(activated()), this, SLOT(deletePage())); deletePageAction->addTo(pageToolBar); QPEToolBar* emptyToolBar = new QPEToolBar(this); emptyToolBar->setHorizontalStretchable(true); @@ -266,8 +267,38 @@ DrawPad::~DrawPad() file.close(); } } +void DrawPad::clearPage() +{ + QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), + QMessageBox::Information, QMessageBox::Yes, + QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, + QMessageBox::NoButton, this); + + messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); + messageBox.setButtonText(QMessageBox::No, tr("No")); + + if (messageBox.exec() == QMessageBox::Yes) { + m_pDrawPadCanvas->clearPage(); + } +} + +void DrawPad::deletePage() +{ + QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe current page?"), + QMessageBox::Information, QMessageBox::Yes, + QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, + QMessageBox::NoButton, this); + + messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); + messageBox.setButtonText(QMessageBox::No, tr("No")); + + if (messageBox.exec() == QMessageBox::Yes) { + m_pDrawPadCanvas->deletePage(); + } +} + void DrawPad::setPointTool() { if (m_pTool) { delete m_pTool; @@ -498,8 +529,23 @@ void DrawPad::updateCaption() setCaption(tr("DrawPad") + " - " + tr("Page") + " " + QString::number(pagePosition) + "/" + QString::number(pageCount)); } +void DrawPad::deleteAll() +{ + QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), + QMessageBox::Information, QMessageBox::Yes, + QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, + QMessageBox::NoButton, this); + + messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); + messageBox.setButtonText(QMessageBox::No, tr("No")); + + if (messageBox.exec() == QMessageBox::Yes) { + m_pDrawPadCanvas->deleteAll(); + } +} + void DrawPad::importPage() { ImportDialog importDialog(this); @@ -528,9 +574,9 @@ void DrawPad::exportPage() } void DrawPad::thumbnailView() { - ThumbnailView thumbnailView(m_pDrawPadCanvas->pages(), this); + ThumbnailView thumbnailView(m_pDrawPadCanvas, this); thumbnailView.showMaximized(); thumbnailView.exec(); } |