From 7692197dbc5e2fee77dda03184f7f1664496f6ca Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 15 Jul 2012 15:15:33 +0200 Subject: [PATCH] Code cleanup --- SparkleShare/Linux/SparkleUI.cs | 3 ++- SparkleShare/Mac/SparkleBubbles.cs | 8 +++----- SparkleShare/Mac/SparkleController.cs | 3 +-- SparkleShare/Mac/SparkleSetup.cs | 4 ++-- SparkleShare/Mac/SparkleShare.csproj | 4 ++-- SparkleShare/Mac/SparkleUI.cs | 10 +++++----- SparkleShare/Program.cs | 13 +------------ SparkleShare/Windows/SparkleUI.cs | 3 ++- 8 files changed, 18 insertions(+), 30 deletions(-) diff --git a/SparkleShare/Linux/SparkleUI.cs b/SparkleShare/Linux/SparkleUI.cs index b212bf95..0c0df8bc 100644 --- a/SparkleShare/Linux/SparkleUI.cs +++ b/SparkleShare/Linux/SparkleUI.cs @@ -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; diff --git a/SparkleShare/Mac/SparkleBubbles.cs b/SparkleShare/Mac/SparkleBubbles.cs index c56f5c1f..97a2c1a9 100755 --- a/SparkleShare/Mac/SparkleBubbles.cs +++ b/SparkleShare/Mac/SparkleBubbles.cs @@ -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 (); } diff --git a/SparkleShare/Mac/SparkleController.cs b/SparkleShare/Mac/SparkleController.cs index 01679c15..5a948aba 100755 --- a/SparkleShare/Mac/SparkleController.cs +++ b/SparkleShare/Mac/SparkleController.cs @@ -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"); diff --git a/SparkleShare/Mac/SparkleSetup.cs b/SparkleShare/Mac/SparkleSetup.cs index 285d4f29..8b4da519 100755 --- a/SparkleShare/Mac/SparkleSetup.cs +++ b/SparkleShare/Mac/SparkleSetup.cs @@ -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]; diff --git a/SparkleShare/Mac/SparkleShare.csproj b/SparkleShare/Mac/SparkleShare.csproj index 987e1c18..1add0349 100644 --- a/SparkleShare/Mac/SparkleShare.csproj +++ b/SparkleShare/Mac/SparkleShare.csproj @@ -100,7 +100,7 @@ SparkleKeys.cs - + @@ -159,7 +159,6 @@ Pixmaps\process-syncing-iiiii.png - Pixmaps\process-syncing-error.png @@ -265,6 +264,7 @@ Plugins\ssnet.xml + diff --git a/SparkleShare/Mac/SparkleUI.cs b/SparkleShare/Mac/SparkleUI.cs index f7152fda..3a0a410c 100755 --- a/SparkleShare/Mac/SparkleUI.cs +++ b/SparkleShare/Mac/SparkleUI.cs @@ -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); diff --git a/SparkleShare/Program.cs b/SparkleShare/Program.cs index 39b17bb2..e40fb245 100644 --- a/SparkleShare/Program.cs +++ b/SparkleShare/Program.cs @@ -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."); diff --git a/SparkleShare/Windows/SparkleUI.cs b/SparkleShare/Windows/SparkleUI.cs index d7d6aa4b..008214ad 100644 --- a/SparkleShare/Windows/SparkleUI.cs +++ b/SparkleShare/Windows/SparkleUI.cs @@ -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;