Пример #1
0
        public int Compare(Gnome.Vfs.Volume b)
        {
            int raw_ret = gnome_vfs_volume_compare(Handle, b == null ? IntPtr.Zero : b.Handle);
            int ret     = raw_ret;

            return(ret);
        }
		public VolumeSource (Gnome.Vfs.Volume vol)
		{
			this.Volume = vol;
			this.Name = vol.DisplayName;

			try {
				mount_point = new Uri (vol.ActivationUri).LocalPath;
			} catch (System.Exception e) {
				System.Console.WriteLine (e);
			}

			uri = mount_point;
			
                        if (this.Icon == null)
				this.Icon = PixbufUtils.LoadThemeIcon (vol.Icon, 32);
			
			if (this.IsIPodPhoto)
				this.Icon = PixbufUtils.LoadThemeIcon ("gnome-dev-ipod", 32);

			if (this.Icon == null && this.IsCamera)
				this.Icon = PixbufUtils.LoadThemeIcon ("gnome-dev-media-cf", 32);

			try {
				if (this.Icon == null)
					this.Icon = new Gdk.Pixbuf (vol.Icon);
			} catch (System.Exception e) {
				System.Console.WriteLine (e.ToString ());
			}
		}
Пример #3
0
        public Gnome.Vfs.Volume GetVolumeById(ulong id)
        {
            IntPtr raw_ret = gnome_vfs_volume_monitor_get_volume_by_id(Handle, new UIntPtr(id));

            Gnome.Vfs.Volume ret = GLib.Object.GetObject(raw_ret) as Gnome.Vfs.Volume;
            return(ret);
        }
Пример #4
0
        public Gnome.Vfs.Volume GetVolumeForPath(string path)
        {
            IntPtr native_path = GLib.Marshaller.StringToPtrGStrdup(path);
            IntPtr raw_ret     = gnome_vfs_volume_monitor_get_volume_for_path(Handle, native_path);

            Gnome.Vfs.Volume ret = GLib.Object.GetObject(raw_ret) as Gnome.Vfs.Volume;
            GLib.Marshaller.Free(native_path);
            return(ret);
        }
Пример #5
0
 protected virtual void OnVolumePreUnmount(Gnome.Vfs.Volume volume)
 {
     GLib.Value      ret             = GLib.Value.Empty;
     GLib.ValueArray inst_and_params = new GLib.ValueArray(2);
     GLib.Value[]    vals            = new GLib.Value [2];
     vals [0] = new GLib.Value(this);
     inst_and_params.Append(vals [0]);
     vals [1] = new GLib.Value(volume);
     inst_and_params.Append(vals [1]);
     g_signal_chain_from_overridden(inst_and_params.ArrayPtr, ref ret);
     foreach (GLib.Value v in vals)
     {
         v.Dispose();
     }
 }
		public VolumeSource (Gnome.Vfs.Volume vol)
		{
			this.Volume = vol;
			this.Name = vol.DisplayName;

			try {
				mount_point = new Uri (vol.ActivationUri).LocalPath;
			} catch (System.Exception e) {
				System.Console.WriteLine (e);
			}

			uri = mount_point;
			
                        if (this.Icon == null)
				this.Icon = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, vol.Icon, 32, (Gtk.IconLookupFlags)0);
			
			if (this.IsIPodPhoto)
				this.Icon = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, "multimedia-player", 32, (Gtk.IconLookupFlags)0);

			if (this.Icon == null && this.IsCamera)
				this.Icon = GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, "media-flash", 32, (Gtk.IconLookupFlags)0);

			try {
				if (this.Icon == null)
					this.Icon = new Gdk.Pixbuf (vol.Icon);
			} catch (System.Exception e) {
				System.Console.WriteLine (e.ToString ());
			}
		}