Index: data/glade/gthumb_camera.glade
===================================================================
RCS file: /cvs/gnome/gthumb/data/glade/gthumb_camera.glade,v
retrieving revision 1.16
diff -u -p -r1.16 gthumb_camera.glade
--- data/glade/gthumb_camera.glade	12 Oct 2006 15:49:13 -0000	1.16
+++ data/glade/gthumb_camera.glade	28 Oct 2006 10:30:52 -0000
@@ -743,6 +743,19 @@
 	      <property name="response_id">-5</property>
 	    </widget>
 	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="cm_helpbutton">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label">gtk-help</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">-11</property>
+	    </widget>
+	  </child>
 	</widget>
 	<packing>
 	  <property name="padding">0</property>
@@ -753,19 +766,57 @@
       </child>
 
       <child>
-	<widget class="GtkTable" id="table2">
-	  <property name="border_width">6</property>
+	<widget class="GtkTable" id="cm_autodetect_table">
 	  <property name="visible">True</property>
-	  <property name="n_rows">3</property>
+	  <property name="n_rows">4</property>
 	  <property name="n_columns">2</property>
 	  <property name="homogeneous">False</property>
-	  <property name="row_spacing">6</property>
-	  <property name="column_spacing">6</property>
+	  <property name="row_spacing">0</property>
+	  <property name="column_spacing">0</property>
 
 	  <child>
-	    <widget class="GtkLabel" id="label5">
+	    <widget class="GtkCombo" id="cm_autodetect_model_combo">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">_Model:</property>
+	      <property name="value_in_list">True</property>
+	      <property name="allow_empty">True</property>
+	      <property name="case_sensitive">False</property>
+	      <property name="enable_arrow_keys">True</property>
+	      <property name="enable_arrows_always">False</property>
+
+	      <child internal-child="entry">
+		<widget class="GtkEntry" id="cm_autodetect_model_combo_entry">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="editable">False</property>
+		  <property name="visibility">True</property>
+		  <property name="max_length">0</property>
+		  <property name="text" translatable="yes"></property>
+		  <property name="has_frame">True</property>
+		  <property name="invisible_char">*</property>
+		  <property name="activates_default">False</property>
+		</widget>
+	      </child>
+
+	      <child internal-child="list">
+		<widget class="GtkList" id="combo-list3">
+		  <property name="visible">True</property>
+		  <property name="selection_mode">GTK_SELECTION_BROWSE</property>
+		</widget>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label11">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Camera _Model:</property>
 	      <property name="use_underline">True</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -775,7 +826,75 @@
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
-	      <property name="mnemonic_widget">cm_model_combo_entry</property>
+	      <property name="mnemonic_widget">cm_autodetect_model_combo_entry</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkCombo" id="cm_autodetect_port_combo">
+	      <property name="visible">True</property>
+	      <property name="value_in_list">True</property>
+	      <property name="allow_empty">True</property>
+	      <property name="case_sensitive">False</property>
+	      <property name="enable_arrow_keys">True</property>
+	      <property name="enable_arrows_always">False</property>
+
+	      <child internal-child="entry">
+		<widget class="GtkEntry" id="cm_autodetect_port_combo_entry">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="editable">False</property>
+		  <property name="visibility">True</property>
+		  <property name="max_length">0</property>
+		  <property name="text" translatable="yes"></property>
+		  <property name="has_frame">True</property>
+		  <property name="invisible_char">*</property>
+		  <property name="activates_default">False</property>
+		</widget>
+	      </child>
+
+	      <child internal-child="list">
+		<widget class="GtkList" id="combo-list4">
+		  <property name="visible">True</property>
+		  <property name="selection_mode">GTK_SELECTION_BROWSE</property>
+		</widget>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">2</property>
+	      <property name="bottom_attach">3</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label12">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Camera _Port:</property>
+	      <property name="use_underline">True</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="mnemonic_widget">cm_autodetect_port_combo_entry</property>
 	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
 	      <property name="width_chars">-1</property>
 	      <property name="single_line_mode">False</property>
