Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/macdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémie Laval <jeremie.laval@gmail.com>2012-12-11 13:05:03 +0400
committerJérémie Laval <jeremie.laval@gmail.com>2012-12-11 13:05:03 +0400
commitf0af9bf24fcb1f9fbab7b1cfdaaef6a9b0d230ee (patch)
treeba027505bbb9ba65497be60ac1965cea66514b6a
parent39f0689e2821e0e3e2843491c606d888474fb665 (diff)
[macdoc] Check for lion or better
-rw-r--r--AppDelegate.cs7
-rw-r--r--WebViewExtraordinaire.cs6
2 files changed, 7 insertions, 6 deletions
diff --git a/AppDelegate.cs b/AppDelegate.cs
index 2a43a8c..f612061 100644
--- a/AppDelegate.cs
+++ b/AppDelegate.cs
@@ -65,10 +65,11 @@ namespace macdoc
ExtractImages ();
controller = new MonodocDocumentController ();
- // Some UI feature we use rely on Lion, so special case it
+ // Some UI feature we use rely on Lion or better, so special case it
try {
var version = new NSDictionary ("/System/Library/CoreServices/SystemVersion.plist");
- isOnLion = version.ObjectForKey (new NSString ("ProductVersion")).ToString ().StartsWith ("10.7");
+ var osxVersion = Version.Parse (version.ObjectForKey (new NSString ("ProductVersion")).ToString ());
+ isOnLion = osxVersion.Major == 10 && osxVersion.Minor >= 7;
} catch {}
// Load documentation
@@ -171,7 +172,7 @@ namespace macdoc
private set;
}
- public static bool IsOnLion {
+ public static bool IsOnLionOrBetter {
get {
return isOnLion;
}
diff --git a/WebViewExtraordinaire.cs b/WebViewExtraordinaire.cs
index dc004a4..b5ac6d2 100644
--- a/WebViewExtraordinaire.cs
+++ b/WebViewExtraordinaire.cs
@@ -43,7 +43,7 @@ namespace macdoc
void Initialize ()
{
// The initializations we do here are Lion-specific
- if (!AppDelegate.IsOnLion)
+ if (!AppDelegate.IsOnLionOrBetter)
return;
findBarController = new FindBarExtraordinaireController ();
IsSwipeEnabled = NSEvent.IsSwipeTrackingFromScrollEventsEnabled;
@@ -83,7 +83,7 @@ namespace macdoc
public override bool AcceptsFirstResponder ()
{
- return AppDelegate.IsOnLion;
+ return AppDelegate.IsOnLionOrBetter;
}
void FireSwipeEvent (SwipeSide side)
@@ -102,7 +102,7 @@ namespace macdoc
public override void PerformFindPanelAction (NSObject sender)
{
- if (!AppDelegate.IsOnLion)
+ if (!AppDelegate.IsOnLionOrBetter)
return;
var ctrl = sender as NSMenuItem;