| 1504 | } |
| 1505 | |
| 1506 | void MainWindowViewer::newVersion() |
| 1507 | { |
| 1508 | QMessageBox msgBox; |
| 1509 | msgBox.setText(tr("There is a new version available")); |
| 1510 | msgBox.setInformativeText(tr("Do you want to download the new version?")); |
| 1511 | msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::Ignore | QMessageBox::No); |
| 1512 | msgBox.setDefaultButton(QMessageBox::Yes); |
| 1513 | msgBox.button(QMessageBox::Ignore)->setText(tr("Remind me in 14 days")); |
| 1514 | msgBox.button(QMessageBox::No)->setText(tr("Not now")); |
| 1515 | msgBox.setWindowFlags(Qt::WindowStaysOnTopHint); |
| 1516 | msgBox.setModal(true); |
| 1517 | int ret = msgBox.exec(); |
| 1518 | |
| 1519 | switch (ret) { |
| 1520 | case QMessageBox::Yes: |
| 1521 | QDesktopServices::openUrl(QUrl("http://www.yacreader.com")); |
| 1522 | break; |
| 1523 | case QMessageBox::No: |
| 1524 | Configuration::getConfiguration().setNumDaysBetweenVersionChecks(1); |
| 1525 | break; |
| 1526 | case QMessageBox::Ignore: |
| 1527 | Configuration::getConfiguration().setNumDaysBetweenVersionChecks(14); |
| 1528 | break; |
| 1529 | } |
| 1530 | } |
| 1531 | |
| 1532 | void MainWindowViewer::closeEvent(QCloseEvent *event) |
| 1533 | { |
nothing calls this directly
no test coverage detected