[osx] Fix some bugs an use sparkleshare.icns for the .app
This commit is contained in:
parent
7502358d69
commit
a6b80ab723
|
@ -32,6 +32,7 @@ namespace SparkleShare {
|
|||
private NSButton CloseButton;
|
||||
private NSButton OpenFolderButton;
|
||||
|
||||
public SparkleLog (IntPtr handle) : base (handle) { }
|
||||
|
||||
public SparkleLog (string path) : base ()
|
||||
{
|
||||
|
@ -116,9 +117,9 @@ namespace SparkleShare {
|
|||
public override void WillClose (NSNotification notification)
|
||||
{
|
||||
|
||||
Console.WriteLine ("CLOSING " + (notification.Object as SparkleLog).LocalPath);
|
||||
|
||||
InvokeOnMainThread (delegate {
|
||||
SparkleUI.OpenLogs.Remove ((SparkleLog) notification.Object);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -81,10 +81,10 @@
|
|||
<Content Include="Pixmaps\idle3.png" />
|
||||
<Content Include="Pixmaps\sparkleshare-idle.png" />
|
||||
<Content Include="Pixmaps\sparkleshare-idle-focus.png" />
|
||||
<Content Include="Pixmaps\sparkleshare.icns" />
|
||||
<Content Include="..\..\..\data\side-splash.png">
|
||||
<Link>Pixmaps\side-splash.png</Link>
|
||||
</Content>
|
||||
<Content Include="sparkleshare.icns" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\SparkleLib\SparkleLib.csproj">
|
||||
|
|
|
@ -41,6 +41,9 @@ namespace SparkleShare {
|
|||
private NSMenuItem NotificationsMenuItem;
|
||||
private NSMenuItem AboutMenuItem;
|
||||
|
||||
private delegate void Task ();
|
||||
private EventHandler [] Tasks;
|
||||
|
||||
|
||||
// Short alias for the translations
|
||||
public static string _ (string s)
|
||||
|
@ -61,6 +64,7 @@ namespace SparkleShare {
|
|||
SetNormalState ();
|
||||
CreateMenu ();
|
||||
|
||||
Menu.Delegate = new SparkleStatusIconMenuDelegate ();
|
||||
|
||||
|
||||
SparkleShare.Controller.FolderSizeChanged += delegate {
|
||||
|
@ -259,15 +263,11 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
|
||||
public delegate void Task();
|
||||
EventHandler [] Tasks;
|
||||
|
||||
// A method reference that makes sure that opening the
|
||||
// event log for each repository works correctly
|
||||
private EventHandler OpenEventLogDelegate (string path)
|
||||
{
|
||||
|
||||
|
||||
return delegate {
|
||||
|
||||
SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) {
|
||||
|
@ -276,10 +276,19 @@ namespace SparkleShare {
|
|||
|
||||
// Check whether the log is already open, create a new one if
|
||||
// that's not the case or present it to the user if it is
|
||||
if (log == null)
|
||||
if (log == null) {
|
||||
|
||||
InvokeOnMainThread (delegate {
|
||||
SparkleUI.OpenLogs.Add (new SparkleLog (path));
|
||||
else
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
InvokeOnMainThread (delegate {
|
||||
log.OrderFrontRegardless ();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
@ -364,6 +373,27 @@ namespace SparkleShare {
|
|||
|
||||
}
|
||||
|
||||
|
||||
public class SparkleStatusIconMenuDelegate : NSMenuDelegate {
|
||||
|
||||
public override void MenuWillHighlightItem (NSMenu menu, NSMenuItem item) { }
|
||||
|
||||
public override void MenuWillOpen (NSMenu menu)
|
||||
{
|
||||
|
||||
Console.WriteLine ("OPENED");
|
||||
|
||||
InvokeOnMainThread (delegate {
|
||||
|
||||
foreach (SparkleLog log in SparkleUI.OpenLogs)
|
||||
log.OrderFrontRegardless ();
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -42,15 +42,12 @@ namespace SparkleShare {
|
|||
{
|
||||
|
||||
NSApplication.Init ();
|
||||
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
|
||||
NSApplication.SharedApplication.applicationIconImage = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/sparkeshare.icns");
|
||||
|
||||
NSApplication.SharedApplication.applicationIconImage = NSImage.ImageNamed ("sparkleshare.icns");
|
||||
|
||||
OpenLogs = new List <SparkleLog> ();
|
||||
StatusIcon = new SparkleStatusIcon ();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue