~ubuntu-branches/ubuntu/saucy/monodevelop/saucy-proposed

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FileOperationsBuilderExtension.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2010-09-10 16:54:48 UTC
  • mfrom: (19.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100910165448-0rybfk25zd4o9431
Tags: 2.4+dfsg-2
* debian/patches/inject_Mono.Debugger.Soft_source.patch,
  debian/patches/use_system_Mono.Debugger.Soft.patch,
  debian/control:
  + Build against system Soft Debugger, since we now have a new
    enough Mono to match MonoDevelop's required API

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
using MonoDevelop.Ide.FindInFiles;
33
33
using MonoDevelop.Ide.Gui.Components;
34
34
using MonoDevelop.Core;
 
35
using System.Linq;
35
36
 
36
37
namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
37
38
{
81
82
                        FindInFilesDialog.FindInPath (path);
82
83
                }
83
84
                
84
 
                public static string TerminalCommand {
85
 
                        get {
86
 
                                return PropertyService.Get ("MonoDevelop.Shell", "gnome-terminal");
87
 
                        }
 
85
                
 
86
                
 
87
                [CommandUpdateHandler (FileCommands.OpenInTerminal)]
 
88
                [AllowMultiSelection]
 
89
                public void OnUpdateOpenInTerminal (CommandInfo info)
 
90
                {
 
91
                        info.Visible = DesktopService.CanOpenTerminal && GetCurrentDirectories ().Any ();
88
92
                }
89
93
                
90
94
                [CommandHandler (FileCommands.OpenInTerminal)]
91
95
                [AllowMultiSelection]
92
96
                public void OnOpenInTerminal ()
93
97
                {
94
 
                        HashSet<string> paths = new HashSet<string> ();
95
 
                        foreach (ITreeNavigator node in CurrentNodes) {
96
 
                                string path = GetDir (node.DataItem);
97
 
                                string terminal = TerminalCommand;
98
 
                                if (paths.Add (path))
99
 
                                        Runtime.ProcessService.StartProcess (terminal, "", path, null);
100
 
                        }
 
98
                        foreach (var dir in GetCurrentDirectories ())
 
99
                                DesktopService.OpenInTerminal (dir);
101
100
                }
102
101
                
 
102
                IEnumerable<String> GetCurrentDirectories ()
 
103
                {
 
104
                        return CurrentNodes.Select (n => GetDir (n.DataItem)) .Where (d => !string.IsNullOrEmpty (d)).Distinct ();
 
105
                }
103
106
        }
104
107
}