mac: add About entry to status menu
This commit is contained in:
parent
307a3d964e
commit
6e5e057afd
|
@ -2,13 +2,13 @@
|
|||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1060</int>
|
||||
<string key="IBDocument.SystemVersion">10D2162</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">762</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.29</string>
|
||||
<string key="IBDocument.HIToolboxVersion">460.00</string>
|
||||
<string key="IBDocument.SystemVersion">10J869</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">851</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">762</string>
|
||||
<string key="NS.object.0">851</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
|
@ -19,13 +19,8 @@
|
|||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
|
@ -666,14 +661,6 @@
|
|||
</object>
|
||||
<int key="connectionID">39</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">orderFrontStandardAboutPanel:</string>
|
||||
<reference key="source" ref="1021"/>
|
||||
<reference key="destination" ref="238522557"/>
|
||||
</object>
|
||||
<int key="connectionID">142</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">toggleContinuousSpellChecking:</string>
|
||||
|
@ -976,7 +963,9 @@
|
|||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<object class="NSArray" key="object" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="children" ref="1048"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace SparkleShare {
|
|||
SetFrame (new RectangleF (0, 0, 360, 288), true);
|
||||
Center ();
|
||||
|
||||
Delegate = new SparkleAboutDelegate ();
|
||||
StyleMask = (NSWindowStyle.Closable | NSWindowStyle.Titled);
|
||||
Title = "About SparkleShare";
|
||||
MaxSize = new SizeF (360, 288);
|
||||
|
@ -71,6 +72,12 @@ namespace SparkleShare {
|
|||
});
|
||||
};
|
||||
|
||||
CheckForNewVersion ();
|
||||
}
|
||||
|
||||
|
||||
public void CheckForNewVersion ()
|
||||
{
|
||||
SparkleShare.Controller.CheckForNewVersion ();
|
||||
}
|
||||
|
||||
|
@ -137,10 +144,8 @@ namespace SparkleShare {
|
|||
};
|
||||
|
||||
WebsiteButton.Activated += delegate {
|
||||
|
||||
NSUrl url = new NSUrl ("http://www.sparkleshare.org/");
|
||||
NSWorkspace.SharedWorkspace.OpenUrl (url);
|
||||
|
||||
};
|
||||
|
||||
CreditsButton = new NSButton () {
|
||||
|
@ -166,4 +171,14 @@ namespace SparkleShare {
|
|||
ContentView.AddSubview (WebsiteButton);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class SparkleAboutDelegate : NSWindowDelegate {
|
||||
|
||||
public override bool WindowShouldClose (NSObject sender)
|
||||
{
|
||||
(sender as SparkleAbout).OrderOut (this);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace SparkleShare {
|
|||
private NSMenuItem FolderMenuItem;
|
||||
private NSMenuItem [] FolderMenuItems;
|
||||
private NSMenuItem SyncMenuItem;
|
||||
private NSMenuItem AboutMenuItem;
|
||||
private NSMenuItem NotificationsMenuItem;
|
||||
|
||||
private delegate void Task ();
|
||||
|
@ -232,6 +233,7 @@ namespace SparkleShare {
|
|||
Menu.AddItem (SyncMenuItem);
|
||||
Menu.AddItem (NSMenuItem.SeparatorItem);
|
||||
|
||||
|
||||
NotificationsMenuItem = new NSMenuItem ();
|
||||
|
||||
if (SparkleShare.Controller.NotificationsEnabled)
|
||||
|
@ -251,6 +253,29 @@ namespace SparkleShare {
|
|||
};
|
||||
|
||||
Menu.AddItem (NotificationsMenuItem);
|
||||
Menu.AddItem (NSMenuItem.SeparatorItem);
|
||||
|
||||
|
||||
AboutMenuItem = new NSMenuItem () {
|
||||
Title = "About SparkleShare"
|
||||
};
|
||||
|
||||
AboutMenuItem.Activated += delegate {
|
||||
InvokeOnMainThread (delegate {
|
||||
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
|
||||
|
||||
if (SparkleUI.About == null)
|
||||
SparkleUI.About = new SparkleAbout ();
|
||||
|
||||
SparkleUI.About.OrderFrontRegardless ();
|
||||
SparkleUI.About.MakeKeyAndOrderFront (this);
|
||||
SparkleUI.About.CheckForNewVersion ();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Menu.AddItem (AboutMenuItem);
|
||||
|
||||
|
||||
StatusItem.Menu = Menu;
|
||||
StatusItem.Menu.Update ();
|
||||
|
|
|
@ -53,6 +53,7 @@ namespace SparkleShare {
|
|||
public static SparkleStatusIcon StatusIcon;
|
||||
public static List <SparkleLog> OpenLogs;
|
||||
public static SparkleIntro Intro;
|
||||
public static SparkleAbout About;
|
||||
public static NSFont Font;
|
||||
|
||||
private NSAlert alert;
|
||||
|
|
Loading…
Reference in a new issue