]> git.sesse.net Git - vlc/commitdiff
Qt: UpdateDialog: highlight security changes
authorFrancois Cartegnie <fcvlcdev@free.fr>
Tue, 26 Mar 2013 16:26:23 +0000 (17:26 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Tue, 26 Mar 2013 16:29:38 +0000 (17:29 +0100)
modules/gui/qt4/dialogs/help.cpp

index fb6fb8d36f921c51aed89eecb2513c3e28b0b63c..31187b7ec897f25a5d905a219eb847d3fd4c04a2 100644 (file)
@@ -249,7 +249,16 @@ void UpdateDialog::updateNotify( bool b_result )
                 .arg( p_release->i_extra == 0 ? "" : "." + QString::number( p_release->i_extra ) );
 
             ui.updateNotifyLabel->setText( message );
-            ui.updateNotifyTextEdit->setText( qfu( p_release->psz_desc ) );
+            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();