~ubuntu-branches/ubuntu/precise/gnome-do/precise-proposed

« back to all changes in this revision

Viewing changes to Do.Addins/src/Do.Universe/OpenWithAction.cs

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2008-09-14 10:09:40 UTC
  • mto: (0.1.8 sid)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20080914100940-kyghudg7py14bu2z
Tags: upstream-0.6.0.0
ImportĀ upstreamĀ versionĀ 0.6.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
using System;
22
22
using System.Collections.Generic;
 
23
using Mono.Unix;
23
24
 
24
25
using Do.Addins;
25
26
 
26
 
namespace Do.Universe
27
 
{
 
27
namespace Do.Universe {
 
28
 
28
29
        /// <summary>
29
30
        /// A command providing "open with..." semantics to file items.
30
31
        /// </summary>
31
 
        public abstract class OpenWithAction : AbstractAction 
32
 
        {
 
32
        public class OpenWithAction : AbstractAction {
 
33
 
33
34
                public OpenWithAction ()
34
35
                {
35
36
                }
36
37
                
37
 
                public override string Name
38
 
                {
39
 
                        get { return "Open With..."; }
40
 
                }
41
 
                
42
 
                public override string Description
43
 
                {
44
 
                        get { return "Opens files in specific applications."; }
45
 
                }
46
 
                
47
 
                public override string Icon
48
 
                {
 
38
                public override string Name {
 
39
                        get { return Catalog.GetString ("Open With..."); }
 
40
                }
 
41
                
 
42
                public override string Description {
 
43
                        get { return Catalog.GetString ("Opens files in specific applications."); }
 
44
                }
 
45
                
 
46
                public override string Icon {
49
47
                        get { return "gtk-open"; }
50
48
                }
51
49
                
52
 
                public override Type[] SupportedItemTypes
53
 
                {
 
50
                public override Type[] SupportedItemTypes {
54
51
                        get {
55
52
                                return new Type[] {
56
53
                                        typeof (IFileItem),
58
55
                        }
59
56
                }
60
57
                
61
 
                public override Type[] SupportedModifierItemTypes
62
 
                {
 
58
                public override Type[] SupportedModifierItemTypes {
63
59
                        get {
64
60
                                return new Type[] {
65
61
                                        typeof (ApplicationItem),
71
67
                {
72
68
                        List<string> uris;
73
69
 
74
 
                        if (modifierItems.Length > 0) {
75
 
                                uris = new List<string> ();
76
 
                                foreach (IItem item in items) {
77
 
                                        uris.Add ((item as IFileItem).URI);
78
 
                                }
79
 
                                (modifierItems[0] as ApplicationItem).RunWithURIs (uris);
 
70
                        uris = new List<string> ();
 
71
                        foreach (IItem item in items) {
 
72
                                uris.Add ((item as IFileItem).URI);
80
73
                        }
 
74
                        (modifierItems [0] as ApplicationItem).RunWithUris (uris);
81
75
                        return null;
82
76
                }
83
77
        }