[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 CloseButton;
|
||||||
private NSButton OpenFolderButton;
|
private NSButton OpenFolderButton;
|
||||||
|
|
||||||
|
public SparkleLog (IntPtr handle) : base (handle) { }
|
||||||
|
|
||||||
public SparkleLog (string path) : base ()
|
public SparkleLog (string path) : base ()
|
||||||
{
|
{
|
||||||
|
@ -116,9 +117,9 @@ namespace SparkleShare {
|
||||||
public override void WillClose (NSNotification notification)
|
public override void WillClose (NSNotification notification)
|
||||||
{
|
{
|
||||||
|
|
||||||
Console.WriteLine ("CLOSING " + (notification.Object as SparkleLog).LocalPath);
|
InvokeOnMainThread (delegate {
|
||||||
|
|
||||||
SparkleUI.OpenLogs.Remove ((SparkleLog) notification.Object);
|
SparkleUI.OpenLogs.Remove ((SparkleLog) notification.Object);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,10 +81,10 @@
|
||||||
<Content Include="Pixmaps\idle3.png" />
|
<Content Include="Pixmaps\idle3.png" />
|
||||||
<Content Include="Pixmaps\sparkleshare-idle.png" />
|
<Content Include="Pixmaps\sparkleshare-idle.png" />
|
||||||
<Content Include="Pixmaps\sparkleshare-idle-focus.png" />
|
<Content Include="Pixmaps\sparkleshare-idle-focus.png" />
|
||||||
<Content Include="Pixmaps\sparkleshare.icns" />
|
|
||||||
<Content Include="..\..\..\data\side-splash.png">
|
<Content Include="..\..\..\data\side-splash.png">
|
||||||
<Link>Pixmaps\side-splash.png</Link>
|
<Link>Pixmaps\side-splash.png</Link>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="sparkleshare.icns" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\..\SparkleLib\SparkleLib.csproj">
|
<ProjectReference Include="..\..\..\SparkleLib\SparkleLib.csproj">
|
||||||
|
|
|
@ -41,6 +41,9 @@ namespace SparkleShare {
|
||||||
private NSMenuItem NotificationsMenuItem;
|
private NSMenuItem NotificationsMenuItem;
|
||||||
private NSMenuItem AboutMenuItem;
|
private NSMenuItem AboutMenuItem;
|
||||||
|
|
||||||
|
private delegate void Task ();
|
||||||
|
private EventHandler [] Tasks;
|
||||||
|
|
||||||
|
|
||||||
// Short alias for the translations
|
// Short alias for the translations
|
||||||
public static string _ (string s)
|
public static string _ (string s)
|
||||||
|
@ -61,6 +64,7 @@ namespace SparkleShare {
|
||||||
SetNormalState ();
|
SetNormalState ();
|
||||||
CreateMenu ();
|
CreateMenu ();
|
||||||
|
|
||||||
|
Menu.Delegate = new SparkleStatusIconMenuDelegate ();
|
||||||
|
|
||||||
|
|
||||||
SparkleShare.Controller.FolderSizeChanged += delegate {
|
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
|
// A method reference that makes sure that opening the
|
||||||
// event log for each repository works correctly
|
// event log for each repository works correctly
|
||||||
private EventHandler OpenEventLogDelegate (string path)
|
private EventHandler OpenEventLogDelegate (string path)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
return delegate {
|
return delegate {
|
||||||
|
|
||||||
SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) {
|
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
|
// 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
|
// 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));
|
SparkleUI.OpenLogs.Add (new SparkleLog (path));
|
||||||
else
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
InvokeOnMainThread (delegate {
|
||||||
log.OrderFrontRegardless ();
|
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.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> ();
|
OpenLogs = new List <SparkleLog> ();
|
||||||
StatusIcon = new SparkleStatusIcon ();
|
StatusIcon = new SparkleStatusIcon ();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue