[Thunar-dev] How to use the eject function

2007-12-11 Thread Tino Keitel
Hi,

the changelog for Thunar 0.9.0 mentions this:

---
Use the correct HAL property to determine whether a given volume or
device requires eject (Bug #3119).
---

As I wasn't aware that #3119 was already fixed in SVN, I opened #3466
and created my own fix. It asks HAL for the eject flag:

+  /* an eject menu entry is shown if this returns true */
+  volume_hal-eject = libhal_drive_requires_eject (hd);

The SVN changeset for revision 25647 shows that Benny did it in the
same way:

+  /* check if the drive requires eject */
+  volume_hal-requires_eject = libhal_drive_requires_eject (hd);

However, all the devices that previously had an eject button in the
context menu don't have it anymore with 4.4.2. I checked the lshal
output and the eject property is still there for the device:

storage.requires_eject = true  (bool)

I noticed that the changes done by Benny use a function
thunar_vfs_volume_is_ejectable(), whereas I just modified
thunar_vfs_volume_is_disc() to return true for devices with the eject
flag.

I assume that the new eject feature in 4.4.2 is tested and working, I
just don't know _how_ it works. Can anyone enlighten me what I have to
do to get the eject button back for my iPod, card reader etc.?

Regards,
Tino
___
Thunar-dev mailing list
Thunar-dev@xfce.org
http://foo-projects.org/mailman/listinfo/thunar-dev


Re: [Thunar-dev] How to use the eject function

2007-12-11 Thread Benedikt Meurer
Tino Keitel wrote:
 Hi,
 
 the changelog for Thunar 0.9.0 mentions this:
 
 ---
 Use the correct HAL property to determine whether a given volume or
 device requires eject (Bug #3119).
 ---
 
 As I wasn't aware that #3119 was already fixed in SVN, I opened #3466
 and created my own fix. It asks HAL for the eject flag:
 
 +  /* an eject menu entry is shown if this returns true */
 +  volume_hal-eject = libhal_drive_requires_eject (hd);
 
 The SVN changeset for revision 25647 shows that Benny did it in the
 same way:
 
 +  /* check if the drive requires eject */
 +  volume_hal-requires_eject = libhal_drive_requires_eject (hd);
 
 However, all the devices that previously had an eject button in the
 context menu don't have it anymore with 4.4.2. I checked the lshal
 output and the eject property is still there for the device:
 
 storage.requires_eject = true  (bool)
 
 I noticed that the changes done by Benny use a function
 thunar_vfs_volume_is_ejectable(), whereas I just modified
 thunar_vfs_volume_is_disc() to return true for devices with the eject
 flag.
 
 I assume that the new eject feature in 4.4.2 is tested and working, I
 just don't know _how_ it works. Can anyone enlighten me what I have to
 do to get the eject button back for my iPod, card reader etc.?

Hm, there seems to be an error in thunar-shortcuts-view.c. The Eject
Volume action is only added for discs. Try the attached patch.

 Regards,
 Tino

Benedikt
Index: thunar-shortcuts-view.c
===
--- thunar-shortcuts-view.c	(revision 26428)
+++ thunar-shortcuts-view.c	(working copy)
@@ -834,13 +834,12 @@
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
   gtk_widget_show (item);
 
-  /* check if the volume is a disc */
-  if (thunar_vfs_volume_is_disc (volume))
+  /* check if the volume is ejectable */
+  if (thunar_vfs_volume_is_ejectable (volume))
 {
   /* append the Eject Volume menu action */
   item = gtk_image_menu_item_new_with_mnemonic (_(E_ject Volume));
   g_signal_connect_swapped (G_OBJECT (item), activate, G_CALLBACK (thunar_shortcuts_view_eject), view);
-  gtk_widget_set_sensitive (item, thunar_vfs_volume_is_ejectable (volume));
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
   gtk_widget_show (item);
 }
___
Thunar-dev mailing list
Thunar-dev@xfce.org
http://foo-projects.org/mailman/listinfo/thunar-dev


Re: [Thunar-dev] How to use the eject function

2007-12-11 Thread Tino Keitel
On Tue, Dec 11, 2007 at 09:29:24 +0100, Benedikt Meurer wrote:

[...]

 Hm, there seems to be an error in thunar-shortcuts-view.c. The Eject
 Volume action is only added for discs. Try the attached patch.

Thanks for the quick reply, I'll try the patch and report back.

Regards,
Tino
___
Thunar-dev mailing list
Thunar-dev@xfce.org
http://foo-projects.org/mailman/listinfo/thunar-dev


Re: [Thunar-dev] How to use the eject function

2007-12-11 Thread Tino Keitel
On Tue, Dec 11, 2007 at 09:29:24 +0100, Benedikt Meurer wrote:

[...]

 Hm, there seems to be an error in thunar-shortcuts-view.c. The Eject
 Volume action is only added for discs. Try the attached patch.

While looking at the source, I wondered if the same patch is necessary
for thunar-tree-view.c, too.

Regards,
Tino
___
Thunar-dev mailing list
Thunar-dev@xfce.org
http://foo-projects.org/mailman/listinfo/thunar-dev


Re: [Thunar-dev] How to use the eject function

2007-12-11 Thread Benedikt Meurer
Tino Keitel wrote:
 On Tue, Dec 11, 2007 at 09:29:24 +0100, Benedikt Meurer wrote:
 
 [...]
 
 Hm, there seems to be an error in thunar-shortcuts-view.c. The Eject
 Volume action is only added for discs. Try the attached patch.
 
 While looking at the source, I wondered if the same patch is necessary
 for thunar-tree-view.c, too.

Of course, but first, let's see if that works for the shortcuts pane.

 Regards,
 Tino

Benedikt
___
Thunar-dev mailing list
Thunar-dev@xfce.org
http://foo-projects.org/mailman/listinfo/thunar-dev


Re: [Thunar-dev] How to use the eject function

2007-12-11 Thread Benedikt Meurer
Tino Keitel wrote:
 I can confirm that I have no Eject button in the shortcuts pane
 without the patch, and and Eject button with the patch.

Committed. Bug Brian to fix xfdesktop as well.

 Regards,
 Tino

Benedikt
___
Thunar-dev mailing list
Thunar-dev@xfce.org
http://foo-projects.org/mailman/listinfo/thunar-dev


Re: [Thunar-dev] How to use the eject function

2007-12-11 Thread Tino Keitel
On Tue, Dec 11, 2007 at 20:31:34 +0100, Benedikt Meurer wrote:
 Tino Keitel wrote:
  I can confirm that I have no Eject button in the shortcuts pane
  without the patch, and and Eject button with the patch.
 
 Committed. Bug Brian to fix xfdesktop as well.

I patched xfdesktop in a minimal way (see the attachment), which lead
to the following inconsistency:

In thunar, either Eject or Unmount is shown in the menu, depending
on thunar_vfs_volume_is_ejectable(). In xfdesktop, both Eject and
Unmount are shown when thunar_vfs_volume_is_ejectable() returns
true.

What behaviour should be preferred?

Regards,
Tino
___
Thunar-dev mailing list
Thunar-dev@xfce.org
http://foo-projects.org/mailman/listinfo/thunar-dev


Re: [Thunar-dev] How to use the eject function

2007-12-11 Thread Tino Keitel
On Wed, Dec 12, 2007 at 00:38:55 +0100, Tino Keitel wrote:
 On Tue, Dec 11, 2007 at 20:31:34 +0100, Benedikt Meurer wrote:
  Tino Keitel wrote:
   I can confirm that I have no Eject button in the shortcuts pane
   without the patch, and and Eject button with the patch.
  
  Committed. Bug Brian to fix xfdesktop as well.
 
 I patched xfdesktop in a minimal way (see the attachment), which lead

Forgot the attachment.

Here it is.

Regards,
Tino
diff -ru xfdesktop4-4.4.2.orig/src/xfdesktop-volume-icon.c xfdesktop4-4.4.2/src/xfdesktop-volume-icon.c
--- xfdesktop4-4.4.2.orig/src/xfdesktop-volume-icon.c	2007-11-17 20:31:41.0 +0100
+++ xfdesktop4-4.4.2/src/xfdesktop-volume-icon.c	2007-12-11 22:14:46.005592273 +0100
@@ -573,8 +573,7 @@
  icon);
 }
 
