View | Details | Raw Unified | Return to bug 114689
Collapse All | Expand All

(-)gnome-volume-manager-1.3.5/src/manager.c.xx (-12 / +16 lines)
Lines 141-147 Link Here
141
	{ N_("Import _Photos"), NULL, GVM_RESPONSE_IMPORT_PHOTOS },
141
	{ N_("Import _Photos"), NULL, GVM_RESPONSE_IMPORT_PHOTOS },
142
};
142
};
143
143
144
static struct _GvmPromptButton GVM_BUTTONS_PTP_CAMERA[] = {
144
static struct _GvmPromptButton GVM_BUTTONS_LIBGPHOTO2_CAMERA[] = {
145
	{ N_("_Ignore"), NULL, GTK_RESPONSE_CANCEL },
145
	{ N_("_Ignore"), NULL, GTK_RESPONSE_CANCEL },
146
	{ N_("Import _Photos"), NULL, GVM_RESPONSE_IMPORT_PHOTOS },
146
	{ N_("Import _Photos"), NULL, GVM_RESPONSE_IMPORT_PHOTOS },
147
};
147
};
Lines 172-178 Link Here
172
typedef enum {
172
typedef enum {
173
	GVM_PROMPT_AUTORUN,
173
	GVM_PROMPT_AUTORUN,
174
	GVM_PROMPT_IMPORT_CAMERA,
174
	GVM_PROMPT_IMPORT_CAMERA,
175
	GVM_PROMPT_IMPORT_PTP_CAMERA,
175
	GVM_PROMPT_IMPORT_LIBGPHOTO2_CAMERA,
176
	GVM_PROMPT_IMPORT_PHOTOS,
176
	GVM_PROMPT_IMPORT_PHOTOS,
177
	GVM_PROMPT_IPOD_PHOTO,
177
	GVM_PROMPT_IPOD_PHOTO,
178
	GVM_PROMPT_CDA_EXTRA,
178
	GVM_PROMPT_CDA_EXTRA,
Lines 216-222 Link Here
216
	  N_("There are photos on the camera. Would you like to add these pictures to your album?"), FALSE, FALSE,
216
	  N_("There are photos on the camera. Would you like to add these pictures to your album?"), FALSE, FALSE,
217
	  GCONF_ROOT "prompts/camera_import_photos", N_("_Always perform this action") },
217
	  GCONF_ROOT "prompts/camera_import_photos", N_("_Always perform this action") },
218
	{ 0, "applets-screenshooter", NULL,
218
	{ 0, "applets-screenshooter", NULL,
219
	  GVM_BUTTONS_PTP_CAMERA, G_N_ELEMENTS (GVM_BUTTONS_PTP_CAMERA),
219
	  GVM_BUTTONS_LIBGPHOTO2_CAMERA, G_N_ELEMENTS (GVM_BUTTONS_LIBGPHOTO2_CAMERA),
220
	  GVM_RESPONSE_IMPORT_PHOTOS,
220
	  GVM_RESPONSE_IMPORT_PHOTOS,
221
	  N_("Camera Import"),
221
	  N_("Camera Import"),
222
	  N_("A camera has been detected."),
222
	  N_("A camera has been detected."),
Lines 721-734 Link Here
721
}
721
}
722
722
723
/*
723
/*
724
 * gvm_udi_is_ptp_camera - checks if the udi is a PTP camera device
724
 * gvm_udi_is_libgphoto2_camera - checks if the udi is a libgphoto2 camera device
725
 *
725
 *
726
 * Returns TRUE if the device is a PTP camera with libgphoto2 support or FALSE otherwise.
726
 * Returns TRUE if the device is a camera with libgphoto2 support or FALSE otherwise.
727
 */
727
 */
728
static gboolean
728
static gboolean
729
gvm_udi_is_ptp_camera (const char *udi)
729
gvm_udi_is_libgphoto2_camera (const char *udi)
730
{
730
{
731
	gboolean is_ptp_camera = FALSE;
731
	gboolean is_libgphoto2_camera = FALSE;
732
	char *access_method;
732
	char *access_method;
733
	
733
	
734
	if (!libhal_device_query_capability (hal_ctx, udi, "camera", NULL))
734
	if (!libhal_device_query_capability (hal_ctx, udi, "camera", NULL))
Lines 739-750 Link Here
739
	
739
	
740
	if (!strcmp (access_method, "ptp")) {
740
	if (!strcmp (access_method, "ptp")) {
741
		dbg ("PTP Camera detected: %s\n", udi);
741
		dbg ("PTP Camera detected: %s\n", udi);
742
		is_ptp_camera = TRUE;
742
		is_libgphoto2_camera = TRUE;
743
	}
744
	if (!strcmp (access_method, "libgphoto2")) {
745
		dbg ("libgphoto2 Camera detected: %s\n", udi);
746
		is_libgphoto2_camera = TRUE;
743
	}
747
	}
744
	
748
	
745
	libhal_free_string (access_method);
749
	libhal_free_string (access_method);
746
	
750
	
747
	return is_ptp_camera;
751
	return is_libgphoto2_camera;
748
}
752
}
749
753
750
/*
754
/*
Lines 1417-1425 Link Here
1417
	} else if (libhal_device_query_capability (hal_ctx, udi, "printer", NULL)) {
1421
	} else if (libhal_device_query_capability (hal_ctx, udi, "printer", NULL)) {
1418
		if (config.autoprinter)
1422
		if (config.autoprinter)
1419
			gvm_run_printer (udi);
1423
			gvm_run_printer (udi);
1420
	} else if (gvm_udi_is_ptp_camera (udi)) {
1424
	} else if (gvm_udi_is_libgphoto2_camera (udi)) {
1421
		/* if the device is a PTP camera with libgphoto2 support, launch the user-specified application */
1425
		/* if the device is a camera with libgphoto2 support, launch the user-specified application */
1422
		if (config.autophoto && gvm_prompt (GVM_PROMPT_IMPORT_PTP_CAMERA, 0, NULL) == GVM_RESPONSE_IMPORT_PHOTOS)
1426
		if (config.autophoto && gvm_prompt (GVM_PROMPT_IMPORT_LIBGPHOTO2_CAMERA, 0, NULL) == GVM_RESPONSE_IMPORT_PHOTOS)
1423
			gvm_run_camera (udi, NULL, NULL);
1427
			gvm_run_camera (udi, NULL, NULL);
1424
	}
1428
	}
1425
	
1429
	

Return to bug 114689