Start working on the user profile page:
authorEric Kohl <eric.kohl@reactos.org>
Sat, 17 Nov 2007 22:24:29 +0000 (22:24 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 17 Nov 2007 22:24:29 +0000 (22:24 +0000)
- Initialize the list view columns.
- Disable the "Delete" and "Copy To" buttons if the user is not an admin.

svn path=/trunk/; revision=30531

reactos/dll/cpl/sysdm/lang/de-DE.rc
reactos/dll/cpl/sysdm/lang/en-US.rc
reactos/dll/cpl/sysdm/lang/fr-FR.rc
reactos/dll/cpl/sysdm/lang/id-ID.rc
reactos/dll/cpl/sysdm/lang/it-IT.rc
reactos/dll/cpl/sysdm/lang/pl-PL.rc
reactos/dll/cpl/sysdm/lang/ru-RU.rc
reactos/dll/cpl/sysdm/lang/sk-SK.rc
reactos/dll/cpl/sysdm/lang/uk-UA.rc
reactos/dll/cpl/sysdm/resource.h
reactos/dll/cpl/sysdm/userprofile.c

index e652ead..f511b2b 100644 (file)
@@ -185,7 +185,7 @@ BEGIN
     LTEXT       "Auslagerungsdatei (MB)", IDC_STATIC, 115, 5, 96, 9
     LISTBOX     IDC_PAGEFILELIST, 10, 16, 204, 52, LBS_NOTIFY | LBS_USETABSTOPS
     GROUPBOX    "Größe der Auslagerungsdatei für das gewählte Laufwerk", IDC_DRIVEGROUP, 10, 70, 204, 104
-    LTEXT       "Laufwerk:", IDC_STATIC, 20, 80, 40, 8
+    LTEXT       "Laufwerk:", IDC_STATIC, 20, 81, 40, 9
     LTEXT       "", IDC_DRIVE, 105, 81, 100, 9
     LTEXT       "Verfügbarer Speicherplatz:", IDC_STATIC, 20, 92, 130, 9
     LTEXT       "", IDC_SPACEAVAIL, 105, 92, 104, 9
@@ -202,9 +202,9 @@ BEGIN
     LTEXT       "Minimal zugelassen:", IDC_STATIC, 18, 188, 70, 9
     LTEXT       "", IDC_MINIMUM, 88, 188, 100, 9
     LTEXT       "Empfohlen:", IDC_STATIC, 18, 199, 52, 9
-    LTEXT       "", IDC_RECOMMENDED, 88, 197, 100, 9
+    LTEXT       "", IDC_RECOMMENDED, 88, 199, 100, 9
     LTEXT       "Momentan zugeteilt:", IDC_STATIC, 18, 210, 66, 9
-    LTEXT       "", IDC_CURRENT, 88, 208, 100, 9
+    LTEXT       "", IDC_CURRENT, 88, 210, 100, 9
 
     DEFPUSHBUTTON  "OK", IDOK, 114, 232, 48, 14
     PUSHBUTTON  "Abbrechen", IDCANCEL, 168, 232, 48, 14
@@ -273,4 +273,9 @@ BEGIN
     IDS_MINI_DUMP "Kleines Speicherabild (64KB)"
     IDS_KERNEL_DUMP "Kernelspeicherabild"
     IDS_FULL_DUMP "Vollständiges Speicherabild"
+    IDS_USERPROFILE_NAME "Name"
+    IDS_USERPROFILE_SIZE "Größe"
+    IDS_USERPROFILE_TYPE "Typ"
+    IDS_USERPROFILE_STATUS "Status"
+    IDS_USERPROFILE_MODIFIED "Geändert"
 END
index 13c1265..a243885 100644 (file)
@@ -267,4 +267,9 @@ BEGIN
     IDS_MINI_DUMP "Minidump(64KB)"
     IDS_KERNEL_DUMP "Kernel dump"
     IDS_FULL_DUMP "Complete dump"
+    IDS_USERPROFILE_NAME "Name"
+    IDS_USERPROFILE_SIZE "Size"
+    IDS_USERPROFILE_TYPE "Type"
+    IDS_USERPROFILE_STATUS "Status"
+    IDS_USERPROFILE_MODIFIED "Modified"
 END
index 4282a37..bdd38f7 100644 (file)
@@ -272,4 +272,9 @@ BEGIN
     IDS_MINI_DUMP "Mini cliché(64Ko)"
     IDS_KERNEL_DUMP "Cliché du noyau"
     IDS_FULL_DUMP "Cliché complet"
+    IDS_USERPROFILE_NAME "Name"
+    IDS_USERPROFILE_SIZE "Size"
+    IDS_USERPROFILE_TYPE "Type"
+    IDS_USERPROFILE_STATUS "Status"
+    IDS_USERPROFILE_MODIFIED "Modified"
 END
index 24250fe..286d9cd 100644 (file)
@@ -266,4 +266,9 @@ BEGIN
     IDS_MINI_DUMP "Minidump(64KB)"
     IDS_KERNEL_DUMP "Kernel dump"
     IDS_FULL_DUMP "Complete dump"
+    IDS_USERPROFILE_NAME "Name"
+    IDS_USERPROFILE_SIZE "Size"
+    IDS_USERPROFILE_TYPE "Type"
+    IDS_USERPROFILE_STATUS "Status"
+    IDS_USERPROFILE_MODIFIED "Modified"
 END
index e251ae4..9e32e4d 100644 (file)
@@ -267,4 +267,9 @@ BEGIN
     IDS_MINI_DUMP "Minidump(64KB)"
     IDS_KERNEL_DUMP "Kernel dump"
     IDS_FULL_DUMP "Complete dump"
+    IDS_USERPROFILE_NAME "Name"
+    IDS_USERPROFILE_SIZE "Size"
+    IDS_USERPROFILE_TYPE "Type"
+    IDS_USERPROFILE_STATUS "Status"
+    IDS_USERPROFILE_MODIFIED "Modified"
 END
index bdaae70..1d75199 100644 (file)
@@ -271,4 +271,9 @@ BEGIN
     IDS_MINI_DUMP "Minidump(64KB)"
     IDS_KERNEL_DUMP "Kernel dump"
     IDS_FULL_DUMP "Complete dump"
+    IDS_USERPROFILE_NAME "Name"
+    IDS_USERPROFILE_SIZE "Size"
+    IDS_USERPROFILE_TYPE "Type"
+    IDS_USERPROFILE_STATUS "Status"
+    IDS_USERPROFILE_MODIFIED "Modified"
 END
index 783cc00..507780c 100644 (file)
@@ -267,4 +267,9 @@ BEGIN
     IDS_MINI_DUMP "Minidump(64KB)"
     IDS_KERNEL_DUMP "Kernel dump"
     IDS_FULL_DUMP "Complete dump"
+    IDS_USERPROFILE_NAME "Name"
+    IDS_USERPROFILE_SIZE "Size"
+    IDS_USERPROFILE_TYPE "Type"
+    IDS_USERPROFILE_STATUS "Status"
+    IDS_USERPROFILE_MODIFIED "Modified"
 END
index 79a0ba6..d779f83 100644 (file)
@@ -276,4 +276,9 @@ BEGIN
     IDS_MINI_DUMP "Malý výpis pamäte (64 kB)"\r
     IDS_KERNEL_DUMP "Výpis pamäte jadra"\r
     IDS_FULL_DUMP "Úplný výpis pamäte"\r
+    IDS_USERPROFILE_NAME "Name"\r
+    IDS_USERPROFILE_SIZE "Size"\r
+    IDS_USERPROFILE_TYPE "Type"\r
+    IDS_USERPROFILE_STATUS "Status"\r
+    IDS_USERPROFILE_MODIFIED "Modified"\r
 END\r
index 5290566..aaed0b6 100644 (file)
@@ -275,5 +275,9 @@ BEGIN
     IDS_MINI_DUMP "̳í³äàìï(64Êá)"
     IDS_KERNEL_DUMP "Äàìï ÿäðà"
     IDS_FULL_DUMP "Ïîâíèé äàìï"
-
+    IDS_USERPROFILE_NAME "Name"
+    IDS_USERPROFILE_SIZE "Size"
+    IDS_USERPROFILE_TYPE "Type"
+    IDS_USERPROFILE_STATUS "Status"
+    IDS_USERPROFILE_MODIFIED "Modified"
 END
index c595b7e..a877014 100644 (file)
 #define IDS_KERNEL_DUMP                 70
 #define IDS_FULL_DUMP                   71
 
+#define IDS_USERPROFILE_NAME            72
+#define IDS_USERPROFILE_SIZE            73
+#define IDS_USERPROFILE_TYPE            74
+#define IDS_USERPROFILE_STATUS          75
+#define IDS_USERPROFILE_MODIFIED        76
+
 
 /* propsheet - general */
 #define IDD_PROPPAGEGENERAL             100
index 3d9e0ba..613c95e 100644 (file)
 
 #include "precomp.h"
 
+
+static VOID
+SetListViewColumns(HWND hwndListView)
+{
+    LV_COLUMN column;
+    RECT rect;
+    TCHAR szStr[32];
+
+    GetClientRect(hwndListView, &rect);
+
+    SendMessage(hwndListView, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
+
+    memset(&column, 0x00, sizeof(column));
+    column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT;
+    column.fmt = LVCFMT_LEFT;
+    column.cx = (INT)((rect.right - rect.left) * 0.40);
+    column.iSubItem = 0;
+    LoadString(hApplet, IDS_USERPROFILE_NAME, szStr, 32);
+    column.pszText = szStr;
+    (void)ListView_InsertColumn(hwndListView, 0, &column);
+
+    column.fmt = LVCFMT_RIGHT;
+    column.cx = (INT)((rect.right - rect.left) * 0.15);
+    column.iSubItem = 1;
+    LoadString(hApplet, IDS_USERPROFILE_SIZE, szStr, 32);
+    column.pszText = szStr;
+    (void)ListView_InsertColumn(hwndListView, 1, &column);
+
+    column.fmt = LVCFMT_LEFT;
+    column.cx = (INT)((rect.right - rect.left) * 0.15);
+    column.iSubItem = 2;
+    LoadString(hApplet, IDS_USERPROFILE_TYPE, szStr, 32);
+    column.pszText = szStr;
+    (void)ListView_InsertColumn(hwndListView, 2, &column);
+
+    column.fmt = LVCFMT_LEFT;
+    column.cx = (INT)((rect.right - rect.left) * 0.15);
+    column.iSubItem = 3;
+    LoadString(hApplet, IDS_USERPROFILE_STATUS, szStr, 32);
+    column.pszText = szStr;
+    (void)ListView_InsertColumn(hwndListView, 3, &column);
+
+    column.fmt = LVCFMT_LEFT;
+    column.cx = (INT)((rect.right - rect.left) * 0.15) - GetSystemMetrics(SM_CYHSCROLL);
+    column.iSubItem = 4;
+    LoadString(hApplet, IDS_USERPROFILE_MODIFIED, szStr, 32);
+    column.pszText = szStr;
+    (void)ListView_InsertColumn(hwndListView, 4, &column);
+}
+
+
+static VOID
+OnInitDialog(HWND hwndDlg)
+{
+    /* Initialize the list view control */
+    SetListViewColumns(GetDlgItem(hwndDlg, IDC_USERPROFILE_LIST));
+
+    /* Disable the "Delete" and "Copy To" buttons if the user is not an admin */
+    if (!IsUserAdmin())
+    {
+         EnableWindow(GetDlgItem(hwndDlg, IDC_USERPROFILE_DELETE), FALSE);
+         EnableWindow(GetDlgItem(hwndDlg, IDC_USERPROFILE_COPY), FALSE);
+    }
+}
+
+
 /* Property page dialog callback */
 INT_PTR CALLBACK
 UserProfileDlgProc(HWND hwndDlg,
@@ -21,6 +87,7 @@ UserProfileDlgProc(HWND hwndDlg,
     {
         case WM_INITDIALOG:
             MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
+            OnInitDialog(hwndDlg);
             break;
 
         case WM_COMMAND: