]> git.sesse.net Git - vlc/commitdiff
Display file size instead of svn revision in update dialog
authorAntoine Cellerier <dionoea@videolan.org>
Fri, 28 Apr 2006 16:32:00 +0000 (16:32 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Fri, 28 Apr 2006 16:32:00 +0000 (16:32 +0000)
modules/gui/wxwidgets/dialogs/updatevlc.cpp

index 2707c57551f5d169b6b078d8ea4f68e35cdd5f7d..0c56162e64203b185bfd1103c56abddaec681d71 100644 (file)
@@ -144,11 +144,27 @@ void UpdateVLC::OnCheckForUpdate( wxCommandEvent& event )
                 default:
                     i_image = 0;
             }
+            char *psz_tmp = NULL;
+            if( p_uit->file.l_size )
+            {
+                if( p_uit->file.l_size > 1024 * 1024 * 1024 )
+                     asprintf( &psz_tmp, "(%ld GB)",
+                                p_uit->file.l_size / (1024*1024*1024) );
+                if( p_uit->file.l_size > 1024 * 1024 )
+                    asprintf( &psz_tmp, "(%ld MB)",
+                                p_uit->file.l_size / (1024*1024) );
+                else if( p_uit->file.l_size > 1024 )
+                    asprintf( &psz_tmp, "(%ld kB)",
+                                p_uit->file.l_size / 1024 );
+                else
+                    asprintf( &psz_tmp, "(%ld B)", p_uit->file.l_size );
+            }
             list->InsertItem( list->GetItemCount(),
                               wxU(p_uit->file.psz_description)+wxU("\n")
-                              + wxU(p_uit->release.psz_version)+wxU(" (")
-                              + wxU(p_uit->release.psz_svn_revision)+wxU(")"),
+                              + wxU(p_uit->release.psz_version)+wxU(" ")
+                              + wxU(psz_tmp),
                               i_image );
+            if( psz_tmp ) free( psz_tmp );
         }
 
         main_sizer->Add( new wxStaticText( this, -1, wxU( _("\nAvailable "