@@ -784,17 +903,101 @@
 	    <packing>
 	      <property name="left_attach">0</property>
 	      <property name="right_attach">1</property>
+	      <property name="top_attach">2</property>
+	      <property name="bottom_attach">3</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label10">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Auto-_detected cameras:</property>
+	      <property name="use_underline">True</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">2</property>
 	      <property name="top_attach">0</property>
 	      <property name="bottom_attach">1</property>
+	      <property name="y_padding">5</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="cm_refresh_button">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="label" translatable="yes">_Refresh list</property>
+	      <property name="use_underline">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">3</property>
+	      <property name="bottom_attach">4</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkCheckButton" id="cm_manual_selection_checkbutton">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="label" translatable="yes">Use manual selection instead:</property>
+	  <property name="use_underline">True</property>
+	  <property name="relief">GTK_RELIEF_NORMAL</property>
+	  <property name="focus_on_click">True</property>
+	  <property name="active">False</property>
+	  <property name="inconsistent">False</property>
+	  <property name="draw_indicator">True</property>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkTable" id="cm_manual_selection_table">
+	  <property name="visible">True</property>
+	  <property name="sensitive">False</property>
+	  <property name="n_rows">2</property>
+	  <property name="n_columns">2</property>
+	  <property name="homogeneous">False</property>
+	  <property name="row_spacing">0</property>
+	  <property name="column_spacing">0</property>
 
 	  <child>
-	    <widget class="GtkLabel" id="label6">
+	    <widget class="GtkLabel" id="label5">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">_Port:</property>
+	      <property name="label" translatable="yes">Camera _Model:</property>
 	      <property name="use_underline">True</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -804,7 +1007,7 @@
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
-	      <property name="mnemonic_widget">cm_port_combo_entry</property>
+	      <property name="mnemonic_widget">cm_model_combo_entry</property>
 	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
 	      <property name="width_chars">-1</property>
 	      <property name="single_line_mode">False</property>
@@ -813,8 +1016,8 @@
 	    <packing>
 	      <property name="left_attach">0</property>
 	      <property name="right_attach">1</property>
-	      <property name="top_attach">1</property>
-	      <property name="bottom_attach">2</property>
+	      <property name="top_attach">0</property>
+	      <property name="bottom_attach">1</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
@@ -860,6 +1063,35 @@
 	  </child>
 
 	  <child>
+	    <widget class="GtkLabel" id="label6">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Camera _Port:</property>
+	      <property name="use_underline">True</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="mnemonic_widget">cm_port_combo_entry</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
 	    <widget class="GtkCombo" id="cm_port_combo">
 	      <property name="visible">True</property>
 	      <property name="value_in_list">False</property>
@@ -895,38 +1127,6 @@
 	      <property name="top_attach">1</property>
 	      <property name="bottom_attach">2</property>
 	      <property name="y_options"></property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkHBox" id="hbox4">
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">0</property>
-
-	      <child>
-		<widget class="GtkButton" id="cm_detect_button">
-		  <property name="visible">True</property>
-		  <property name="can_default">True</property>
-		  <property name="can_focus">True</property>
-		  <property name="label" translatable="yes">_Auto Detect</property>
-		  <property name="use_underline">True</property>
-		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">True</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="left_attach">0</property>
-	      <property name="right_attach">2</property>
-	      <property name="top_attach">2</property>
-	      <property name="bottom_attach">3</property>
-	      <property name="x_options">fill</property>
 	    </packing>
 	  </child>
 	</widget>
Index: doc/C/gthumb.xml
===================================================================
RCS file: /cvs/gnome/gthumb/doc/C/gthumb.xml,v
retrieving revision 1.27
diff -u -p -r1.27 gthumb.xml
--- doc/C/gthumb.xml	12 Oct 2006 15:49:16 -0000	1.27
+++ doc/C/gthumb.xml	28 Oct 2006 10:30:53 -0000
@@ -101,9 +101,7 @@
       animations or little static images.
       Another important image format is PNG, this format is very
       common on Unix platforms and is considered
