+ Possibility to skip the latest release when checking for new releases.

This commit is contained in:
Konstantin Isakov 2009-05-14 17:59:49 +00:00
parent 7118c23d93
commit f065a1c592
3 changed files with 15 additions and 1 deletions

View file

@ -460,6 +460,8 @@ Class load() throw( exError )
c.timeForNewReleaseCheck = QDateTime::fromString( timeForNewReleaseCheck.toElement().text(),
Qt::ISODate );
c.skippedRelease = root.namedItem( "skippedRelease" ).toElement().text();
return c;
}
@ -813,6 +815,10 @@ void save( Class const & c ) throw( exError )
opt = dd.createElement( "timeForNewReleaseCheck" );
opt.appendChild( dd.createTextNode( c.timeForNewReleaseCheck.toString( Qt::ISODate ) ) );
root.appendChild( opt );
opt = dd.createElement( "skippedRelease" );
opt.appendChild( dd.createTextNode( c.skippedRelease ) );
root.appendChild( opt );
}
configFile.write( dd.toByteArray() );

View file

@ -266,6 +266,7 @@ struct Class
QDateTime timeForNewReleaseCheck; // Only effective if
// preferences.checkForNewReleases is set
QString skippedRelease; // Empty by default
Class(): lastMainGroupId( 0 ), lastPopupGroupId( 0 )
{}

View file

@ -1203,7 +1203,7 @@ void MainWindow::latestReleaseReplyReady()
latestVersion.toStdWString().c_str() );
}
if ( success && latestVersion > PROGRAM_VERSION )
if ( success && latestVersion > PROGRAM_VERSION && latestVersion != cfg.skippedRelease )
{
QMessageBox msg( QMessageBox::Information,
tr( "New Release Available" ),
@ -1213,12 +1213,19 @@ void MainWindow::latestReleaseReplyReady()
this );
QPushButton * dload = msg.addButton( tr( "Download" ), QMessageBox::AcceptRole );
QPushButton * skip = msg.addButton( tr( "Skip This Release" ), QMessageBox::DestructiveRole );
msg.addButton( QMessageBox::Cancel );
msg.exec();
if ( msg.clickedButton() == dload )
QDesktopServices::openUrl( QUrl( downloadUrl ) );
else
if ( msg.clickedButton() == skip )
{
cfg.skippedRelease = latestVersion;
Config::save( cfg );
}
}
}