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/drawpadcanvas.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/drawpadcanvas.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 75 |
1 files changed, 22 insertions, 53 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 79bef35..252f4d5 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp @@ -23,9 +23,8 @@ #include <qpe/mimetype.h> #include <qbuffer.h> #include <qimage.h> -#include <qmessagebox.h> #include <qpainter.h> #include <qtextcodec.h> #include <qtextstream.h> #include <qxml.h> @@ -345,31 +344,21 @@ void DrawPadCanvas::backupPage() } void DrawPadCanvas::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); + m_pages.clear(); - messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); - messageBox.setButtonText(QMessageBox::No, tr("No")); - - if (messageBox.exec() == QMessageBox::Yes) { - m_pages.clear(); - - m_pages.append(new Page(contentsRect().size())); - m_pages.current()->fill(Qt::white); + m_pages.append(new Page(contentsRect().size())); + m_pages.current()->fill(Qt::white); - m_pageBackups.clear(); - m_pageBackups.append(new Page(*(m_pages.current()))); + m_pageBackups.clear(); + m_pageBackups.append(new Page(*(m_pages.current()))); - resizeContents(m_pages.current()->width(), m_pages.current()->height()); - viewport()->update(); + resizeContents(m_pages.current()->width(), m_pages.current()->height()); + viewport()->update(); - emit pagesChanged(); - emit pageBackupsChanged(); - } + emit pagesChanged(); + emit pageBackupsChanged(); } void DrawPadCanvas::newPage() { @@ -395,50 +384,30 @@ void DrawPadCanvas::newPage() } void DrawPadCanvas::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_pages.current()->fill(Qt::white); + m_pages.current()->fill(Qt::white); - viewport()->update(); - } + viewport()->update(); } void DrawPadCanvas::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")); + m_pages.remove(m_pages.current()); - if (messageBox.exec() == QMessageBox::Yes) { - m_pages.remove(m_pages.current()); - - if (m_pages.isEmpty()) { - m_pages.append(new Page(contentsRect().size())); - m_pages.current()->fill(Qt::white); - } + if (m_pages.isEmpty()) { + m_pages.append(new Page(contentsRect().size())); + m_pages.current()->fill(Qt::white); + } - m_pageBackups.clear(); - m_pageBackups.append(new Page(*(m_pages.current()))); + m_pageBackups.clear(); + m_pageBackups.append(new Page(*(m_pages.current()))); - resizeContents(m_pages.current()->width(), m_pages.current()->height()); - viewport()->update(); + resizeContents(m_pages.current()->width(), m_pages.current()->height()); + viewport()->update(); - emit pagesChanged(); - emit pageBackupsChanged(); - } + emit pagesChanged(); + emit pageBackupsChanged(); } bool DrawPadCanvas::undoEnabled() { |