Index: modules/shortcut/shortcut.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.admin.inc,v
retrieving revision 1.4
diff -u -p -r1.4 shortcut.admin.inc
--- modules/shortcut/shortcut.admin.inc	3 Jan 2010 21:01:04 -0000	1.4
+++ modules/shortcut/shortcut.admin.inc	11 Jan 2010 04:32:30 -0000
@@ -140,15 +140,16 @@ function shortcut_set_switch_submit($for
  *   An associative array containing the structure of the form.
  * @param $form_state
  *   An associative array containing the current state of the form.
- * @param $shortcut_set
- *   An object representing the shortcut set which is being edited.
+ * @param $set_name
+ *   The unique name of the shortcut set which is being edited.
  * @return
  *   An array representing the form definition.
  *
  * @ingroup forms
  * @see shortcut_set_customize_submit()
  */
-function shortcut_set_customize($form, &$form_state, $shortcut_set) {
+function shortcut_set_customize($form, &$form_state, $set_name) {
+  $shortcut_set = shortcut_set_load($set_name);
   $form['set'] = array(
     '#markup' => t('Using set "@set"', array('@set' => $shortcut_set->title)),
     '#prefix' => '<h4 class="shortcuts-set">',
@@ -292,8 +293,8 @@ function theme_shortcut_set_customize($v
  *   An associative array containing the structure of the form.
  * @param $form_state
  *   An associative array containing the current state of the form.
- * @param $shortcut_set
- *   An object representing the shortcut set to which the link will be added.
+ * @param $set_name
+ *   The unique name of the shortcut set to which the link will be added.
  * @return
  *   An array representing the form definition.
  *
@@ -301,7 +302,8 @@ function theme_shortcut_set_customize($v
  * @see shortcut_link_edit_validate()
  * @see shortcut_link_add_submit()
  */
-function shortcut_link_add($form, &$form_state, $shortcut_set) {
+function shortcut_link_add($form, &$form_state, $set_name) {
+  $shortcut_set = shortcut_set_load($set_name);
   drupal_set_title(t('Add new shortcut'));
   $form['shortcut_set'] = array(
     '#type' => 'value',
@@ -455,6 +457,52 @@ function shortcut_admin_add_link($shortc
 }
 
 /**
+ * Menu callback; Build the form for deleting a shortcut set.
+ *
+ * @param $form
+ *   An associative array containing the structure of the form.
+ * @param $form_state
+ *   An associative array containing the current state of the form.
+ * @param $set_name
+ *   The unique name of the set that will be deleted.
+ * @return
+ *   An array representing the form definition.
+ *
+ * @ingroup forms
+ * @see shortcut_set_delete_form_submit()
+ */
+function shortcut_set_delete_form($form, &$form_state, $set_name) {
+  $form['shortcut_set'] = array(
+    '#type' => 'value',
+    '#value' => $set_name,
+  );
+
+  $shortcut_set = shortcut_set_load($set_name);
+  return confirm_form(
+    $form,
+    t('Are you sure you want to delete the shortcut set %title?', array('%title' => $shortcut_set->title)),
+    'admin/config/system/shortcut/' . $set_name,
+    t('This action cannot be undone.'),
+    t('Delete'),
+    t('Cancel')
+  );
+}
+
+/**
+ * Submit handler for the shortcut link deletion form.
+ */
+function shortcut_set_delete_form_submit($form, &$form_state) {
+  $shortcut_set = shortcut_set_load($form_state['values']['shortcut_set']);
+  /*if ($new_default = $form_state['values']['new_default']) {
+    global $user;
+    shortcut_set_assign_user($new_default, $user);
+  }*/
+  shortcut_set_delete($shortcut_set);
+  $form_state['redirect'] = 'admin/config/system/shortcut/';
+  drupal_set_message(t('The shortcut set %title has been deleted.', array('%title' => $shortcut_set->title)));
+}
+
+/**
  * Menu callback; Build the form for deleting a shortcut link.
  *
  * @param $form
@@ -500,10 +548,11 @@ function shortcut_link_delete_submit($fo
  *
  * After completion, redirects the user back to where they came from.
  *
- * @param $shortcut_set
- *   Returned from shortcut_set_load().
+ * @param $set_name
+ *   The unique name of the set
  */
-function shortcut_link_add_inline($shortcut_set) {
+function shortcut_link_add_inline($set_name) {
+  $shortcut_set = shortcut_set_load($set_name);
   if (isset($_REQUEST['token']) && drupal_valid_token($_REQUEST['token'], 'shortcut-add-link') && shortcut_valid_link($_GET['link'])) {
     $link = array(
       'link_title' => $_GET['name'],
Index: modules/shortcut/shortcut.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.module,v
retrieving revision 1.17
diff -u -p -r1.17 shortcut.module
--- modules/shortcut/shortcut.module	11 Jan 2010 00:06:58 -0000	1.17
+++ modules/shortcut/shortcut.module	11 Jan 2010 04:32:30 -0000
@@ -61,35 +61,54 @@ function shortcut_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('shortcut_set_switch'),
     'access arguments' => array('administer shortcuts'),
+    'type' => MENU_LOCAL_TASK,
     'file' => 'shortcut.admin.inc',
   );
-  $items['admin/config/system/shortcut/%shortcut_set'] = array(
-    'title' => 'Customize shortcuts',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('shortcut_set_customize', 4),
-    'access callback' => 'shortcut_set_edit_access',
-    'access arguments' => array(4),
-    'type' => MENU_CALLBACK,
-    'file' => 'shortcut.admin.inc',
-  );
-  $items['admin/config/system/shortcut/%shortcut_set/add-link'] = array(
-    'title' => 'Add shortcut',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('shortcut_link_add', 4),
-    'access callback' => 'shortcut_set_edit_access',
-    'access arguments' => array(4),
-    'type' => MENU_LOCAL_ACTION,
-    'file' => 'shortcut.admin.inc',
-  );
-  $items['admin/config/system/shortcut/%shortcut_set/add-link-inline'] = array(
-    'title' => 'Add shortcut',
-    'page callback' => 'shortcut_link_add_inline',
-    'page arguments' => array(4),
-    'access callback' => 'shortcut_set_edit_access',
-    'access arguments' => array(4),
-    'type' => MENU_CALLBACK,
-    'file' => 'shortcut.admin.inc',
+  $items['admin/config/system/shortcut/select'] = array(
+    'title' => 'Select Active Shortcuts',
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'weight' => -1,
   );
+  foreach (shortcut_sets() AS $name => $set) {
+    $items['admin/config/system/shortcut/' . $name] = array(
+      'title' => 'Edit '. check_plain($set->title),
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('shortcut_set_customize', 4),
+      'access callback' => 'shortcut_set_edit_access',
+      'access arguments' => array(4),
+      'type' => MENU_LOCAL_TASK,
+      'file' => 'shortcut.admin.inc',
+    );
+    $items['admin/config/system/shortcut/'. $name .'/add-link'] = array(
+      'title' => 'Add shortcut',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('shortcut_link_add', 4),
+      'access callback' => 'shortcut_set_edit_access',
+      'access arguments' => array(4),
+      'type' => MENU_LOCAL_ACTION,
+      'file' => 'shortcut.admin.inc',
+    );
+    //We can never delete the default set
+    if ($name != shortcut_default_set()->set_name ) {
+      $items['admin/config/system/shortcut/'. $name .'/delete'] = array(
+        'title' => 'Delete this shortcut set',
+        'page callback' => 'drupal_get_form',
+        'page arguments' => array('shortcut_set_delete_form', 4),
+        'access arguments' => array('administer shortcuts'),
+        'type' => MENU_LOCAL_ACTION,
+        'file' => 'shortcut.admin.inc',
+      );
+    }
+    $items['admin/config/system/shortcut/'. $name .'/add-link-inline'] = array(
+      'title' => 'Add shortcut',
+      'page callback' => 'shortcut_link_add_inline',
+      'page arguments' => array(4),
+      'access callback' => 'shortcut_set_edit_access',
+      'access arguments' => array(4),
+      'type' => MENU_CALLBACK,
+      'file' => 'shortcut.admin.inc',
+    );
+  }
   $items['admin/config/system/shortcut/link/%menu_link'] = array(
     'title' => 'Edit shortcut',
     'page callback' => 'drupal_get_form',
@@ -262,6 +281,7 @@ function shortcut_set_save(&$shortcut_se
   else {
     $shortcut_set->set_name = shortcut_set_get_unique_name();
     $return = drupal_write_record('shortcut_set', $shortcut_set);
+    menu_rebuild();
   }
   // If links were provided for the set, save them.
   if (isset($shortcut_set->links)) {
@@ -310,6 +330,7 @@ function shortcut_set_delete($shortcut_s
   $deleted = db_delete('shortcut_set')
     ->condition('set_name', $shortcut_set->set_name)
     ->execute();
+  menu_rebuild();
   return (bool) $deleted;
 }
 
