-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 65b3dea..9f1e50b 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -337,29 +337,32 @@ void DrawPadCanvas::backupPage() | |||
337 | 337 | ||
338 | while (m_pageBackups.count() >= (5 + 1)) { | 338 | while (m_pageBackups.count() >= (5 + 1)) { |
339 | m_pageBackups.removeFirst(); | 339 | m_pageBackups.removeFirst(); |
340 | } | 340 | } |
341 | 341 | ||
342 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); | 342 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); |
343 | 343 | ||
344 | emit pageBackupsChanged(); | 344 | emit pageBackupsChanged(); |
345 | } | 345 | } |
346 | 346 | ||
347 | void DrawPadCanvas::deleteAll() | 347 | void DrawPadCanvas::deleteAll() |
348 | { | 348 | { |
349 | QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), | 349 | QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), |
350 | QMessageBox::Information, QMessageBox::Yes, | 350 | QMessageBox::Information, QMessageBox::Yes, |
351 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | 351 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, |
352 | QMessageBox::NoButton, this); | 352 | QMessageBox::NoButton, this); |
353 | 353 | ||
354 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
355 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
356 | |||
354 | if (messageBox.exec() == QMessageBox::Yes) { | 357 | if (messageBox.exec() == QMessageBox::Yes) { |
355 | m_pages.clear(); | 358 | m_pages.clear(); |
356 | 359 | ||
357 | m_pages.append(new QPixmap(contentsRect().size())); | 360 | m_pages.append(new QPixmap(contentsRect().size())); |
358 | m_pages.current()->fill(Qt::white); | 361 | m_pages.current()->fill(Qt::white); |
359 | 362 | ||
360 | m_pageBackups.clear(); | 363 | m_pageBackups.clear(); |
361 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); | 364 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); |
362 | 365 | ||
363 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); | 366 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); |
364 | viewport()->update(); | 367 | viewport()->update(); |
365 | 368 | ||
@@ -389,38 +392,44 @@ void DrawPadCanvas::newPage() | |||
389 | emit pagesChanged(); | 392 | emit pagesChanged(); |
390 | emit pageBackupsChanged(); | 393 | emit pageBackupsChanged(); |
391 | } | 394 | } |
392 | } | 395 | } |
393 | 396 | ||
394 | void DrawPadCanvas::clearPage() | 397 | void DrawPadCanvas::clearPage() |
395 | { | 398 | { |
396 | QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), | 399 | QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), |
397 | QMessageBox::Information, QMessageBox::Yes, | 400 | QMessageBox::Information, QMessageBox::Yes, |
398 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | 401 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, |
399 | QMessageBox::NoButton, this); | 402 | QMessageBox::NoButton, this); |
400 | 403 | ||
404 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
405 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
406 | |||
401 | if (messageBox.exec() == QMessageBox::Yes) { | 407 | if (messageBox.exec() == QMessageBox::Yes) { |
402 | m_pages.current()->fill(Qt::white); | 408 | m_pages.current()->fill(Qt::white); |
403 | 409 | ||
404 | viewport()->update(); | 410 | viewport()->update(); |
405 | } | 411 | } |
406 | } | 412 | } |
407 | 413 | ||
408 | void DrawPadCanvas::deletePage() | 414 | void DrawPadCanvas::deletePage() |
409 | { | 415 | { |
410 | QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe current page?"), | 416 | QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe current page?"), |
411 | QMessageBox::Information, QMessageBox::Yes, | 417 | QMessageBox::Information, QMessageBox::Yes, |
412 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | 418 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, |
413 | QMessageBox::NoButton, this); | 419 | QMessageBox::NoButton, this); |
414 | 420 | ||
421 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
422 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
423 | |||
415 | if (messageBox.exec() == QMessageBox::Yes) { | 424 | if (messageBox.exec() == QMessageBox::Yes) { |
416 | m_pages.remove(m_pages.current()); | 425 | m_pages.remove(m_pages.current()); |
417 | 426 | ||
418 | if (m_pages.isEmpty()) { | 427 | if (m_pages.isEmpty()) { |
419 | m_pages.append(new QPixmap(contentsRect().size())); | 428 | m_pages.append(new QPixmap(contentsRect().size())); |
420 | m_pages.current()->fill(Qt::white); | 429 | m_pages.current()->fill(Qt::white); |
421 | } | 430 | } |
422 | 431 | ||
423 | m_pageBackups.clear(); | 432 | m_pageBackups.clear(); |
424 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); | 433 | m_pageBackups.append(new QPixmap(*(m_pages.current()))); |
425 | 434 | ||
426 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); | 435 | resizeContents(m_pages.current()->width(), m_pages.current()->height()); |