Hiding Dock Icon, Programatically showing it while opening setup or events. Added menu-item for ending the application
This commit is contained in:
parent
db1dbf8178
commit
c5f75c9c5b
|
@ -8,9 +8,11 @@
|
||||||
<string>org.sparkleshare.sparkleshare</string>
|
<string>org.sparkleshare.sparkleshare</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>SparkleShare</string>
|
<string>SparkleShare</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>10.6</string>
|
<string>10.6</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>LSUIElement</key>
|
||||||
<string>1</string>
|
<string>1</string>
|
||||||
<key>NSMainNibFile</key>
|
<key>NSMainNibFile</key>
|
||||||
<string>MainMenu</string>
|
<string>MainMenu</string>
|
||||||
|
|
|
@ -28,6 +28,8 @@ using MonoMac.WebKit;
|
||||||
namespace SparkleShare {
|
namespace SparkleShare {
|
||||||
|
|
||||||
public class SparkleEventLog : NSWindow {
|
public class SparkleEventLog : NSWindow {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public SparkleEventLogController Controller = new SparkleEventLogController ();
|
public SparkleEventLogController Controller = new SparkleEventLogController ();
|
||||||
|
|
||||||
|
@ -51,7 +53,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
// TODO: Window needs to be made resizable
|
// TODO: Window needs to be made resizable
|
||||||
public SparkleEventLog () : base ()
|
public SparkleEventLog () : base ()
|
||||||
{
|
{
|
||||||
Title = "Recent Events";
|
Title = "Recent Events";
|
||||||
Delegate = new SparkleEventsDelegate ();
|
Delegate = new SparkleEventsDelegate ();
|
||||||
|
|
||||||
|
|
4
SparkleShare/Mac/SparkleShare.csproj
Executable file → Normal file
4
SparkleShare/Mac/SparkleShare.csproj
Executable file → Normal file
|
@ -6,7 +6,7 @@
|
||||||
<ProductVersion>10.0.0</ProductVersion>
|
<ProductVersion>10.0.0</ProductVersion>
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
<ProjectGuid>{CF5BC8DB-A633-4FCC-8A3E-E3AC9B59FABC}</ProjectGuid>
|
<ProjectGuid>{CF5BC8DB-A633-4FCC-8A3E-E3AC9B59FABC}</ProjectGuid>
|
||||||
<ProjectTypeGuids>{1C533B1C-72DD-4CB1-9F6B-BF11D93BCFBE};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RootNamespace>SparkleShare</RootNamespace>
|
<RootNamespace>SparkleShare</RootNamespace>
|
||||||
<AssemblyName>SparkleShare</AssemblyName>
|
<AssemblyName>SparkleShare</AssemblyName>
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Include="MainMenu.xib" />
|
<InterfaceDefinition Include="MainMenu.xib" xmlns="" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Info.plist" />
|
<None Include="Info.plist" />
|
||||||
|
|
|
@ -46,6 +46,7 @@ namespace SparkleShare {
|
||||||
private NSMenuItem AboutMenuItem;
|
private NSMenuItem AboutMenuItem;
|
||||||
private NSMenuItem NotificationsMenuItem;
|
private NSMenuItem NotificationsMenuItem;
|
||||||
private NSMenuItem RecentEventsMenuItem;
|
private NSMenuItem RecentEventsMenuItem;
|
||||||
|
private NSMenuItem QuitAppMenuItem;
|
||||||
private NSImage [] AnimationFrames;
|
private NSImage [] AnimationFrames;
|
||||||
private NSImage [] AnimationFramesActive;
|
private NSImage [] AnimationFramesActive;
|
||||||
private NSImage ErrorImage;
|
private NSImage ErrorImage;
|
||||||
|
@ -251,6 +252,9 @@ namespace SparkleShare {
|
||||||
if (Controller.Folders.Length > 0) {
|
if (Controller.Folders.Length > 0) {
|
||||||
RecentEventsMenuItem.Activated += delegate {
|
RecentEventsMenuItem.Activated += delegate {
|
||||||
InvokeOnMainThread (delegate {
|
InvokeOnMainThread (delegate {
|
||||||
|
//Show the icon in Dock
|
||||||
|
Program.UI.SetRegularActivationPolicy();
|
||||||
|
|
||||||
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
|
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
|
||||||
|
|
||||||
if (SparkleUI.EventLog == null)
|
if (SparkleUI.EventLog == null)
|
||||||
|
@ -303,9 +307,21 @@ namespace SparkleShare {
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
QuitAppMenuItem = new NSMenuItem () {
|
||||||
|
Title = "Quit SparkleShare",
|
||||||
|
Enabled = true
|
||||||
|
};
|
||||||
|
|
||||||
|
QuitAppMenuItem.Activated += delegate {
|
||||||
|
InvokeOnMainThread (delegate {
|
||||||
|
NSApplication.SharedApplication.Terminate(this);
|
||||||
|
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
Menu.AddItem (AboutMenuItem);
|
Menu.AddItem (QuitAppMenuItem);
|
||||||
|
|
||||||
StatusItem.Menu = Menu;
|
StatusItem.Menu = Menu;
|
||||||
StatusItem.Menu.Update ();
|
StatusItem.Menu.Update ();
|
||||||
|
|
|
@ -67,6 +67,8 @@ namespace SparkleShare {
|
||||||
Bubbles = new SparkleBubbles ();
|
Bubbles = new SparkleBubbles ();
|
||||||
|
|
||||||
if (Program.Controller.FirstRun) {
|
if (Program.Controller.FirstRun) {
|
||||||
|
//Show Icon in Dock
|
||||||
|
this.SetRegularActivationPolicy();
|
||||||
Setup = new SparkleSetup ();
|
Setup = new SparkleSetup ();
|
||||||
Setup.Controller.ShowSetupPage ();
|
Setup.Controller.ShowSetupPage ();
|
||||||
}
|
}
|
||||||
|
@ -90,6 +92,11 @@ namespace SparkleShare {
|
||||||
{
|
{
|
||||||
NSApplication.Main (new string [0]);
|
NSApplication.Main (new string [0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetRegularActivationPolicy()
|
||||||
|
{
|
||||||
|
NSApplication.SharedApplication.ActivationPolicy = NSApplicationActivationPolicy.Regular;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[Export("registrationDictionaryForGrowl")]
|
[Export("registrationDictionaryForGrowl")]
|
||||||
|
|
Loading…
Reference in a new issue