3
//GNOME Do is the legal property of its developers. Please refer to the
4
//COPYRIGHT file distributed with this
7
// This program is free software; you can redistribute it and/or modify
8
// it under the terms of the GNU General Public License as published by
9
// the Free Software Foundation; either version 2 of the License, or
10
// (at your option) any later version.
12
// This program is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
// You should have received a copy of the GNU General Public License
18
// along with this program; if not, write to the Free Software
19
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
using System.Collections.Generic;
30
public class ShelfExploreAction : AbstractAction
32
public override string Name {
33
get { return Catalog.GetString ("Explore Shelf"); }
36
public override string Description {
37
get { return Catalog.GetString ("Get a list of everything in your shelf"); }
40
public override string Icon {
41
get { return "folder-saved-search"; }
44
public override Type[] SupportedItemTypes {
45
get { return new Type[] {
51
public override IItem[] Perform (IItem[] items, IItem[] modItems)
53
return (items[0] as ShelfItem).Items.ToArray ();
57
public class ShelfRemoveAction : AbstractAction
59
public override string Name {
60
get { return Catalog.GetString ("Remove From Shelf"); }
63
public override string Description {
64
get { return Catalog.GetString ("Remove Selected Item From Shelf"); }
67
public override string Icon {
68
get { return "remove"; }
71
public override bool ModifierItemsOptional {
75
public override Type[] SupportedItemTypes {
76
get { return new Type[] {
82
public override bool SupportsItem (IItem item)
84
return ShelfItemSource.InShelf (item);
87
public override IItem[] Perform (IItem[] items, IItem[] modItems)
89
if (modItems.Length == 0)
90
ShelfItemSource.RemoveFromDefault (items[0]);
92
(modItems[0] as ShelfItem).RemoveItem (items[0]);
98
public class ShelfAddAction : AbstractAction
100
public override string Name {
101
get { return Catalog.GetString ("Add To Shelf"); }
104
public override string Description {
105
get { return Catalog.GetString ("Add Selected Item to Shelf"); }
108
public override string Icon {
109
get { return "bookmark_add"; }
112
public override bool ModifierItemsOptional {
116
public override Type[] SupportedItemTypes {
117
get { return new Type[] {
123
public override bool SupportsItem (IItem item)
125
return (!(item is ShelfItem) && !ShelfItemSource.InShelf (item));
128
public override IItem[] Perform (IItem[] items, IItem[] modItems)
130
if (modItems.Length == 0) {
131
ShelfItemSource.AddToDefault (items[0]);
133
(modItems[0] as ShelfItem).AddItem (items[0]);