~cszikszoy/do-plugins/pastebin

« back to all changes in this revision

Viewing changes to Tomboy/src/NewNoteAction.cs

* Cleanup Tomboy.
* Add Firefox.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//  RhythmboxPlayCommand.cs
 
1
//  NewNoteAction.cs
2
2
//
3
3
//  GNOME Do is the legal property of its developers, whose names are too numerous
4
4
//  to list here.  Please refer to the COPYRIGHT file distributed with this
24
24
 
25
25
namespace Tomboy
26
26
{       
27
 
        public class TomboyNewNoteCommand : IAction
 
27
        public class NewNoteAction : AbstractAction
28
28
        {
29
 
                
30
 
                public TomboyNewNoteCommand()
31
 
                {
32
 
                }
33
 
                
34
 
                public string Name {
 
29
                public override string Name {
35
30
                        get { return "New Tomboy Note"; }
36
31
                }
37
32
                
38
 
                public string Description {
 
33
                public override string Description {
39
34
                        get { return "Create a new empty Tomboy note"; }
40
35
                }
41
36
                
42
 
                public string Icon {
 
37
                public override string Icon {
43
38
                        get { return "tomboy"; }
44
39
                }
45
40
                
46
 
                public Type[] SupportedItemTypes {
 
41
                public override Type[] SupportedItemTypes {
47
42
                        get {
48
43
                                return new Type[] {
49
44
                                        typeof (ITextItem),
51
46
                        }
52
47
                }
53
48
                
54
 
                public Type[] SupportedModifierItemTypes {
55
 
                        get { return null; }
56
 
                }
57
 
                
58
 
            public bool ModifierItemsOptional {
59
 
                  get { return false; }
60
 
            }
61
 
 
62
 
                public bool SupportsItem (IItem item) {
63
 
                        return true;
64
 
                }
65
 
                
66
 
            public bool SupportsModifierItemForItems (IItem[] items, IItem modItem) {
67
 
              return false;
68
 
            }
69
 
                        
70
 
            public IItem[] DynamicModifierItemsForItem (IItem item) {
71
 
              return null;
72
 
            }
73
 
                
74
 
                public IItem[] Perform (IItem[] items, IItem[] modifierItems)
 
49
                public override IItem[] Perform (IItem[] items, IItem[] modifierItems)
75
50
                {
76
 
                        TextItemPerform(items[0] as ITextItem);
77
 
                        return null;
 
51
                        return ITextItemPerform (items [0] as ITextItem);
78
52
                }
79
53
                
80
 
                protected IItem[] TextItemPerform(ITextItem item) {
81
 
                        TomboyDBus tomboy_instance = new TomboyDBus();
82
 
                        // create a new note with the title filled in
83
 
                        tomboy_instance.CreateNewNote(item.Text);
 
54
                protected IItem [] ITextItemPerform (ITextItem item) {
 
55
                        TomboyDBus tb = new TomboyDBus ();
 
56
                        tb.CreateNewNote (item.Text);
84
57
                        return null;
85
58
                }
86
59
        }