-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() while (m_pageBackups.count() >= (5 + 1)) { m_pageBackups.removeFirst(); } m_pageBackups.append(new QPixmap(*(m_pages.current()))); emit pageBackupsChanged(); } void DrawPadCanvas::deleteAll() { - QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), + 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_pages.clear(); m_pages.append(new QPixmap(contentsRect().size())); m_pages.current()->fill(Qt::white); m_pageBackups.clear(); m_pageBackups.append(new QPixmap(*(m_pages.current()))); resizeContents(m_pages.current()->width(), m_pages.current()->height()); viewport()->update(); @@ -389,38 +392,44 @@ void DrawPadCanvas::newPage() emit pagesChanged(); emit pageBackupsChanged(); } } 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); 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")); + if (messageBox.exec() == QMessageBox::Yes) { m_pages.remove(m_pages.current()); if (m_pages.isEmpty()) { m_pages.append(new QPixmap(contentsRect().size())); m_pages.current()->fill(Qt::white); } m_pageBackups.clear(); m_pageBackups.append(new QPixmap(*(m_pages.current()))); resizeContents(m_pages.current()->width(), m_pages.current()->height()); |