Commit Graph

7 Commits

Author SHA1 Message Date
Cosimo Cecchi
5c1dd4ea18 autorun: prefer Safe Removal over eject/unmount if possible
Basically do what NautilusPlacesSidebar does with the drive/volume/mount
eject/unmount/stop priorities.

We follow this pattern:
- always prefer Safely Remove if available (i.e. drive.stop())
- fallback to ejecting the mount/volume/drive if that's not possible
- finally, fallback to unmounting the mount if even eject is not
  available

This also means we don't care about the distinction between
Stop/Eject/Unmount at this level. Disk Utility (or Nautilus) are
available for those who want that degree of control, but the common case
here should do the most useful action without presenting the choice.

https://bugzilla.gnome.org/show_bug.cgi?id=653520
2011-07-13 14:39:36 -04:00
Cosimo Cecchi
297d1356a2 mount-operation: add a ShellMountOperation implementation
Ideally, this would be an entirely-JS implementation, but we have a
couple of issues with gjs and gobject-introspection to work around, so
we need a ShellMountOperation class for the time being.

This first commit implements the show-processes dialog, with a system
modal style very similar to the EndSession dialog.
Implementations of ask-question and ask-password will follow shortly.

https://bugzilla.gnome.org/show_bug.cgi?id=653520
2011-07-13 14:39:36 -04:00
Cosimo Cecchi
98327b0c13 automount: only autorun volumes marked as allowed
Port code from g-s-d to mark volumes as allowed for autorun, and check
for it when running the notification.

https://bugzilla.gnome.org/show_bug.cgi?id=653520
2011-07-13 14:39:35 -04:00
Cosimo Cecchi
6786aee5ed autorun: integrate with the shell sniffer process
If possible, use the results from the sniffer process in order to have
less-generic alternatives to the file manager in the proposed autorun
choices.

https://bugzilla.gnome.org/show_bug.cgi?id=653520
2011-07-13 14:39:35 -04:00
Cosimo Cecchi
436dd6ee8c autorun: follow per content-type gsettings preferences for autorun
Autorun preferences can be fine-tweaked at the content-type level from
the System Settings 'Removable Media' panel.
Use those settings to figure out the default action for newly-mounted
mounts.

https://bugzilla.gnome.org/show_bug.cgi?id=653520
2011-07-13 14:39:35 -04:00
Cosimo Cecchi
acc053302d automount: add an AutomountManager class
The AutomountManager class is the low-level counterpart of the
previously introduced AutorunManager, and takes care of extracting the
list of valid mounts from a GVolume or a GDrive and mounting them,
provided a number of conditions and requirements are met.

AutomountManager also keeps track of the current session availability
(using the ConsoleKit and gnome-screensaver DBus interfaces) and
inhibits mounting if the current session is locked, or another session
is in use instead.

https://bugzilla.gnome.org/show_bug.cgi?id=653520
2011-07-13 14:39:35 -04:00
Cosimo Cecchi
534b371d42 autorun: add an AutorunManager class
AutorunManager is a class that takes care of displaying and managing
notifications and UI for storage devices.

When a mount appears and a number of conditions are satisified, a
transient notification will be displayed to immediately interact with
the device. AutorunTransientDispatcher is the object that takes care of
showing/hiding the notification sources as devices appear/disappear.

Likewise, current mounts are kept in a list and presented within a
list in a resident notification, handled by AutorunResidentSource.

https://bugzilla.gnome.org/show_bug.cgi?id=653520
2011-07-13 14:39:35 -04:00