# Path: sunflower/plugin_base/mount_manager_extension.py
# class MountManagerExtension:
# 	"""Base class for mount manager extensions.
# 
# 	Mount manager has only one instance and is created on program startup.
# 	Methods defined in this class are called automatically by the mount manager
# 	so you need to implement them.
# 
# 	"""
# 
# 	# features extension supports
# 	features = ()
# 
# 	def __init__(self, parent, window):
# 		self._parent = parent
# 		self._window = window
# 		self._application = self._parent._application
# 
# 		# create user interface
# 		self._container = Gtk.VBox(False, 5)
# 		self._controls = Gtk.HBox(False, 5)
# 
# 		separator = Gtk.HSeparator()
# 
# 		# pack interface
# 		self._container.pack_end(separator, False, False, 0)
# 		self._container.pack_end(self._controls, False, False, 0)
# 
# 	def can_handle(self, uri):
# 		"""Returns boolean denoting if specified URI can be handled by this extension"""
# 		return False
# 
# 	def get_container(self):
# 		"""Return container widget"""
# 		return self._container
# 
# 	def get_information(self):
# 		"""Returns information about extension"""
# 		icon = None
# 		name = None
# 
# 		return icon, name
# 
# 	def unmount(self, uri):
# 		"""Method called by the mount manager for unmounting the selected URI"""
# 		pass
# 
# 	def focus_object(self):
# 		"""Method called by the mount manager for focusing main object"""
# 		pass
# 
# 	@classmethod
# 	def get_features(cls):
# 		"""Returns set of features supported by extension"""
# 		return cls.features
# 
# class ExtensionFeatures:
# 	SYSTEM_WIDE = 0


from gi.repository import Gtk, Gdk, Gio, GObject, GLib
from sunflower.parameters import Parameters
from sunflower.plugin_base.mount_manager_extension import MountManagerExtension, ExtensionFeatures
		"""Unmount selected item"""
		selection = self._list.get_selection()
		item_list, selected_iter = selection.get_selected()

		if selected_iter is not None:
			uri = item_list.get_value(selected_iter, MountsColumn.URI)

			# let all extensions know we are performing unmount
			for extension in self._window._extensions:
				if extension.can_handle(uri):
					extension.unmount(uri)

	def can_handle(self, uri):
		"""Returns boolean denoting if specified URI can be handled by this extension"""
		return True

	def get_information(self):
		"""Get extension information"""
		return 'harddrive', _('Mounts')

	def focus_object(self):
		"""Focus main list on managers request"""
		self._list.grab_focus()

	def add_mount(self, icon, name, uri, extension):
		"""Add mount to the list"""
		system_wide = True

		# check extension features
		if extension is not None:

# Path: sunflower/plugin_base/mount_manager_extension.py
# class MountManagerExtension:
# 	"""Base class for mount manager extensions.
# 
# 	Mount manager has only one instance and is created on program startup.
# 	Methods defined in this class are called automatically by the mount manager
# 	so you need to implement them.
# 
# 	"""
# 
# 	# features extension supports
# 	features = ()
# 
# 	def __init__(self, parent, window):
# 		self._parent = parent
# 		self._window = window
# 		self._application = self._parent._application
# 
# 		# create user interface
# 		self._container = Gtk.VBox(False, 5)
# 		self._controls = Gtk.HBox(False, 5)
# 
# 		separator = Gtk.HSeparator()
# 
# 		# pack interface
# 		self._container.pack_end(separator, False, False, 0)
# 		self._container.pack_end(self._controls, False, False, 0)
# 
# 	def can_handle(self, uri):
# 		"""Returns boolean denoting if specified URI can be handled by this extension"""
# 		return False
# 
# 	def get_container(self):
# 		"""Return container widget"""
# 		return self._container
# 
# 	def get_information(self):
# 		"""Returns information about extension"""
# 		icon = None
# 		name = None
# 
# 		return icon, name
# 
# 	def unmount(self, uri):
# 		"""Method called by the mount manager for unmounting the selected URI"""
# 		pass
# 
# 	def focus_object(self):
# 		"""Method called by the mount manager for focusing main object"""
# 		pass
# 
# 	@classmethod
# 	def get_features(cls):
# 		"""Returns set of features supported by extension"""
# 		return cls.features
# 
# class ExtensionFeatures:
# 	SYSTEM_WIDE = 0


# Path: sunflower/gui/mounts_manager_window.py
from gi.repository import Gtk, Gdk, Gio, GObject, GLib
from sunflower.parameters import Parameters
from sunflower.plugin_base.mount_manager_extension import MountManagerExtension, ExtensionFeatures

		"""Unmount selected item"""
		selection = self._list.get_selection()
		item_list, selected_iter = selection.get_selected()

		if selected_iter is not None:
			uri = item_list.get_value(selected_iter, MountsColumn.URI)

			# let all extensions know we are performing unmount
			for extension in self._window._extensions:
				if extension.can_handle(uri):
					extension.unmount(uri)

	def can_handle(self, uri):
		"""Returns boolean denoting if specified URI can be handled by this extension"""
		return True

	def get_information(self):
		"""Get extension information"""
		return 'harddrive', _('Mounts')

	def focus_object(self):
		"""Focus main list on managers request"""
		self._list.grab_focus()

	def add_mount(self, icon, name, uri, extension):
		"""Add mount to the list"""
		system_wide = True

		# check extension features
		if extension is not None:

			system_wide = ExtensionFeatures.SYSTEM_WIDE in extension.get_features()