msi: Add the total and free disk space to the VolumeCostList control.

This commit is contained in:
James Hawkins 2006-09-14 18:10:30 -07:00 committed by Alexandre Julliard
parent 34e03fc042
commit 32c0a764ee
1 changed files with 20 additions and 7 deletions

View File

@ -2290,7 +2290,6 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
WCHAR num[10]; WCHAR num[10];
LVCOLUMNW lvc; LVCOLUMNW lvc;
DWORD count = 0; DWORD count = 0;
LRESULT r;
static const WCHAR zero[] = {'0',0}; static const WCHAR zero[] = {'0',0};
static const WCHAR negative[] = {'-',0}; static const WCHAR negative[] = {'-',0};
@ -2316,20 +2315,20 @@ static void msi_dialog_vcl_add_columns( msi_dialog *dialog, msi_control *control
if ( !strncmpW( num, negative, 1 ) || !str_is_number( num ) ) if ( !strncmpW( num, negative, 1 ) || !str_is_number( num ) )
return; return;
lvc.mask = LVCF_FMT | LVCF_ORDER | LVCF_WIDTH | LVCF_TEXT; ZeroMemory( &lvc, sizeof(lvc) );
lvc.iOrder = count; lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
lvc.pszText = msi_dialog_get_uitext( dialog, column_keys[count++] );
lvc.cx = atolW( num ); lvc.cx = atolW( num );
lvc.fmt = LVCFMT_LEFT; lvc.pszText = msi_dialog_get_uitext( dialog, column_keys[count] );
r = SendMessageW( control->hwnd, LVM_INSERTCOLUMNW, 0, (LPARAM)&lvc ); SendMessageW( control->hwnd, LVM_INSERTCOLUMNW, count++, (LPARAM)&lvc );
msi_free( lvc.pszText ); msi_free( lvc.pszText );
if ( r ) return;
} }
} }
static void msi_dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control ) static void msi_dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control )
{ {
ULARGE_INTEGER total, free;
WCHAR size_text[MAX_PATH];
LPWSTR drives, ptr; LPWSTR drives, ptr;
LVITEMW lvitem; LVITEMW lvitem;
DWORD size; DWORD size;
@ -2353,6 +2352,20 @@ static void msi_dialog_vcl_add_drives( msi_dialog *dialog, msi_control *control
lvitem.cchTextMax = lstrlenW(ptr) + 1; lvitem.cchTextMax = lstrlenW(ptr) + 1;
SendMessageW( control->hwnd, LVM_INSERTITEMW, 0, (LPARAM)&lvitem ); SendMessageW( control->hwnd, LVM_INSERTITEMW, 0, (LPARAM)&lvitem );
GetDiskFreeSpaceExW(ptr, &free, &total, NULL);
StrFormatByteSizeW(total.QuadPart, size_text, MAX_PATH);
lvitem.iSubItem = 1;
lvitem.pszText = size_text;
lvitem.cchTextMax = lstrlenW(size_text) + 1;
SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
StrFormatByteSizeW(free.QuadPart, size_text, MAX_PATH);
lvitem.iSubItem = 2;
lvitem.pszText = size_text;
lvitem.cchTextMax = lstrlenW(size_text) + 1;
SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
ptr += lstrlenW(ptr) + 1; ptr += lstrlenW(ptr) + 1;
i++; i++;
} }