[placeDisplay] Prefer eject over unmount when applicable

Clicking the eject button in the places display always triggers an
unmount action. In some cases like USB drives or DVDs, eject makes
more sense - it is also consistent with nautilus' behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=613405
This commit is contained in:
Florian Müllner 2010-03-20 14:52:40 +01:00
parent 8b3d4857aa
commit d1a178301f

View File

@ -93,12 +93,18 @@ PlaceDeviceInfo.prototype = {
if (!this.isRemovable()) if (!this.isRemovable())
return; return;
this._mount.unmount(0, null, Lang.bind(this, this._removeFinish)); if (this._mount.can_eject())
this._mount.eject(0, null, Lang.bind(this, this._removeFinish));
else
this._mount.unmount(0, null, Lang.bind(this, this._removeFinish));
}, },
_removeFinish: function(o, res, data) { _removeFinish: function(o, res, data) {
try { try {
this._mount.unmount_finish(res); if (this._mount.can_eject())
this._mount.eject_finish(res);
else
this._mount.unmount_finish(res);
} catch (e) { } catch (e) {
let message = _("Failed to unmount '%s'").format(o.get_name()); let message = _("Failed to unmount '%s'").format(o.get_name());
Main.overview.infoBar.setMessage(message, Main.overview.infoBar.setMessage(message,