Index: quicktabs.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/quicktabs/quicktabs.install,v
retrieving revision 1.4.2.9
diff -u -p -r1.4.2.9 quicktabs.install
--- quicktabs.install	6 Apr 2009 18:17:54 -0000	1.4.2.9
+++ quicktabs.install	11 Sep 2009 21:04:14 -0000
@@ -42,6 +42,13 @@ function quicktabs_schema() {
         'length' => 255,
         'not null' => TRUE,
       ),
+      'default_tab' => array(
+        'description' => 'Default tab.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'size' => 'tiny',
+        'not null' => TRUE,
+      ),
     ),
     'primary key' => array('qtid'),
   );
@@ -84,7 +91,7 @@ function quicktabs_update_6000() {
  */
 function quicktabs_update_6001() {
   $ret = array();
-  db_add_field($ret, 'quicktabs', 'ajax', array('description' => 'Whether this is an ajax views block', 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
+  db_add_field($ret, 'quicktabs', 'ajax', array('description' => t('Whether this is an ajax views block'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0));
   return $ret;
 }
 
@@ -181,3 +188,12 @@ function quicktabs_update_6004() {
   }
   return $ret;
 }
+
+/**
+ * Add default_tab column.
+ */
+function quicktabs_update_6005() {
+  $ret = array();
+  db_add_field($ret, 'quicktabs', 'default_tab', array('description' => 'The default tab.', 'type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE));
+  return $ret;
+}
Index: quicktabs.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/quicktabs/quicktabs.module,v
retrieving revision 1.10.2.65
diff -u -p -r1.10.2.65 quicktabs.module
--- quicktabs.module	18 Jul 2009 03:05:13 -0000	1.10.2.65
+++ quicktabs.module	11 Sep 2009 21:04:14 -0000
@@ -189,6 +189,7 @@ function quicktabs_render($quicktabs) {
   ));
   $output = '<div'. $attributes .'>';
   $active_tab = _quicktabs_get_active_tab($quicktabs);
+  $active_tab = ($active_tab ? $active_tab : $quicktabs['default_tab']);
   $output .= theme('quicktabs_tabs', $quicktabs, $active_tab);
 
   // The main content area, each quicktab container needs a unique id.
@@ -430,7 +431,7 @@ function quicktabs_quicktabs_tabstyles()
  * Load the quicktabs data.
  */
 function quicktabs_load($qtid) {
-  $quicktabs = db_fetch_array(db_query('SELECT qtid, title, tabs, ajax, style FROM {quicktabs} WHERE qtid = %d', $qtid));
+  $quicktabs = db_fetch_array(db_query('SELECT qtid, title, tabs, default_tab, ajax, style FROM {quicktabs} WHERE qtid = %d', $qtid));
   if (!$quicktabs) {
     return FALSE;
   }
Index: includes/admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/quicktabs/includes/Attic/admin.inc,v
retrieving revision 1.1.2.46
diff -u -p -r1.1.2.46 admin.inc
--- includes/admin.inc	15 Jun 2009 21:48:54 -0000	1.1.2.46
+++ includes/admin.inc	11 Sep 2009 21:04:15 -0000
@@ -55,12 +55,24 @@ function quicktabs_form($form_state, $fo
       0 => array(),
       1 => array(),
     );
+    $no_tabs = TRUE;
   }
 
   // Add the current tabs to the form.
   foreach ($quicktabs['tabs'] as $delta => $details) {
     $details['delta'] = $delta;
     $form['qt_wrapper']['tabs'][$delta] = _quicktabs_form($details);
+    $tabs[$delta] = $details['title'];
+  }
+
+  if (!$no_tabs) {
+    $form['default_tab'] = array(
+      '#type' => 'select',
+      '#title' => t('Default tab'),
+      '#options' => $tabs,
+      '#default_value' => $quicktabs['default_tab'],
+      '#weight' => -6,
+    );
   }
 
   return $form;
@@ -637,6 +649,7 @@ function _quicktabs_convert_form_to_quic
     'title' => $form_state['values']['title'],
     'ajax' => $form_state['values']['ajax'],
     'style' => $form_state['values']['style'],
+    'default_tab' => $form_state['values']['default_tab'],
     'tabs' => $formvalues_tabs,
   );
 
