Index: trunk/admin/update.php
===================================================================
--- trunk/admin/update.php	(revision 675)
+++ trunk/admin/update.php	(revision 691)
@@ -248,6 +248,7 @@
   }
   
+  echo '<!-- scanning dirs : ';
   echo get_elapsed_time($start, get_moment());
-  echo ' for new method scanning directories<br />';
+  echo ' -->'."\n";
 }
 // +-----------------------------------------------------------------------+
@@ -261,6 +262,5 @@
   $fs = get_fs($basedir);
   
-  echo get_elapsed_time($start, get_moment());
-  echo ' for get_fs<br />';
+  echo '<!-- get_fs : '.get_elapsed_time($start, get_moment()).' -->'."\n";
   
   $cat_ids = array_diff(array_keys($db_categories), $to_delete);
@@ -451,6 +451,7 @@
   }
   
+  echo '<!-- scanning files : ';
   echo get_elapsed_time($start_files, get_moment());
-  echo ' for new method scanning files<br />';
+  echo ' -->'."\n";
 }
 // +-----------------------------------------------------------------------+
@@ -469,4 +470,5 @@
   array(
     'L_SUBMIT'=>$lang['submit'],
+    'L_RESET'=>$lang['reset'],
     'L_UPDATE_TITLE'=>$lang['update_default_title'],
     'L_UPDATE_SYNC_FILES'=>$lang['update_sync_files'],
@@ -496,7 +498,55 @@
 // |                        introduction : choices                         |
 // +-----------------------------------------------------------------------+
-if (!isset($_POST['submit']))
+if (!isset($_POST['submit']) or (isset($simulate) and $simulate))
 {
   $template->assign_block_vars('introduction', array());
+
+  if (isset($simulate) and $simulate)
+  {
+    switch ($_POST['sync'])
+    {
+      case 'dirs' :
+      {
+        $template->assign_vars(
+          array('SYNC_DIRS_CHECKED'=>'checked="checked"'));
+        break;
+      }
+      case 'files' :
+      {
+        $template->assign_vars(
+          array('SYNC_ALL_CHECKED'=>'checked="checked"'));
+        break;
+      }
+    }
+
+    if (isset($_POST['display_info']) and $_POST['display_info'] == 1)
+    {
+      $template->assign_vars(
+        array('DISPLAY_INFO_CHECKED'=>'checked="checked"'));
+    }
+
+    if (isset($_POST['subcats-included']) and $_POST['subcats-included'] == 1)
+    {
+      $template->assign_vars(
+        array('SUBCATS_INCLUDED_CHECKED'=>'checked="checked"'));
+    }
+
+    if (isset($_POST['cat']) and is_numeric($_POST['cat']))
+    {
+      $cat_selected = array($_POST['cat']);
+    }
+    else
+    {
+      $cat_selected = array();
+    }
+  }
+  else
+  {
+    $template->assign_vars(
+      array('SYNC_DIRS_CHECKED' => 'checked="checked"',
+            'SUBCATS_INCLUDED_CHECKED'=>'checked="checked"'));
+
+    $cat_selected = array();
+  }
 
   $query = '
@@ -506,5 +556,5 @@
 ;';
   display_select_cat_wrapper($query,
-                             array(),
+                             $cat_selected,
                              'introduction.category_option',
                              false);
@@ -513,6 +563,6 @@
 // |                          synchronize files                            |
 // +-----------------------------------------------------------------------+
-else if (isset($_POST['submit'])
-         and ($_POST['sync'] == 'dirs' or $_POST['sync'] == 'files'))
+if (isset($_POST['submit'])
+    and ($_POST['sync'] == 'dirs' or $_POST['sync'] == 'files'))
 {
   $template->assign_block_vars(
@@ -559,11 +609,13 @@
     $start = get_moment();
     update_category('all');
+    echo '<!-- update_category(all) : ';
     echo get_elapsed_time($start,get_moment());
-    echo ' for update_category(all)<br />';
+    echo ' -->'."\n";
     $start = get_moment();
     ordering();
     update_global_rank();
+    echo '<!-- ordering categories : ';
     echo get_elapsed_time($start, get_moment());
-    echo ' for ordering categories<br />';
+    echo ' -->'."\n";
   }
 }
@@ -598,9 +650,14 @@
                         $opts['recursive'],
                         $opts['only_new']);
-  echo get_elapsed_time($start, get_moment()).' for get_filelist<br />';
+  
+  echo '<!-- get_filelist : ';
+  echo get_elapsed_time($start, get_moment());
+  echo ' -->'."\n";
   
   $start = get_moment();
   update_metadata($files);
-  echo get_elapsed_time($start, get_moment()).' for metadata update<br />';
+  echo '<!-- metadata update : ';
+  echo get_elapsed_time($start, get_moment());
+  echo ' -->'."\n";
 }
 // +-----------------------------------------------------------------------+
