~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
                public override object GetParentObject (object dataObject)
96
96
                {
97
97
                        ProjectFile file = (ProjectFile) dataObject;
98
 
                        FilePath dir = !file.IsLink ? file.FilePath : file.Project.BaseDirectory.Combine (file.ProjectVirtualPath).ParentDirectory;
 
98
                        FilePath dir = !file.IsLink ? file.FilePath.ParentDirectory : file.Project.BaseDirectory.Combine (file.ProjectVirtualPath).ParentDirectory;
99
99
                        
100
100
                        if (!string.IsNullOrEmpty (file.DependsOn)) {
101
101
                                ProjectFile groupUnder = file.Project.Files.GetFile (file.FilePath.ParentDirectory.Combine (file.DependsOn));
223
223
                        
224
224
                        string question, secondaryText;
225
225
                        
226
 
                        secondaryText = GettextCatalog.GetString ("The Delete option permanently removes the file from your hard disk. Click Remove from Project if you only want to remove it from your current solution.");
 
226
                        secondaryText = GettextCatalog.GetString ("The Delete option permanently removes the file from your hard disk. " +
 
227
                                "Click Remove from Project if you only want to remove it from your current solution.");
227
228
                        
228
229
                        if (hasChildren) {
229
230
                                if (files.Count == 1)
291
292
                [CommandUpdateHandler (ViewCommands.OpenWithList)]
292
293
                public void OnOpenWithUpdate (CommandArrayInfo info)
293
294
                {
294
 
                        ProjectFile finfo = (ProjectFile) CurrentNode.DataItem;
 
295
                        var pf = (ProjectFile) CurrentNode.DataItem;
 
296
                        PopulateOpenWithViewers (info, pf.Project, pf.FilePath);
 
297
                }
 
298
                
 
299
                internal static void PopulateOpenWithViewers (CommandArrayInfo info, Project project, string filePath)
 
300
                {
 
301
                        var viewers = DisplayBindingService.GetFileViewers (filePath, project).ToList ();
 
302
                        
 
303
                        //show the default viewer first
 
304
                        var def = viewers.FirstOrDefault (v => v.CanUseAsDefault) ?? viewers.FirstOrDefault (v => v.IsExternal);
 
305
                        if (def != null) {
 
306
                                CommandInfo ci = info.Add (def.Title, def);
 
307
                                ci.Description = GettextCatalog.GetString ("Open with '{0}'", def.Title);
 
308
                                if (viewers.Count > 1)
 
309
                                        info.AddSeparator ();
 
310
                        }
 
311
                        
 
312
                        //then the builtins, followed by externals
295
313
                        FileViewer prev = null; 
296
 
                        foreach (FileViewer fv in IdeApp.Workbench.GetFileViewers (finfo.Name)) {
 
314
                        foreach (FileViewer fv in viewers) {
 
315
                                if (def != null && fv.Equals (def))
 
316
                                        continue;
297
317
                                if (prev != null && fv.IsExternal != prev.IsExternal)
298
318
                                        info.AddSeparator ();
299
319
                                CommandInfo ci = info.Add (fv.Title, fv);