[vlc-commits] Qt: UpdateDialog: highlight security changes

Francois Cartegnie git at videolan.org
Tue Mar 26 17:29:48 CET 2013


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Mar 26 17:26:23 2013 +0100| [93eea1cb6b03e76080a317aa531dea7cbdf563a0] | committer: Francois Cartegnie

Qt: UpdateDialog: highlight security changes

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=93eea1cb6b03e76080a317aa531dea7cbdf563a0
---

 modules/gui/qt4/dialogs/help.cpp |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt4/dialogs/help.cpp b/modules/gui/qt4/dialogs/help.cpp
index fb6fb8d..31187b7 100644
--- a/modules/gui/qt4/dialogs/help.cpp
+++ b/modules/gui/qt4/dialogs/help.cpp
@@ -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();



More information about the vlc-commits mailing list