Index: system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.298
diff -u -r1.298 system.admin.inc
--- system.admin.inc	22 Aug 2010 12:55:04 -0000	1.298
+++ system.admin.inc	31 Aug 2010 16:34:11 -0000
@@ -925,7 +925,7 @@
     }
 
     // Mark dependents disabled so the user cannot remove required modules.
-    $dependents = array();
+    $extra['dependents'][] = array();
     // If this module is required by other modules, list those, and then make it
     // impossible to disable this one.
     foreach ($module->required_by as $required_by => $v) {
@@ -938,6 +938,7 @@
         else {
           $extra['required_by'][] = t('@module (<span class="admin-disabled">disabled</span>)', array('@module' => $files[$required_by]->info['name']));
         }
+        $extra['dependents'][] = array('package' => $files[$required_by]->info['package'], 'filename' => $required_by);
       }
     }
     $form['modules'][$module->info['package']][$filename] = _system_modules_build_row($module->info, $extra);
@@ -1040,6 +1041,13 @@
     $status_long .= t('This module requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion()));
   }
 
+  $states = array();
+  foreach ($extra['dependents'] as $dependent) {
+    if (!empty($dependent)) {
+      $states[':input[name="modules[' . $dependent['package'] . '][' . $dependent['filename'] . '][enable]"]'] = array('checked' => FALSE);
+    }
+  }
+
   // If this module is compatible, present a checkbox indicating
   // this module may be installed. Otherwise, show a big red X.
   if ($compatible) {
@@ -1047,6 +1055,9 @@
       '#type' => 'checkbox',
       '#title' => t('Enable'),
       '#default_value' => $extra['enabled'],
+      '#states' => array(
+        'enabled' => $states,
+      ),
     );
     if ($extra['disabled']) {
       $form['enable']['#disabled'] = TRUE;