-      a replacement of the GIF format which has  
-      <ulink url="http://www.gnu.org/philosophy/gif.html"
-      type="http">license issues</ulink>.
+      a replacement of the GIF format.
     </para>
     <para>
       &app; supports all this formats and many others, it also displays
@@ -2222,6 +2220,60 @@
          <menuchoice><guimenu>File</guimenu><guimenuitem>Import Photos
          </guimenuitem></menuchoice>.
        </para>
+       <para>
+         Several options are presented in the
+         <menuchoice><guimenu>File</guimenu><guimenuitem>Import Photos
+         </guimenuitem></menuchoice> dialog.
+       </para>
+       <para>
+         The destination folder can be selected through the
+         <guilabel>Destination</guilabel> box. The photos will
+         be imported into a sub-folder of the <guilabel>Destination</guilabel>
+         folder. The name of the sub-folder is set by the
+         <guilabel>Film</guilabel> box. If no "Film" folder is specified,
+         a sub-folder name consisting of the import data and time will
+         be automatically generated.
+       </para>
+       <para>
+         <guilabel>Categories</guilabel> can be specified for the imported
+         photos using the <guilabel>Categories</guilabel> box.
+       </para>
+       <para>
+         If the <guilabel>Delete imported images from the camera</guilabel>
+         checkbox is enabled, the photos will be deleted from the camera
+         after they have been imported.
+       </para>
+       <para>
+         &app; will rename the images (in numerical re-order) when they 
+ 	 are imported, unless the
+         <guilabel>Keep original filenames</guilabel> checkbox is selected.
+       </para>
+       <para>
+         If the <guilabel>Rotate images physically</guilabel> checkbox is selected,
+         and the imported photo contains an Exif orientation tag, the image data 
+         will be physically transformed (losslessly) so that the viewed image 
+         looks the same as before but the orientation tag is reset to "top left". 
+         If this checkbox is not enabled, the image data and the orientation tag 
+         are both left unchanged. The image will be displayed identically by 
+         gthumb for both possibilities, but for maximum compatibility with other 
+         applications this checkbox should be enabled.
+       </para>
+       <sect3 id="gthumb-select-camera">
+	<title>Selecting the Camera Model</title>
+         <para>
+         &app; should auto-detect your camera (if it is turned on) when you
+         launch the <menuchoice><guimenu>File</guimenu><guimenuitem>Import Photos
+         </guimenuitem></menuchoice> dialog. If it does, a camera icon will be
+         displayed in the dialog box. If not, a camera with an "X" through it
+         will be shown.
+         </para>
+         <para>
+         If the wrong camera has been detected, click the camera icon to select
+         a different one. A drop-down box listing all auto-detected cameras will
+         be shown. If the <guilabel>Use manual selection instead</guilabel> checkbox
+         is enabled, the user can manually set the camera model and port.
+         </para>
+       </sect3>
     </sect2>
     <sect2 id="gthumb-write-to-cd">
       <title>To Write Images to a CD or DVD</title>
Index: src/dlg-photo-importer.c
===================================================================
RCS file: /cvs/gnome/gthumb/src/dlg-photo-importer.c,v
retrieving revision 1.42
diff -u -p -r1.42 dlg-photo-importer.c
--- src/dlg-photo-importer.c	12 Oct 2006 19:15:12 -0000	1.42
+++ src/dlg-photo-importer.c	28 Oct 2006 10:30:54 -0000
@@ -1992,19 +1992,30 @@ dlg_photo_importer (GthBrowser *browser)
 }
 
 
-
-
-
 typedef struct {
 	DialogData     *data;
 	GladeXML       *gui;
 
 	GtkWidget      *dialog;
+
 	GtkWidget      *cm_model_combo;
 	GtkWidget      *cm_model_combo_entry;
 	GtkWidget      *cm_port_combo;
 	GtkWidget      *cm_port_combo_entry;
-	GtkWidget      *cm_detect_button;
+
+	GtkWidget      *cm_autodetect_table;
+	GtkWidget      *cm_autodetect_model_combo;
+	GtkWidget      *cm_autodetect_model_combo_entry;
+	GtkWidget      *cm_autodetect_port_combo;
+	GtkWidget      *cm_autodetect_port_combo_entry;
+
+	GtkWidget      *cm_refresh_button;
+	
+	GtkWidget      *cm_manual_selection_checkbutton;
+	GtkWidget      *cm_manual_selection_table;
+
+	GHashTable     *autodetected_models;
+	
 } ModelDialogData;
 
 
