[osx] Hook things up
|
@ -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;
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>sparkleshare.icns</string>
|
||||
<key>LSEnvironment</key>
|
||||
<dict>
|
||||
<key>PATH</key>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
// SparkleShare, an instant update workflow to Git.
|
||||
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
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;
|
||||
public SparkleStatusIcon StatusIcon;
|
||||
|
||||
|
||||
int i = 0;
|
||||
|
||||
|
||||
/* public override NSMenu ApplicationDockMenu (NSApplication app)
|
||||
public SparkleUI ()
|
||||
{
|
||||
|
||||
return (NSMenu) Menu;
|
||||
|
||||
}
|
||||
*/
|
||||
public AppDelegate ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SparkleStatusIcon StatusIcon;
|
||||
|
||||
public override void FinishedLaunching (NSObject notification)
|
||||
{
|
||||
|
||||
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.Init ();
|
||||
//NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
|
||||
//NSApplication.SharedApplication.applicationIconImage = NSImage.ImageNamed ("sparkleshare.icns");
|
||||
|
||||
//StatusIcon = new SparkleStatusIcon ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void Run ()
|
||||
{
|
||||
|
||||
NSApplication.Main (new string [0]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 732 B After Width: | Height: | Size: 732 B |
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 797 B |
Before Width: | Height: | Size: 803 B After Width: | Height: | Size: 803 B |
Before Width: | Height: | Size: 822 B After Width: | Height: | Size: 822 B |
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 818 B |
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 831 B |
Before Width: | Height: | Size: 826 B After Width: | Height: | Size: 826 B |
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 216 B |
75
SparkleShare/Mac/SparkleShare/SparkleMacController.cs
Normal file
|
@ -0,0 +1,75 @@
|
|||
// SparkleShare, an instant update workflow to Git.
|
||||
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -44,6 +44,7 @@
|
|||
<Reference Include="MonoMac">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Mono.Posix" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
|
@ -53,6 +54,13 @@
|
|||
<Compile Include="Layout.cs" />
|
||||
<Compile Include="SparkleLog.cs" />
|
||||
<Compile Include="SparkleStatusIcon.cs" />
|
||||
<Compile Include="..\..\SparkleShare.cs">
|
||||
<Link>SparkleShare.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\SparkleController.cs">
|
||||
<Link>SparkleController.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="SparkleMacController.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="MainMenu.xib" />
|
||||
|
@ -63,16 +71,15 @@
|
|||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
|
||||
<ItemGroup>
|
||||
<Content Include="sparkleshare-idle-focus.png" />
|
||||
<Content Include="sparkleshare-idle.png" />
|
||||
<Content Include="sparkleshare.icns" />
|
||||
<Content Include="idle-active.png" />
|
||||
<Content Include="idle.png" />
|
||||
<Content Include="idle0.png" />
|
||||
<Content Include="idle1.png" />
|
||||
<Content Include="idle2.png" />
|
||||
<Content Include="idle3.png" />
|
||||
<Content Include="idle4.png" />
|
||||
<Content Include="Pixmaps\idle.png" />
|
||||
<Content Include="Pixmaps\idle0.png" />
|
||||
<Content Include="Pixmaps\idle2.png" />
|
||||
<Content Include="Pixmaps\idle-active.png" />
|
||||
<Content Include="Pixmaps\idle1.png" />
|
||||
<Content Include="Pixmaps\idle4.png" />
|
||||
<Content Include="Pixmaps\idle3.png" />
|
||||
<Content Include="Pixmaps\sparkleshare-idle.png" />
|
||||
<Content Include="Pixmaps\sparkleshare-idle-focus.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\SparkleLib\SparkleLib.csproj">
|
||||
|
@ -80,4 +87,10 @@
|
|||
<Name>SparkleLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Pixmaps\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Pixmaps\sparkleshare.icns" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -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 ();
|
||||
|
||||
|
||||
|
|