# Apple iPod Video
#
-SYSFS{idVendor}=="05ac", SYSFS{idProduct}=="1209", ENV{ID_DRIVE_REQUIRES_EJECT}="1"
+SYSFS{idVendor}=="05ac", SYSFS{idProduct}=="1209", ENV{ID_DRIVE_REQUIRES_EJECT}="1", ENV{DKD_PRESENTATION_ICON_NAME}="multimedia-player-ipod-white"
# USB floppy drives
#
}
void
+devkit_disks_device_set_device_presentation_name (DevkitDisksDevice *device, const gchar *value)
+{
+ if (G_UNLIKELY (g_strcmp0 (device->priv->device_presentation_name, value) != 0))
+ {
+ g_free (device->priv->device_presentation_name);
+ device->priv->device_presentation_name = g_strdup (value);
+ emit_changed (device, "device_presentation_name");
+ }
+}
+
+void
+devkit_disks_device_set_device_presentation_icon_name (DevkitDisksDevice *device, const gchar *value)
+{
+ if (G_UNLIKELY (g_strcmp0 (device->priv->device_presentation_icon_name, value) != 0))
+ {
+ g_free (device->priv->device_presentation_icon_name);
+ device->priv->device_presentation_icon_name = g_strdup (value);
+ emit_changed (device, "device_presentation_icon_name");
+ }
+}
+
+void
devkit_disks_device_set_device_mounted_by_uid (DevkitDisksDevice *device, guint value)
{
if (G_UNLIKELY (device->priv->device_mounted_by_uid != value))
gboolean device_is_mounted;
char *device_mount_path;
uid_t device_mounted_by_uid;
+ char *device_presentation_name;
+ char *device_presentation_icon_name;
char *id_usage;
char *id_type;
void devkit_disks_device_set_device_is_mounted (DevkitDisksDevice *device, gboolean value);
void devkit_disks_device_set_device_mount_path (DevkitDisksDevice *device, const gchar *value);
void devkit_disks_device_set_device_mounted_by_uid (DevkitDisksDevice *device, guint value);
+void devkit_disks_device_set_device_presentation_name (DevkitDisksDevice *device, const gchar *value);
+void devkit_disks_device_set_device_presentation_icon_name (DevkitDisksDevice *device, const gchar *value);
void devkit_disks_device_set_id_usage (DevkitDisksDevice *device, const gchar *value);
void devkit_disks_device_set_id_type (DevkitDisksDevice *device, const gchar *value);
PROP_DEVICE_IS_BUSY,
PROP_DEVICE_MOUNT_PATH,
PROP_DEVICE_MOUNTED_BY_UID,
+ PROP_DEVICE_PRESENTATION_NAME,
+ PROP_DEVICE_PRESENTATION_ICON_NAME,
PROP_JOB_IN_PROGRESS,
PROP_JOB_ID,
case PROP_DEVICE_MOUNTED_BY_UID:
g_value_set_uint (value, device->priv->device_mounted_by_uid);
break;
+ case PROP_DEVICE_PRESENTATION_NAME:
+ g_value_set_string (value, device->priv->device_presentation_name);
+ break;
+ case PROP_DEVICE_PRESENTATION_ICON_NAME:
+ g_value_set_string (value, device->priv->device_presentation_icon_name);
+ break;
case PROP_JOB_IN_PROGRESS:
g_value_set_boolean (value, device->priv->job_in_progress);
object_class,
PROP_DEVICE_MOUNTED_BY_UID,
g_param_spec_uint ("device-mounted-by-uid", NULL, NULL, 0, G_MAXUINT, 0, G_PARAM_READABLE));
+ g_object_class_install_property (
+ object_class,
+ PROP_DEVICE_PRESENTATION_NAME,
+ g_param_spec_string ("device-presentation-name", NULL, NULL, NULL, G_PARAM_READABLE));
+ g_object_class_install_property (
+ object_class,
+ PROP_DEVICE_PRESENTATION_ICON_NAME,
+ g_param_spec_string ("device-presentation-icon-name", NULL, NULL, NULL, G_PARAM_READABLE));
g_object_class_install_property (
object_class,
g_ptr_array_foreach (device->priv->device_file_by_path, (GFunc) g_free, NULL);
g_ptr_array_free (device->priv->device_file_by_id, TRUE);
g_ptr_array_free (device->priv->device_file_by_path, TRUE);
+ g_free (device->priv->device_mount_path);
+ g_free (device->priv->device_presentation_name);
+ g_free (device->priv->device_presentation_icon_name);
g_free (device->priv->id_usage);
g_free (device->priv->id_type);
/* update id_* properties */
static gboolean
+update_info_presentation (DevkitDisksDevice *device)
+{
+ devkit_disks_device_set_device_presentation_name (device,
+ devkit_device_get_property (device->priv->d, "DKD_PRESENTATION_NAME"));
+
+ devkit_disks_device_set_device_presentation_icon_name (device,
+ devkit_device_get_property (device->priv->d, "DKD_PRESENTATION_ICON_NAME"));
+
+ return TRUE;
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+/* update id_* properties */
+static gboolean
update_info_id (DevkitDisksDevice *device)
{
gchar *decoded_string;
*
*/
+ /* device_presentation_name and device_presentation_icon_name properties */
+ if (!update_info_presentation (device))
+ goto out;
+
/* id_* properties */
if (!update_info_id (device))
goto out;
The block size of the device in bytes.
</doc:para></doc:description></doc:doc>
</property>
+ <property name="device-presentation-name" type="s" access="read">
+ <doc:doc><doc:description><doc:para>
+ The name to use when presenting the device to an end user.
+ </doc:para></doc:description></doc:doc>
+ </property>
+ <property name="device-presentation-icon-name" type="s" access="read">
+ <doc:doc><doc:description><doc:para>
+ The icon to use when presenting the device to an end user. If set, must be a name
+ following the freedesktop.org icon theme specification.
+ </doc:para></doc:description></doc:doc>
+ </property>
<property name="job-in-progress" type="b" access="read">
<doc:doc><doc:description><doc:para>
gboolean device_is_linux_md;
char *device_mount_path;
uid_t device_mounted_by_uid;
+ char *device_presentation_name;
+ char *device_presentation_icon_name;
guint64 device_size;
guint64 device_block_size;
props->device_mount_path = g_strdup (g_value_get_string (value));
else if (strcmp (key, "device-mounted-by-uid") == 0)
props->device_mounted_by_uid = g_value_get_uint (value);
+ else if (strcmp (key, "device-presentation-name") == 0)
+ props->device_presentation_name = g_strdup (g_value_get_string (value));
+ else if (strcmp (key, "device-presentation-icon-name") == 0)
+ props->device_presentation_icon_name = g_strdup (g_value_get_string (value));
else if (strcmp (key, "device-size") == 0)
props->device_size = g_value_get_uint64 (value);
else if (strcmp (key, "device-block-size") == 0)
g_strfreev (props->device_file_by_id);
g_strfreev (props->device_file_by_path);
g_free (props->device_mount_path);
+ g_free (props->device_presentation_name);
+ g_free (props->device_presentation_icon_name);
g_free (props->job_id);
g_free (props->job_cur_task_id);
g_free (props->id_usage);
g_print (" is busy: %d\n", props->device_is_busy);
g_print (" mount path: %s\n", props->device_mount_path);
g_print (" mounted by uid: %d\n", props->device_mounted_by_uid);
+ g_print (" presentation name: %s\n", props->device_presentation_name);
+ g_print (" presentation icon: %s\n", props->device_presentation_icon_name);
g_print (" size: %" G_GUINT64_FORMAT "\n", props->device_size);
g_print (" block size: %" G_GUINT64_FORMAT "\n", props->device_block_size);