Add SparkleAbout to .csproj

This commit is contained in:
Hylke Bons 2011-03-08 23:55:21 +00:00
parent a13d6a996c
commit 5d8717d354
5 changed files with 57 additions and 36 deletions

View file

@ -15,11 +15,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
using GitSharp;
using GitSharp.Commands;
using GitSharp.Core.Transport;
using Meebey.SmartIrc4net;
using Mono.Unix;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
@ -27,6 +22,12 @@ using System.IO;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Timers; using System.Timers;
using GitSharp;
using GitSharp.Commands;
using GitSharp.Core.Transport;
using Meebey.SmartIrc4net;
using Mono.Unix;
namespace SparkleLib { namespace SparkleLib {
public class SparkleRepo : Repository { public class SparkleRepo : Repository {

View file

@ -12,7 +12,7 @@
</object> </object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<integer value="29"/> <integer value="57"/>
</object> </object>
<object class="NSArray" key="IBDocument.PluginDependencies"> <object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
@ -962,6 +962,14 @@
</object> </object>
<int key="connectionID">534</int> <int key="connectionID">534</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1050"/>
<reference key="destination" ref="238522557"/>
</object>
<int key="connectionID">538</int>
</object>
</object> </object>
<object class="IBMutableOrderedSet" key="objectRecords"> <object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects"> <object class="NSArray" key="orderedObjects">
@ -1768,7 +1776,7 @@
</object> </object>
</object> </object>
<nil key="sourceID"/> <nil key="sourceID"/>
<int key="maxID">534</int> <int key="maxID">538</int>
</object> </object>
<object class="IBClassDescriber" key="IBDocument.Classes"> <object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions"> <object class="NSMutableArray" key="referencedPartialClassDescriptions">

View file

@ -17,13 +17,13 @@
using System; using System;
using System.Drawing; using System.Drawing;
using System.IO;
using MonoMac.Foundation; using MonoMac.Foundation;
using MonoMac.AppKit; using MonoMac.AppKit;
using MonoMac.ObjCRuntime; using MonoMac.ObjCRuntime;
using MonoMac.WebKit; using MonoMac.WebKit;
using System.IO;
namespace SparkleShare { namespace SparkleShare {
public class SparkleLog : NSWindow { public class SparkleLog : NSWindow {

View file

@ -101,6 +101,7 @@
<Compile Include="..\SparkleShare.cs"> <Compile Include="..\SparkleShare.cs">
<Link>SparkleShare.cs</Link> <Link>SparkleShare.cs</Link>
</Compile> </Compile>
<Compile Include="SparkleAbout.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="MainMenu.xib" /> <Page Include="MainMenu.xib" />

View file

@ -20,6 +20,7 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Timers; using System.Timers;
using MonoMac.Foundation; using MonoMac.Foundation;
using MonoMac.AppKit; using MonoMac.AppKit;
using MonoMac.ObjCRuntime; using MonoMac.ObjCRuntime;
@ -28,35 +29,27 @@ using MonoMac.WebKit;
namespace SparkleShare { namespace SparkleShare {
public partial class AppDelegate : NSApplicationDelegate { public partial class AppDelegate : NSApplicationDelegate {
public override void WillBecomeActive (NSNotification notification)
{
SparkleUI.NewEvents = 0;
NSApplication.SharedApplication.DockTile.BadgeLabel = null;
}
} }
public class SparkleUI : AppDelegate public class SparkleUI : AppDelegate
{ {
public static SparkleStatusIcon StatusIcon; public static SparkleStatusIcon StatusIcon;
public static List <SparkleLog> OpenLogs; public static List <SparkleLog> OpenLogs;
public static int NewEvents; public static int NewEvents;
public static SparkleIntro Intro; public static SparkleIntro Intro;
public static NSFont Font; public static NSFont Font;
public SparkleAbout About;
public SparkleUI () public SparkleUI ()
{ {
NSApplication.Init (); NSApplication.Init ();
SetSparkleIcon (); SetSparkleIcon ();
// TODO: Getting crashes when I remove this // TODO: Getting crashes when I remove this
NSApplication.SharedApplication.ApplicationIconImage NSApplication.SharedApplication.ApplicationIconImage
= NSImage.ImageNamed ("sparkleshare.icns"); = NSImage.ImageNamed ("sparkleshare.icns");
@ -64,17 +57,18 @@ namespace SparkleShare {
Font = NSFontManager.SharedFontManager.FontWithFamily Font = NSFontManager.SharedFontManager.FontWithFamily
("Lucida Grande", NSFontTraitMask.Condensed, 0, 13); ("Lucida Grande", NSFontTraitMask.Condensed, 0, 13);
OpenLogs = new List <SparkleLog> (); OpenLogs = new List <SparkleLog> ();
StatusIcon = new SparkleStatusIcon (); StatusIcon = new SparkleStatusIcon ();
NewEvents = 0; NewEvents = 0;
SparkleShare.Controller.NotificationRaised += delegate { SparkleShare.Controller.NotificationRaised += delegate {
InvokeOnMainThread (delegate { InvokeOnMainThread (delegate {
NewEvents++; NewEvents++;
NSApplication.SharedApplication.DockTile.BadgeLabel = NewEvents.ToString (); NSApplication.SharedApplication.DockTile.BadgeLabel = NewEvents.ToString ();
@ -124,7 +118,7 @@ namespace SparkleShare {
public void SetSparkleIcon () public void SetSparkleIcon ()
{ {
string folder_icon_path = Path.Combine (NSBundle.MainBundle.ResourcePath, string folder_icon_path = Path.Combine (NSBundle.MainBundle.ResourcePath,
"sparkleshare-mac.icns"); "sparkleshare-mac.icns");
@ -132,17 +126,34 @@ namespace SparkleShare {
NSWorkspace.SharedWorkspace.SetIconforFile (folder_icon, NSWorkspace.SharedWorkspace.SetIconforFile (folder_icon,
SparkleShare.Controller.SparklePath, 0); SparkleShare.Controller.SparklePath, 0);
} }
public void Run () public void Run ()
{ {
NSApplication.Main (new string [0]); NSApplication.Main (new string [0]);
} }
public override void WillBecomeActive (NSNotification notification)
{
NewEvents = 0;
NSApplication.SharedApplication.DockTile.BadgeLabel = null;
}
public override void OrderFrontStandardAboutPanel (NSObject sender)
{
// FIXME: Doesn't work
About = new SparkleAbout ();
}
} }
} }