Make the UI update properly when the user adds/removes drives.
authorMike Hearn <mike@navi.cx>
Sun, 9 Jan 2005 18:00:46 +0000 (18:00 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Sun, 9 Jan 2005 18:00:46 +0000 (18:00 +0000)
programs/winecfg/driveui.c

index 6422b8f83981400a00ea1f5e67d1b62dab10f925..69e547aed8a4b1c35bab5eb41a0e7935b677a8c5 100644 (file)
@@ -51,6 +51,7 @@ static BOOL updating_ui = FALSE;
 static struct drive* current_drive;
 
 static void get_etched_rect(HWND dialog, RECT *rect);
+static void update_controls(HWND dialog);
 
 static void set_advanced(HWND dialog)
 {
@@ -297,6 +298,8 @@ void on_add_click(HWND dialog)
     SendDlgItemMessage(dialog, IDC_LIST_DRIVES, LB_SETCURSEL, c, 0);
 
     SetFocus(GetDlgItem(dialog, IDC_LIST_DRIVES));
+
+    update_controls(dialog);
 }
 
 void on_remove_click(HWND dialog)
@@ -324,9 +327,12 @@ void on_remove_click(HWND dialog)
     SendDlgItemMessage(dialog, IDC_LIST_DRIVES, LB_SETCURSEL, item, 0);   /* previous item */
 
     SetFocus(GetDlgItem(dialog, IDC_LIST_DRIVES));
+
+    update_controls(dialog);
 }
 
-void update_controls(HWND dialog) {
+static void update_controls(HWND dialog)
+{
     char *path;
     uint type;
     char *label;