@@ -2013,6 +2024,12 @@ model__destroy_cb (GtkWidget       *widg
 		   ModelDialogData *data)
 {
 	g_object_unref (data->gui);
+	
+	if (data->autodetected_models) {
+		g_hash_table_destroy (data->autodetected_models);
+		data->autodetected_models = NULL;
+	}
+
 	g_free (data);
 }
 
@@ -2023,16 +2040,22 @@ model__ok_clicked_cb (GtkButton       *b
 {
 	const char *model, *port;
 
-	model = gtk_entry_get_text (GTK_ENTRY (mdata->cm_model_combo_entry));
-	port = gtk_entry_get_text (GTK_ENTRY (mdata->cm_port_combo_entry));
-
+	if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mdata->cm_manual_selection_checkbutton)) == TRUE)
+	{
+		model = gtk_entry_get_text (GTK_ENTRY (mdata->cm_model_combo_entry));
+		port = gtk_entry_get_text (GTK_ENTRY (mdata->cm_port_combo_entry));
+	} else {
+		model = gtk_entry_get_text (GTK_ENTRY (mdata->cm_autodetect_model_combo_entry));
+		port = gtk_entry_get_text (GTK_ENTRY (mdata->cm_autodetect_port_combo_entry));
+	}
+	
 	gtk_widget_hide (mdata->dialog);
 	if ((model != NULL) && (*model != 0))
 		set_camera_model (mdata->data, model, port);
+
 	gtk_widget_destroy (mdata->dialog);
 }
 
