/* Notify the end of the update_Check */ void UpdateDialog::updateNotify( bool b_result ) { /* The update finish without errors */ if( b_result ) { if( update_NeedUpgrade( p_update ) ) { ui.stackedWidget->setCurrentWidget( ui.updateNotifyPage ); update_release_t *p_release = update_GetRelease( p_update ); assert( p_release ); b_checked = true; QString message = QString( qtr( "A new version of VLC (%1.%2.%3%4) is available." ) ) .arg( QString::number( p_release->i_major ) ) .arg( QString::number( p_release->i_minor ) ) .arg( QString::number( p_release->i_revision ) ) .arg( p_release->i_extra == 0 ? "" : "." + QString::number( p_release->i_extra ) ); ui.updateNotifyLabel->setText( message ); message = qfu( p_release->psz_desc ).replace( "\n", "<br/>" ); /* Try to highlight releases featuring security changes */ int i_index = message.indexOf( "security", Qt::CaseInsensitive ); if ( i_index >= 0 ) { message.insert( i_index + 8, "</font>" ); message.insert( i_index, "<font style=\"color:red\">" ); } ui.updateNotifyTextEdit->setHtml( message ); /* Force the dialog to be shown */ this->show(); } else { ui.stackedWidget->setCurrentWidget( ui.updateDialogPage ); ui.updateDialogLabel->setText( qtr( "You have the latest version of VLC media player." ) ); } } else { ui.stackedWidget->setCurrentWidget( ui.updateDialogPage ); ui.updateDialogLabel->setText( qtr( "An error occurred while checking for updates..." ) ); } }
/* Notify the end of the update_Check */ void UpdateDialog::updateNotify( bool b_result ) { /* The update finish without errors */ if( b_result ) { if( update_NeedUpgrade( p_update ) ) { ui.stackedWidget->setCurrentWidget( ui.updateNotifyPage ); update_release_t *p_release = update_GetRelease( p_update ); assert( p_release ); b_checked = true; QString message = QString( qtr( "A new version of VLC (%1.%2.%3%4) is available." ) ) .arg( QString::number( p_release->i_major ) ) .arg( QString::number( p_release->i_minor ) ) .arg( QString::number( p_release->i_revision ) ) .arg( p_release->i_extra == 0 ? "" : "." + QString::number( p_release->i_extra ) ); ui.updateNotifyLabel->setText( message ); ui.updateNotifyTextEdit->setText( qfu( p_release->psz_desc ) ); /* Force the dialog to be shown */ this->show(); } else { ui.stackedWidget->setCurrentWidget( ui.updateDialogPage ); ui.updateDialogLabel->setText( qtr( "You have the latest version of VLC media player." ) ); } } else { ui.stackedWidget->setCurrentWidget( ui.updateDialogPage ); ui.updateDialogLabel->setText( qtr( "An error occurred while checking for updates..." ) ); } }
/* Notify the end of the update_Check */ void UpdateDialog::updateNotify( bool b_result ) { /* The update finish without errors */ if( b_result ) { if( update_NeedUpgrade( p_update ) ) { update_release_t *p_release = update_GetRelease( p_update ); assert( p_release ); b_checked = true; updateButton->setText( qtr( "&Yes" ) ); QString message = qtr( "A new version of VLC(" ) + QString::number( p_release->i_major ) + "." + QString::number( p_release->i_minor ) + "." + QString::number( p_release->i_revision ); if( p_release->extra ) message += p_release->extra; message += qtr( ") is available."); updateLabelTop->setText( message ); updateText->setText( qfu( p_release->psz_desc ) ); updateText->setEnabled( true ); updateLabelDown->show(); /* Force the dialog to be shown */ this->show(); } else updateLabelTop->setText( qtr( "You have the latest version of VLC media player." ) ); } else updateLabelTop->setText( qtr( "An error occurred while checking for updates..." ) ); updateButton->setEnabled( true ); }