Code cleanup

This commit is contained in:
Hylke Bons 2012-07-15 15:15:33 +02:00
parent 6dc28e2bc2
commit 7692197dbc
8 changed files with 18 additions and 30 deletions

View file

@ -31,7 +31,8 @@ using SparkleLib;
namespace SparkleShare {
public class SparkleUI {
// TODO: These don't need to be static
public static SparkleStatusIcon StatusIcon;
public static SparkleEventLog EventLog;
public static SparkleBubbles Bubbles;

View file

@ -43,12 +43,10 @@ namespace SparkleShare {
if (image_path != null) {
NSData image_data = NSData.FromFile (image_path);
GrowlApplicationBridge.Notify (title, subtext,
"Event", image_data, 0, false, new NSString (""));
GrowlApplicationBridge.Notify (title, subtext, "Event", image_data, 0, false, new NSString (""));
} else {
GrowlApplicationBridge.Notify (title, subtext,
"Event", null, 0, false, new NSString (""));
GrowlApplicationBridge.Notify (title, subtext, "Event", null, 0, false, new NSString (""));
}
});
};
@ -62,7 +60,7 @@ namespace SparkleShare {
public override void GrowlNotificationWasClicked (NSObject o)
{
NSApplication.SharedApplication.DockTile.BadgeLabel = null;
SparkleUI.Bubbles.Controller.BubbleClicked ();
Program.UI.Bubbles.Controller.BubbleClicked ();
}

View file

@ -43,8 +43,7 @@ namespace SparkleShare {
{
using (var a = new NSAutoreleasePool ())
{
string content_path =
Directory.GetParent (System.AppDomain.CurrentDomain.BaseDirectory).ToString ();
string content_path = Directory.GetParent (System.AppDomain.CurrentDomain.BaseDirectory).ToString ();
string app_path = Directory.GetParent (content_path).ToString ();
string growl_path = Path.Combine (app_path, "Frameworks", "Growl.framework", "Growl");

View file

@ -1134,8 +1134,8 @@ namespace SparkleShare {
{
if (table_column.HeaderToolTip.Equals ("Description")) {
if (table_view.SelectedRow == row_index &&
SparkleUI.Setup.IsKeyWindow &&
SparkleUI.Setup.FirstResponder == table_view) {
Program.UI.Setup.IsKeyWindow &&
Program.UI.Setup.FirstResponder == table_view) {
return SelectedCells [row_index];

View file

@ -100,7 +100,7 @@
</Compile>
<Compile Include="..\SparkleKeys.cs">
<Link>SparkleKeys.cs</Link>
</Compile>
</Compile>
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="MainMenu.xib" xmlns="" />
@ -159,7 +159,6 @@
<Content Include="Pixmaps\process-syncing-iiiii.png">
<Link>Pixmaps\process-syncing-iiiii.png</Link>
</Content>
<Content Include="Growl.plist" />
<Content Include="Pixmaps\process-syncing-error.png">
<Link>Pixmaps\process-syncing-error.png</Link>
</Content>
@ -265,6 +264,7 @@
<Content Include="..\Common\Plugins\ssnet.xml">
<Link>Plugins\ssnet.xml</Link>
</Content>
<Content Include="Growl.plist" />
</ItemGroup>
<ItemGroup>
<Folder Include="Pixmaps\" />

View file

@ -29,11 +29,11 @@ namespace SparkleShare {
public class SparkleUI : AppDelegate {
public static SparkleStatusIcon StatusIcon;
public static SparkleEventLog EventLog;
public static SparkleSetup Setup;
public static SparkleBubbles Bubbles;
public static SparkleAbout About;
public SparkleStatusIcon StatusIcon;
public SparkleEventLog EventLog;
public SparkleSetup Setup;
public SparkleBubbles Bubbles;
public SparkleAbout About;
public static NSFont Font = NSFontManager.SharedFontManager.FontWithFamily (
"Lucida Grande", NSFontTraitMask.Condensed, 0, 13);

View file

@ -31,17 +31,6 @@ namespace SparkleShare {
public static SparkleUI UI;
private static Mutex program_mutex = new Mutex (false, "SparkleShare");
// Short alias for the translations
public static string _ (string s)
{
#if __MonoCS__
return Catalog.GetString (s);
#else
return s;
#endif
}
#if !__MonoCS__
@ -54,7 +43,7 @@ namespace SparkleShare {
Console.WriteLine ("SparkleShare is a collaboration and sharing tool that is ");
Console.WriteLine ("designed to keep things simple and to stay out of your way.");
Console.WriteLine (" ");
Console.WriteLine ("Version: " + SparkleLib.Defines.VERSION);
Console.WriteLine ("Version: " + SparkleLib.SparkleBackend.Version);
Console.WriteLine ("Copyright (C) 2010 Hylke Bons");
Console.WriteLine (" ");
Console.WriteLine ("This program comes with ABSOLUTELY NO WARRANTY.");

View file

@ -21,7 +21,8 @@ using System.Windows.Forms;
namespace SparkleShare {
public class SparkleUI {
// TODO: These don't need to be static
public static SparkleSetup Setup;
public static SparkleEventLog EventLog;
public static SparkleBubbles Bubbles;