-
 static GList *
 get_camera_port_list (ModelDialogData *mdata, GPPortType types)
 {
@@ -2074,6 +2097,86 @@ get_camera_model_list (ModelDialogData *
 	return g_list_reverse (list);
 }
 
+static GList*
+get_autodetect_model_list (ModelDialogData *mdata)
+{
+	DialogData   *data = mdata->data;
+	CameraList   *camera_list = NULL;
+	GList	     *model_list = NULL;
+	GHashTable   *model_hash = NULL;
+	int	     n, i;
+
+	gp_list_new (&camera_list);
+
+	/*
+	 * Hack to force update of usb ports (which are added dynamically when a device is plugged in)
+	 * (libgphoto2 should have a gp_port_info_list_update method)
+	 */
+
+	gp_port_info_list_free (data->port_list);
+	gp_port_info_list_new (&data->port_list);
+	gp_port_info_list_load (data->port_list);
+
+	/* */
+
+	gp_abilities_list_detect (data->abilities_list,
+				  data->port_list,
+				  camera_list, 
+				  data->context);
+
+	n = gp_list_count (camera_list);
+
+	model_list = g_list_append (NULL, g_strdup (""));
+	model_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)path_list_free);
+
+	for (i = 0; i < n; i++) {
+		const char *model = NULL;
+		const char *port = NULL;
+		GList* port_list;
+
+		gp_list_get_name (camera_list, i, &model);
+		gp_list_get_value (camera_list, i, &port);
+
+		port_list = g_hash_table_lookup (model_hash, model);
+		if (port_list == NULL) {
+			model_list = g_list_append (model_list, g_strdup_printf ("%s", model));
+			port_list = g_list_append (port_list, g_strdup_printf("%s", port));
+			g_hash_table_insert(model_hash, g_strdup_printf("%s", model), port_list);
+		} else {
+			port_list = g_list_append (port_list, g_strdup_printf("%s", port));
+		}
+	}
+
+	if (mdata->autodetected_models != NULL) {
+		g_hash_table_destroy (mdata->autodetected_models);
+	}
+
+	gp_list_free (camera_list);
+	mdata->autodetected_models = model_hash;
+	return model_list;
+}
+
+static void
+model__autodetect_model_changed_cb (GtkEditable     *editable,
+				    ModelDialogData *mdata)
+{
+	const char      *model = NULL;
+	GList           *list = NULL;
+	int              m;
+	CameraAbilities  a;
+
+	model = gtk_entry_get_text (GTK_ENTRY (mdata->cm_autodetect_model_combo_entry));
+
+	if (model == NULL || *model == 0) {
+		list =  g_list_append (NULL, g_strdup (""));
+		gtk_combo_set_popdown_strings (GTK_COMBO (mdata->cm_autodetect_port_combo), list);
+		path_list_free (list);
+	} else {
+		list = g_hash_table_lookup (mdata->autodetected_models, model);
+		gtk_combo_set_popdown_strings (GTK_COMBO (mdata->cm_autodetect_port_combo), list);
+	}		
+}
+
 
 static void
 model__model_changed_cb (GtkEditable     *editable,
@@ -2095,48 +2198,46 @@ model__model_changed_cb (GtkEditable    
 	path_list_free (list);
 }
 
-
 static void
-model__autodetect_cb (GtkButton       *button,
-		      ModelDialogData *mdata)
+model__refresh_cb (GtkButton       *button,
+		   ModelDialogData *mdata)
 {
 	DialogData *data = mdata->data;
-	CameraList *list = NULL;
-	int         count;
+	GList *list = NULL;
+	int n, i;
 
-	gp_list_new (&list);
-	gp_abilities_list_detect (data->abilities_list,
-				  data->port_list,
-				  list, 
-				  data->context);
-	count = gp_list_count (list);
-	
-	if (count >= 1) {
-		const char *model = NULL, *port = NULL;
-		gp_list_get_name (list, 0, &model);
-		gp_list_get_value (list, 0, &port);
+	list = get_autodetect_model_list (mdata);
+	gtk_combo_set_popdown_strings (GTK_COMBO (mdata->cm_autodetect_model_combo), list);
+	path_list_free (list);
+}
 
-		gtk_entry_set_text (GTK_ENTRY (mdata->cm_model_combo_entry), model);
-		gtk_entry_set_text (GTK_ENTRY (mdata->cm_port_combo_entry), port);
+static void
+model__manual_select_cb (GtkButton       *button,
+			 ModelDialogData *mdata)
+{
+	DialogData *data = mdata->data;
+	GList *list = NULL;
+
+	if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)) == TRUE) {
+		gtk_widget_set_sensitive(mdata->cm_manual_selection_table, TRUE);
+		gtk_widget_set_sensitive(mdata->cm_autodetect_table, FALSE);
+	} else {
+		gtk_widget_set_sensitive(mdata->cm_manual_selection_table, FALSE);
+		gtk_widget_set_sensitive(mdata->cm_autodetect_table, TRUE);
 	}
 	
-	gp_list_free (list);
 }
 