-if(thunar_vfs_volume_is_disc(volume)
-thunar_vfs_volume_is_ejectable(volume))
+if(thunar_vfs_volume_is_ejectable(volume))
 {
 mi = gtk_image_menu_item_new_with_mnemonic(_(E_ject Volume));
 gtk_widget_show(mi);
___
Thunar-dev mailing list
Thunar-dev@xfce.org
http://foo-projects.org/mailman/listinfo/thunar-dev


Re: [Thunar-dev] How to use the eject function

2007-12-11 Thread Brian J. Tarricone
Tino Keitel wrote:
 On Tue, Dec 11, 2007 at 20:31:34 +0100, Benedikt Meurer wrote:
 Tino Keitel wrote:
 I can confirm that I have no Eject button in the shortcuts pane
 without the patch, and and Eject button with the patch.
 Committed. Bug Brian to fix xfdesktop as well.
 
 I patched xfdesktop in a minimal way (see the attachment), which lead
 to the following inconsistency:
 
 In thunar, either Eject or Unmount is shown in the menu, depending
 on thunar_vfs_volume_is_ejectable(). In xfdesktop, both Eject and
 Unmount are shown when thunar_vfs_volume_is_ejectable() returns
 true.
 
 What behaviour should be preferred?

Eject.  Feel free to cook up a patch, open a bug on bugzilla, and attach it.

-brian
___
Thunar-dev mailing list
Thunar-dev@xfce.org
http://foo-projects.org/mailman/listinfo/thunar-dev


Re: [Thunar-dev] How to use the eject function

2007-12-11 Thread Tino Keitel
On Tue, Dec 11, 2007 at 15:44:36 -0800, Brian J. Tarricone wrote:
 Tino Keitel wrote:
  On Tue, Dec 11, 2007 at 20:31:34 +0100, Benedikt Meurer wrote:
  Tino Keitel wrote:
  I can confirm that I have no Eject button in the shortcuts pane
  without the patch, and and Eject button with the patch.
  Committed. Bug Brian to fix xfdesktop as well.
  
  I patched xfdesktop in a minimal way (see the attachment), which lead
  to the following inconsistency:
  
  In thunar, either Eject or Unmount is shown in the menu, depending
  on thunar_vfs_volume_is_ejectable(). In xfdesktop, both Eject and
  Unmount are shown when thunar_vfs_volume_is_ejectable() returns
  true.
  
  What behaviour should be preferred?
 
 Eject.  Feel free to cook up a patch, open a bug on bugzilla, and attach it.

Done.

Btw., the 4.4.2 version is missing in Bugzilla.

Regards,
Tino
___
Thunar-dev mailing list
Thunar-dev@xfce.org
http://foo-projects.org/mailman/listinfo/thunar-dev


Re: [Thunar-dev] How to use the eject function

2007-12-11 Thread Tino Keitel
On Wed, Dec 12, 2007 at 01:18:46 +0100, Tino Keitel wrote:
 Done.

It's bug #3738.
___
Thunar-dev mailing list
Thunar-dev@xfce.org
http://foo-projects.org/mailman/listinfo/thunar-dev