MCPcopy Create free account
hub / github.com/YACReader/yacreader / newVersion

Method newVersion

YACReader/main_window_viewer.cpp:1506–1530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1504}
1505
1506void 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
1532void MainWindowViewer::closeEvent(QCloseEvent *event)
1533{

Callers

nothing calls this directly

Calls 3

execMethod · 0.80
setTextMethod · 0.45

Tested by

no test coverage detected