reset to upstream/master, add windows files and fixes
This commit is contained in:
parent
01f266c21a
commit
c16623715c
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
.gitattributes eol=lf
|
||||
.gitmodules eol=lf
|
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -6,6 +6,9 @@
|
|||
*.app
|
||||
*.pidb
|
||||
*.gmo
|
||||
*.bak
|
||||
*.suo
|
||||
*.sln.cache
|
||||
po/POTFILES
|
||||
Makefile.in
|
||||
Makefile
|
||||
|
@ -22,6 +25,7 @@ INSTALL
|
|||
aclocal.m4
|
||||
autom4te.cache/
|
||||
bin/
|
||||
obj/
|
||||
install-sh
|
||||
libtool
|
||||
ltmain.sh
|
||||
|
@ -33,7 +37,9 @@ SparkleLib/AssemblyInfo.cs
|
|||
build/m4/shave/shave
|
||||
build/m4/*.m4
|
||||
build/m4/shave/shave-libtool
|
||||
Defines.cs
|
||||
SparkleLib/Defines.cs
|
||||
SparkleLib/windows/Defines.cs
|
||||
SparkleLib/windows/GlobalAssemblyInfo.cs
|
||||
SparkleShare/sparkleshare
|
||||
po/sparkleshare.pot
|
||||
SparkleShare/Nautilus/sparkleshare-nautilus-extension.py
|
||||
|
|
|
@ -348,7 +348,12 @@ namespace SparkleLib {
|
|||
List <SparkleChangeSet> change_sets = new List <SparkleChangeSet> ();
|
||||
|
||||
SparkleGit git_log = new SparkleGit (LocalPath, "log -" + count + " --raw -M --date=iso");
|
||||
Console.OutputEncoding = System.Text.Encoding.Unicode;
|
||||
if ((SparkleBackend.Platform == PlatformID.Unix ||
|
||||
SparkleBackend.Platform == PlatformID.MacOSX)) {
|
||||
// this causes an IOException on windows
|
||||
Console.OutputEncoding = System.Text.Encoding.Unicode;
|
||||
}
|
||||
|
||||
git_log.Start ();
|
||||
|
||||
// Reading the standard output HAS to go before
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace SparkleLib {
|
|||
public SparkleBackend (string name, string [] paths)
|
||||
{
|
||||
Name = name;
|
||||
Path = "git"; // default
|
||||
|
||||
foreach (string path in paths) {
|
||||
if (File.Exists (path)) {
|
||||
|
|
|
@ -136,9 +136,12 @@ namespace SparkleLib {
|
|||
writer.Close ();
|
||||
}
|
||||
|
||||
UnixFileSystemInfo file_info = new UnixFileInfo (ssh_config_file_path);
|
||||
file_info.FileAccessPermissions = (FileAccessPermissions.UserRead |
|
||||
if ((SparkleBackend.Platform == PlatformID.Unix ||
|
||||
SparkleBackend.Platform == PlatformID.MacOSX)) {
|
||||
UnixFileSystemInfo file_info = new UnixFileInfo (ssh_config_file_path);
|
||||
file_info.FileAccessPermissions = (FileAccessPermissions.UserRead |
|
||||
FileAccessPermissions.UserWrite);
|
||||
}
|
||||
|
||||
SparkleHelpers.DebugInfo ("Fetcher", "Disabled host key checking");
|
||||
}
|
||||
|
@ -174,10 +177,13 @@ namespace SparkleLib {
|
|||
TextWriter writer = new StreamWriter (ssh_config_file_path);
|
||||
writer.WriteLine (current_ssh_config);
|
||||
writer.Close ();
|
||||
if ((SparkleBackend.Platform == PlatformID.Unix ||
|
||||
SparkleBackend.Platform == PlatformID.MacOSX)) {
|
||||
|
||||
UnixFileSystemInfo file_info = new UnixFileInfo (ssh_config_file_path);
|
||||
file_info.FileAccessPermissions = (FileAccessPermissions.UserRead |
|
||||
FileAccessPermissions.UserWrite);
|
||||
UnixFileSystemInfo file_info = new UnixFileInfo (ssh_config_file_path);
|
||||
file_info.FileAccessPermissions = (FileAccessPermissions.UserRead |
|
||||
FileAccessPermissions.UserWrite);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
14
SparkleLib/windows/AssemblyInfo.cs
Normal file
14
SparkleLib/windows/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* AssemblyInfo.cs
|
||||
*
|
||||
* This is free software. See COPYING for details.
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle ("SparkleLib")]
|
||||
[assembly: AssemblyDescription ("SparkleShare is a simple file sharing and collaboration tool.")]
|
||||
|
||||
[assembly: Guid ("38092E48-5DCC-4d23-8109-9D994E710ACF")]
|
46
SparkleLib/windows/Defines.tt
Normal file
46
SparkleLib/windows/Defines.tt
Normal file
|
@ -0,0 +1,46 @@
|
|||
// 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/>.
|
||||
|
||||
<#@ template language="C#v3.5" HostSpecific="true" #>
|
||||
<#@ output extension="cs" #>
|
||||
|
||||
<#@ include file="getversion.tt" #>
|
||||
|
||||
<#
|
||||
PlatformID platform = Environment.OSVersion.Platform;
|
||||
bool IsWindows = (platform == PlatformID.Win32NT
|
||||
|| platform == PlatformID.Win32S
|
||||
|| platform == PlatformID.Win32Windows
|
||||
|| platform == PlatformID.WinCE);
|
||||
#>
|
||||
|
||||
using System;
|
||||
|
||||
namespace SparkleLib {
|
||||
|
||||
public class Defines {
|
||||
|
||||
public const string VERSION = "<#= VERSION #>";
|
||||
public const string LOCALE_DIR = "@prefix@/share/locale";
|
||||
public const string DATAROOTDIR = "@expanded_datadir@";
|
||||
public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@";
|
||||
public const string PREFIX = "@prefix@";
|
||||
public const string OPEN_COMMAND = "xdg-open";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
25
SparkleLib/windows/GlobalAssemblyInfo.tt
Normal file
25
SparkleLib/windows/GlobalAssemblyInfo.tt
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* GlobalAssemblyInfo.cs
|
||||
*
|
||||
* This is free software. See COPYING for details.
|
||||
*/
|
||||
<#@ template language="C#v3.5" HostSpecific="true" #>
|
||||
<#@ output extension="cs" #>
|
||||
|
||||
<#@ include file="getversion.tt" #>
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: AssemblyProduct("SparkleShare")]
|
||||
|
||||
[assembly: AssemblyVersion("<#= ASM_VERSION #>")]
|
||||
[assembly: AssemblyFileVersion("<#= ASM_FILE_VERSION #>")]
|
||||
[assembly: AssemblyInformationalVersion("<#= VERSION #>")]
|
||||
|
||||
#if DEBUG
|
||||
[assembly: AssemblyConfiguration("Debug")]
|
||||
#else
|
||||
[assembly: AssemblyConfiguration("Release")]
|
||||
#endif
|
||||
|
159
SparkleLib/windows/SparkleLib.csproj
Normal file
159
SparkleLib/windows/SparkleLib.csproj
Normal file
|
@ -0,0 +1,159 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{2C914413-B31C-4362-93C7-1AE34F09112A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>SparkleLib</RootNamespace>
|
||||
<AssemblyName>SparkleLib</AssemblyName>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\bin</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\bin</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Mono.Posix" />
|
||||
<Reference Include="Meebey.SmartIrc4net, Version=0.4.5.0, Culture=neutral, PublicKeyToken=7868485fbf407e0f">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\bin\Meebey.SmartIrc4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.XML" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Git\SparkleFetcherGit.cs">
|
||||
<Link>SparkleFetcherGit.cs</Link>
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="..\Git\SparkleRepoGit.cs">
|
||||
<Link>SparkleRepoGit.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Hg\SparkleFetcherHg.cs">
|
||||
<Link>SparkleFetcherHg.cs</Link>
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="..\Hg\SparkleRepoHg.cs">
|
||||
<Link>SparkleRepoHg.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Scp\SparkleFetcherScp.cs">
|
||||
<Link>SparkleFetcherScp.cs</Link>
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="..\Scp\SparkleRepoScp.cs">
|
||||
<Link>SparkleRepoScp.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\SparkleConfig.cs">
|
||||
<Link>SparkleConfig.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\SparkleRepoBase.cs">
|
||||
<Link>SparkleRepoBase.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="Defines.cs">
|
||||
<DependentUpon>Defines.tt</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
</Compile>
|
||||
<Compile Include="..\SparkleFetcherBase.cs" />
|
||||
<Compile Include="..\SparkleHelpers.cs" />
|
||||
<Compile Include="..\SparklePaths.cs" />
|
||||
<Compile Include="..\SparkleOptions.cs" />
|
||||
<Compile Include="..\SparkleChangeSet.cs" />
|
||||
<Compile Include="..\SparkleListenerBase.cs" />
|
||||
<Compile Include="..\SparkleListenerIrc.cs" />
|
||||
<Compile Include="..\SparkleBackend.cs" />
|
||||
<Compile Include="GlobalAssemblyInfo.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>GlobalAssemblyInfo.tt</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Defines.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>Defines.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="GlobalAssemblyInfo.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>GlobalAssemblyInfo.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<MonoDevelop>
|
||||
<Properties InternalTargetFrameworkVersion="3.5">
|
||||
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="true" RelativeMakefileName="Makefile.am">
|
||||
<BuildFilesVar Sync="true" Name="SOURCES" />
|
||||
<DeployFilesVar />
|
||||
<ResourcesVar />
|
||||
<OthersVar />
|
||||
<GacRefVar />
|
||||
<AsmRefVar />
|
||||
<ProjectRefVar />
|
||||
</MonoDevelop.Autotools.MakefileInfo>
|
||||
</Properties>
|
||||
</MonoDevelop>
|
||||
<VisualStudio />
|
||||
</ProjectExtensions>
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>$(ProjectDir)transform_tt.cmd</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
41
SparkleLib/windows/getversion.tt
Normal file
41
SparkleLib/windows/getversion.tt
Normal file
|
@ -0,0 +1,41 @@
|
|||
<#@ import namespace="System" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
<#@ import namespace="System.Diagnostics" #>
|
||||
<#@ import namespace="System.Text.RegularExpressions" #>
|
||||
|
||||
<#
|
||||
// Add msysgit to path, as we cannot asume it is added to the path
|
||||
// Asume it is installed in @"C:\msysgit\msysgit\bin" for now
|
||||
string MSysGit=@"C:\msysgit\msysgit";
|
||||
|
||||
string newPath = MSysGit + @"\bin" + ";"
|
||||
+ MSysGit + @"\mingw\bin" + ";"
|
||||
+ MSysGit + @"\cmd" + ";"
|
||||
+ System.Environment.ExpandEnvironmentVariables ("%PATH%");
|
||||
System.Environment.SetEnvironmentVariable ("PATH", newPath);
|
||||
|
||||
Process process = new Process();
|
||||
process.StartInfo.UseShellExecute = false;
|
||||
process.StartInfo.RedirectStandardOutput = true;
|
||||
process.StartInfo.CreateNoWindow = true;
|
||||
process.StartInfo.FileName = "git";
|
||||
process.StartInfo.Arguments = "describe --tags --dirty=-d --always";
|
||||
process.StartInfo.WorkingDirectory = Path.GetDirectoryName(Host.TemplateFile);
|
||||
process.Start();
|
||||
|
||||
String DescribeOutput=process.StandardOutput.ReadLine();
|
||||
|
||||
Match m = Regex.Match(DescribeOutput, @"(\d+)\.(\d+)(?:-rc(\d+))?-(\d+)");
|
||||
int[] version = new int [4];
|
||||
for(int i=1; i <= 4; i++)
|
||||
Int32.TryParse(m.Groups[i].Value, out version[i-1]);
|
||||
|
||||
String VERSION=DescribeOutput;
|
||||
String ASM_VERSION=String.Format("{0}.{1}",version[0],version[1]);
|
||||
String ASM_FILE_VERSION=String.Format("{0}.{1}.{2}.{3}",version[0],version[1],version[2],version[3]);
|
||||
|
||||
#>
|
||||
|
||||
// VERSION=<#= VERSION #>
|
||||
// ASM_VERSION=<#= ASM_VERSION #>
|
||||
|
7
SparkleLib/windows/transform_tt.cmd
Normal file
7
SparkleLib/windows/transform_tt.cmd
Normal file
|
@ -0,0 +1,7 @@
|
|||
@echo off
|
||||
|
||||
echo running texttransform..
|
||||
cd %~dp0
|
||||
|
||||
"%CommonProgramFiles%\Microsoft Shared\TextTemplating\1.2\texttransform.exe" -out Defines.cs Defines.tt
|
||||
"%CommonProgramFiles%\Microsoft Shared\TextTemplating\1.2\texttransform.exe" -out GlobalAssemblyInfo.cs GlobalAssemblyInfo.tt
|
|
@ -49,6 +49,27 @@ namespace SparkleShare {
|
|||
// Initialize the application
|
||||
Application.Init ();
|
||||
|
||||
GLib.ExceptionManager.UnhandledException += delegate (GLib.UnhandledExceptionArgs exArgs) {
|
||||
Exception UnhandledException = (Exception)exArgs.ExceptionObject;
|
||||
string ExceptionMessage = UnhandledException.Message.ToString ();
|
||||
MessageDialog ExceptionDialog = new MessageDialog (null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok,
|
||||
"Unhandled Exception!\n" + UnhandledException.GetType ().ToString ());
|
||||
ExceptionDialog.Title = "ERROR";
|
||||
|
||||
while (UnhandledException != null) {
|
||||
Console.WriteLine ("\n\n"
|
||||
+ "Unhandled exception\n"
|
||||
+ "-------------------\n"
|
||||
+ UnhandledException.Message + "\n\n"
|
||||
+ UnhandledException.StackTrace);
|
||||
UnhandledException = UnhandledException.InnerException;
|
||||
}
|
||||
|
||||
ExceptionDialog.Run ();
|
||||
ExceptionDialog.Destroy ();
|
||||
|
||||
};
|
||||
|
||||
// Create the statusicon
|
||||
StatusIcon = new SparkleStatusIcon ();
|
||||
|
||||
|
|
14
SparkleShare/Windows/AssemblyInfo.cs
Normal file
14
SparkleShare/Windows/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* AssemblyInfo.cs
|
||||
*
|
||||
* This is free software. See COPYING for details.
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle ("SparkleShare")]
|
||||
[assembly: AssemblyDescription ("SparkleShare is a simple file sharing and collaboration tool.")]
|
||||
|
||||
[assembly: Guid ("A8F34995-DB20-4bf2-AA27-869B15B8C2F9")]
|
70
SparkleShare/Windows/Notification.cs
Normal file
70
SparkleShare/Windows/Notification.cs
Normal file
|
@ -0,0 +1,70 @@
|
|||
// 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 Gdk;
|
||||
|
||||
namespace Notifications
|
||||
{
|
||||
public enum Urgency : byte {
|
||||
Low = 0,
|
||||
Normal,
|
||||
Critical
|
||||
}
|
||||
|
||||
public class ActionArgs : EventArgs {
|
||||
private string action;
|
||||
public string Action {
|
||||
get { return action; }
|
||||
}
|
||||
|
||||
public ActionArgs (string action) {
|
||||
this.action = action;
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void ActionHandler (object o, ActionArgs args);
|
||||
|
||||
public class Notification
|
||||
{
|
||||
public Pixbuf Icon;
|
||||
|
||||
public Notification ()
|
||||
{
|
||||
}
|
||||
|
||||
public Notification (string title, string subtext)
|
||||
{
|
||||
}
|
||||
|
||||
public void AddAction (string action, string label, ActionHandler handler)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveAction (string action)
|
||||
{
|
||||
}
|
||||
|
||||
public void ClearActions ()
|
||||
{
|
||||
}
|
||||
|
||||
public void Show ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
35
SparkleShare/Windows/SparkleBubble.cs
Normal file
35
SparkleShare/Windows/SparkleBubble.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// 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 Notifications;
|
||||
|
||||
namespace SparkleShare {
|
||||
|
||||
public class SparkleBubble : Notification {
|
||||
|
||||
public SparkleBubble (string title, string subtext) : base (title, subtext)
|
||||
{
|
||||
}
|
||||
|
||||
// Checks whether the system allows adding buttons to a notification,
|
||||
// prevents error messages in Ubuntu.
|
||||
new public void AddAction (string action, string label, ActionHandler handler)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
143
SparkleShare/Windows/SparkleShare.csproj
Normal file
143
SparkleShare/Windows/SparkleShare.csproj
Normal file
|
@ -0,0 +1,143 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<ProjectGuid>{728483AA-E34B-4441-BF2C-C8BC2901E4E0}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AssemblyName>SparkleShare</AssemblyName>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<RootNamespace>SparkleShare</RootNamespace>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\bin</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\bin</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
|
||||
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
|
||||
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
|
||||
</Reference>
|
||||
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
|
||||
</Reference>
|
||||
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Mono.Posix" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="webkit-sharp, Version=1.1.15.0, Culture=neutral, PublicKeyToken=eaa1d335d2e19745">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\bin\webkit-sharp.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\SparkleLib\windows\GlobalAssemblyInfo.cs">
|
||||
<Link>GlobalAssemblyInfo.cs</Link>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>GlobalAssemblyInfo.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="Notification.cs" />
|
||||
<Compile Include="SparkleBubble.cs" />
|
||||
<Compile Include="..\SparkleIntro.cs" />
|
||||
<Compile Include="..\SparkleShare.cs" />
|
||||
<Compile Include="..\SparkleSpinner.cs" />
|
||||
<Compile Include="..\SparkleStatusIcon.cs" />
|
||||
<Compile Include="..\SparkleUI.cs" />
|
||||
<Compile Include="..\SparkleWindow.cs" />
|
||||
<Compile Include="..\SparkleEntry.cs" />
|
||||
<Compile Include="..\SparkleLog.cs" />
|
||||
<Compile Include="..\SparkleUIHelpers.cs" />
|
||||
<Compile Include="..\SparkleInfobar.cs" />
|
||||
<Compile Include="..\SparkleController.cs" />
|
||||
<Compile Include="..\SparkleAbout.cs" />
|
||||
<Compile Include="SparkleWinController.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\SparkleLib\Windows\SparkleLib.csproj">
|
||||
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
|
||||
<Name>SparkleLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
<MonoDevelop>
|
||||
<Properties InternalTargetFrameworkVersion="3.5">
|
||||
<MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="true" RelativeMakefileName="Makefile.am">
|
||||
<BuildFilesVar Sync="true" Name="SOURCES" />
|
||||
<DeployFilesVar />
|
||||
<ResourcesVar />
|
||||
<OthersVar />
|
||||
<GacRefVar />
|
||||
<AsmRefVar />
|
||||
<ProjectRefVar />
|
||||
</MonoDevelop.Autotools.MakefileInfo>
|
||||
</Properties>
|
||||
</MonoDevelop>
|
||||
<VisualStudio />
|
||||
</ProjectExtensions>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\SparkleLib\windows\GlobalAssemblyInfo.tt">
|
||||
<Link>GlobalAssemblyInfo.tt</Link>
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>GlobalAssemblyInfo.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>$(ProjectDir)transform_tt.cmd</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
31
SparkleShare/Windows/SparkleShare.sln
Normal file
31
SparkleShare/Windows/SparkleShare.sln
Normal file
|
@ -0,0 +1,31 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleShare", "SparkleShare.csproj", "{728483AA-E34B-4441-BF2C-C8BC2901E4E0}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleLib", "..\..\SparkleLib\windows\SparkleLib.csproj", "{2C914413-B31C-4362-93C7-1AE34F09112A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{728483AA-E34B-4441-BF2C-C8BC2901E4E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{728483AA-E34B-4441-BF2C-C8BC2901E4E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{728483AA-E34B-4441-BF2C-C8BC2901E4E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{728483AA-E34B-4441-BF2C-C8BC2901E4E0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2C914413-B31C-4362-93C7-1AE34F09112A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2C914413-B31C-4362-93C7-1AE34F09112A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2C914413-B31C-4362-93C7-1AE34F09112A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2C914413-B31C-4362-93C7-1AE34F09112A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = SparkleShare.csproj
|
||||
outputpath = bin
|
||||
name = SparkleShare
|
||||
EndGlobalSection
|
||||
EndGlobal
|
150
SparkleShare/Windows/SparkleWinController.cs
Normal file
150
SparkleShare/Windows/SparkleWinController.cs
Normal file
|
@ -0,0 +1,150 @@
|
|||
// 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 Mono.Unix;
|
||||
using Mono.Unix.Native;
|
||||
using SparkleLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace SparkleShare {
|
||||
|
||||
public class SparkleWinController : SparkleController {
|
||||
|
||||
public SparkleWinController () : base ()
|
||||
{
|
||||
}
|
||||
|
||||
public override void Initialize ()
|
||||
{
|
||||
// Add msysgit to path, as we cannot asume it is added to the path
|
||||
// Asume it is installed in @"C:\msysgit\msysgit\bin" for now
|
||||
string MSysGit=@"C:\msysgit\msysgit";
|
||||
|
||||
string newPath = MSysGit + @"\bin" + ";"
|
||||
+ MSysGit + @"\mingw\bin" + ";"
|
||||
+ MSysGit + @"\cmd" + ";"
|
||||
+ System.Environment.ExpandEnvironmentVariables ("%PATH%");
|
||||
System.Environment.SetEnvironmentVariable ("PATH", newPath);
|
||||
System.Environment.SetEnvironmentVariable ("PLINK_PROTOCOL", "ssh");
|
||||
System.Environment.SetEnvironmentVariable ("HOME", Environment.ExpandEnvironmentVariables ("%HOMEDRIVE%%HOMEPATH%"));
|
||||
|
||||
StartSshAgent ();
|
||||
AddDefaultKey ();
|
||||
|
||||
base.Initialize ();
|
||||
}
|
||||
|
||||
public override string EventLogHTML { get { return ""; } }
|
||||
public override string DayEntryHTML { get { return ""; } }
|
||||
public override string EventEntryHTML { get { return ""; } }
|
||||
|
||||
// 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 ()
|
||||
{
|
||||
if (!Directory.Exists (SparklePaths.SparklePath)) {
|
||||
|
||||
Directory.CreateDirectory (SparklePaths.SparklePath);
|
||||
SparkleHelpers.DebugInfo ("Config", "Created '" + SparklePaths.SparklePath + "'");
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OpenSparkleShareFolder (string subfolder)
|
||||
{
|
||||
Process process = new Process();
|
||||
process.StartInfo.Arguments = ",/root," + SparkleHelpers.CombineMore(SparklePaths.SparklePath, subfolder);
|
||||
process.StartInfo.FileName = "explorer";
|
||||
|
||||
process.Start();
|
||||
}
|
||||
|
||||
public void AddDefaultKey ()
|
||||
{
|
||||
/*Process process = new Process ();
|
||||
process.StartInfo.RedirectStandardOutput = true;
|
||||
process.StartInfo.UseShellExecute = false;
|
||||
process.StartInfo.FileName = "ssh-add";
|
||||
process.StartInfo.Arguments = @"~/.ssh/id_rsa";
|
||||
process.Start ();
|
||||
process.WaitForExit ();*/
|
||||
}
|
||||
|
||||
private void StartSshAgent ()
|
||||
{
|
||||
if (String.IsNullOrEmpty (System.Environment.GetEnvironmentVariable ("SSH_AUTH_SOCK"))) {
|
||||
|
||||
Process process = new Process ();
|
||||
process.StartInfo.FileName = "ssh-agent";
|
||||
process.StartInfo.UseShellExecute = false;
|
||||
process.StartInfo.RedirectStandardOutput = true;
|
||||
|
||||
process.Start ();
|
||||
|
||||
string Output = process.StandardOutput.ReadToEnd ();
|
||||
process.WaitForExit ();
|
||||
|
||||
Match AuthSock = new Regex (@"SSH_AUTH_SOCK=([^;\n\r]*)").Match (Output);
|
||||
if (AuthSock.Success) {
|
||||
System.Environment.SetEnvironmentVariable ("SSH_AUTH_SOCK", AuthSock.Groups[1].Value);
|
||||
}
|
||||
|
||||
Match AgentPid = new Regex (@"SSH_AGENT_PID=([^;\n\r]*)").Match (Output);
|
||||
if (AgentPid.Success) {
|
||||
System.Environment.SetEnvironmentVariable ("SSH_AGENT_PID", AgentPid.Groups[1].Value);
|
||||
SparkleHelpers.DebugInfo ("SSH", "ssh-agent started, PID=" + AgentPid.Groups[1].Value);
|
||||
}
|
||||
else {
|
||||
SparkleHelpers.DebugInfo ("SSH", "ssh-agent started, PID=unknown");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
8
SparkleShare/Windows/transform_tt.cmd
Normal file
8
SparkleShare/Windows/transform_tt.cmd
Normal file
|
@ -0,0 +1,8 @@
|
|||
@echo off
|
||||
|
||||
echo running texttransform..
|
||||
cd %~dp0
|
||||
|
||||
|
||||
cd ..\..\Sparklelib\windows
|
||||
"%CommonProgramFiles%\Microsoft Shared\TextTemplating\1.2\texttransform.exe" -out GlobalAssemblyInfo.cs GlobalAssemblyInfo.tt
|
Loading…
Reference in a new issue