diff options
author | Miguel de Icaza <miguel@gnome.org> | 2010-12-29 23:04:04 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2010-12-29 23:04:04 +0300 |
commit | 0224a05d26b27c5f1c3765997177e5d49bf093f7 (patch) | |
tree | 947f2b8edf8a41de0e19060f39c1faac83331072 /AppDelegate.cs | |
parent | d5ef62e71ab8944df2e3835d4e90ec4ae738864f (diff) |
Small UI touch ups
Diffstat (limited to 'AppDelegate.cs')
-rw-r--r-- | AppDelegate.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/AppDelegate.cs b/AppDelegate.cs index ed10fae..fb89607 100644 --- a/AppDelegate.cs +++ b/AppDelegate.cs @@ -3,18 +3,47 @@ using System.Drawing; using MonoMac.Foundation; using MonoMac.AppKit; using Monodoc; +using System.IO; namespace macdoc { public partial class AppDelegate : NSApplicationDelegate { static public RootTree Root; + static public string MonodocDir; + static public NSUrl MonodocBaseUrl; + + static void ExtractImages () + { + var mdocAssembly = typeof (Node).Assembly; + + foreach (var res in mdocAssembly.GetManifestResourceNames ()){ + if (!res.EndsWith (".png") || res.EndsWith (".jpg")) + continue; + + using (var output = File.Create (Path.Combine (MonodocDir, "mdocimages", res))) + mdocAssembly.GetManifestResourceStream (res).CopyTo (output); + } + } public AppDelegate () { + MonodocDir = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Library/Caches/MacDoc/"); + var mdocimages = Path.Combine (MonodocDir, "mdocimages"); + MonodocBaseUrl = new NSUrl (MonodocDir); + if (!Directory.Exists (mdocimages)){ + try { + Directory.CreateDirectory (mdocimages); + } catch {} + } + + ExtractImages (); + Root = RootTree.LoadTree (null); SettingsHandler.Settings.EnableEditing = false; + SettingsHandler.Settings.preferred_font_size = 200; HelpSource.use_css = true; + } public override void FinishedLaunching (NSObject notification) |