Diffstat (limited to 'noncore/graphics/drawpad/drawpadcanvas.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 31 |
1 files changed, 0 insertions, 31 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 @@ | |||
23 | #include <qpe/mimetype.h> | 23 | #include <qpe/mimetype.h> |
24 | 24 | ||
25 | #include <qbuffer.h> | 25 | #include <qbuffer.h> |
26 | #include <qimage.h> | 26 | #include <qimage.h> |
27 | #include <qmessagebox.h> | ||
28 | #include <qpainter.h> | 27 | #include <qpainter.h> |
29 | #include <qtextcodec.h> | 28 | #include <qtextcodec.h> |
30 | #include <qtextstream.h> | 29 | #include <qtextstream.h> |
31 | #include <qxml.h> | 30 | #include <qxml.h> |
@@ -345,17 +344,8 @@ void DrawPadCanvas::backupPage() | |||
345 | } | 344 | } |
346 | 345 | ||
347 | void DrawPadCanvas::deleteAll() | 346 | void DrawPadCanvas::deleteAll() |
348 | { | 347 | { |
349 | QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), | ||
350 | QMessageBox::Information, QMessageBox::Yes, | ||
351 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | ||
352 | QMessageBox::NoButton, this); | ||
353 | |||
354 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
355 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
356 | |||
357 | if (messageBox.exec() == QMessageBox::Yes) { | ||
358 | m_pages.clear(); | 348 | m_pages.clear(); |
359 | 349 | ||
360 | m_pages.append(new Page(contentsRect().size())); | 350 | m_pages.append(new Page(contentsRect().size())); |
361 | m_pages.current()->fill(Qt::white); | 351 | m_pages.current()->fill(Qt::white); |
@@ -368,9 +358,8 @@ void DrawPadCanvas::deleteAll() | |||
368 | 358 | ||
369 | emit pagesChanged(); | 359 | emit pagesChanged(); |
370 | emit pageBackupsChanged(); | 360 | emit pageBackupsChanged(); |
371 | } | 361 | } |
372 | } | ||
373 | 362 | ||
374 | void DrawPadCanvas::newPage() | 363 | void DrawPadCanvas::newPage() |
375 | { | 364 | { |
376 | QRect rect = contentsRect(); | 365 | QRect rect = contentsRect(); |
@@ -395,34 +384,15 @@ void DrawPadCanvas::newPage() | |||
395 | } | 384 | } |
396 | 385 | ||
397 | void DrawPadCanvas::clearPage() | 386 | void DrawPadCanvas::clearPage() |
398 | { | 387 | { |
399 | QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), | ||
400 | QMessageBox::Information, QMessageBox::Yes, | ||
401 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | ||
402 | QMessageBox::NoButton, this); | ||
403 | |||
404 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
405 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
406 | |||
407 | if (messageBox.exec() == QMessageBox::Yes) { | ||
408 | m_pages.current()->fill(Qt::white); | 388 | m_pages.current()->fill(Qt::white); |
409 | 389 | ||
410 | viewport()->update(); | 390 | viewport()->update(); |
411 | } | 391 | } |
412 | } | ||
413 | 392 | ||
414 | void DrawPadCanvas::deletePage() | 393 | void DrawPadCanvas::deletePage() |
415 | { | 394 | { |
416 | QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe current page?"), | ||
417 | QMessageBox::Information, QMessageBox::Yes, | ||
418 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | ||
419 | QMessageBox::NoButton, this); | ||
420 | |||
421 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
422 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
423 | |||
424 | if (messageBox.exec() == QMessageBox::Yes) { | ||
425 | m_pages.remove(m_pages.current()); | 395 | m_pages.remove(m_pages.current()); |
426 | 396 | ||
427 | if (m_pages.isEmpty()) { | 397 | if (m_pages.isEmpty()) { |
428 | m_pages.append(new Page(contentsRect().size())); | 398 | m_pages.append(new Page(contentsRect().size())); |
@@ -437,9 +407,8 @@ void DrawPadCanvas::deletePage() | |||
437 | 407 | ||
438 | emit pagesChanged(); | 408 | emit pagesChanged(); |
439 | emit pageBackupsChanged(); | 409 | emit pageBackupsChanged(); |
440 | } | 410 | } |
441 | } | ||
442 | 411 | ||
443 | bool DrawPadCanvas::undoEnabled() | 412 | bool DrawPadCanvas::undoEnabled() |
444 | { | 413 | { |
445 | return (m_pageBackups.current() != m_pageBackups.getFirst()); | 414 | return (m_pageBackups.current() != m_pageBackups.getFirst()); |