Index: includes/theme.maintenance.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.maintenance.inc,v
retrieving revision 1.46
diff -u -p -r1.46 theme.maintenance.inc
--- includes/theme.maintenance.inc	19 Nov 2009 15:50:23 -0000	1.46
+++ includes/theme.maintenance.inc	20 Nov 2009 06:23:46 -0000
@@ -10,9 +10,13 @@
  * Sets up the theming system for site installs, updates and when the site is
  * in maintenance mode. It also applies when the database is unavailable.
  *
- * Seven is always used for the initial install and update operations. In
- * other cases, Minnelli is used, but this can be overridden by setting a
- * "maintenance_theme" key in the $conf variable in settings.php.
+ * Seven is always used for the initial install and update operations. When
+ * the site is in maintenance mode, Minnelli is used by default, but this can
+ * be overridden either via the user interface (where the name of the
+ * maintenance theme is stored in the "maintenance_theme" variable in the
+ * database), or by setting a "maintenance_theme" key in the $conf variable in
+ * settings.php. The latter is more robust since it also applies when the
+ * database is unavailable.
  */
 function _drupal_maintenance_theme() {
   global $theme, $theme_key;
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.223
diff -u -p -r1.223 system.admin.inc
--- modules/system/system.admin.inc	17 Nov 2009 21:24:18 -0000	1.223
+++ modules/system/system.admin.inc	20 Nov 2009 06:23:47 -0000
@@ -291,6 +291,21 @@ function system_themes_form() {
     '#default_value' => variable_get('node_admin_theme', '0'),
   );
 
+  // Maintenance theme settings.
+  $form['maintenance_theme'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Maintenance theme'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+  );
+  $form['maintenance_theme']['maintenance_theme'] = array(
+    '#type' => 'select',
+    '#options' => $options,
+    '#title' => t('Maintenance theme'),
+    '#description' => t('This theme will be displayed to visitors when the site is in maintenance mode.'),
+    '#default_value' => variable_get('maintenance_theme', 'minnelli'),
+  );
+
   $form['buttons']['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Save configuration'),
@@ -342,12 +357,14 @@ function system_themes_form_submit($form
     variable_set('theme_default', $form_state['values']['theme_default']);
     variable_set('admin_theme', $form_state['values']['admin_theme']);
     variable_set('node_admin_theme', $form_state['values']['node_admin_theme']);
+    variable_set('maintenance_theme', $form_state['values']['maintenance_theme']);
   }
   else {
     // Revert to defaults: only Garland is enabled.
     variable_del('theme_default');
     variable_del('admin_theme');
     variable_del('node_admin_theme');
+    variable_del('maintenance_theme');
     db_update('system')
       ->fields(array('status' => 1))
       ->condition('type', 'theme')
Index: themes/garland/maintenance-page.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/maintenance-page.tpl.php,v
retrieving revision 1.12
diff -u -p -r1.12 maintenance-page.tpl.php
--- themes/garland/maintenance-page.tpl.php	21 Sep 2009 06:36:54 -0000	1.12
+++ themes/garland/maintenance-page.tpl.php	20 Nov 2009 06:23:47 -0000
@@ -6,8 +6,8 @@
  * Override of the default maintenance page.
  *
  * This is an override of the default maintenance page. Used for Garland and
- * Minnelli, this file should not be moved or modified since the installation
- * and update pages depend on this file.
+ * Minnelli, this file should not be moved or modified since the maintenance
+ * theme may be set to use this file.
  *
  * This mirrors closely page.tpl.php for Garland in order to share the same
  * styles.
