[Xfce4-commits] [xfce/thunar-volman] 01/01: Add support for Blu-ray media (Bug #13297)
noreply at xfce.org
noreply at xfce.org
Wed Sep 26 03:11:37 CEST 2018
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/thunar-volman.
commit 8bc682457c34c426065eb250974649b2096b1a00
Author: James Le Cuirot <chewi at gentoo.org>
Date: Tue Sep 25 22:09:57 2018 -0300
Add support for Blu-ray media (Bug #13297)
---
thunar-volman-settings/tvm-preferences-dialog.c | 6 ++--
thunar-volman/tvm-block-device.c | 42 +++++++++++++++----------
2 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/thunar-volman-settings/tvm-preferences-dialog.c b/thunar-volman-settings/tvm-preferences-dialog.c
index 97a747a..8609550 100644
--- a/thunar-volman-settings/tvm-preferences-dialog.c
+++ b/thunar-volman-settings/tvm-preferences-dialog.c
@@ -295,7 +295,7 @@ tvm_preferences_dialog_init (TvmPreferencesDialog *dialog)
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0);
gtk_widget_show (frame);
- label = gtk_label_new (_("Video CDs/DVDs"));
+ label = gtk_label_new (_("Video CDs/DVDs/Blu-rays"));
gtk_label_set_attributes (GTK_LABEL (label), tvm_pango_attr_list_bold ());
gtk_frame_set_label_widget (GTK_FRAME (frame), label);
gtk_widget_show (label);
@@ -314,8 +314,8 @@ tvm_preferences_dialog_init (TvmPreferencesDialog *dialog)
gtk_grid_attach (GTK_GRID (grid), image, 0, 0, 1, 3);
gtk_widget_show (image);
- button = gtk_check_button_new_with_mnemonic (_("Play _video CDs and DVDs when "
- "inserted"));
+ button = gtk_check_button_new_with_mnemonic (_("Play _video CDs, DVDs, and "
+ "Blu-rays when inserted"));
xfconf_g_property_bind (channel, "/autoplay-video-cds/enabled", G_TYPE_BOOLEAN,
button, "active");
gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 1);
diff --git a/thunar-volman/tvm-block-device.c b/thunar-volman/tvm-block-device.c
index edb6cad..475fd03 100644
--- a/thunar-volman/tvm-block-device.c
+++ b/thunar-volman/tvm-block-device.c
@@ -327,21 +327,22 @@ tvm_block_device_autorun (TvmContext *context,
g_return_val_if_fail (G_IS_MOUNT (mount), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- /* check if autoplaying video CDs and DVDs is enabled */
+ /* check if autoplaying video disks is enabled */
autoplay = xfconf_channel_get_bool (context->channel,
"/autoplay-video-cds/enabled", FALSE);
if (autoplay)
{
- /* check if we have a video CD or video DVD here */
+ /* check if we have a video disk here */
if (tvm_file_test (mount, "vcd", G_FILE_TEST_IS_DIR)
- || tvm_file_test (mount, "video_ts", G_FILE_TEST_IS_DIR))
+ || tvm_file_test (mount, "video_ts", G_FILE_TEST_IS_DIR)
+ || tvm_file_test (mount, "bdmv", G_FILE_TEST_IS_DIR))
{
- /* determine the autoplay command for video CDs/DVDs */
+ /* determine the autoplay command for video disks */
autoplay_command = xfconf_channel_get_string (context->channel,
"/autoplay-video-cds/command",
"parole");
- /* try to spawn the preferred video CD/DVD player */
+ /* try to spawn the preferred video disk player */
result = tvm_run_command (context, mount, autoplay_command, &err);
/* free the command string */
@@ -596,8 +597,6 @@ tvm_block_device_mounted (TvmContext *context,
const gchar *summary;
const gchar *icon;
const gchar *volume_name;
- gboolean is_cdrom;
- gboolean is_dvd;
gchar *message;
gchar *decoded_name;
#endif
@@ -608,18 +607,27 @@ tvm_block_device_mounted (TvmContext *context,
g_return_if_fail (error == NULL || *error == NULL);
#ifdef HAVE_LIBNOTIFY
- /* distinguish between CDs and DVDs */
- is_cdrom = g_udev_device_get_property_as_boolean (context->device, "ID_CDROM_MEDIA_CD");
- is_dvd = g_udev_device_get_property_as_boolean (context->device, "ID_CDROM_MEDIA_DVD");
-
- if (is_cdrom || is_dvd)
+
+ icon = "drive-optical";
+
+ /* distinguish between CDs, DVDs, Blu-rays */
+ if (g_udev_device_get_property_as_boolean (context->device, "ID_CDROM_MEDIA_CD"))
+ {
+ /* generate notification info */
+ summary = _("CD mounted");
+ message = g_strdup (_("The CD was mounted automatically"));
+ }
+ else if (g_udev_device_get_property_as_boolean (context->device, "ID_CDROM_MEDIA_DVD"))
+ {
+ /* generate notification info */
+ summary = _("DVD mounted");
+ message = g_strdup (_("The DVD was mounted automatically"));
+ }
+ else if (g_udev_device_get_property_as_boolean (context->device, "ID_CDROM_MEDIA_BD"))
{
/* generate notification info */
- icon = "drive-optical";
- summary = is_cdrom ? _("CD mounted") : _("DVD mounted");
- message = g_strdup (is_cdrom
- ? _("The CD was mounted automatically")
- : _("The DVD was mounted automatically"));
+ summary = _("Blu-ray mounted");
+ message = g_strdup (_("The Blu-ray was mounted automatically"));
}
else
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list