-
 static void
 dlg_select_camera_model_cb (GtkButton  *button,
 			    DialogData *data)
 {
 	ModelDialogData *mdata;
-	GtkWidget       *btn_ok, *btn_cancel;
+	GtkWidget       *btn_ok, *btn_help, *btn_cancel;
 	GList           *list;
 	CameraAbilities  a;
 	int              r;
 
-	if (autodetect_camera (data))
-		return;
-
 	mdata = g_new (ModelDialogData, 1);
 	mdata->data = data;
 	
@@ -2154,8 +2255,17 @@ dlg_select_camera_model_cb (GtkButton  *
 	mdata->cm_model_combo_entry = glade_xml_get_widget (mdata->gui, "cm_model_combo_entry");
 	mdata->cm_port_combo = glade_xml_get_widget (mdata->gui, "cm_port_combo");
 	mdata->cm_port_combo_entry = glade_xml_get_widget (mdata->gui, "cm_port_combo_entry");
-	mdata->cm_detect_button = glade_xml_get_widget (mdata->gui, "cm_detect_button");
+	mdata->cm_autodetect_model_combo = glade_xml_get_widget (mdata->gui, "cm_autodetect_model_combo");
+	mdata->cm_autodetect_model_combo_entry = glade_xml_get_widget (mdata->gui, "cm_autodetect_model_combo_entry");
+	mdata->cm_autodetect_port_combo = glade_xml_get_widget (mdata->gui, "cm_autodetect_port_combo");
+	mdata->cm_autodetect_port_combo_entry = glade_xml_get_widget (mdata->gui, "cm_autodetect_port_combo_entry");
+	mdata->cm_refresh_button = glade_xml_get_widget (mdata->gui, "cm_refresh_button");
+	mdata->cm_autodetect_table = glade_xml_get_widget (mdata->gui, "cm_autodetect_table");
+	mdata->cm_manual_selection_table = glade_xml_get_widget (mdata->gui, "cm_manual_selection_table");
+	mdata->cm_manual_selection_checkbutton = glade_xml_get_widget (mdata->gui, "cm_manual_selection_checkbutton");
+
 	btn_ok = glade_xml_get_widget (mdata->gui, "cm_okbutton");
+	btn_help = glade_xml_get_widget (mdata->gui, "cm_helpbutton");
 	btn_cancel = glade_xml_get_widget (mdata->gui, "cm_cancelbutton");
 
 	/* Set widgets data. */
@@ -2164,6 +2274,11 @@ dlg_select_camera_model_cb (GtkButton  *
 	gtk_combo_set_popdown_strings (GTK_COMBO (mdata->cm_model_combo), list);
 	path_list_free (list);
 
+	mdata->autodetected_models = NULL;
+	list = get_autodetect_model_list (mdata);
+	gtk_combo_set_popdown_strings (GTK_COMBO (mdata->cm_autodetect_model_combo), list);
+	path_list_free (list);
+
 	/* Set the signals handlers. */
 
 	g_signal_connect (G_OBJECT (mdata->dialog), 
@@ -2174,6 +2289,10 @@ dlg_select_camera_model_cb (GtkButton  *
 			  "clicked",
 			  G_CALLBACK (model__ok_clicked_cb),
 			  mdata);
+        g_signal_connect (G_OBJECT (btn_help),
+                          "clicked",
+                          G_CALLBACK (help_cb),
+                          mdata);
 	g_signal_connect_swapped (G_OBJECT (btn_cancel), 
 				  "clicked",
 				  G_CALLBACK (gtk_widget_destroy),
@@ -2182,9 +2301,17 @@ dlg_select_camera_model_cb (GtkButton  *
 			  "changed",
 			  G_CALLBACK (model__model_changed_cb),
 			  mdata);
-	g_signal_connect (G_OBJECT (mdata->cm_detect_button), 
+	g_signal_connect (G_OBJECT (mdata->cm_refresh_button), 
 			  "clicked",
-			  G_CALLBACK (model__autodetect_cb),
+			  G_CALLBACK (model__refresh_cb),
+			  mdata);
+	g_signal_connect (G_OBJECT (mdata->cm_autodetect_model_combo_entry),
+			  "changed",
+			  G_CALLBACK (model__autodetect_model_changed_cb),
+			  mdata);
+	g_signal_connect (G_OBJECT (mdata->cm_manual_selection_checkbutton), 
+			  "toggled",
+			  G_CALLBACK (model__manual_select_cb),
 			  mdata);
 
 	/* run dialog. */
@@ -2207,6 +2334,12 @@ dlg_select_camera_model_cb (GtkButton  *
 		}
 
 		gtk_entry_set_text (GTK_ENTRY (mdata->cm_model_combo_entry), a.model);
+		
+		if (g_hash_table_lookup(mdata->autodetected_models, a.model)) {
+			char *model = g_strdup_printf ("%s", a.model);
+			gtk_entry_set_text (GTK_ENTRY (mdata->cm_autodetect_model_combo_entry), model);
+			g_free (model);
+		}
 	}
 }
 
