diff --git a/SparkleLib/SparklePaths.cs b/SparkleLib/SparklePaths.cs index 45ed4ff0..138379f6 100644 --- a/SparkleLib/SparklePaths.cs +++ b/SparkleLib/SparklePaths.cs @@ -24,7 +24,7 @@ namespace SparkleLib { public static class SparklePaths { - public static string GitPath = GetGitPath (); + public static string GitPath = "/usr/bin/git"; // TODO: Don't hardcode this public static string HomePath = new UnixUserInfo (UnixEnvironment.UserName).HomeDirectory; diff --git a/SparkleShare/Mac/SparkleShare/Info.plist b/SparkleShare/Mac/SparkleShare/Info.plist index 553e5dec..4431992a 100644 --- a/SparkleShare/Mac/SparkleShare/Info.plist +++ b/SparkleShare/Mac/SparkleShare/Info.plist @@ -2,6 +2,8 @@ + CFBundleIconFile + sparkleshare.icns LSEnvironment PATH diff --git a/SparkleShare/Mac/SparkleShare/Main.cs b/SparkleShare/Mac/SparkleShare/Main.cs index 74b271e6..caaee850 100644 --- a/SparkleShare/Mac/SparkleShare/Main.cs +++ b/SparkleShare/Mac/SparkleShare/Main.cs @@ -1,3 +1,20 @@ +// SparkleShare, an instant update workflow to Git. +// Copyright (C) 2010 Hylke Bons +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + using System; using System.Drawing; using System.Timers; @@ -5,88 +22,39 @@ using MonoMac.Foundation; using MonoMac.AppKit; using MonoMac.ObjCRuntime; using MonoMac.WebKit; -using MonoMac.Growl; -namespace SparkleShare -{ - class MainClass - { - static void Main (string[] args) - { - NSApplication.Init (); - NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); - NSApplication.SharedApplication.applicationIconImage = NSImage.ImageNamed ("sparkleshare.icns"); - NSApplication.Main (args); - } +namespace SparkleShare { + + public partial class AppDelegate : NSApplicationDelegate { + // Workaround to be able to work with SparkleUI as the main class } - - - public partial class AppDelegate : NSApplicationDelegate + + public class SparkleUI : AppDelegate { - //MainWindowController mainWindowController; - NSStatusItem StatusItem; - - NSMenu Menu; - NSMenuItem FolderMenuItem; - NSMenuItem [] FolderMenuItems; - NSMenuItem SyncMenuItem; - NSMenuItem NotificationsMenuItem; - NSMenuItem AboutMenuItem; - NSMenuItem QuitMenuItem; - - SparkleLog Log; - - - int i = 0; + public SparkleStatusIcon StatusIcon; - /* public override NSMenu ApplicationDockMenu (NSApplication app) + public SparkleUI () { + + NSApplication.Init (); + //NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); + //NSApplication.SharedApplication.applicationIconImage = NSImage.ImageNamed ("sparkleshare.icns"); - return (NSMenu) Menu; - - } - */ - public AppDelegate () - { + //StatusIcon = new SparkleStatusIcon (); + } - - SparkleStatusIcon StatusIcon; - - public override void FinishedLaunching (NSObject notification) + + public void Run () { - StatusIcon = new SparkleStatusIcon (); - - /* tile = NSApplication.SharedApplication.DockTile; - tile.BadgeLabel = "!"; -tile.Display (); - */ - // mainWindowController = new MainWindowController (); - // mainWindowController.Window.MakeKeyAndOrderFront (this); - - // SparkleStatusIcon = new SparkleStatusIcon (); - - // SparkleRepo repo = new SparkleRepo ("/Users/hbons/SparkleShare/SparkleShare-Test"); - - //StatusItem = NSStatusBar.SystemStatusBar.CreateStatusItem (28); - - - - - - NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); - + NSApplication.Main (new string [0]); } - - - } } - diff --git a/SparkleShare/Mac/SparkleShare/idle-active.png b/SparkleShare/Mac/SparkleShare/Pixmaps/idle-active.png similarity index 100% rename from SparkleShare/Mac/SparkleShare/idle-active.png rename to SparkleShare/Mac/SparkleShare/Pixmaps/idle-active.png diff --git a/SparkleShare/Mac/SparkleShare/idle.png b/SparkleShare/Mac/SparkleShare/Pixmaps/idle.png similarity index 100% rename from SparkleShare/Mac/SparkleShare/idle.png rename to SparkleShare/Mac/SparkleShare/Pixmaps/idle.png diff --git a/SparkleShare/Mac/SparkleShare/idle0.png b/SparkleShare/Mac/SparkleShare/Pixmaps/idle0.png similarity index 100% rename from SparkleShare/Mac/SparkleShare/idle0.png rename to SparkleShare/Mac/SparkleShare/Pixmaps/idle0.png diff --git a/SparkleShare/Mac/SparkleShare/idle1.png b/SparkleShare/Mac/SparkleShare/Pixmaps/idle1.png similarity index 100% rename from SparkleShare/Mac/SparkleShare/idle1.png rename to SparkleShare/Mac/SparkleShare/Pixmaps/idle1.png diff --git a/SparkleShare/Mac/SparkleShare/idle2.png b/SparkleShare/Mac/SparkleShare/Pixmaps/idle2.png similarity index 100% rename from SparkleShare/Mac/SparkleShare/idle2.png rename to SparkleShare/Mac/SparkleShare/Pixmaps/idle2.png diff --git a/SparkleShare/Mac/SparkleShare/idle3.png b/SparkleShare/Mac/SparkleShare/Pixmaps/idle3.png similarity index 100% rename from SparkleShare/Mac/SparkleShare/idle3.png rename to SparkleShare/Mac/SparkleShare/Pixmaps/idle3.png diff --git a/SparkleShare/Mac/SparkleShare/idle4.png b/SparkleShare/Mac/SparkleShare/Pixmaps/idle4.png similarity index 100% rename from SparkleShare/Mac/SparkleShare/idle4.png rename to SparkleShare/Mac/SparkleShare/Pixmaps/idle4.png diff --git a/SparkleShare/Mac/SparkleShare/sparkleshare-idle-focus.png b/SparkleShare/Mac/SparkleShare/Pixmaps/sparkleshare-idle-focus.png similarity index 100% rename from SparkleShare/Mac/SparkleShare/sparkleshare-idle-focus.png rename to SparkleShare/Mac/SparkleShare/Pixmaps/sparkleshare-idle-focus.png diff --git a/SparkleShare/Mac/SparkleShare/sparkleshare-idle.png b/SparkleShare/Mac/SparkleShare/Pixmaps/sparkleshare-idle.png similarity index 100% rename from SparkleShare/Mac/SparkleShare/sparkleshare-idle.png rename to SparkleShare/Mac/SparkleShare/Pixmaps/sparkleshare-idle.png diff --git a/SparkleShare/Mac/SparkleShare/sparkleshare.icns b/SparkleShare/Mac/SparkleShare/Pixmaps/sparkleshare.icns similarity index 100% rename from SparkleShare/Mac/SparkleShare/sparkleshare.icns rename to SparkleShare/Mac/SparkleShare/Pixmaps/sparkleshare.icns diff --git a/SparkleShare/Mac/SparkleShare/SparkleMacController.cs b/SparkleShare/Mac/SparkleShare/SparkleMacController.cs new file mode 100644 index 00000000..e954479c --- /dev/null +++ b/SparkleShare/Mac/SparkleShare/SparkleMacController.cs @@ -0,0 +1,75 @@ +// SparkleShare, an instant update workflow to Git. +// Copyright (C) 2010 Hylke Bons +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + + +using System; +using System.Diagnostics; +using System.IO; + +namespace SparkleShare { + + public class SparkleMacController : SparkleController { + + // Creates a .desktop entry in autostart folder to + // start SparkleShare automatically at login + public override void EnableSystemAutostart () + { + + + + } + + + // Installs a launcher so the user can launch SparkleShare + // from the Internet category if needed + public override void InstallLauncher () + { + + + + } + + + // Adds the SparkleShare folder to the user's + // list of bookmarked places + public override void AddToBookmarks () + { + + + + } + + + // Creates the SparkleShare folder in the user's home folder + public override bool CreateSparkleShareFolder () + { + + return true; + + } + + + // Opens the SparkleShare folder or an (optional) subfolder + public override void OpenSparkleShareFolder (string subfolder) + { + + + + } + + } + +} \ No newline at end of file diff --git a/SparkleShare/Mac/SparkleShare/SparkleShare.csproj b/SparkleShare/Mac/SparkleShare/SparkleShare.csproj index f39ee51d..85062258 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleShare.csproj +++ b/SparkleShare/Mac/SparkleShare/SparkleShare.csproj @@ -44,6 +44,7 @@ False + @@ -53,6 +54,13 @@ + + SparkleShare.cs + + + SparkleController.cs + + @@ -63,16 +71,15 @@ - - - - - - - - - - + + + + + + + + + @@ -80,4 +87,10 @@ SparkleLib + + + + + + \ No newline at end of file diff --git a/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs index f3b0bd1d..f3d30f8e 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs @@ -20,6 +20,7 @@ using System.Timers; using MonoMac.Foundation; using MonoMac.AppKit; using MonoMac.ObjCRuntime; +using Mono.Unix; namespace SparkleShare { @@ -39,12 +40,12 @@ namespace SparkleShare { private NSMenuItem SyncMenuItem; private NSMenuItem NotificationsMenuItem; private NSMenuItem AboutMenuItem; - private NSMenuItem QuitMenuItem; - public string _ (string s) + // Short alias for the translations + public static string _ (string s) { - return s; + return Catalog.GetString (s); } @@ -57,7 +58,7 @@ namespace SparkleShare { StatusItem.HighlightMode = true; - SetNormalState (); + SetAnimationState (); CreateMenu ();