diff options
84 files changed, 398 insertions, 173 deletions
diff --git a/extras/AspNetEdit/AspNetEdit.Integration/AspNetEditViewContent.cs b/extras/AspNetEdit/AspNetEdit.Integration/AspNetEditViewContent.cs index eae20657a3..1f27e608e8 100644 --- a/extras/AspNetEdit/AspNetEdit.Integration/AspNetEditViewContent.cs +++ b/extras/AspNetEdit/AspNetEdit.Integration/AspNetEditViewContent.cs @@ -183,7 +183,7 @@ namespace AspNetEdit.Integration string codeBehind = null; if (viewContent.Project != null) { string mimeType = - MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeForUri (viewContent.ContentName); + DesktopService.GetMimeTypeForUri (viewContent.ContentName); MonoDevelop.AspNet.Parser.AspNetParsedDocument cu = MonoDevelop.Projects.Dom.Parser.ProjectDomService.Parse ( diff --git a/extras/AspNetEdit/ChangeLog b/extras/AspNetEdit/ChangeLog index a5ff41fa80..b2bbb9c6a6 100644 --- a/extras/AspNetEdit/ChangeLog +++ b/extras/AspNetEdit/ChangeLog @@ -1,3 +1,8 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * AspNetEdit.Integration/AspNetEditViewContent.cs: Use the new + DesktopService instead of PlatformService. + 2009-05-19 Lluis Sanchez Gual <lluis@novell.com> * AspNetEdit.csproj: Flush. diff --git a/extras/GtkSourceViewEditor/MonoDevelop.SourceEditor.Gui/SourceEditorDisplayBinding.cs b/extras/GtkSourceViewEditor/MonoDevelop.SourceEditor.Gui/SourceEditorDisplayBinding.cs index f9db11cb18..5999e3294e 100644 --- a/extras/GtkSourceViewEditor/MonoDevelop.SourceEditor.Gui/SourceEditorDisplayBinding.cs +++ b/extras/GtkSourceViewEditor/MonoDevelop.SourceEditor.Gui/SourceEditorDisplayBinding.cs @@ -49,7 +49,7 @@ namespace MonoDevelop.SourceEditor.Gui { if (String.IsNullOrEmpty (mimetype)) return false; - return IdeApp.Services.PlatformService.GetMimeTypeIsText (mimetype); + return DesktopService.GetMimeTypeIsText (mimetype); } public virtual IViewContent CreateContentForFile (string fileName) @@ -417,7 +417,7 @@ namespace MonoDevelop.SourceEditor.Gui vfsname = vfsname.Replace ("%", "%25"); vfsname = vfsname.Replace ("#", "%23"); vfsname = vfsname.Replace ("?", "%3F"); - se.Buffer.LoadFile (fileName, IdeApp.Services.PlatformService.GetMimeTypeForUri (vfsname), encoding); + se.Buffer.LoadFile (fileName, DesktopService.GetMimeTypeForUri (vfsname), encoding); ContentName = fileName; lastSaveTime = File.GetLastWriteTime (ContentName); InitializeFormatter (); diff --git a/main/src/addins/AspNetAddIn/ChangeLog b/main/src/addins/AspNetAddIn/ChangeLog index 3f82aedcd7..e1e998fc82 100644 --- a/main/src/addins/AspNetAddIn/ChangeLog +++ b/main/src/addins/AspNetAddIn/ChangeLog @@ -1,3 +1,10 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.AspNet/AspNetToolboxNode.cs: + * MonoDevelop.AspNet.Gui/BrowserLauncher.cs: + * MonoDevelop.AspNet.Gui/AspNetFileSelector.cs: Use the new + DesktopService instead of PlatformService. + 2009-06-15 Michael Hutchinson <mhutchinson@novell.com> * MonoDevelop.AspNet/WebTypeManager.cs: Track assembly lookup diff --git a/main/src/addins/AspNetAddIn/MonoDevelop.AspNet.Gui/AspNetFileSelector.cs b/main/src/addins/AspNetAddIn/MonoDevelop.AspNet.Gui/AspNetFileSelector.cs index b2f698e042..c33b588980 100644 --- a/main/src/addins/AspNetAddIn/MonoDevelop.AspNet.Gui/AspNetFileSelector.cs +++ b/main/src/addins/AspNetAddIn/MonoDevelop.AspNet.Gui/AspNetFileSelector.cs @@ -150,7 +150,7 @@ namespace MonoDevelop.AspNet.Gui CellRendererPixbuf pixRenderer = (CellRendererPixbuf) cell; ProjectFile pf = (ProjectFile)tree_model.GetValue (iter, 0); Gdk.Pixbuf oldBuf = pixRenderer.Pixbuf; - pixRenderer.Pixbuf = IdeApp.Services.PlatformService.GetPixbufForFile (pf.FilePath, Gtk.IconSize.Menu); + pixRenderer.Pixbuf = DesktopService.GetPixbufForFile (pf.FilePath, Gtk.IconSize.Menu); if (oldBuf != null) oldBuf.Dispose (); } diff --git a/main/src/addins/AspNetAddIn/MonoDevelop.AspNet.Gui/BrowserLauncher.cs b/main/src/addins/AspNetAddIn/MonoDevelop.AspNet.Gui/BrowserLauncher.cs index 4a405036aa..cd7f21ce9d 100644 --- a/main/src/addins/AspNetAddIn/MonoDevelop.AspNet.Gui/BrowserLauncher.cs +++ b/main/src/addins/AspNetAddIn/MonoDevelop.AspNet.Gui/BrowserLauncher.cs @@ -44,7 +44,7 @@ namespace MonoDevelop.AspNet.Gui public static void LaunchDefaultBrowser (string url) { - MonoDevelop.Core.Gui.Services.PlatformService.ShowUrl (url); + MonoDevelop.Core.Gui.DesktopService.ShowUrl (url); } public static BrowserLauncherOperation LaunchWhenReady (string url) diff --git a/main/src/addins/AspNetAddIn/MonoDevelop.AspNet/AspNetToolboxNode.cs b/main/src/addins/AspNetAddIn/MonoDevelop.AspNet/AspNetToolboxNode.cs index 14f90216d0..d8341be947 100644 --- a/main/src/addins/AspNetAddIn/MonoDevelop.AspNet/AspNetToolboxNode.cs +++ b/main/src/addins/AspNetAddIn/MonoDevelop.AspNet/AspNetToolboxNode.cs @@ -31,6 +31,7 @@ using System.ComponentModel; using System.Drawing.Design; using MonoDevelop.Core; +using MonoDevelop.Core.Gui; using MonoDevelop.DesignerSupport.Toolbox; using MonoDevelop.Core.Serialization; using MonoDevelop.Core.Assemblies; @@ -121,7 +122,7 @@ namespace MonoDevelop.AspNet return tag; //look up the control prefix - string mime = MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeForUri (path); + string mime = DesktopService.GetMimeTypeForUri (path); MonoDevelop.AspNet.Parser.AspNetParsedDocument cu = MonoDevelop.Projects.Dom.Parser.ProjectDomService.Parse (project, path, mime) as MonoDevelop.AspNet.Parser.AspNetParsedDocument; diff --git a/main/src/addins/CBinding/ChangeLog b/main/src/addins/CBinding/ChangeLog index 21dbdd7a09..4fae53f15b 100644 --- a/main/src/addins/CBinding/ChangeLog +++ b/main/src/addins/CBinding/ChangeLog @@ -1,5 +1,10 @@ 2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + * Parser/TagDatabaseManager.cs: Use the new DesktopService + instead of PlatformService. + +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + * Project/CProject.cs: Track api changes. 2009-06-13 Mike Krüger <mkrueger@novell.com> diff --git a/main/src/addins/CBinding/Parser/TagDatabaseManager.cs b/main/src/addins/CBinding/Parser/TagDatabaseManager.cs index a747ae770c..8dc50de97c 100644 --- a/main/src/addins/CBinding/Parser/TagDatabaseManager.cs +++ b/main/src/addins/CBinding/Parser/TagDatabaseManager.cs @@ -82,7 +82,7 @@ namespace CBinding.Parser get { if (!checkedCtagsInstalled) { checkedCtagsInstalled = true; - if (IdeApp.Services.PlatformService.Name.Equals ("OSX")) { + if (PropertyService.IsMac) { return false; } try { diff --git a/main/src/addins/CSharpBinding/ChangeLog b/main/src/addins/CSharpBinding/ChangeLog index 271f0651f1..71437f0996 100644 --- a/main/src/addins/CSharpBinding/ChangeLog +++ b/main/src/addins/CSharpBinding/ChangeLog @@ -1,3 +1,8 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * Parser/CSharpFormatter.cs: Use the new DesktopService + instead of PlatformService. + 2009-06-23 Mike Krüger <mkrueger@novell.com> * Parser/CSharpFormatter.cs: Worked on formatter. diff --git a/main/src/addins/CSharpBinding/Parser/CSharpFormatter.cs b/main/src/addins/CSharpBinding/Parser/CSharpFormatter.cs index be1c29e015..2327bcae92 100644 --- a/main/src/addins/CSharpBinding/Parser/CSharpFormatter.cs +++ b/main/src/addins/CSharpBinding/Parser/CSharpFormatter.cs @@ -240,7 +240,7 @@ namespace CSharpBinding.Parser if (string.IsNullOrEmpty (input)) return input; - IEnumerable<string> types = MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeInheritanceChain (mimeType); + IEnumerable<string> types = MonoDevelop.Core.Gui.DesktopService.GetMimeTypeInheritanceChain (mimeType); TextStylePolicy currentPolicy = policyParent != null ? policyParent.Policies.Get<TextStylePolicy> (types) : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> (types); CSharpFormattingPolicy codePolicy = policyParent != null ? policyParent.Policies.Get<CSharpFormattingPolicy> (types) : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<CSharpFormattingPolicy> (types); diff --git a/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs b/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs index 9fde773ec9..29bb0a5e83 100644 --- a/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs +++ b/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs @@ -46,8 +46,7 @@ namespace MonoDevelop.ChangeLogAddIn { Build (); - Pango.FontDescription font = Pango.FontDescription.FromString ( - MonoDevelop.Core.Gui.Services.PlatformService.DefaultMonospaceFont); + Pango.FontDescription font = Pango.FontDescription.FromString (DesktopService.DefaultMonospaceFont); textview.ModifyFont (font); textview.WrapMode = WrapMode.None; textview.AcceptsTab = true; diff --git a/main/src/addins/ChangeLogAddIn/ChangeLog b/main/src/addins/ChangeLogAddIn/ChangeLog index 66eb4ed68c..89955df232 100644 --- a/main/src/addins/ChangeLogAddIn/ChangeLog +++ b/main/src/addins/ChangeLogAddIn/ChangeLog @@ -1,3 +1,8 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * AddLogEntryDialog.cs: Use the new DesktopService instead of + PlatformService. + 2009-06-09 Lluis Sanchez Gual <lluis@novell.com> * OldChangeLogData.cs: Track api changes. diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/ChangeLog b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/ChangeLog index 75374f0381..56065436e7 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/ChangeLog +++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/ChangeLog @@ -1,5 +1,10 @@ 2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + * MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs: Use + the new DesktopService instead of PlatformService. + +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + * MonoDevelop.Deployment.Linux/LinuxDeployExtension.cs: * MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs: Track api changes. diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs index bb13752fbc..fc07a3f54a 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs @@ -5,6 +5,7 @@ using System.Collections.Specialized; using System.Xml; using Gtk; using MonoDevelop.Core; +using MonoDevelop.Core.Gui; using MonoDevelop.Ide.Gui; namespace MonoDevelop.Deployment.Linux @@ -130,7 +131,7 @@ namespace MonoDevelop.Deployment.Linux sortedmt.Sort (); foreach (string mt in sortedmt) { - string desc = IdeApp.Services.PlatformService.GetMimeTypeDescription (mt); + string desc = DesktopService.GetMimeTypeDescription (mt); storeMimeTypes.AppendValues (mt, desc); } @@ -302,7 +303,7 @@ namespace MonoDevelop.Deployment.Linux if (!entry.MimeTypes.Contains (mt)) { entry.MimeTypes.Add (mt); storeMimeTypes.SetValue (iter, 0, mt); - storeMimeTypes.SetValue (iter, 1, IdeApp.Services.PlatformService.GetMimeTypeDescription (mt)); + storeMimeTypes.SetValue (iter, 1, DesktopService.GetMimeTypeDescription (mt)); if (!string.IsNullOrEmpty (oldmt)) // It is a modification. Remove the old name. diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/ChangeLog b/main/src/addins/Deployment/MonoDevelop.Deployment/ChangeLog index 46ef88d59d..2dfb93e66d 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/ChangeLog +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/ChangeLog @@ -1,3 +1,9 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs: + * MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs: + Use the new DesktopService instead of PlatformService. + 2009-05-19 Lluis Sanchez Gual <lluis@novell.com> * MonoDevelop.Deployment\DeployFile.cs: Use the new FilePath diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs index 8814347496..bef8681edd 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs @@ -37,7 +37,6 @@ using MonoDevelop.Components.Commands; using MonoDevelop.Ide.Commands; using MonoDevelop.Core.Gui; using MonoDevelop.Deployment.Gui; -using GuiServices = MonoDevelop.Core.Gui.Services; using MonoDevelop.Ide.Gui.Components; namespace MonoDevelop.Deployment.NodeBuilders diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs index 0dbf14e14b..58fd5956e1 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs @@ -37,7 +37,6 @@ using MonoDevelop.Components.Commands; using MonoDevelop.Ide.Commands; using MonoDevelop.Core.Gui; using MonoDevelop.Deployment.Gui; -using GuiServices = MonoDevelop.Core.Gui.Services; using MonoDevelop.Ide.Gui.Components; namespace MonoDevelop.Deployment.NodeBuilders diff --git a/main/src/addins/MonoDevelop.Debugger/ChangeLog b/main/src/addins/MonoDevelop.Debugger/ChangeLog index 0eaf37e731..add1dfa7db 100644 --- a/main/src/addins/MonoDevelop.Debugger/ChangeLog +++ b/main/src/addins/MonoDevelop.Debugger/ChangeLog @@ -1,3 +1,8 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.Debugger/ImmediatePad.cs: Use the new + DesktopService instead of PlatformService. + 2009-06-12 Lluis Sanchez Gual <lluis@novell.com> * Makefile.am: diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs index 08b2d4acd9..d11dc0e2b7 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs @@ -29,6 +29,7 @@ using MonoDevelop.Ide.Gui; using MonoDevelop.Components; using Mono.Debugging.Client; using MonoDevelop.Core; +using MonoDevelop.Core.Gui; namespace MonoDevelop.Debugger { @@ -40,7 +41,7 @@ namespace MonoDevelop.Debugger { view = new ConsoleView (); view.ConsoleInput += OnViewConsoleInput; - Pango.FontDescription font = Pango.FontDescription.FromString (IdeApp.Services.PlatformService.DefaultMonospaceFont); + Pango.FontDescription font = Pango.FontDescription.FromString (DesktopService.DefaultMonospaceFont); font.Size = (font.Size * 8) / 10; view.SetFont (font); } diff --git a/main/src/addins/MonoDevelop.DesignerSupport/ChangeLog b/main/src/addins/MonoDevelop.DesignerSupport/ChangeLog index dbf516eeeb..ef5888587f 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/ChangeLog +++ b/main/src/addins/MonoDevelop.DesignerSupport/ChangeLog @@ -1,3 +1,8 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs: + Use the new DesktopService instead of PlatformService. + 2009-06-15 Michael Hutchinson <mhutchinson@novell.com> * MonoDevelop.DesignerSupport/ToolboxService.cs: Track diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs index 1e803ffc45..4b717f23fd 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs @@ -63,8 +63,8 @@ namespace MonoDevelop.DesignerSupport [LocalizedDescription ("Type of the file.")] public string FileType { get { - string type = MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeForUri (file.Name); - return MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeDescription (type); + string type = MonoDevelop.Core.Gui.DesktopService.GetMimeTypeForUri (file.Name); + return MonoDevelop.Core.Gui.DesktopService.GetMimeTypeDescription (type); } } diff --git a/main/src/addins/MonoDevelop.Gettext/ChangeLog b/main/src/addins/MonoDevelop.Gettext/ChangeLog index 04781d7d8f..e075b2c8fc 100644 --- a/main/src/addins/MonoDevelop.Gettext/ChangeLog +++ b/main/src/addins/MonoDevelop.Gettext/ChangeLog @@ -1,3 +1,8 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.Gettext/TranslationProject.cs: Use the new + DesktopService instead of PlatformService. + 2009-05-19 Lluis Sanchez Gual <lluis@novell.com> * MonoDevelop.Gettext\Translation.cs: diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs index 17843211ac..1d3ca4f9fa 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs @@ -251,7 +251,7 @@ namespace MonoDevelop.Gettext if (!File.Exists (file.FilePath)) continue; if (file.Subtype == Subtype.Code) { - string mimeType = MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeForUri (file.FilePath); + string mimeType = MonoDevelop.Core.Gui.DesktopService.GetMimeTypeForUri (file.FilePath); foreach (IFileScanner fs in scanners) { if (fs.CanScan (this, catalog, file.FilePath, mimeType)) fs.UpdateCatalog (this, catalog, monitor, file.FilePath); diff --git a/main/src/addins/MonoDevelop.GtkCore/ChangeLog b/main/src/addins/MonoDevelop.GtkCore/ChangeLog index 765fc1433e..11b422e456 100644 --- a/main/src/addins/MonoDevelop.GtkCore/ChangeLog +++ b/main/src/addins/MonoDevelop.GtkCore/ChangeLog @@ -1,3 +1,9 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.GtkCore/ProjectResourceProvider.cs: + * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Use the + new DesktopService instead of PlatformService. + 2009-06-15 Michael Hutchinson <mhutchinson@novell.com> * MonoDevelop.GtkCore/ReferenceManager.cs: diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs index 3ce981f722..213d6733e6 100644 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs +++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs @@ -108,12 +108,12 @@ namespace MonoDevelop.GtkCore.GuiBuilder static string OnMimeResolve (string url) { - return MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeForUri (url); + return MonoDevelop.Core.Gui.DesktopService.GetMimeTypeForUri (url); } static void OnShowUrl (string url) { - MonoDevelop.Core.Gui.Services.PlatformService.ShowUrl (url); + MonoDevelop.Core.Gui.DesktopService.ShowUrl (url); } internal static void StoreConfiguration () diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs index 362095945b..c027f6c572 100644 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs +++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs @@ -47,7 +47,7 @@ namespace MonoDevelop.GtkCore ArrayList list = new ArrayList (); foreach (ProjectFile file in project.Files) { if (file.BuildAction == BuildAction.EmbeddedResource) - list.Add (new Stetic.ResourceInfo (Path.GetFileName (file.Name), file.Name, MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeForUri (file.Name))); + list.Add (new Stetic.ResourceInfo (Path.GetFileName (file.Name), file.Name, MonoDevelop.Core.Gui.DesktopService.GetMimeTypeForUri (file.Name))); } return (Stetic.ResourceInfo[]) list.ToArray (typeof(Stetic.ResourceInfo)); } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/ChangeLog b/main/src/addins/MonoDevelop.SourceEditor2/ChangeLog index 9f4942df93..78ef01e734 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/ChangeLog +++ b/main/src/addins/MonoDevelop.SourceEditor2/ChangeLog @@ -1,3 +1,12 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.SourceEditor/SourceEditorView.cs: + * MonoDevelop.SourceEditor/DefaultFormatter.cs: + * MonoDevelop.SourceEditor/SourceEditorOptions.cs: + * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs: + * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: Use + the new DesktopService instead of PlatformService. + 2009-06-22 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com> * MonoDevelop.SourceEditor/DropDownBox.cs: diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DefaultFormatter.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DefaultFormatter.cs index 1c3d444318..ece52d0151 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DefaultFormatter.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DefaultFormatter.cs @@ -48,7 +48,7 @@ namespace MonoDevelop.SourceEditor protected override string InternalFormat (SolutionItem policyParent, string mimeType, string input, int startOffset, int endOffset) { - IEnumerable<string> mtypes = MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeInheritanceChain (mimeType); + IEnumerable<string> mtypes = MonoDevelop.Core.Gui.DesktopService.GetMimeTypeInheritanceChain (mimeType); TextStylePolicy currentPolicy = policyParent != null ? policyParent.Policies.Get<TextStylePolicy> (mtypes) : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> (mtypes); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs index a84814c1c0..e1f2ee7047 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs @@ -79,7 +79,7 @@ namespace MonoDevelop.SourceEditor { if (String.IsNullOrEmpty (mimetype)) return false; - return IdeApp.Services.PlatformService.GetMimeTypeIsText (mimetype); + return DesktopService.GetMimeTypeIsText (mimetype); } public override MonoDevelop.Ide.Gui.IViewContent CreateContentForMimeType (string mimeType, System.IO.Stream content) @@ -97,8 +97,8 @@ namespace MonoDevelop.SourceEditor public override bool CanCreateContentForUri (string fileName) { - string mt = IdeApp.Services.PlatformService.GetMimeTypeForUri (fileName); - return IdeApp.Services.PlatformService.GetMimeTypeIsText (mt); + string mt = DesktopService.GetMimeTypeForUri (fileName); + return DesktopService.GetMimeTypeIsText (mt); } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs index 1016e79ded..f55a5edba6 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs @@ -32,6 +32,7 @@ using Mono.TextEditor; using Mono.TextEditor.Highlighting; using MonoDevelop.Core; +using MonoDevelop.Core.Gui; using MonoDevelop.Ide.Gui; using MonoDevelop.Ide.Gui.Content; using MonoDevelop.Projects; @@ -141,7 +142,7 @@ namespace MonoDevelop.SourceEditor this.onTheFlyFormatting = PropertyService.Get ("OnTheFlyFormatting", false); this.enableAutoCodeCompletion = PropertyService.Get ("EnableAutoCodeCompletion", true); this.completeWithSpaceOrPunctuation = PropertyService.Get ("CompleteWithSpaceOrPunctuation", true); - this.ControlLeftRightMode = (ControlLeftRightMode)Enum.Parse (typeof (ControlLeftRightMode), PropertyService.Get ("ControlLeftRightMode", IdeApp.Services.PlatformService.DefaultControlLeftRightBehavior)); + this.ControlLeftRightMode = (ControlLeftRightMode)Enum.Parse (typeof (ControlLeftRightMode), PropertyService.Get ("ControlLeftRightMode", DesktopService.DefaultControlLeftRightBehavior)); } #region new options @@ -524,7 +525,7 @@ namespace MonoDevelop.SourceEditor public override string FontName { get { if (EditorFontType == EditorFontType.DefaultMonospace) { - string font = IdeApp.Services.PlatformService.DefaultMonospaceFont; + string font = DesktopService.DefaultMonospaceFont; if (String.IsNullOrEmpty (font)) return DEFAULT_FONT; else diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs index 195d957fc4..5729abd5f2 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs @@ -235,7 +235,7 @@ namespace MonoDevelop.SourceEditor try { TextFile.WriteFile (fileName, Document.Text, encoding); lastSaveTime = File.GetLastWriteTime (fileName); - IdeApp.Services.PlatformService.SetFileAttributes (fileName, attributes); + DesktopService.SetFileAttributes (fileName, attributes); } finally { isInWrite = false; } @@ -262,7 +262,7 @@ namespace MonoDevelop.SourceEditor autoSave.RemoveAutoSaveFile (); } - attributes = IdeApp.Services.PlatformService.GetFileAttributes (fileName); + attributes = DesktopService.GetFileAttributes (fileName); autoSave.FileName = fileName; if (warnOverwrite) { warnOverwrite = false; @@ -325,11 +325,11 @@ namespace MonoDevelop.SourceEditor void UpdateMimeType (string fileName) { // Look for a mime type for which there is a syntax mode - string mimeType = IdeApp.Services.PlatformService.GetMimeTypeForUri (fileName); + string mimeType = DesktopService.GetMimeTypeForUri (fileName); if (loadedMimeType != mimeType) { loadedMimeType = mimeType; if (mimeType != null) { - foreach (string mt in IdeApp.Services.PlatformService.GetMimeTypeInheritanceChain (loadedMimeType)) { + foreach (string mt in DesktopService.GetMimeTypeInheritanceChain (loadedMimeType)) { if (Mono.TextEditor.Highlighting.SyntaxModeService.GetSyntaxMode (mt) != null) { Document.MimeType = mt; break; @@ -1175,7 +1175,7 @@ namespace MonoDevelop.SourceEditor Gnome.Font font = Gnome.Font.FindClosestFromFullName (fontName); if (font == null) { LoggingService.LogError ("Can't find font: '" + fontName + "', trying default." ); - font = Gnome.Font.FindClosestFromFullName (IdeApp.Services.PlatformService.DefaultMonospaceFont); + font = Gnome.Font.FindClosestFromFullName (DesktopService.DefaultMonospaceFont); } if (font == null) { LoggingService.LogError ("Unable to load font." ); @@ -1274,7 +1274,7 @@ namespace MonoDevelop.SourceEditor item.Description += line; } item.Category = GettextCatalog.GetString ("Clipboard ring"); - item.Icon = IdeApp.Services.PlatformService.GetPixbufForFile ("test.txt", Gtk.IconSize.Menu); + item.Icon = DesktopService.GetPixbufForFile ("test.txt", Gtk.IconSize.Menu); item.Name = text.Length > 16 ? text.Substring (0, 16) + "..." : text; item.Name = item.Name.Replace ("\t", "\\t"); item.Name = item.Name.Replace ("\n", "\\n"); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs index 77af41d97a..2201ea927e 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs @@ -58,7 +58,7 @@ namespace MonoDevelop.SourceEditor if (string.IsNullOrEmpty (mimeType)) mimeType = "text/plain"; - this.mimeTypes = MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeInheritanceChain (mimeType); + this.mimeTypes = MonoDevelop.Core.Gui.DesktopService.GetMimeTypeInheritanceChain (mimeType); if (styleParent != null) policyContainer = styleParent.Policies; diff --git a/main/src/addins/MonoDevelop.XmlEditor/ChangeLog b/main/src/addins/MonoDevelop.XmlEditor/ChangeLog index cdcb19429a..69081128ca 100644 --- a/main/src/addins/MonoDevelop.XmlEditor/ChangeLog +++ b/main/src/addins/MonoDevelop.XmlEditor/ChangeLog @@ -1,3 +1,9 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.XmlEditor/XmlFormatter.cs: + * MonoDevelop.XmlEditor/XmlTextEditorExtension.cs: Use the new + DesktopService instead of PlatformService. + 2009-06-22 Lluis Sanchez Gual <lluis@novell.com> * Makefile.am: diff --git a/main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/XmlFormatter.cs b/main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/XmlFormatter.cs index 798b078a21..3dc19dc1e2 100644 --- a/main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/XmlFormatter.cs +++ b/main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/XmlFormatter.cs @@ -38,16 +38,16 @@ namespace MonoDevelop.XmlEditor { public bool CanFormat (string mimeType) { - return Services.PlatformService.GetMimeTypeIsSubtype (mimeType, "application/xml"); + return DesktopService.GetMimeTypeIsSubtype (mimeType, "application/xml"); } public string FormatText (MonoDevelop.Projects.SolutionItem policyParent, string mimeType, string input) { TextStylePolicy policy; if (policyParent != null) - policy = policyParent.Policies.Get <TextStylePolicy> (Services.PlatformService.GetMimeTypeInheritanceChain (mimeType)); + policy = policyParent.Policies.Get <TextStylePolicy> (DesktopService.GetMimeTypeInheritanceChain (mimeType)); else - policy = PolicyService.GetDefaultPolicy <TextStylePolicy> (Services.PlatformService.GetMimeTypeInheritanceChain (mimeType)); + policy = PolicyService.GetDefaultPolicy <TextStylePolicy> (DesktopService.GetMimeTypeInheritanceChain (mimeType)); XmlTextReader reader = new XmlTextReader (new StringReader (input)); reader.WhitespaceHandling = WhitespaceHandling.None; diff --git a/main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/XmlTextEditorExtension.cs b/main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/XmlTextEditorExtension.cs index 57669ca2a2..e4032a7710 100644 --- a/main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/XmlTextEditorExtension.cs +++ b/main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/XmlTextEditorExtension.cs @@ -469,7 +469,7 @@ namespace MonoDevelop.XmlEditor if (System.IO.Path.IsPathRooted (fileName)) { string vfsname = fileName.Replace ("%", "%25").Replace ("#", "%23").Replace ("?", "%3F"); - string mimeType = MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeForUri (vfsname); + string mimeType = MonoDevelop.Core.Gui.DesktopService.GetMimeTypeForUri (vfsname); if (IsMimeTypeHandled (mimeType)) return true; } diff --git a/main/src/addins/NUnit/ChangeLog b/main/src/addins/NUnit/ChangeLog index 4b787ba45e..dd041ff5bb 100644 --- a/main/src/addins/NUnit/ChangeLog +++ b/main/src/addins/NUnit/ChangeLog @@ -1,3 +1,10 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * Services/NUnitService.cs: + * Gui/NUnitAssemblyGroupNodeBuilder.cs: + * Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs: Use the + new DesktopService instead of PlatformService. + 2009-06-18 Lluis Sanchez Gual <lluis@novell.com> * Services\ExternalTestRunner.cs: diff --git a/main/src/addins/NUnit/Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs b/main/src/addins/NUnit/Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs index 69193514fa..9fae735918 100644 --- a/main/src/addins/NUnit/Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs +++ b/main/src/addins/NUnit/Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs @@ -37,7 +37,6 @@ using MonoDevelop.NUnit.Commands; using MonoDevelop.Core.Gui; using MonoDevelop.Components; using MonoDevelop.Ide.Gui; -using GuiServices = MonoDevelop.Core.Gui.Services; using MonoDevelop.Ide.Gui.Components; namespace MonoDevelop.NUnit diff --git a/main/src/addins/NUnit/Gui/NUnitAssemblyGroupNodeBuilder.cs b/main/src/addins/NUnit/Gui/NUnitAssemblyGroupNodeBuilder.cs index 0aa8ecbd1f..dff1ce2d86 100644 --- a/main/src/addins/NUnit/Gui/NUnitAssemblyGroupNodeBuilder.cs +++ b/main/src/addins/NUnit/Gui/NUnitAssemblyGroupNodeBuilder.cs @@ -37,7 +37,6 @@ using MonoDevelop.Components.Commands; using MonoDevelop.NUnit.Commands; using MonoDevelop.Ide.Commands; using MonoDevelop.Core.Gui; -using GuiServices = MonoDevelop.Core.Gui.Services; using MonoDevelop.Ide.Gui.Components; namespace MonoDevelop.NUnit diff --git a/main/src/addins/NUnit/Services/NUnitService.cs b/main/src/addins/NUnit/Services/NUnitService.cs index 3ce7277f0a..7b7cb04add 100644 --- a/main/src/addins/NUnit/Services/NUnitService.cs +++ b/main/src/addins/NUnit/Services/NUnitService.cs @@ -41,7 +41,6 @@ using Mono.Addins; using MonoDevelop.Projects; using NUnit.Core; using MonoDevelop.Ide.Gui; -using GuiServices = MonoDevelop.Core.Gui.Services; namespace MonoDevelop.NUnit { diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/ChangeLog b/main/src/addins/VersionControl/MonoDevelop.VersionControl/ChangeLog index 6c9db93f8d..1c1507177d 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/ChangeLog +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/ChangeLog @@ -1,3 +1,12 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.VersionControl.Views/LogView.cs: + * MonoDevelop.VersionControl.Views/DiffView.cs: + * MonoDevelop.VersionControl.Views/StatusView.cs: + * MonoDevelop.VersionControl.Views/CellRendererDiff.cs: + * MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs: + Use the new DesktopService instead of PlatformService. + 2009-06-16 Lluis Sanchez Gual <lluis@novell.com> * MonoDevelop.VersionControl.Views/StatusView.cs: Use diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs index 1c3c78b403..b19465a0b3 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs @@ -44,7 +44,7 @@ namespace MonoDevelop.VersionControl this.Build(); Pango.FontDescription font = Pango.FontDescription.FromString ( - MonoDevelop.Core.Gui.Services.PlatformService.DefaultMonospaceFont); + MonoDevelop.Core.Gui.DesktopService.DefaultMonospaceFont); font.Size = Pango.Units.FromPixels (8); textview.ModifyFont (font); textview.AcceptsTab = true; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs index 35c6328761..21d9509709 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs @@ -4,6 +4,7 @@ using System.Collections; using Gtk; using Gdk; using MonoDevelop.Core; +using MonoDevelop.Core.Gui; using MonoDevelop.Ide.Gui; namespace MonoDevelop.VersionControl.Views @@ -18,7 +19,7 @@ namespace MonoDevelop.VersionControl.Views public CellRendererDiff() { - font = Pango.FontDescription.FromString (IdeApp.Services.PlatformService.DefaultMonospaceFont); + font = Pango.FontDescription.FromString (DesktopService.DefaultMonospaceFont); } void DisposeLayout () diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs index 1d07c61cce..69ca76cd2f 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs @@ -129,7 +129,7 @@ namespace MonoDevelop.VersionControl.Views } DiffWidget.Options opts = new DiffWidget.Options(); - opts.Font = IdeApp.Services.PlatformService.DefaultMonospaceFont; + opts.Font = DesktopService.DefaultMonospaceFont; opts.LeftName = "Repository"; opts.RightName = "Working Copy"; widget = new DiffWidget(diff, opts); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs index 10391b6efd..491447ea0e 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs @@ -254,7 +254,7 @@ namespace MonoDevelop.VersionControl.Views actionIcon = ImageService.GetPixbuf (MonoDevelop.Core.Gui.Stock.Empty, Gtk.IconSize.Menu); } - Gdk.Pixbuf fileIcon = IdeApp.Services.PlatformService.GetPixbufForFile (rp.Path, Gtk.IconSize.Menu); + Gdk.Pixbuf fileIcon = DesktopService.GetPixbufForFile (rp.Path, Gtk.IconSize.Menu); changedpathstore.AppendValues (actionIcon, action, fileIcon, rp.Path); } } @@ -347,7 +347,7 @@ namespace MonoDevelop.VersionControl.Views internal class HistoricalFileView { public static void Show (string name, string file, string text) { - string mimeType = IdeApp.Services.PlatformService.GetMimeTypeForUri (file); + string mimeType = DesktopService.GetMimeTypeForUri (file); if (mimeType == null || mimeType.Length == 0) mimeType = "text/plain"; Document doc = MonoDevelop.Ide.Gui.IdeApp.Workbench.NewDocument (name, mimeType, text); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs index 5fcb68bace..222bad5b22 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs @@ -448,7 +448,7 @@ namespace MonoDevelop.VersionControl.Views if (n.IsDirectory) fileIcon = ImageService.GetPixbuf (MonoDevelop.Core.Gui.Stock.ClosedFolder, Gtk.IconSize.Menu); else - fileIcon = IdeApp.Services.PlatformService.GetPixbufForFile (n.LocalPath, Gtk.IconSize.Menu); + fileIcon = DesktopService.GetPixbufForFile (n.LocalPath, Gtk.IconSize.Menu); diff --git a/main/src/addins/WelcomePage/ChangeLog b/main/src/addins/WelcomePage/ChangeLog index 694e7d2646..cc8a9538ce 100644 --- a/main/src/addins/WelcomePage/ChangeLog +++ b/main/src/addins/WelcomePage/ChangeLog @@ -1,3 +1,8 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * WelcomePageView.cs: Use the new DesktopService instead of + PlatformService. + 2009-05-20 Lluis Sanchez Gual <lluis@novell.com> * WelcomePageView.cs: diff --git a/main/src/addins/WelcomePage/WelcomePageView.cs b/main/src/addins/WelcomePage/WelcomePageView.cs index e0af4d4a47..3f1df89262 100644 --- a/main/src/addins/WelcomePage/WelcomePageView.cs +++ b/main/src/addins/WelcomePage/WelcomePageView.cs @@ -216,7 +216,7 @@ namespace MonoDevelop.WelcomePage { //Launch the Uri externally try { - IdeApp.Services.PlatformService.ShowUrl (uri); + DesktopService.ShowUrl (uri); } catch (Exception) { string msg = String.Format (GettextCatalog.GetString ("Could not open the url {0}"), uri); Gtk.MessageDialog md = new Gtk.MessageDialog diff --git a/main/src/core/MonoDevelop.Core.Gui/ChangeLog b/main/src/core/MonoDevelop.Core.Gui/ChangeLog index a8ce4a75cb..ab9977b607 100644 --- a/main/src/core/MonoDevelop.Core.Gui/ChangeLog +++ b/main/src/core/MonoDevelop.Core.Gui/ChangeLog @@ -1,3 +1,13 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * Makefile.am: + * MonoDevelop.Core.Gui.csproj: + * MonoDevelop.Core.Gui/GuiService.cs: + * MonoDevelop.Core.Gui/RecentOpen.cs: + * MonoDevelop.Core.Gui/DesktopService.cs: + * MonoDevelop.Core.Gui.Components/FileBrowser.cs: Use the new + DesktopService instead of PlatformService. + 2009-06-18 Lluis Sanchez Gual <lluis@novell.com> * MonoDevelop.Core.Gui.Dialogs/OptionsDialog.cs: Show main diff --git a/main/src/core/MonoDevelop.Core.Gui/Makefile.am b/main/src/core/MonoDevelop.Core.Gui/Makefile.am index fe067f178a..d2bb0d6930 100644 --- a/main/src/core/MonoDevelop.Core.Gui/Makefile.am +++ b/main/src/core/MonoDevelop.Core.Gui/Makefile.am @@ -53,10 +53,10 @@ FILES = \ MonoDevelop.Core.Gui/AsyncDispatchAttribute.cs \ MonoDevelop.Core.Gui/DefaultPlatformService.cs \ MonoDevelop.Core.Gui/DesktopApplication.cs \ + MonoDevelop.Core.Gui/DesktopService.cs \ MonoDevelop.Core.Gui/DispatchService.cs \ MonoDevelop.Core.Gui/FreeDispatchAttribute.cs \ MonoDevelop.Core.Gui/GLibLogging.cs \ - MonoDevelop.Core.Gui/GuiService.cs \ MonoDevelop.Core.Gui/GuiSyncContext.cs \ MonoDevelop.Core.Gui/GuiSyncObject.cs \ MonoDevelop.Core.Gui/ImageService.cs \ diff --git a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs index 59078b477d..0287c36a20 100644 --- a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs +++ b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs @@ -169,11 +169,11 @@ namespace MonoDevelop.Core.Gui.Components if (ignoreHidden) { if (!d.Name.StartsWith (".") && NotHidden (d.Name)) - store.AppendValues (Services.PlatformService.GetPixbufForFile (System.IO.Path.Combine (CurrentDir, d.Name), Gtk.IconSize.Menu), d.Name); + store.AppendValues (DesktopService.GetPixbufForFile (System.IO.Path.Combine (CurrentDir, d.Name), Gtk.IconSize.Menu), d.Name); } else { - store.AppendValues (Services.PlatformService.GetPixbufForFile (System.IO.Path.Combine (CurrentDir, d.Name), Gtk.IconSize.Menu), d.Name); + store.AppendValues (DesktopService.GetPixbufForFile (System.IO.Path.Combine (CurrentDir, d.Name), Gtk.IconSize.Menu), d.Name); } } @@ -414,7 +414,7 @@ namespace MonoDevelop.Core.Gui.Components performingtask = PerformingTask.CreatingNew; text_render.Editable = true; - iter = store.AppendValues (Services.PlatformService.GetPixbufForFile (CurrentDir, Gtk.IconSize.Menu), "folder name"); + iter = store.AppendValues (DesktopService.GetPixbufForFile (CurrentDir, Gtk.IconSize.Menu), "folder name"); treepath = tv.Model.GetPath(iter); column = tv.GetColumn (0); diff --git a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.csproj b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.csproj index 92946787b9..6a577bded1 100644 --- a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.csproj +++ b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.csproj @@ -468,7 +468,6 @@ <Compile Include="MonoDevelop.Core.Gui\SyncObject.cs" /> <Compile Include="MonoDevelop.Core.Gui\RecentOpen.cs" /> <Compile Include="MonoDevelop.Core.Gui.ProgressMonitoring\BaseProgressMonitor.cs" /> - <Compile Include="MonoDevelop.Core.Gui\GuiService.cs" /> <Compile Include="MonoDevelop.Core.Gui\IMementoCapable.cs" /> <Compile Include="MonoDevelop.Core.Gui\PixbufList.cs" /> <Compile Include="MonoDevelop.Core.Gui.Dialogs\ErrorDialog.cs" /> @@ -508,6 +507,7 @@ <Compile Include="AssemblyInfo.cs" /> <Compile Include="MonoDevelop.Core.Gui.Dialogs\MultiMessageDialog.cs" /> <Compile Include="gtk-gui\MonoDevelop.Core.Gui.Dialogs.MultiMessageDialog.cs" /> + <Compile Include="MonoDevelop.Core.Gui\DesktopService.cs" /> </ItemGroup> <ItemGroup> <None Include="Makefile.am" /> diff --git a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/DesktopService.cs b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/DesktopService.cs new file mode 100644 index 0000000000..ad8b077b2f --- /dev/null +++ b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/DesktopService.cs @@ -0,0 +1,135 @@ +// +// DesktopService.cs +// +// Author: +// Lluis Sanchez Gual <lluis@novell.com> +// +// Copyright (c) 2009 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; +using Mono.Addins; + +namespace MonoDevelop.Core.Gui +{ + public class DesktopService + { + static PlatformService platformService; + + public static void Initialize () + { + if (platformService != null) + return; + object[] platforms = AddinManager.GetExtensionObjects ("/MonoDevelop/Core/PlatformService"); + if (platforms.Length > 0) + platformService = (PlatformService) platforms [0]; + else { + platformService = new DefaultPlatformService (); + LoggingService.LogFatalError ("A platform service implementation has not been found."); + } + } + + public static DesktopApplication GetDefaultApplication (string mimetype) + { + return platformService.GetDefaultApplication (mimetype); + } + + public static DesktopApplication [] GetAllApplications (string mimetype) + { + return platformService.GetAllApplications (mimetype); + } + + public static string DefaultMonospaceFont { + get { return platformService.DefaultMonospaceFont; } + } + + public static string PlatformName { + get { return platformService.Name; } + } + + /// <summary> + /// Used in the text editor. Valid values are found in MonoDevelop.SourceEditor.ControlLeftRightMode in the + /// source editor project. + /// </summary> + public static string DefaultControlLeftRightBehavior { + get { + return platformService.DefaultControlLeftRightBehavior; + } + } + + public static void ShowUrl (string url) + { + platformService.ShowUrl (url); + } + + public static string GetMimeTypeForUri (string uri) + { + return platformService.GetMimeTypeForUri (uri); + } + + public static string GetMimeTypeDescription (string mimeType) + { + return platformService.GetMimeTypeDescription (mimeType); + } + + public static bool GetMimeTypeIsText (string mimeType) + { + return platformService.GetMimeTypeIsText (mimeType); + } + + public static bool GetMimeTypeIsSubtype (string subMimeType, string baseMimeType) + { + return platformService.GetMimeTypeIsSubtype (subMimeType, baseMimeType); + } + + public static IEnumerable<string> GetMimeTypeInheritanceChain (string mimeType) + { + return platformService.GetMimeTypeInheritanceChain (mimeType); + } + + public static Gdk.Pixbuf GetPixbufForFile (string filename, Gtk.IconSize size) + { + return platformService.GetPixbufForFile (filename, size); + } + + public static Gdk.Pixbuf GetPixbufForType (string mimeType, Gtk.IconSize size) + { + return platformService.GetPixbufForFile (mimeType, size); + } + + public static bool SetGlobalMenu (MonoDevelop.Components.Commands.CommandManager commandManager, string commandMenuAddinPath) + { + return platformService.SetGlobalMenu (commandManager, commandMenuAddinPath); + } + + // Used for preserve the file attributes when monodevelop opens & writes a file. + // This should work on unix & mac platform. + public static object GetFileAttributes (string fileName) + { + return platformService.GetFileAttributes (fileName); + } + + public static void SetFileAttributes (string fileName, object attributes) + { + platformService.SetFileAttributes (fileName, attributes); + } + } +} diff --git a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/GuiService.cs b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/GuiService.cs deleted file mode 100644 index 0ab65e7080..0000000000 --- a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/GuiService.cs +++ /dev/null @@ -1,63 +0,0 @@ -// GuiService.cs -// -// Author: -// Lluis Sanchez Gual <lluis@novell.com> -// -// Copyright (c) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -// - - -using MonoDevelop.Core; -using MonoDevelop.Core.Gui.Dialogs; -using System; -using Mono.Addins; -using Mono.Addins.Gui; - -namespace MonoDevelop.Core.Gui -{ - public class Services - { - static PlatformService platformService; - - static Services () - { - object[] platforms = AddinManager.GetExtensionObjects ("/MonoDevelop/Core/PlatformService"); - if (platforms.Length > 0) - platformService = (PlatformService) platforms [0]; - else { - platformService = new DefaultPlatformService (); - LoggingService.LogFatalError ("A platform service implementation has not been found."); - } - } - - public static PlatformService PlatformService { - get { - return platformService; - } - } - - public static void RunAddinManager (Gtk.Window parent) - { - AddinManagerWindow.Run (parent); - } - } -} diff --git a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/RecentOpen.cs b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/RecentOpen.cs index 750d206e51..aea2b9a08c 100644 --- a/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/RecentOpen.cs +++ b/main/src/core/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/RecentOpen.cs @@ -70,7 +70,7 @@ namespace MonoDevelop.Core.Gui public void AddLastFile (string name, string project) { - RecentItem recentItem = new RecentItem (RecentFileStorage.ToUri (name), Services.PlatformService.GetMimeTypeForUri (name), fileGroup); + RecentItem recentItem = new RecentItem (RecentFileStorage.ToUri (name), DesktopService.GetMimeTypeForUri (name), fileGroup); recentItem.Private = project != null ? string.Format ("{0} [{1}]", Path.GetFileName (name), project) : Path.GetFileName (name); recentFiles.AddWithLimit (recentItem, fileGroup, ItemLimit); OnRecentFileChange(); @@ -104,7 +104,7 @@ namespace MonoDevelop.Core.Gui } public void AddLastProject (string name, string projectName) { - RecentItem recentItem = new RecentItem (RecentFileStorage.ToUri (name), Services.PlatformService.GetMimeTypeForUri (name), projectGroup); + RecentItem recentItem = new RecentItem (RecentFileStorage.ToUri (name), DesktopService.GetMimeTypeForUri (name), projectGroup); recentItem.Private = projectName; recentFiles.AddWithLimit (recentItem, projectGroup, ItemLimit); OnRecentProjectChange(); diff --git a/main/src/core/MonoDevelop.Ide/ChangeLog b/main/src/core/MonoDevelop.Ide/ChangeLog index 7573e36cc5..990ad4e801 100644 --- a/main/src/core/MonoDevelop.Ide/ChangeLog +++ b/main/src/core/MonoDevelop.Ide/ChangeLog @@ -1,5 +1,31 @@ 2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + * MonoDevelop.Ide.Gui/Ide.cs: + * MonoDevelop.Ide.Gui/Document.cs: + * MonoDevelop.Ide.Gui/Workbench.cs: + * MonoDevelop.Ide.Gui/IdeStartup.cs: + * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: + * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: + * MonoDevelop.Ide.Gui.Pads/FileListItem.cs: + * MonoDevelop.Ide.Commands/FileCommands.cs: + * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: + * MonoDevelop.Ide.Gui/AddinUpdateHandler.cs: + * MonoDevelop.Ide.Templates/FileTemplate.cs: + * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: + * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: + * MonoDevelop.Ide.FindInFiles/FileProvider.cs: + * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: + * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: + * MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs: + * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs: + * MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs: + * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: + * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs: + * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs: + Use the new DesktopService instead of PlatformService. + +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + * MonoDevelop.Ide.Gui/WorkbenchMemento.cs: Update header. The file is not derived from SD anymore. diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs index 2dc570526a..8feb6be54e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs @@ -28,7 +28,7 @@ using System; using MonoDevelop.Components.Commands; using MonoDevelop.Projects.Text; using MonoDevelop.Ide.Gui; - +using MonoDevelop.Core.Gui; namespace MonoDevelop.Ide.CodeFormatting @@ -43,7 +43,7 @@ namespace MonoDevelop.Ide.CodeFormatting protected override void Update (CommandInfo info) { if (IdeApp.Workbench.ActiveDocument != null && IdeApp.Workbench.ActiveDocument.IsFile) { - string mt = IdeApp.Services.PlatformService.GetMimeTypeForUri (IdeApp.Workbench.ActiveDocument.FileName); + string mt = DesktopService.GetMimeTypeForUri (IdeApp.Workbench.ActiveDocument.FileName); IPrettyPrinter printer = TextFileService.GetPrettyPrinter (mt); if (printer != null) return; @@ -56,7 +56,7 @@ namespace MonoDevelop.Ide.CodeFormatting Document doc = IdeApp.Workbench.ActiveDocument; if (doc == null) return; - string mt = IdeApp.Services.PlatformService.GetMimeTypeForUri (doc.FileName); + string mt = DesktopService.GetMimeTypeForUri (doc.FileName); IPrettyPrinter printer = TextFileService.GetPrettyPrinter (mt); if (printer == null) return; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs index 53e3bd9da7..966cba785c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs @@ -34,6 +34,7 @@ using System.Collections.Generic; using System.Xml; using MonoDevelop.Core; +using MonoDevelop.Core.Gui; using MonoDevelop.Projects.Gui.Completion; namespace MonoDevelop.Ide.CodeTemplates @@ -74,13 +75,13 @@ namespace MonoDevelop.Ide.CodeTemplates public static IEnumerable<CodeTemplate> GetCodeTemplatesForFile (string fileName) { - string mimeType = MonoDevelop.Ide.Gui.IdeApp.Services.PlatformService.GetMimeTypeForUri (fileName); + string mimeType = DesktopService.GetMimeTypeForUri (fileName); return GetCodeTemplates (mimeType); } public static void AddCompletionDataForFileName (string fileName, CompletionDataList list) { - string mimeType = MonoDevelop.Ide.Gui.IdeApp.Services.PlatformService.GetMimeTypeForUri (fileName); + string mimeType = DesktopService.GetMimeTypeForUri (fileName); AddCompletionDataForFileName (mimeType, list); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs index 8fe9867d66..5c37a4d537 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs @@ -231,7 +231,7 @@ namespace MonoDevelop.Ide.Commands string label = ((ri.Private == null || ri.Private.Length < 1) ? Path.GetFileName (ri.ToString ()) : ri.Private); CommandInfo cmd = new CommandInfo (accelaratorKeyPrefix + label.Replace ("_", "__")); cmd.Description = GettextCatalog.GetString ("Open {0}", ri.ToString ()); - Gdk.Pixbuf icon = IdeApp.Services.PlatformService.GetPixbufForFile (ri.ToString(), IconSize.Menu); + Gdk.Pixbuf icon = DesktopService.GetPixbufForFile (ri.ToString(), IconSize.Menu); if (icon != null) cmd.Icon = ImageService.GetStockId (icon, IconSize.Menu); info.Add (cmd, ri); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs index de1d6dcaa8..add1a82307 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs @@ -29,7 +29,7 @@ using System.IO; using MonoDevelop.Projects; using MonoDevelop.Ide.Gui; using System.Text; - +using MonoDevelop.Core.Gui; namespace MonoDevelop.Ide.FindInFiles { @@ -116,9 +116,9 @@ namespace MonoDevelop.Ide.FindInFiles }); return; } - object attributes = IdeApp.Services.PlatformService.GetFileAttributes (FileName); + object attributes = DesktopService.GetFileAttributes (FileName); File.WriteAllText (FileName, buffer.ToString ()); - IdeApp.Services.PlatformService.SetFileAttributes (FileName, attributes); + DesktopService.SetFileAttributes (FileName, attributes); buffer = null; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs index 03c7436c4f..da0a1e3533 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs @@ -31,6 +31,7 @@ using MonoDevelop.Ide.Gui; using Mono.TextEditor.Highlighting; using System.Collections.Generic; using MonoDevelop.Core; +using MonoDevelop.Core.Gui; using System.Text; using MonoDevelop.Components.Commands; using MonoDevelop.Ide.Commands; @@ -277,7 +278,7 @@ namespace MonoDevelop.Ide.FindInFiles { CellRendererPixbuf fileNamePixbufRenderer = (CellRendererPixbuf)cell; SearchResult searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn); - fileNamePixbufRenderer.Pixbuf =IdeApp.Services.PlatformService.GetPixbufForFile (searchResult.FileName, Gtk.IconSize.Menu); + fileNamePixbufRenderer.Pixbuf = DesktopService.GetPixbufForFile (searchResult.FileName, Gtk.IconSize.Menu); } Gdk.Color GetColor (Gdk.Color baseColor) @@ -438,7 +439,7 @@ namespace MonoDevelop.Ide.FindInFiles Mono.TextEditor.Document doc; if (!documents.TryGetValue (result.FileName, out doc)) { doc = new Mono.TextEditor.Document (); - doc.MimeType = IdeApp.Services.PlatformService.GetMimeTypeForUri (result.FileName); + doc.MimeType = DesktopService.GetMimeTypeForUri (result.FileName); TextReader reader = result.FileProvider.Open (); doc.Text = reader.ReadToEnd (); reader.Close (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs index a279548927..020211aa9e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs @@ -4,6 +4,7 @@ using System.Text; using Pango; using MonoDevelop.Core; +using MonoDevelop.Core.Gui; namespace MonoDevelop.Ide.Gui.Content { public enum LineViewerStyle { @@ -405,7 +406,7 @@ namespace MonoDevelop.Ide.Gui.Content { switch (s) { case "__default_monospace": try { - string fontName = IdeApp.Services.PlatformService.DefaultMonospaceFont; + string fontName = DesktopService.DefaultMonospaceFont; return FontDescription.FromString (fontName); } catch (Exception ex) { LoggingService.LogWarning ("Could not load platform's default monospace font.", ex); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs index ff44f205dd..520ba83746 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs @@ -758,7 +758,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs public override Gdk.Pixbuf Icon { get { - return IdeApp.Services.PlatformService.GetPixbufForFile (file, IconSize.Menu); + return DesktopService.GetPixbufForFile (file, IconSize.Menu); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs index 86105c622e..1d5d5b7330 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs @@ -184,7 +184,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs string relativePath = FileService.AbsoluteToRelativePath (project.BaseDirectory, fileName); TreeIter iter = GetPath (System.IO.Path.GetDirectoryName (relativePath)); object[] values = new object[] { - IdeApp.Services.PlatformService.GetPixbufForFile (fileName, IconSize.Menu), + DesktopService.GetPixbufForFile (fileName, IconSize.Menu), null, System.IO.Path.GetFileName (fileName), fileName, diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs index 171cde9022..232f82eb27 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs @@ -80,7 +80,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad label = "<span foreground='red'>" + label + "</span>"; } - icon = IdeApp.Services.PlatformService.GetPixbufForFile (file.FilePath, Gtk.IconSize.Menu); + icon = DesktopService.GetPixbufForFile (file.FilePath, Gtk.IconSize.Menu); } public override object GetParentObject (object dataObject) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs index 90e4a73041..bdb4923d41 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs @@ -66,7 +66,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad SystemFile file = (SystemFile) dataObject; label = file.Name; - icon = IdeApp.Services.PlatformService.GetPixbufForFile (file.Path, Gtk.IconSize.Menu); + icon = DesktopService.GetPixbufForFile (file.Path, Gtk.IconSize.Menu); if (file.ShowTransparent) { Gdk.Pixbuf gicon = Context.GetComposedIcon (icon, "fade"); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/FileListItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/FileListItem.cs index 3235faf4a2..b422f7809b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/FileListItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/FileListItem.cs @@ -29,6 +29,7 @@ using System; using System.IO; using MonoDevelop.Core; +using MonoDevelop.Core.Gui; namespace MonoDevelop.Ide.Gui.Pads { @@ -89,7 +90,7 @@ namespace MonoDevelop.Ide.Gui.Pads this.lastModified = lastModified; //FIXME: This is because //home/blah is not the same as /home/blah according to Icon.LookupSync, if we get weird behaviours, lets look at this again, see if we still need it. FullName = fullname.Substring (1); - icon = IdeApp.Services.PlatformService.GetPixbufForFile (FullName, Gtk.IconSize.Menu); + icon = DesktopService.GetPixbufForFile (FullName, Gtk.IconSize.Menu); } public FileListItem (string name) @@ -98,7 +99,7 @@ namespace MonoDevelop.Ide.Gui.Pads this.size = Math.Round ((double) fi.Length / 1024).ToString () + " KB"; this.lastModified = fi.LastWriteTime.ToString (); FullName = System.IO.Path.GetFullPath (name); - icon = IdeApp.Services.PlatformService.GetPixbufForFile (FullName, Gtk.IconSize.Menu); + icon = DesktopService.GetPixbufForFile (FullName, Gtk.IconSize.Menu); } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AddinUpdateHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AddinUpdateHandler.cs index edf9256326..a53d5bfce2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AddinUpdateHandler.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AddinUpdateHandler.cs @@ -36,6 +36,7 @@ using Gtk; using MonoDevelop.Core; using Mono.Addins; using Mono.Addins.Setup; +using Mono.Addins.Gui; using MonoDevelop.Core.Gui; using MonoDevelop.Core.Gui.Dialogs; using MonoDevelop.Ide.Gui.Dialogs; @@ -123,7 +124,7 @@ namespace MonoDevelop.Ide.Gui { if (args.Event.Button == 1) { HideAlert (); - MonoDevelop.Core.Gui.Services.RunAddinManager (IdeApp.Workbench.RootWindow); + AddinManagerWindow.Run (IdeApp.Workbench.RootWindow); } } @@ -136,7 +137,7 @@ namespace MonoDevelop.Ide.Gui } HideAlert (); - Core.Gui.Services.RunAddinManager (IdeApp.Workbench.RootWindow); + AddinManagerWindow.Run (IdeApp.Workbench.RootWindow); } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs index 5235e1f741..ed40426020 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs @@ -228,7 +228,7 @@ namespace MonoDevelop.Ide.Gui // TopMenu.Selected += new CommandHandler(OnTopMenuSelected); // TopMenu.Deselected += new CommandHandler(OnTopMenuDeselected); - if (!MonoDevelop.Core.Gui.Services.PlatformService.SetGlobalMenu (MonoDevelop.Ide.Gui.IdeApp.CommandService, mainMenuPath)) + if (!DesktopService.SetGlobalMenu (MonoDevelop.Ide.Gui.IdeApp.CommandService, mainMenuPath)) topMenu = IdeApp.CommandService.CreateMenuBar (mainMenuPath); toolbars = IdeApp.CommandService.CreateToolbarSet (toolbarsPath); @@ -250,7 +250,7 @@ namespace MonoDevelop.Ide.Gui bool changed = false; if (args.PathChanged (mainMenuPath)) { - if (MonoDevelop.Core.Gui.Services.PlatformService.SetGlobalMenu (MonoDevelop.Ide.Gui.IdeApp.CommandService, mainMenuPath)) + if (DesktopService.SetGlobalMenu (MonoDevelop.Ide.Gui.IdeApp.CommandService, mainMenuPath)) return; topMenu = IdeApp.CommandService.CreateMenuBar (mainMenuPath); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs index 0424c2a4b7..c1debea8e7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs @@ -384,7 +384,7 @@ namespace MonoDevelop.Ide.Gui if (currentParseFile != null) { System.Threading.ThreadPool.QueueUserWorkItem (delegate { // Don't access Document properties from the thread - ProjectDomService.Parse (curentParseProject, currentParseFile, IdeApp.Services.PlatformService.GetMimeTypeForUri (currentParseFile)); + ProjectDomService.Parse (curentParseProject, currentParseFile, DesktopService.GetMimeTypeForUri (currentParseFile)); }); } } @@ -461,7 +461,7 @@ namespace MonoDevelop.Ide.Gui if (editor == null) return; editor.TextChanged += OnDocumentChanged; - //this.parsedDocument = MonoDevelop.Projects.Dom.Parser.ProjectDomService.Parse (Project, FileName, MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeForUri (FileName), TextEditor.Text); + //this.parsedDocument = MonoDevelop.Projects.Dom.Parser.ProjectDomService.Parse (Project, FileName, DesktopService.GetMimeTypeForUri (FileName), TextEditor.Text); OnDocumentChanged (this, null); // If the new document is a text editor, attach the extensions @@ -500,7 +500,7 @@ namespace MonoDevelop.Ide.Gui parsing = true; try { string currentParseFile = FileName; - string mime = IdeApp.Services.PlatformService.GetMimeTypeForUri (currentParseFile); + string mime = DesktopService.GetMimeTypeForUri (currentParseFile); string currentParseText = TextEditor.Text; Project curentParseProject = Project; this.parsedDocument = ProjectDomService.Parse (curentParseProject, currentParseFile, mime, currentParseText); @@ -523,7 +523,7 @@ namespace MonoDevelop.Ide.Gui parsing = true; string currentParseFile = FileName; - string mime = IdeApp.Services.PlatformService.GetMimeTypeForUri (currentParseFile); + string mime = DesktopService.GetMimeTypeForUri (currentParseFile); GLib.Timeout.Add (ParseDelay, delegate { if (closed) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs index 6d83937e33..8063e4b715 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs @@ -75,7 +75,7 @@ namespace MonoDevelop.Ide if (string.IsNullOrEmpty (document.FileName)) return ImageService.GetPixbuf (MonoDevelop.Core.Gui.Stock.MiscFiles, iconSize); - return IdeApp.Services.PlatformService.GetPixbufForFile (document.FileName, iconSize); + return DesktopService.GetPixbufForFile (document.FileName, iconSize); } void ShowSelectedDocument () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Ide.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Ide.cs index 07e34d896c..b153aa72e8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Ide.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Ide.cs @@ -374,9 +374,5 @@ namespace MonoDevelop.Ide.Gui public ProjectService ProjectService { get { return MonoDevelop.Projects.Services.ProjectService; } } - - public PlatformService PlatformService { - get { return MonoDevelop.Core.Gui.Services.PlatformService; } - } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IdeStartup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IdeStartup.cs index 31b1d6db86..1de4ad6eaf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IdeStartup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IdeStartup.cs @@ -114,7 +114,7 @@ namespace MonoDevelop.Ide.Gui monitor.Step (1); Runtime.Initialize (true); //make sure that the platform service is initialised so that the Mac platform can subscribe to open-document events - MonoDevelop.Core.Gui.Services.PlatformService.ToString (); + DesktopService.Initialize (); monitor.Step (1); monitor.EndTask (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs index 01289074a8..fdfb422d0b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs @@ -694,9 +694,9 @@ namespace MonoDevelop.Ide.Gui mimeimage = new Gtk.Image (content.StockIconId, IconSize.Menu ); } else if (content.IsUntitled && content.UntitledName == null) { - mimeimage = new Gtk.Image (IdeApp.Services.PlatformService.GetPixbufForType ("gnome-fs-regular", Gtk.IconSize.Menu)); + mimeimage = new Gtk.Image (DesktopService.GetPixbufForType ("gnome-fs-regular", Gtk.IconSize.Menu)); } else { - mimeimage = new Gtk.Image (IdeApp.Services.PlatformService.GetPixbufForFile (content.ContentName ?? content.UntitledName, Gtk.IconSize.Menu)); + mimeimage = new Gtk.Image (DesktopService.GetPixbufForFile (content.ContentName ?? content.UntitledName, Gtk.IconSize.Menu)); } TabLabel tabLabel = new TabLabel (new Label (), mimeimage != null ? mimeimage : new Gtk.Image ("")); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs index 938c8ef896..c284a7bc37 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs @@ -593,11 +593,11 @@ namespace MonoDevelop.Ide.Gui tabLabel.Icon = new Gtk.Image ( content.StockIconId, IconSize.Menu ); } else if (content.ContentName != null && content.ContentName.IndexOfAny (new char[] { '*', '+'}) == -1) { - tabLabel.Icon.Pixbuf = IdeApp.Services.PlatformService.GetPixbufForFile (content.ContentName, Gtk.IconSize.Menu); + tabLabel.Icon.Pixbuf = DesktopService.GetPixbufForFile (content.ContentName, Gtk.IconSize.Menu); } } catch (Exception ex) { LoggingService.LogError (ex.ToString ()); - tabLabel.Icon.Pixbuf = IdeApp.Services.PlatformService.GetPixbufForType ("gnome-fs-regular", Gtk.IconSize.Menu); + tabLabel.Icon.Pixbuf = DesktopService.GetPixbufForType ("gnome-fs-regular", Gtk.IconSize.Menu); } if (TitleChanged != null) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs index 4cd707a928..6354f3b2f5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs @@ -293,12 +293,12 @@ namespace MonoDevelop.Ide.Gui { List<FileViewer> list = new List<FileViewer> (); - string mimeType = IdeApp.Services.PlatformService.GetMimeTypeForUri (fileName); + string mimeType = DesktopService.GetMimeTypeForUri (fileName); foreach (IDisplayBinding bin in DisplayBindingService.GetBindingsForMimeType (mimeType)) list.Add (new FileViewer (bin)); - foreach (DesktopApplication app in IdeApp.Services.PlatformService.GetAllApplications (mimeType)) + foreach (DesktopApplication app in DesktopService.GetAllApplications (mimeType)) if (app.Command != "monodevelop") list.Add (new FileViewer (app)); @@ -684,7 +684,7 @@ namespace MonoDevelop.Ide.Gui if (oFileInfo.DisplayBinding != null) { binding = oFileInfo.DisplayBinding; } else { - binding = DisplayBindingService.GetBinding (fileName, IdeApp.Services.PlatformService.GetMimeTypeForUri (fileName)); + binding = DisplayBindingService.GetBinding (fileName, DesktopService.GetMimeTypeForUri (fileName)); } if (binding != null) { @@ -719,7 +719,7 @@ namespace MonoDevelop.Ide.Gui //if (mimetype != null) { // mimetype.DefaultAction.Launch (); //} else { - IdeApp.Services.PlatformService.ShowUrl ("file://" + fileName); + DesktopService.ShowUrl ("file://" + fileName); //} } catch (Exception ex) { LoggingService.LogError ("Error opening file: " + fileName, ex); @@ -877,7 +877,7 @@ namespace MonoDevelop.Ide.Gui if (binding.CanCreateContentForUri (fileName)) { newContent = binding.CreateContentForUri (fileName); } else { - string mimeType = IdeApp.Services.PlatformService.GetMimeTypeForUri (fileName); + string mimeType = DesktopService.GetMimeTypeForUri (fileName); if (!binding.CanCreateContentForMimeType (mimeType)) { fileInfo.ProgressMonitor.ReportError (GettextCatalog.GetString ("The file '{0}' could not be opened.", fileName), null); return; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs index 7288c5683f..2c0f907423 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs @@ -352,7 +352,7 @@ namespace MonoDevelop.Ide.Templates while (File.Exists (fn + n + ext)) n++; FileService.MoveFile (fn, fn + n + ext); - string mimeType = IdeApp.Services.PlatformService.GetMimeTypeForUri (fn + n + ext); + string mimeType = DesktopService.GetMimeTypeForUri (fn + n + ext); FileService.DeleteFile (fn + n + ext); if (mimeType == null || mimeType == "") mimeType = "text"; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs index 5a9ec73820..8ebe2f07f6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs @@ -235,7 +235,7 @@ namespace MonoDevelop.Ide.Templates string content = CreateContent (language); content = StringParserService.Parse (content, HashtableToStringArray (tags)); - string mime = IdeApp.Services.PlatformService.GetMimeTypeForUri (fileName); + string mime = DesktopService.GetMimeTypeForUri (fileName); IFormatter formatter = !String.IsNullOrEmpty (mime) ? TextFileService.GetFormatter (mime) : null; if (formatter != null) content = formatter.FormatText (policyParent, mime, content); diff --git a/main/src/core/MonoDevelop.Projects.Gui/ChangeLog b/main/src/core/MonoDevelop.Projects.Gui/ChangeLog index cc7a4c1286..cb59318c3e 100644 --- a/main/src/core/MonoDevelop.Projects.Gui/ChangeLog +++ b/main/src/core/MonoDevelop.Projects.Gui/ChangeLog @@ -1,3 +1,10 @@ +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.Projects.Gui.Dialogs/MimeTypePolicyOptionsPanel.cs: + * MonoDevelop.Projects.Gui.Dialogs/MimeTypePolicyOptionsSection.cs: + * MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CodeFormattingPanel.cs: + Use the new DesktopService instead of PlatformService. + 2009-06-17 Lluis Sanchez Gual <lluis@novell.com> * MonoDevelop.Projects.Gui.Dialogs\MimeTypePolicyOptionsSection.cs: diff --git a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CodeFormattingPanel.cs b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CodeFormattingPanel.cs index f749af76c2..86c599856c 100644 --- a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CodeFormattingPanel.cs +++ b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs.OptionPanels/CodeFormattingPanel.cs @@ -60,11 +60,11 @@ namespace MonoDevelop.Projects.Gui.Dialogs.OptionPanels MimeTypePanelData data = new MimeTypePanelData (); OptionsDialogSection sec = new OptionsDialogSection (typeof(MimeTypePolicyOptionsSection)); sec.Fill = true; - Gdk.Pixbuf icon = MonoDevelop.Core.Gui.Services.PlatformService.GetPixbufForType (mt, Gtk.IconSize.Menu); + Gdk.Pixbuf icon = DesktopService.GetPixbufForType (mt, Gtk.IconSize.Menu); sec.Icon = ImageService.GetStockId (icon, Gtk.IconSize.Menu); data.Section = sec; data.MimeType = mt;
- data.TypeDescription = MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeDescription (mt);
+ data.TypeDescription = DesktopService.GetMimeTypeDescription (mt);
if (string.IsNullOrEmpty (data.TypeDescription))
data.TypeDescription = mt; data.DataObject = DataObject; @@ -88,7 +88,7 @@ namespace MonoDevelop.Projects.Gui.Dialogs.OptionPanels void LoadPolicyTypeData (MimeTypePanelData data, string mimeType) { List<string> types = new List<string> (); - types.AddRange (MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeInheritanceChain (mimeType)); + types.AddRange (DesktopService.GetMimeTypeInheritanceChain (mimeType)); List<IMimeTypePolicyOptionsPanel> panels = new List<IMimeTypePolicyOptionsPanel> (); bool useParentPolicy = false; @@ -147,8 +147,8 @@ namespace MonoDevelop.Projects.Gui.Dialogs.OptionPanels } else if (item is Project) { foreach (ProjectFile pf in ((Project)item).Files) { - string mt = MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeForUri (pf.FilePath); - foreach (string mth in MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeInheritanceChain (mt)) + string mt = DesktopService.GetMimeTypeForUri (pf.FilePath); + foreach (string mth in DesktopService.GetMimeTypeInheritanceChain (mt)) types.Add (mth); } } @@ -184,8 +184,18 @@ namespace MonoDevelop.Projects.Gui.Dialogs.OptionPanels CellRendererComboBox comboCell = new CellRendererComboBox (); comboCell.Changed += OnPolicySelectionChanged; - tree.AppendColumn (GettextCatalog.GetString ("Policy"), comboCell, new Gtk.TreeCellDataFunc (OnSetPolicyData)); + Gtk.TreeViewColumn polCol = tree.AppendColumn (GettextCatalog.GetString ("Policy"), comboCell, new Gtk.TreeCellDataFunc (OnSetPolicyData)); + tree.Selection.Changed += delegate { + Gtk.TreeIter it; + tree.Selection.GetSelected (out it); + Gtk.TreeViewColumn ccol; + Gtk.TreePath path; + tree.GetCursor (out path, out ccol); + if (ccol == polCol) + tree.SetCursor (path, ccol, true); + }; + Fill (); } @@ -245,9 +255,8 @@ namespace MonoDevelop.Projects.Gui.Dialogs.OptionPanels void Fill () { - PlatformService pf = MonoDevelop.Core.Gui.Services.PlatformService; foreach (MimeTypePanelData mt in panel.GetMimeTypeData ()) { - store.AppendValues (mt, pf.GetPixbufForType (mt.MimeType, Gtk.IconSize.Menu), mt.TypeDescription); + store.AppendValues (mt, DesktopService.GetPixbufForType (mt.MimeType, Gtk.IconSize.Menu), mt.TypeDescription); } } diff --git a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/MimeTypePolicyOptionsPanel.cs b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/MimeTypePolicyOptionsPanel.cs index 2503c675a5..47aea7b69c 100644 --- a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/MimeTypePolicyOptionsPanel.cs +++ b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/MimeTypePolicyOptionsPanel.cs @@ -30,6 +30,7 @@ using Gtk; using System.Linq; using MonoDevelop.Core; +using MonoDevelop.Core.Gui; using MonoDevelop.Core.Gui.Dialogs; using MonoDevelop.Projects; using MonoDevelop.Projects.Policies; @@ -74,7 +75,7 @@ namespace MonoDevelop.Projects.Gui.Dialogs this.mimeType = mimeType; this.policyContainer = policyContainer; this.isExactMimeType = isExactMimeType; - mimeTypeScopes = MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeInheritanceChain (mimeType); + mimeTypeScopes = DesktopService.GetMimeTypeInheritanceChain (mimeType); } void IMimeTypePolicyOptionsPanel.SetParentSection (MimeTypePolicyOptionsSection section) @@ -236,7 +237,7 @@ namespace MonoDevelop.Projects.Gui.Dialogs box.Spacing = 6; string baseType = mimeTypeScopes.ElementAt (1); - baseType = MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeDescription (baseType); + baseType = DesktopService.GetMimeTypeDescription (baseType); defaultSettingsButton = new CheckButton (GettextCatalog.GetString ("Use default settings from '{0}'", baseType)); defaultSettingsButton.Clicked += delegate { if (defaultSettingsButton.Active) { diff --git a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/MimeTypePolicyOptionsSection.cs b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/MimeTypePolicyOptionsSection.cs index 62e61887c1..b66fa64794 100644 --- a/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/MimeTypePolicyOptionsSection.cs +++ b/main/src/core/MonoDevelop.Projects.Gui/MonoDevelop.Projects.Gui.Dialogs/MimeTypePolicyOptionsSection.cs @@ -31,6 +31,7 @@ using System.Linq; using Mono.Addins; using MonoDevelop.Core; +using MonoDevelop.Core.Gui; using MonoDevelop.Core.Gui.Dialogs; using MonoDevelop.Projects; using MonoDevelop.Projects.Policies; @@ -99,7 +100,7 @@ namespace MonoDevelop.Projects.Gui.Dialogs // Get the panels for all mime types List<string> types = new List<string> (); - types.AddRange (MonoDevelop.Core.Gui.Services.PlatformService.GetMimeTypeInheritanceChain (mimeType)); + types.AddRange (DesktopService.GetMimeTypeInheritanceChain (mimeType)); panelData.SectionLoaded = true; panels = panelData.Panels; diff --git a/main/src/core/MonoDevelop.Projects/ChangeLog b/main/src/core/MonoDevelop.Projects/ChangeLog index 4a9022d2c2..23405d3d61 100644 --- a/main/src/core/MonoDevelop.Projects/ChangeLog +++ b/main/src/core/MonoDevelop.Projects/ChangeLog @@ -1,5 +1,10 @@ 2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + * MonoDevelop.Projects.Dom.Parser/AbstractParser.cs: Use the + new DesktopService instead of PlatformService. + +2009-06-23 Lluis Sanchez Gual <lluis@novell.com> + * MonoDevelop.Projects/Project.cs: * MonoDevelop.Projects/DotNetProject.cs: * MonoDevelop.Projects/DotNetProjectConfiguration.cs: diff --git a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom.Parser/AbstractParser.cs b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom.Parser/AbstractParser.cs index 1af0b5de78..419825e590 100644 --- a/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom.Parser/AbstractParser.cs +++ b/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects.Dom.Parser/AbstractParser.cs @@ -84,7 +84,6 @@ namespace MonoDevelop.Projects.Dom.Parser public virtual bool CanParse (string fileName) { return false; -// return CanParseMimeType (IdeApp.Services.PlatformService.GetMimeTypeForUri (fileName)); } public string[] LexerTags { |