Rename SparkleLib to Sparkles

This commit is contained in:
Hylke Bons 2016-03-31 09:35:26 +01:00
parent a2337e6c8d
commit b312620048
93 changed files with 438 additions and 487 deletions

1
.gitignore vendored
View file

@ -33,7 +33,6 @@ missing
build/m4/shave/shave
build/m4/*.m4
build/m4/shave/shave-libtool
SparkleLib/Defines.cs
SparkleShare/Linux/sparkleshare
SparkleShare/Mac/git*
gnome-doc-utils.make

View file

@ -1,22 +1,23 @@
basedirs = build SparkleLib SparkleLib/Git
basedirs = build Sparkles Sparkles/Git
SUBDIRS = $(basedirs) $(GUISUBDIRS)
DIST_SUBDIRS = $(basedirs) SparkleShare
EXTRA_DIST = \
News.txt \
README.md \
README.md \
legal/License_for_SparkleShare.txt \
legal/License_for_SparkleLib.txt \
legal/License_for_Sparkles.txt \
legal/Authors.txt \
SparkleShare/Linux/README.md \
SparkleShare/Linux/org.sparkleshare.SparkleShare.appdata.xml
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update \
intltool-extract \
intltool-merge \
intltool-update \
gnome-doc-utils.make
clean-local:
rm -rf $(top_builddir)/bin

View file

@ -16,7 +16,7 @@ SparkleShare uses the version control system [Git](https://git-scm.com/) under t
## Free and Open Source
`SparkleShare` is Free and Open Source software and licensed under the [GNU General Public License version 3 or later](legal/License_for_SparkleShare.txt). You are welcome to change and redistribute it under certain conditions. Its library `SparkleLib` is licensed under the [GNU Lesser General Public License version 3 or later](legal/License_for_SparkleLib.txt).
`SparkleShare` is Free and Open Source software and licensed under the [GNU General Public License version 3 or later](legal/License_for_SparkleShare.txt). You are welcome to change and redistribute it under certain conditions. Its library `Sparkles` is licensed under the [GNU Lesser General Public License version 3 or later](legal/License_for_Sparkles.txt).
## Compiling from source

View file

@ -1,13 +1,13 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleShare.Linux", "Linux\SparkleShare.Linux.csproj", "{CF5BC8DB-A633-4FCC-8A3E-E3AC9B59FABC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleShare.Mac", "SparkleShare\Mac\SparkleShare.Mac.csproj", "{CF5BC8DB-A633-4FCC-8A3E-E3AC9B59FABC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleLib", "..\SparkleLib\SparkleLib.csproj", "{2C914413-B31C-4362-93C7-1AE34F09112A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sparkles", "Sparkles\Sparkles.csproj", "{2C914413-B31C-4362-93C7-1AE34F09112A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleLib.Git", "..\SparkleLib\Git\SparkleLib.Git.csproj", "{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sparkles.Git", "Sparkles\Git\Sparkles.Git.csproj", "{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleShare.Windows", "Windows\SparkleShare.Windows.csproj", "{728483AA-E34B-4441-BF2C-C8BC2901E4E0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SparkleShare.Windows", "SparkleShare\Windows\SparkleShare.Windows.csproj", "{728483AA-E34B-4441-BF2C-C8BC2901E4E0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View file

@ -19,6 +19,8 @@ using System;
using System.Net;
using System.Threading;
using Sparkles;
namespace SparkleShare {
public class SparkleAboutController {
@ -39,11 +41,11 @@ namespace SparkleShare {
public SparkleAboutController ()
{
RunningVersion = SparkleLib.Backend.Version;
RunningVersion = InstallationInfo.Version;
SparkleShare.Controller.ShowAboutWindowEvent += delegate {
ShowWindowEvent ();
new Thread (() => CheckForNewVersion ()).Start ();
new Thread (CheckForNewVersion).Start ();
};
}
@ -54,13 +56,13 @@ namespace SparkleShare {
}
private void CheckForNewVersion ()
void CheckForNewVersion ()
{
UpdateLabelEvent ("Checking for updates...");
Thread.Sleep (500);
WebClient web_client = new WebClient ();
Uri uri = new Uri ("http://www.sparkleshare.org/version");
var web_client = new WebClient ();
var uri = new Uri ("http://www.sparkleshare.org/version");
try {
string latest_version = web_client.DownloadString (uri).Trim ();

View file

@ -23,7 +23,7 @@ using System.Net.Mime;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using SparkleLib;
using Sparkles;
namespace SparkleShare
{

View file

@ -21,8 +21,8 @@ using System.IO;
using System.Linq;
using System.Threading;
using SparkleLib;
using SparkleLib.Git;
using Sparkles;
using Sparkles.Git;
namespace SparkleShare {
@ -155,7 +155,7 @@ namespace SparkleShare {
// Path where the plugins are kept
public abstract string PluginsPath { get; }
public abstract string PresetsPath { get; }
// Enables SparkleShare to start automatically at login
public abstract void CreateStartupItem ();
@ -212,11 +212,11 @@ namespace SparkleShare {
public virtual void Initialize ()
{
Logger.LogInfo ("Environment", "SparkleShare " + Backend.Version);
Logger.LogInfo ("Environment", "SparkleShare " + InstallationInfo.Version);
Logger.LogInfo ("Environment", "Git " + GitCommand.GitVersion);
Logger.LogInfo ("Environment", Backend.Platform + " (" + Environment.OSVersion + ")");
Logger.LogInfo ("Environment", InstallationInfo.Platform + " (" + Environment.OSVersion + ")");
Plugin.PluginsPath = PluginsPath;
Preset.PresetsPath = PresetsPath;
InstallProtocolHandler ();
try {
@ -394,7 +394,7 @@ namespace SparkleShare {
try {
repo = (BaseRepository) Activator.CreateInstance (
Type.GetType ("SparkleLib." + backend + "." + backend + "Repository, SparkleLib." + backend),
Type.GetType ("Sparkles." + backend + "." + backend + "Repository, Sparkles." + backend),
new object [] { folder_path, Config });
} catch (Exception e) {
@ -561,7 +561,7 @@ namespace SparkleShare {
try {
this.fetcher = (BaseFetcher) Activator.CreateInstance (
Type.GetType ("SparkleLib." + backend + ".SparkleFetcher, SparkleLib." + backend), info);
Type.GetType ("Sparkles." + backend + "." + backend + "Fetcher, Sparkles." + backend), info);
} catch (Exception e) {
Logger.LogInfo ("Controller",

View file

@ -18,7 +18,7 @@
using System;
using System.Text;
using SparkleLib;
using Sparkles;
namespace SparkleShare {

View file

@ -24,7 +24,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using SparkleLib;
using Sparkles;
namespace SparkleShare {

View file

@ -21,7 +21,7 @@ using System.Net;
using System.Text;
using System.Xml;
using SparkleLib;
using Sparkles;
namespace SparkleShare {

View file

@ -1,3 +1,3 @@
SUBDIRS = HTML \
Plugins \
Presets \
Pixmaps

View file

@ -18,7 +18,7 @@
using System;
using System.Threading;
using SparkleLib;
using Sparkles;
namespace SparkleShare {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<sparkleshare>
<plugin>
<info>
<name>Gitorious</name>
<description>Open source infrastructure for hosting open source projects</description>
<icon>gitorious.png</icon>
<backend>Git</backend>
<fingerprint>7e:af:8d:ec:f0:39:5e:ba:52:16:ce:19:fa:d4:b8:7d</fingerprint>
</info>
<address>
<value>ssh://git@gitorious.org/</value>
<example/>
</address>
<path>
<value/>
<example>/project/repository</example>
</path>
</plugin>
</sparkleshare>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<sparkleshare>
<plugin>
<info>
<name>SparkleShare.Net</name>
<description>The easiest way to share projects with SparkleShare</description>
<icon>ssnet.png</icon>
<backend>Git</backend>
</info>
<address>
<value>ssh://storage@sparkleshare.net/</value>
<example/>
</address>
<path>
<value/>
<example>/username/project</example>
</path>
</plugin>
</sparkleshare>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

View file

@ -1,18 +1,15 @@
dist_plugins_DATA = \
bitbucket.xml \
github.xml \
gitorious.xml \
ssnet.xml \
own-server.xml \
planio.xml \
github.png \
gitorious.png \
bitbucket.png \
ssnet.png \
planio.png \
own-server.png
pluginsdir = $(pkgdatadir)/plugins/
pluginsdir = $(pkgdatadir)/presets/
MAINTAINERCLEANFILES = \
Makefile.in

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

@ -21,7 +21,7 @@ using System.IO;
using System.Text.RegularExpressions;
using System.Threading;
using SparkleLib;
using Sparkles;
namespace SparkleShare {
@ -73,8 +73,8 @@ namespace SparkleShare {
public event ChangePathFieldEventHandler ChangePathFieldEvent = delegate { };
public delegate void ChangePathFieldEventHandler (string text, string example_text, FieldState state);
public readonly List<Plugin> Plugins = new List<Plugin> ();
public Plugin SelectedPlugin;
public readonly List<Preset> Presets = new List<Preset> ();
public Preset SelectedPreset;
public bool WindowIsOpen { get; private set; }
public SparkleInvite PendingInvite { get; private set; }
@ -86,9 +86,9 @@ namespace SparkleShare {
public double ProgressBarPercentage { get; private set; }
public int SelectedPluginIndex {
public int SelectedPresetIndex {
get {
return Plugins.IndexOf (SelectedPlugin);
return Presets.IndexOf (SelectedPreset);
}
}
@ -117,35 +117,29 @@ namespace SparkleShare {
PreviousUrl = "";
SyncingFolder = "";
string local_plugins_path = Plugin.LocalPluginsPath;
int local_plugins_count = 0;
string local_presets_path = Preset.LocalPresetsPath;
int local_presets_count = 0;
// Import all of the plugins
if (Directory.Exists (local_plugins_path))
// Local plugins go first...
foreach (string xml_file_path in Directory.GetFiles (local_plugins_path, "*.xml")) {
Plugins.Add (new Plugin (xml_file_path));
local_plugins_count++;
// Import all of the presets
if (Directory.Exists (local_presets_path))
// Local presets go first...
foreach (string xml_file_path in Directory.GetFiles (local_presets_path, "*.xml")) {
Presets.Add (new Preset (xml_file_path));
local_presets_count++;
}
// ...system plugins after that...
if (Directory.Exists (SparkleShare.Controller.PluginsPath)) {
foreach (string xml_file_path in Directory.GetFiles (SparkleShare.Controller.PluginsPath, "*.xml")) {
// ...system presets after that...
if (Directory.Exists (SparkleShare.Controller.PresetsPath)) {
foreach (string xml_file_path in Directory.GetFiles (SparkleShare.Controller.PresetsPath, "*.xml")) {
// ...and "Own server" at the very top
if (xml_file_path.EndsWith ("own-server.xml")) {
Plugins.Insert (0, new Plugin (xml_file_path));
} else if (xml_file_path.EndsWith ("ssnet.xml")) {
// Plugins.Insert ((local_plugins_count + 1), new SparklePlugin (xml_file_path));
// TODO: Skip this plugin for now
} else {
Plugins.Add (new Plugin (xml_file_path));
}
if (xml_file_path.EndsWith ("own-server.xml"))
Presets.Insert (0, new Preset (xml_file_path));
else
Presets.Add (new Preset (xml_file_path));
}
}
SelectedPlugin = Plugins [0];
SelectedPreset = Presets [0];
SparkleShare.Controller.InviteReceived += delegate (SparkleInvite invite) {
PendingInvite = invite;
@ -203,7 +197,7 @@ namespace SparkleShare {
public void PageCancelled ()
{
PendingInvite = null;
SelectedPlugin = Plugins [0];
SelectedPreset = Presets [0];
PreviousAddress = "";
PreviousPath = "";
@ -275,25 +269,25 @@ namespace SparkleShare {
}
public void SelectedPluginChanged (int plugin_index)
public void SelectedPresetChanged (int preset_index)
{
SelectedPlugin = Plugins [plugin_index];
SelectedPreset = Presets [preset_index];
if (SelectedPlugin.Address != null) {
ChangeAddressFieldEvent (SelectedPlugin.Address, "", FieldState.Disabled);
if (SelectedPreset.Address != null) {
ChangeAddressFieldEvent (SelectedPreset.Address, "", FieldState.Disabled);
} else if (SelectedPlugin.AddressExample != null) {
ChangeAddressFieldEvent (this.saved_address, SelectedPlugin.AddressExample, FieldState.Enabled);
} else if (SelectedPreset.AddressExample != null) {
ChangeAddressFieldEvent (this.saved_address, SelectedPreset.AddressExample, FieldState.Enabled);
} else {
ChangeAddressFieldEvent (this.saved_address, "", FieldState.Enabled);
}
if (SelectedPlugin.Path != null) {
ChangePathFieldEvent (SelectedPlugin.Path, "", FieldState.Disabled);
if (SelectedPreset.Path != null) {
ChangePathFieldEvent (SelectedPreset.Path, "", FieldState.Disabled);
} else if (SelectedPlugin.PathExample != null) {
ChangePathFieldEvent (this.saved_remote_path, SelectedPlugin.PathExample, FieldState.Enabled);
} else if (SelectedPreset.PathExample != null) {
ChangePathFieldEvent (this.saved_remote_path, SelectedPreset.PathExample, FieldState.Enabled);
} else {
ChangePathFieldEvent (this.saved_remote_path, "", FieldState.Enabled);
@ -307,12 +301,12 @@ namespace SparkleShare {
}
public void CheckAddPage (string address, string remote_path, int selected_plugin)
public void CheckAddPage (string address, string remote_path, int selected_preset)
{
address = address.Trim ();
remote_path = remote_path.Trim ();
if (selected_plugin == 0)
if (selected_preset == 0)
this.saved_address = address;
this.saved_remote_path = remote_path;
@ -341,7 +335,7 @@ namespace SparkleShare {
remote_path = remote_path.Trim ();
remote_path = remote_path.TrimEnd ("/".ToCharArray ());
if (SelectedPlugin.PathUsesLowerCase)
if (SelectedPreset.PathUsesLowerCase)
remote_path = remote_path.ToLower ();
PreviousAddress = address;
@ -353,11 +347,11 @@ namespace SparkleShare {
SparkleFetcherInfo info = new SparkleFetcherInfo {
Address = address,
Fingerprint = SelectedPlugin.Fingerprint,
Fingerprint = SelectedPreset.Fingerprint,
RemotePath = remote_path,
FetchPriorHistory = this.fetch_prior_history,
AnnouncementsUrl = SelectedPlugin.AnnouncementsUrl,
Backend = SelectedPlugin.Backend
AnnouncementsUrl = SelectedPreset.AnnouncementsUrl,
Backend = SelectedPreset.Backend
};
new Thread (() => { SparkleShare.Controller.StartFetcher (info); }).Start ();
@ -370,23 +364,23 @@ namespace SparkleShare {
{
SyncingFolder = "";
// Create a local plugin for succesfully added projects, so
// Create a local preset for succesfully added projects, so
// so the user can easily use the same host again
if (SelectedPluginIndex == 0) {
Plugin new_plugin;
if (SelectedPresetIndex == 0) {
Preset new_preset;
Uri uri = new Uri (remote_url);
try {
string address = remote_url.Replace (uri.AbsolutePath, "");
new_plugin = Plugin.Create (uri.Host, address, address, "", "", "/path/to/project");
new_preset = Preset.Create (uri.Host, address, address, "", "", "/path/to/project");
if (new_plugin != null) {
Plugins.Insert (1, new_plugin);
Logger.LogInfo ("Controller", "Added plugin for " + uri.Host);
if (new_preset != null) {
Presets.Insert (1, new_preset);
Logger.LogInfo ("Controller", "Added preset for " + uri.Host);
}
} catch {
Logger.LogInfo ("Controller", "Failed adding plugin for " + uri.Host);
Logger.LogInfo ("Controller", "Failed adding preset for " + uri.Host);
}
}
@ -571,7 +565,7 @@ namespace SparkleShare {
public void FinishPageCompleted ()
{
SelectedPlugin = Plugins [0];
SelectedPreset = Presets [0];
PreviousUrl = "";
PreviousAddress = "";
PreviousPath = "";

View file

@ -18,18 +18,17 @@
using System;
using System.Threading;
using SparkleLib;
using Sparkles;
namespace SparkleShare {
// This is SparkleShare!
public class SparkleShare {
public static Controller Controller;
public static UserInterface UI;
public static string [] Arguments;
private static Mutex program_mutex = new Mutex (false, "SparkleShare");
static Mutex program_mutex = new Mutex (false, "SparkleShare");
#if !__MonoCS__
@ -39,25 +38,23 @@ namespace SparkleShare {
{
Arguments = args;
if (args.Length != 0 && !args [0].Equals ("help") &&
Backend.Platform != PlatformID.MacOSX &&
Backend.Platform != PlatformID.Win32NT) {
if (args.Length != 0 && (args [0].Equals ("help") || args [0].Equals ("version")) &&
InstallationInfo.Platform != PlatformID.MacOSX &&
InstallationInfo.Platform != PlatformID.Win32NT) {
string n = Environment.NewLine;
Console.WriteLine (n +
"Share and collaborate by syncing with any Git repository instantly." + n +
n +
"Version: " + SparkleLib.Backend.Version + n +
"Version: " + InstallationInfo.Version + n +
"Copyright (C) 2010 Hylke Bons and others" + n +
"This program comes with ABSOLUTELY NO WARRANTY." + n +
n +
"This is free software, and you are welcome to redistribute it" + n +
"under certain conditions. Please read the GNU GPLv3 for details." + n +
n +
"Usage: sparkleshare [start|open]");
"under certain conditions. Please read the GNU GPLv3 for details." + n);
Environment.Exit (-1);
Environment.Exit (0);
}
// Only allow one instance of SparkleShare (on Windows)
@ -81,15 +78,11 @@ namespace SparkleShare {
#endif
}
private static void OnUnhandledException (object sender, UnhandledExceptionEventArgs exception_args)
static void OnUnhandledException (object sender, UnhandledExceptionEventArgs exception_args)
{
try {
Exception e = (Exception) exception_args.ExceptionObject;
Logger.WriteCrashReport (e);
} finally {
Environment.Exit (-1);
}
var exception = (Exception) exception_args.ExceptionObject;
Logger.WriteCrashReport (exception);
}
}
}

View file

@ -20,7 +20,7 @@ using System.Collections.Generic;
using System.Threading;
using Timers = System.Timers;
using SparkleLib;
using Sparkles;
namespace SparkleShare {

View file

@ -19,7 +19,8 @@ using System;
using Gtk;
using Notifications;
using SparkleLib;
using Sparkles;
namespace SparkleShare {

View file

@ -22,18 +22,18 @@ using System.IO;
using Gtk;
using Mono.Unix.Native;
using SparkleLib;
using Sparkles;
namespace SparkleShare {
public class SparkleController : SparkleControllerBase {
public class SparkleController : ControllerBase {
public SparkleController ()
{
}
public override string PluginsPath {
public override string PresetsPath {
get {
return Path.Combine (Defines.INSTALL_DIR, "plugins");
}
@ -58,6 +58,7 @@ namespace SparkleShare {
if (Defines.INSTALL_DIR.StartsWith ("/app/"))
autostart_exec = "xdg-app run org.sparkleshare.SparkleShare";
// TODO: Ship as .desktop file and copy in place
try {
File.WriteAllText (autostart_file_path,
"[Desktop Entry]\n" +

View file

@ -74,7 +74,7 @@ namespace SparkleShare {
this.content_wrapper.StyleContext.AddProvider (css_provider, 800);
// this.web_view = new WebView () { Editable = false };
// this.web_view.Settings.EnablePlugins = false;
// this.web_view.Settings.EnablePresets = false;
// this.web_view.NavigationRequested += WebViewNavigationRequested;
this.scrolled_window.Add (new Button ("WebView"));

View file

@ -18,7 +18,6 @@ SOURCES = \
../Common/EventLogController.cs \
../Common/Invite.cs \
../Common/NoteController.cs \
../Common/Plugin.cs \
../Common/SetupController.cs \
../Common/StatusIconController.cs \
About.cs \
@ -37,9 +36,11 @@ include $(top_srcdir)/build/build.mk
bin_SCRIPTS = sparkleshare
Applicationsdir = $(datadir)/applications
dist_Applications_DATA = org.sparkleshare.SparkleShare.desktop \
dist_Applications_DATA = \
org.sparkleshare.SparkleShare.desktop \
org.sparkleshare.SparkleShare.Invites.desktop
install-data-hook:
test -f $(datadir)/applications/defaults.list && \
test -z $(DESTDIR) && update-desktop-database $(datadir)/applications || :

View file

@ -7,3 +7,4 @@ pixmapsdir = $(pkgdatadir)/pixmaps/
MAINTAINERCLEANFILES = \
Makefile.in

View file

@ -50,3 +50,4 @@ uninstall-hook:
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = $(wildcard *.png *.svg)

View file

@ -18,3 +18,4 @@ uninstall-hook:
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = $(wildcard *.png *.svg)

View file

@ -137,7 +137,7 @@ namespace SparkleShare {
VBox layout_address = new VBox (true, 0);
VBox layout_path = new VBox (true, 0);
ListStore store = new ListStore (typeof (string), typeof (Gdk.Pixbuf), typeof (string), typeof (SparklePlugin));
ListStore store = new ListStore (typeof (string), typeof (Gdk.Pixbuf), typeof (string), typeof (SparklePreset));
SparkleTreeView tree_view = new SparkleTreeView (store) { HeadersVisible = false };
ScrolledWindow scrolled_window = new ScrolledWindow () { ShadowType = ShadowType.In };
@ -157,7 +157,7 @@ namespace SparkleShare {
service_column.PackStart (service_cell, true);
service_column.SetCellDataFunc (service_cell, new TreeCellDataFunc (RenderServiceColumn));
foreach (SparklePlugin plugin in Controller.Plugins) {
foreach (SparklePreset plugin in Controller.Presets) {
store.AppendValues ("", new Gdk.Pixbuf (plugin.ImagePath),
"<span size=\"small\"><b>" + plugin.Name + "</b>\n" +
"<span fgcolor=\"" + Program.UI.SecondaryTextColor + "\">" + plugin.Description + "</span>" +
@ -169,13 +169,13 @@ namespace SparkleShare {
Entry address_entry = new Entry () {
Text = Controller.PreviousAddress,
Sensitive = (Controller.SelectedPlugin.Address == null),
Sensitive = (Controller.SelectedPreset.Address == null),
ActivatesDefault = true
};
Entry path_entry = new Entry () {
Text = Controller.PreviousPath,
Sensitive = (Controller.SelectedPlugin.Path == null),
Sensitive = (Controller.SelectedPreset.Path == null),
ActivatesDefault = true
};
@ -183,19 +183,19 @@ namespace SparkleShare {
Xalign = 0,
UseMarkup = true,
Markup = "<span size=\"small\" fgcolor=\"" +
Program.UI.SecondaryTextColor + "\">" + Controller.SelectedPlugin.AddressExample + "</span>"
Program.UI.SecondaryTextColor + "\">" + Controller.SelectedPreset.AddressExample + "</span>"
};
Label path_example = new Label () {
Xalign = 0,
UseMarkup = true,
Markup = "<span size=\"small\" fgcolor=\"" +
Program.UI.SecondaryTextColor + "\">" + Controller.SelectedPlugin.PathExample + "</span>"
Program.UI.SecondaryTextColor + "\">" + Controller.SelectedPreset.PathExample + "</span>"
};
TreeSelection default_selection = tree_view.Selection;
TreePath default_path = new TreePath ("" + Controller.SelectedPluginIndex);
TreePath default_path = new TreePath ("" + Controller.SelectedPresetIndex);
default_selection.SelectPath (default_path);
tree_view.Model.Foreach (new TreeModelForeachFunc (
@ -203,7 +203,7 @@ namespace SparkleShare {
string address;
try {
address = (model.GetValue (iter, 2) as SparklePlugin).Address;
address = (model.GetValue (iter, 2) as SparklePreset).Address;
} catch (NullReferenceException) {
address = "";
@ -213,7 +213,7 @@ namespace SparkleShare {
address.Equals (Controller.PreviousAddress)) {
tree_view.SetCursor (path, service_column, false);
SparklePlugin plugin = (SparklePlugin) model.GetValue (iter, 2);
SparklePreset plugin = (SparklePreset) model.GetValue (iter, 2);
if (plugin.Address != null)
address_entry.Sensitive = false;
@ -256,7 +256,7 @@ namespace SparkleShare {
layout_vertical.PackStart (scrolled_window, true, true, 0);
layout_vertical.PackStart (layout_fields, false, false, 0);
tree_view.ScrollToCell (new TreePath ("" + Controller.SelectedPluginIndex), null, true, 0, 0);
tree_view.ScrollToCell (new TreePath ("" + Controller.SelectedPresetIndex), null, true, 0, 0);
Add (layout_vertical);
@ -301,7 +301,7 @@ namespace SparkleShare {
tree_view.CursorChanged += delegate (object sender, EventArgs e) {
Controller.SelectedPluginChanged (tree_view.SelectedRow);
Controller.SelectedPresetChanged (tree_view.SelectedRow);
};
address_entry.Changed += delegate {

View file

@ -167,18 +167,18 @@
<ItemGroup>
<Folder Include="Resources\" />
<Folder Include="HTML\" />
<Folder Include="Plugins\" />
<Folder Include="Presets\" />
<Folder Include="Controllers\" />
<Folder Include="UserInterface\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\SparkleLib\SparkleLib.csproj">
<ProjectReference Include="..\..\Sparkles\Sparkles.csproj">
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
<Name>SparkleLib</Name>
<Name>Sparkles</Name>
</ProjectReference>
<ProjectReference Include="..\..\SparkleLib\Git\SparkleLib.Git.csproj">
<ProjectReference Include="..\..\Sparkles\Git\Sparkles.Git.csproj">
<Project>{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}</Project>
<Name>SparkleLib.Git</Name>
<Name>Sparkles.Git</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
@ -234,60 +234,60 @@
<BundleResource Include="..\Common\Pixmaps\tutorial-slide-2%402x.png">
<Link>Resources\tutorial-slide-2%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\bitbucket%402x.png">
<Link>Plugins\bitbucket%402x.png</Link>
<BundleResource Include="..\Common\Presets\bitbucket%402x.png">
<Link>Presets\bitbucket%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\github%402x.png">
<Link>Plugins\github%402x.png</Link>
<BundleResource Include="..\Common\Presets\github%402x.png">
<Link>Presets\github%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\gitorious%402x.png">
<Link>Plugins\gitorious%402x.png</Link>
<BundleResource Include="..\Common\Presets\gitorious%402x.png">
<Link>Presets\gitorious%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\own-server%402x.png">
<Link>Plugins\own-server%402x.png</Link>
<BundleResource Include="..\Common\Presets\own-server%402x.png">
<Link>Presets\own-server%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\ssnet%402x.png">
<Link>Plugins\ssnet%402x.png</Link>
<BundleResource Include="..\Common\Presets\ssnet%402x.png">
<Link>Presets\ssnet%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\bitbucket.xml">
<Link>Plugins\bitbucket.xml</Link>
<BundleResource Include="..\Common\Presets\bitbucket.xml">
<Link>Presets\bitbucket.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\github.xml">
<Link>Plugins\github.xml</Link>
<BundleResource Include="..\Common\Presets\github.xml">
<Link>Presets\github.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\gitorious.xml">
<Link>Plugins\gitorious.xml</Link>
<BundleResource Include="..\Common\Presets\gitorious.xml">
<Link>Presets\gitorious.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\own-server.xml">
<Link>Plugins\own-server.xml</Link>
<BundleResource Include="..\Common\Presets\own-server.xml">
<Link>Presets\own-server.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\bitbucket.png">
<Link>Plugins\bitbucket.png</Link>
<BundleResource Include="..\Common\Presets\bitbucket.png">
<Link>Presets\bitbucket.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\github.png">
<Link>Plugins\github.png</Link>
<BundleResource Include="..\Common\Presets\github.png">
<Link>Presets\github.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\gitorious.png">
<Link>Plugins\gitorious.png</Link>
<BundleResource Include="..\Common\Presets\gitorious.png">
<Link>Presets\gitorious.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\own-server.png">
<Link>Plugins\own-server.png</Link>
<BundleResource Include="..\Common\Presets\own-server.png">
<Link>Presets\own-server.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\ssnet.png">
<Link>Plugins\ssnet.png</Link>
<BundleResource Include="..\Common\Presets\ssnet.png">
<Link>Presets\ssnet.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\ssnet.xml">
<Link>Plugins\ssnet.xml</Link>
<BundleResource Include="..\Common\Presets\ssnet.xml">
<Link>Presets\ssnet.xml</Link>
</BundleResource>
<BundleResource Include="Resources\tutorial-slide-3%402x.png" />
<BundleResource Include="..\Common\Plugins\planio.png">
<Link>Plugins\planio.png</Link>
<BundleResource Include="..\Common\Presets\planio.png">
<Link>Presets\planio.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\planio.xml">
<Link>Plugins\planio.xml</Link>
<BundleResource Include="..\Common\Presets\planio.xml">
<Link>Presets\planio.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\planio%402x.png">
<Link>Plugins\planio%402x.png</Link>
<BundleResource Include="..\Common\Presets\planio%402x.png">
<Link>Presets\planio%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Pixmaps\text-balloon.png">
<Link>Resources\text-balloon.png</Link>

View file

@ -19,11 +19,12 @@ using System;
using GLib;
using Gtk;
using SparkleLib;
using Sparkles;
namespace SparkleShare {
public class SparkleUI {
public class UserInterface {
public static string AssetsPath = Defines.INSTALL_DIR;
@ -37,15 +38,15 @@ namespace SparkleShare {
public readonly string SecondaryTextColor;
public readonly string SecondaryTextColorSelected;
private Gtk.Application application;
Gtk.Application application;
public SparkleUI ()
public UserInterface ()
{
this.application = new Gtk.Application ("org.sparkleshare.SparkleShare", 0);
application = new Gtk.Application ("org.sparkleshare.SparkleShare", 0);
this.application.Register (null);
this.application.Activated += ApplicationActivatedDelegate;
application.Register (null);
application.Activated += ApplicationActivatedDelegate;
Gdk.Color color = SparkleUIHelpers.RGBAToColor (new Label().StyleContext.GetColor (StateFlags.Insensitive));
SecondaryTextColor = SparkleUIHelpers.ColorToHex (color);
@ -61,16 +62,16 @@ namespace SparkleShare {
public void Run ()
{
(this.application as GLib.Application).Run (null, null);
(application as GLib.Application).Run (null, null);
}
private void ApplicationActivatedDelegate (object sender, EventArgs args)
void ApplicationActivatedDelegate (object sender, EventArgs args)
{
if (this.application.Windows.Length > 0) {
if (application.Windows.Length > 0) {
bool has_visible_windows = false;
foreach (Window window in this.application.Windows) {
foreach (Window window in application.Windows) {
if (window.Visible) {
window.Present ();
has_visible_windows = true;
@ -88,9 +89,9 @@ namespace SparkleShare {
StatusIcon = new SparkleStatusIcon ();
Note = new SparkleNote ();
Setup.Application = this.application;
EventLog.Application = this.application;
About.Application = this.application;
Setup.Application = application;
EventLog.Application = application;
About.Application = application;
Program.Controller.UIHasLoaded ();
}

View file

@ -12,8 +12,8 @@ case $1 in
curl --insecure --output ~/SparkleShare/.$invite.xml $open
mono "@expanded_libdir@/@PACKAGE@/SparkleShare.exe"
;;
help|--help)
mono "@expanded_libdir@/@PACKAGE@/SparkleShare.exe" --help
help|--help|version|--version)
mono "@expanded_libdir@/@PACKAGE@/SparkleShare.exe" help
;;
*)
mono "@expanded_libdir@/@PACKAGE@/SparkleShare.exe" $2

View file

@ -24,16 +24,16 @@ using Mono.Unix.Native;
using MonoMac.Foundation;
using MonoMac.AppKit;
using SparkleLib;
using SparkleLib.Git;
using Sparkles;
using Sparkles.Git;
namespace SparkleShare {
public class Controller : BaseController {
public override string PluginsPath {
public override string PresetsPath {
get {
return Path.Combine (NSBundle.MainBundle.ResourcePath, "Plugins");
return Path.Combine (NSBundle.MainBundle.ResourcePath, "Presets");
}
}
@ -138,7 +138,7 @@ namespace SparkleShare {
public override void SetFolderIcon ()
{
if (Environment.OSVersion.Version.Major >= 14) {
/* if (Environment.OSVersion.Version.Major >= 14) {
NSWorkspace.SharedWorkspace.SetIconforFile (
NSImage.ImageNamed ("sparkleshare-folder-yosemite.icns"),
SparkleShare.Controller.FoldersPath, 0);
@ -147,7 +147,7 @@ namespace SparkleShare {
NSWorkspace.SharedWorkspace.SetIconforFile (
NSImage.ImageNamed ("sparkleshare-folder.icns"),
SparkleShare.Controller.FoldersPath, 0);
}
}*/
}

View file

@ -95,9 +95,6 @@
<Link>SparkleShare.cs</Link>
</Compile>
<Compile Include="MacWatcher.cs" />
<Compile Include="..\Common\Plugin.cs">
<Link>Plugin.cs</Link>
</Compile>
<Compile Include="..\Common\Invite.cs">
<Link>Invite.cs</Link>
</Compile>
@ -128,10 +125,10 @@
<Compile Include="UserInterface\SetupWindow.cs" />
<Compile Include="UserInterface\StatusIcon.cs" />
<Compile Include="UserInterface\UserInterface.cs" />
<Compile Include="Controllers\Controller.cs" />
<Compile Include="..\Common\BaseController.cs">
<Link>Controllers\BaseController.cs</Link>
</Compile>
<Compile Include="Controller.cs" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="MainMenu.xib" />
@ -167,20 +164,10 @@
<ItemGroup>
<Folder Include="Resources\" />
<Folder Include="HTML\" />
<Folder Include="Plugins\" />
<Folder Include="Presets\" />
<Folder Include="Controllers\" />
<Folder Include="UserInterface\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\SparkleLib\SparkleLib.csproj">
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
<Name>SparkleLib</Name>
</ProjectReference>
<ProjectReference Include="..\..\SparkleLib\Git\SparkleLib.Git.csproj">
<Project>{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}</Project>
<Name>SparkleLib.Git</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BundleResource Include="..\Common\Pixmaps\side-splash.png">
<Link>Resources\side-splash.png</Link>
@ -234,60 +221,42 @@
<BundleResource Include="..\Common\Pixmaps\tutorial-slide-2%402x.png">
<Link>Resources\tutorial-slide-2%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\bitbucket%402x.png">
<Link>Plugins\bitbucket%402x.png</Link>
<BundleResource Include="..\Common\Presets\bitbucket%402x.png">
<Link>Presets\bitbucket%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\github%402x.png">
<Link>Plugins\github%402x.png</Link>
<BundleResource Include="..\Common\Presets\github%402x.png">
<Link>Presets\github%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\gitorious%402x.png">
<Link>Plugins\gitorious%402x.png</Link>
<BundleResource Include="..\Common\Presets\own-server%402x.png">
<Link>Presets\own-server%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\own-server%402x.png">
<Link>Plugins\own-server%402x.png</Link>
<BundleResource Include="..\Common\Presets\bitbucket.xml">
<Link>Presets\bitbucket.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\ssnet%402x.png">
<Link>Plugins\ssnet%402x.png</Link>
<BundleResource Include="..\Common\Presets\github.xml">
<Link>Presets\github.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\bitbucket.xml">
<Link>Plugins\bitbucket.xml</Link>
<BundleResource Include="..\Common\Presets\own-server.xml">
<Link>Presets\own-server.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\github.xml">
<Link>Plugins\github.xml</Link>
<BundleResource Include="..\Common\Presets\bitbucket.png">
<Link>Presets\bitbucket.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\gitorious.xml">
<Link>Plugins\gitorious.xml</Link>
<BundleResource Include="..\Common\Presets\github.png">
<Link>Presets\github.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\own-server.xml">
<Link>Plugins\own-server.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\bitbucket.png">
<Link>Plugins\bitbucket.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\github.png">
<Link>Plugins\github.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\gitorious.png">
<Link>Plugins\gitorious.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\own-server.png">
<Link>Plugins\own-server.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\ssnet.png">
<Link>Plugins\ssnet.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\ssnet.xml">
<Link>Plugins\ssnet.xml</Link>
<BundleResource Include="..\Common\Presets\own-server.png">
<Link>Presets\own-server.png</Link>
</BundleResource>
<BundleResource Include="Resources\tutorial-slide-3%402x.png" />
<BundleResource Include="..\Common\Plugins\planio.png">
<Link>Plugins\planio.png</Link>
<BundleResource Include="..\Common\Presets\planio.png">
<Link>Presets\planio.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\planio.xml">
<Link>Plugins\planio.xml</Link>
<BundleResource Include="..\Common\Presets\planio.xml">
<Link>Presets\planio.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\planio%402x.png">
<Link>Plugins\planio%402x.png</Link>
<BundleResource Include="..\Common\Presets\planio%402x.png">
<Link>Presets\planio%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Pixmaps\text-balloon.png">
<Link>Resources\text-balloon.png</Link>
@ -296,4 +265,14 @@
<Link>Resources\text-balloon%402x.png</Link>
</BundleResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Sparkles\Sparkles.csproj">
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
<Name>Sparkles</Name>
</ProjectReference>
<ProjectReference Include="..\..\Sparkles\Git\Sparkles.Git.csproj">
<Project>{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}</Project>
<Name>Sparkles.Git</Name>
</ProjectReference>
</ItemGroup>
</Project>

View file

@ -30,18 +30,20 @@ namespace SparkleShare {
public SparkleEventLogController Controller = new SparkleEventLogController ();
public float TitlebarHeight;
private WebView web_view;
private NSBox background;
private NSBox cover;
private NSPopUpButton popup_button;
private NSProgressIndicator progress_indicator;
private NSTextField size_label, size_label_value, history_label, history_label_value;
private NSButton hidden_close_button;
WebView web_view;
NSBox background;
NSBox cover;
NSPopUpButton popup_button;
NSProgressIndicator progress_indicator;
NSTextField size_label, size_label_value, history_label, history_label_value;
NSButton hidden_close_button;
public EventLog (IntPtr handle) : base (handle) { }
public EventLog (IntPtr handle) : base (handle)
{
}
public EventLog () : base ()
public EventLog ()
{
Title = "Recent Changes";
Delegate = new SparkleEventsDelegate ();

View file

@ -189,7 +189,7 @@ namespace SparkleShare {
AddressTextField = new NSTextField () {
Frame = new RectangleF (190, Frame.Height - 336, 196, 22),
Enabled = (Controller.SelectedPlugin.Address == null),
Enabled = (Controller.SelectedPreset.Address == null),
Delegate = new SparkleTextFieldDelegate (),
StringValue = "" + Controller.PreviousAddress
};
@ -203,24 +203,24 @@ namespace SparkleShare {
PathTextField = new NSTextField () {
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 336, 196, 22),
Enabled = (Controller.SelectedPlugin.Path == null),
Enabled = (Controller.SelectedPreset.Path == null),
Delegate = new SparkleTextFieldDelegate (),
StringValue = "" + Controller.PreviousPath
};
PathTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
PathHelpLabel = new SparkleLabel (Controller.SelectedPlugin.PathExample, NSTextAlignment.Left) {
PathHelpLabel = new SparkleLabel (Controller.SelectedPreset.PathExample, NSTextAlignment.Left) {
TextColor = NSColor.DisabledControlText,
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 358, 204, 19)
};
AddressHelpLabel = new SparkleLabel (Controller.SelectedPlugin.AddressExample, NSTextAlignment.Left) {
AddressHelpLabel = new SparkleLabel (Controller.SelectedPreset.AddressExample, NSTextAlignment.Left) {
TextColor = NSColor.DisabledControlText,
Frame = new RectangleF (190, Frame.Height - 358, 204, 19)
};
if (TableView == null || TableView.RowCount != Controller.Plugins.Count) {
if (TableView == null || TableView.RowCount != Controller.Presets.Count) {
TableView = new NSTableView () {
Frame = new RectangleF (0, 0, 0, 0),
RowHeight = 38,
@ -256,21 +256,21 @@ namespace SparkleShare {
// Hi-res display support was added after Snow Leopard
if (Environment.OSVersion.Version.Major < 11)
DataSource = new SparkleDataSource (1, Controller.Plugins);
DataSource = new SparkleDataSource (1, Controller.Presets);
else
DataSource = new SparkleDataSource (BackingScaleFactor, Controller.Plugins);
DataSource = new SparkleDataSource (BackingScaleFactor, Controller.Presets);
TableView.DataSource = DataSource;
TableView.ReloadData ();
(TableView.Delegate as SparkleTableViewDelegate).SelectionChanged += delegate {
Controller.SelectedPluginChanged (TableView.SelectedRow);
Controller.SelectedPresetChanged (TableView.SelectedRow);
Controller.CheckAddPage (AddressTextField.StringValue, PathTextField.StringValue, TableView.SelectedRow);
};
}
TableView.SelectRow (Controller.SelectedPluginIndex, false);
TableView.ScrollRowToVisible (Controller.SelectedPluginIndex);
TableView.SelectRow (Controller.SelectedPresetIndex, false);
TableView.ScrollRowToVisible (Controller.SelectedPresetIndex);
MakeFirstResponder ((NSResponder) TableView);
HistoryCheckButton = new NSButton () {
@ -730,7 +730,7 @@ namespace SparkleShare {
int backing_scale_factor;
public SparkleDataSource (float backing_scale_factor, List<Plugin> plugins)
public SparkleDataSource (float backing_scale_factor, List<Preset> plugins)
{
Items = new List <object> ();
Cells = new NSAttributedString [plugins.Count];
@ -739,7 +739,7 @@ namespace SparkleShare {
this.backing_scale_factor = (int) backing_scale_factor;
int i = 0;
foreach (Plugin plugin in plugins) {
foreach (Preset plugin in plugins) {
Items.Add (plugin);
NSTextFieldCell cell = new NSTextFieldCell ();
@ -815,27 +815,24 @@ namespace SparkleShare {
SparkleShare.UI.Setup.FirstResponder == table_view) {
return SelectedCells [row_index];
} else {
return Cells [row_index];
}
} else {
Plugin plugin = (Plugin) Items [row_index];
string path = plugin.ImagePath;
if (backing_scale_factor >= 2) {
string hi_path = String.Format ("{0}@{1}x{2}",
Path.Combine (Path.GetDirectoryName (path), Path.GetFileNameWithoutExtension (path)),
backing_scale_factor, Path.GetExtension (path)
);
if (File.Exists (hi_path))
path = hi_path;
}
return new NSImage (path) { Size = new SizeF (24, 24) };
return Cells [row_index];
}
string image_path = (Items [row_index] as Preset).ImagePath;
if (backing_scale_factor >= 2) {
string hi_path = String.Format ("{0}@{1}x{2}",
Path.Combine (Path.GetDirectoryName (image_path), Path.GetFileNameWithoutExtension (image_path)),
backing_scale_factor, Path.GetExtension (image_path)
);
if (File.Exists (hi_path))
image_path = hi_path;
}
return new NSImage (image_path) { Size = new SizeF (24, 24) };
}
}

View file

@ -41,18 +41,7 @@ namespace SparkleShare {
FontName = "Lucida Grande";
SparkleShare.Controller.Invoke (() => {
if (Environment.OSVersion.Version.Major >= 14) {
NSWorkspace.SharedWorkspace.SetIconforFile (
NSImage.ImageNamed ("sparkleshare-folder-yosemite.icns"),
SparkleShare.Controller.FoldersPath, 0);
} else {
NSWorkspace.SharedWorkspace.SetIconforFile (
NSImage.ImageNamed ("sparkleshare-folder.icns"),
SparkleShare.Controller.FoldersPath, 0);
}
NSApplication.SharedApplication.ApplicationIconImage = NSImage.ImageNamed ("sparkleshare-app.icns");
// NSApplication.SharedApplication.ApplicationIconImage = NSImage.ImageNamed ("Resources/sparkleshare-app.icns");
Setup = new Setup ();
EventLog = new EventLog ();

View file

@ -19,6 +19,6 @@ cp ${MONO_PATH}/lib/libMonoPosixHelper.dylib ../MacOS/
sed -i .bak 's/libMonoPosixHelper.dylib/@executable_path\/libMonoPosixHelper.dylib/' ./config
# merge all Assemblies into one Mac binary
mkbundle --static --deps --config ./config -o ../MacOS/SparkleShare SparkleShare.exe SparkleLib.dll MonoMac.dll SparkleLib.Git.dll
mkbundle --static --deps --config ./config -o ../MacOS/SparkleShare SparkleShare.exe Sparkles.dll MonoMac.dll Sparkles.Git.dll
rm *.dll *.exe

View file

@ -29,7 +29,7 @@ using System.Windows;
using Forms = System.Windows.Forms;
using Microsoft.Win32;
using SparkleLib;
using Sparkles;
namespace SparkleShare {
@ -40,7 +40,7 @@ namespace SparkleShare {
}
public override string PluginsPath
public override string PresetsPath
{
get {
return Path.Combine (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "plugins");
@ -63,7 +63,7 @@ namespace SparkleShare {
Environment.SetEnvironmentVariable ("PATH", new_PATH);
Environment.SetEnvironmentVariable ("HOME", Environment.GetFolderPath (Environment.SpecialFolder.UserProfile));
SparkleLib.Git.SparkleGit.SSHPath = Path.Combine (msysgit_path, "bin", "ssh.exe");
Sparkles.Git.SparkleGit.SSHPath = Path.Combine (msysgit_path, "bin", "ssh.exe");
base.Initialize ();
}

View file

@ -145,7 +145,7 @@ namespace SparkleShare
private void UpdateContent (string html)
{
string pixmaps_path = Path.Combine (SparkleLib.SparkleConfig.DefaultConfig.TmpPath, "Pixmaps");
string pixmaps_path = Path.Combine (Sparkles.SparkleConfig.DefaultConfig.TmpPath, "Pixmaps");
pixmaps_path = pixmaps_path.Replace ("\\", "/");
html = html.Replace ("<a href=", "<a class='windows' href=");
@ -207,7 +207,7 @@ namespace SparkleShare
private void WriteOutImages ()
{
string tmp_path = SparkleLib.SparkleConfig.DefaultConfig.TmpPath;
string tmp_path = Sparkles.SparkleConfig.DefaultConfig.TmpPath;
string pixmaps_path = Path.Combine (tmp_path, "Pixmaps");
if (!Directory.Exists (pixmaps_path))

View file

@ -22,7 +22,7 @@ using System.Windows;
using System.Windows.Forms.Integration;
using System.Windows.Media;
using SparkleLib;
using Sparkles;
namespace SparkleShare {

View file

@ -268,7 +268,7 @@ namespace SparkleShare {
header_style.Setters.Add (new Setter (GridViewColumnHeader.VisibilityProperty, Visibility.Collapsed));
grid_view.ColumnHeaderContainerStyle = header_style;
foreach (SparklePlugin plugin in Controller.Plugins) {
foreach (SparklePreset plugin in Controller.Presets) {
// FIXME: images are blurry
BitmapFrame image = BitmapFrame.Create (
new Uri (plugin.ImagePath)
@ -284,7 +284,7 @@ namespace SparkleShare {
}
list_view.View = grid_view;
list_view.SelectedIndex = Controller.SelectedPluginIndex;
list_view.SelectedIndex = Controller.SelectedPresetIndex;
TextBlock address_label = new TextBlock () {
Text = "Address:",
@ -294,11 +294,11 @@ namespace SparkleShare {
TextBox address_box = new TextBox () {
Width = 200,
Text = Controller.PreviousAddress,
IsEnabled = (Controller.SelectedPlugin.Address == null)
IsEnabled = (Controller.SelectedPreset.Address == null)
};
TextBlock address_help_label = new TextBlock () {
Text = Controller.SelectedPlugin.AddressExample,
Text = Controller.SelectedPreset.AddressExample,
FontSize = 11,
Foreground = new SolidColorBrush (Color.FromRgb (128, 128, 128))
};
@ -312,11 +312,11 @@ namespace SparkleShare {
TextBox path_box = new TextBox () {
Width = 200,
Text = Controller.PreviousPath,
IsEnabled = (Controller.SelectedPlugin.Path == null)
IsEnabled = (Controller.SelectedPreset.Path == null)
};
TextBlock path_help_label = new TextBlock () {
Text = Controller.SelectedPlugin.PathExample,
Text = Controller.SelectedPreset.PathExample,
FontSize = 11,
Width = 200,
Foreground = new SolidColorBrush (Color.FromRgb (128, 128, 128))
@ -409,11 +409,11 @@ namespace SparkleShare {
};
list_view.SelectionChanged += delegate {
Controller.SelectedPluginChanged (list_view.SelectedIndex);
Controller.SelectedPresetChanged (list_view.SelectedIndex);
};
list_view.KeyDown += delegate {
Controller.SelectedPluginChanged (list_view.SelectedIndex);
Controller.SelectedPresetChanged (list_view.SelectedIndex);
};
Controller.CheckAddPage (address_box.Text, path_box.Text, list_view.SelectedIndex);

View file

@ -202,54 +202,54 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="..\Common\Plugins\github.png">
<Link>Plugins\github.png</Link>
<None Include="..\Common\Presets\github.png">
<Link>Presets\github.png</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\Common\Plugins\gitorious.png">
<Link>Plugins\gitorious.png</Link>
<None Include="..\Common\Presets\gitorious.png">
<Link>Presets\gitorious.png</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\Common\Plugins\own-server.png">
<Link>Plugins\own-server.png</Link>
<None Include="..\Common\Presets\own-server.png">
<Link>Presets\own-server.png</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\Common\Plugins\bitbucket.png">
<Link>Plugins\bitbucket.png</Link>
<None Include="..\Common\Presets\bitbucket.png">
<Link>Presets\bitbucket.png</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\Common\Plugins\ssnet.png">
<Link>Plugins\ssnet.png</Link>
<None Include="..\Common\Presets\ssnet.png">
<Link>Presets\ssnet.png</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\Common\Plugins\planio.png">
<Link>Plugins\planio.png</Link>
<None Include="..\Common\Presets\planio.png">
<Link>Presets\planio.png</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="..\Common\Plugins\ssnet.xml">
<Link>Plugins\ssnet.xml</Link>
<None Include="..\Common\Presets\ssnet.xml">
<Link>Presets\ssnet.xml</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\Common\Plugins\bitbucket.xml">
<Link>Plugins\bitbucket.xml</Link>
<None Include="..\Common\Presets\bitbucket.xml">
<Link>Presets\bitbucket.xml</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\Common\Plugins\github.xml">
<Link>Plugins\github.xml</Link>
<None Include="..\Common\Presets\github.xml">
<Link>Presets\github.xml</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\Common\Plugins\gitorious.xml">
<Link>Plugins\gitorious.xml</Link>
<None Include="..\Common\Presets\gitorious.xml">
<Link>Presets\gitorious.xml</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\Common\Plugins\own-server.xml">
<Link>Plugins\own-server.xml</Link>
<None Include="..\Common\Presets\own-server.xml">
<Link>Presets\own-server.xml</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\Common\Plugins\planio.xml">
<Link>Plugins\planio.xml</Link>
<None Include="..\Common\Presets\planio.xml">
<Link>Presets\planio.xml</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
@ -281,11 +281,11 @@
<ItemGroup>
<ProjectReference Include="SparkleLib\Git\SparkleLib.Git.csproj">
<Project>{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}</Project>
<Name>SparkleLib.Git</Name>
<Name>Sparkles.Git</Name>
</ProjectReference>
<ProjectReference Include="SparkleLib\SparkleLib.csproj">
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
<Name>SparkleLib</Name>
<Name>Sparkles</Name>
</ProjectReference>
</ItemGroup>
</Project>

File diff suppressed because one or more lines are too long

View file

@ -20,8 +20,8 @@
<File Id='SparkleShareInviteOpener.exe' Name='SparkleShareInviteOpener.exe' Source='!(wix.root)\bin\SparkleShareInviteOpener.exe' DiskId='1' />
</Component>
<Component Id='Libraries' Guid='0DA692D5-4DBE-4251-9F62-E7C1A76F10E1'>
<File Id='SparkleLib.Git.dll' Name='SparkleLib.Git.dll' Source='!(wix.root)\bin\SparkleLib.Git.dll' DiskId='1' />
<File Id='SparkleLib.dll' Name='SparkleLib.dll' Source='!(wix.root)\bin\SparkleLib.dll' DiskId='1' />
<File Id='Sparkles.Git.dll' Name='Sparkles.Git.dll' Source='!(wix.root)\bin\Sparkles.Git.dll' DiskId='1' />
<File Id='Sparkles.dll' Name='Sparkles.dll' Source='!(wix.root)\bin\Sparkles.dll' DiskId='1' />
<File Id='sparkleshare_app.ico' Name='sparkleshare.ico' Source='!(wix.root)\SparkleShare\Windows\Pixmaps\sparkleshare-app.ico' DiskId='1' />
</Component>
<Directory Id='MSYSGIT_DIR' Name='msysgit'>

View file

@ -19,7 +19,7 @@ using System;
using System.Threading;
using System.Windows.Forms;
using SparkleLib;
using Sparkles;
namespace SparkleShare {

View file

@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace SparkleLib {
namespace Sparkles {
public abstract class AuthenticationInfo
{

2
SparkleLib/BaseFetcher.cs → Sparkles/BaseFetcher.cs Executable file → Normal file
View file

@ -22,7 +22,7 @@ using System.IO;
using System.Security.Cryptography;
using System.Threading;
namespace SparkleLib {
namespace Sparkles {
public class SparkleFetcherInfo {
public string Address;

View file

@ -19,7 +19,7 @@ using System;
using System.Collections.Generic;
using System.Timers;
namespace SparkleLib {
namespace Sparkles {
public enum DisconnectReason {
None,

View file

@ -22,7 +22,7 @@ using System.Threading;
using Timers = System.Timers;
namespace SparkleLib {
namespace Sparkles {
public enum SyncStatus {
Idle,

View file

@ -19,7 +19,7 @@ using System;
using System.IO;
using System.Collections.Generic;
namespace SparkleLib {
namespace Sparkles {
public enum ChangeType {
Added,

View file

@ -19,7 +19,7 @@ using System;
using System.Diagnostics;
using System.IO;
namespace SparkleLib {
namespace Sparkles {
public class Command : Process {
@ -52,7 +52,7 @@ namespace SparkleLib {
if (!string.IsNullOrEmpty (StartInfo.WorkingDirectory))
folder = Path.GetFileName (StartInfo.WorkingDirectory) + " | ";
if (this.write_output)
if (write_output)
Logger.LogInfo ("Cmd", folder + Path.GetFileName (StartInfo.FileName) + " " + StartInfo.Arguments);
try {
@ -103,7 +103,7 @@ namespace SparkleLib {
{
string [] possible_command_paths = {
Environment.GetFolderPath (Environment.SpecialFolder.Personal) + "/bin/" + name,
Defines.INSTALL_DIR + "/bin/" + name,
InstallationInfo.Directory + "/bin/" + name,
"/usr/local/bin/" + name,
"/usr/bin/" + name,
"/opt/local/bin/" + name
@ -118,4 +118,3 @@ namespace SparkleLib {
}
}
}

View file

@ -20,7 +20,7 @@ using System.IO;
using System.Collections.Generic;
using System.Xml;
namespace SparkleLib {
namespace Sparkles {
public class Configuration : XmlDocument {
@ -34,7 +34,7 @@ namespace SparkleLib {
public string HomePath {
get {
if (Backend.Platform == PlatformID.Win32NT)
if (InstallationInfo.Platform == PlatformID.Win32NT)
return Environment.GetFolderPath (Environment.SpecialFolder.UserProfile);
else
return Environment.GetFolderPath (Environment.SpecialFolder.Personal);
@ -110,8 +110,8 @@ namespace SparkleLib {
{
string user_name = "Unknown";
if (Backend.Platform == PlatformID.Unix ||
Backend.Platform == PlatformID.MacOSX) {
if (InstallationInfo.Platform == PlatformID.Unix ||
InstallationInfo.Platform == PlatformID.MacOSX) {
user_name = Environment.UserName;
if (string.IsNullOrEmpty (user_name))

2
SparkleLib/Extensions.cs → Sparkles/Extensions.cs Executable file → Normal file
View file

@ -20,7 +20,7 @@ using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace SparkleLib {
namespace Sparkles {
public static class Extensions {

View file

@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace SparkleLib.Git {
namespace Sparkles.Git {
public class GitCommand : Command {

View file

@ -21,7 +21,7 @@ using System.IO;
using System.Text.RegularExpressions;
using System.Threading;
namespace SparkleLib.Git {
namespace Sparkles.Git {
public class GitFetcher : SSHFetcher {
@ -259,7 +259,7 @@ namespace SparkleLib.Git {
"push.default matching"
};
if (Backend.Platform == PlatformID.Win32NT)
if (InstallationInfo.Platform == PlatformID.Win32NT)
settings [0] = "core.autocrlf true";
foreach (string setting in settings) {

View file

@ -23,7 +23,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
namespace SparkleLib.Git {
namespace Sparkles.Git {
public class GitRepository : BaseRepository {

View file

@ -1,14 +1,13 @@
ASSEMBLY = SparkleLib.Git
ASSEMBLY = Sparkles.Git
TARGET = library
LINK = -r:$(DIR_BIN)/SparkleLib.dll
LINK = -r:$(DIR_BIN)/Sparkles.dll
SOURCES = \
GitCommand.cs \
GitFetcher.cs \
GitRepository.cs
install-data-hook:
for ASM in $(EXTRA_BUNDLE); do \
$(INSTALL) -m 0755 $$ASM $(DESTDIR)$(moduledir); \
@ -20,3 +19,4 @@ uninstall-hook:
done;
include $(top_srcdir)/build/build.mk

View file

@ -8,8 +8,8 @@
<ProjectGuid>{009FDCD7-1D57-4202-BB6D-8477D8C6B8EE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SparkleLib.Git</RootNamespace>
<AssemblyName>SparkleLib.Git</AssemblyName>
<RootNamespace>Sparkles.Git</RootNamespace>
<AssemblyName>Sparkles.Git</AssemblyName>
<FileAlignment>512</FileAlignment>
<ReleaseVersion>
</ReleaseVersion>
@ -45,15 +45,15 @@
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<ProjectReference Include="..\SparkleLib.csproj">
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
<Name>SparkleLib</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="GitFetcher.cs" />
<Compile Include="GitCommand.cs" />
<Compile Include="GitRepository.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Sparkles.csproj">
<Project>{2C914413-B31C-4362-93C7-1AE34F09112A}</Project>
<Name>Sparkles</Name>
</ProjectReference>
</ItemGroup>
</Project>

View file

@ -0,0 +1,29 @@
// SparkleShare, a collaboration and sharing tool.
// 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 Lesser 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.Reflection;
[assembly:AssemblyTitle ("Sparkles")]
[assembly:AssemblyVersion ("2.0")]
[assembly:AssemblyCopyright ("Copyright (c) 2010 Hylke Bons and others")]
namespace Sparkles {
public partial class InstallationInfo {
public const string Directory = "/app/share/sparkleshare";
}
}

View file

@ -15,16 +15,15 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Reflection;
[assembly:AssemblyTitle ("SparkleLib")]
[assembly:AssemblyTitle ("Sparkles")]
[assembly:AssemblyVersion ("@VERSION@")]
[assembly:AssemblyCopyright ("Copyright (c) 2010 Hylke Bons and others")]
namespace SparkleLib {
namespace Sparkles {
public class Defines {
public const string INSTALL_DIR = "@expanded_datadir@/sparkleshare";
public partial class InstallationInfo {
public const string Directory = "@expanded_datadir@/sparkleshare";
}
}

8
SparkleLib/Backend.cs → Sparkles/InstallationInfo.cs Executable file → Normal file
View file

@ -1,4 +1,4 @@
// SparkleShare, a collaboration and sharing tool.
// SparkleShare, a collaboration and sharing tool.
// Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
@ -19,9 +19,9 @@ using System;
using System.Reflection;
using System.Runtime.InteropServices;
namespace SparkleLib {
public static class Backend {
namespace Sparkles {
public partial class InstallationInfo {
public static string Version {
get {

View file

@ -18,7 +18,7 @@
using System;
using System.Collections.Generic;
namespace SparkleLib {
namespace Sparkles {
public static class ListenerFactory {

View file

@ -18,7 +18,7 @@
using System;
using System.IO;
namespace SparkleLib {
namespace Sparkles {
public static class Logger {
@ -65,21 +65,24 @@ namespace SparkleLib {
{
string home_path = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
if (Backend.Platform == PlatformID.Win32NT)
if (InstallationInfo.Platform == PlatformID.Win32NT)
home_path = Environment.GetFolderPath (Environment.SpecialFolder.UserProfile);
string crash_report_file_path = new string [] { home_path, "SparkleShare", "crash_report.txt" }.Combine ();
string n = Environment.NewLine;
string crash_report = "Oops! SparkleShare has crashed... :(" + n + n +
string crash_report =
"Oops! SparkleShare has crashed... :(" + n +
n +
"If you want to help fix this crash, please report it at " + n +
"https://github.com/hbons/SparkleShare/issues and include the lines below." + n + n +
"Remove any sensitive information like file names, IP addresses, domain names, etc. if needed." + n + n +
"------" + n + n +
"SparkleShare version: " + Backend.Version + n +
"Operating system: " + Backend.Platform + " (" + Environment.OSVersion + ")" + n;
"https://github.com/hbons/SparkleShare/issues and include the lines below." + n +
n +
"Remove any sensitive information like file names, IP addresses, domain names, etc. if needed." + n +
n +
"------" + n +
n;
crash_report += e.GetType () + ": " + e.Message + n + e.StackTrace + n;
crash_report += e.GetType () + ": " + e.Message + n + e.StackTrace + n + n;
if (e.InnerException != null)
crash_report += n + e.InnerException.Message + n + e.InnerException.StackTrace + n;
@ -89,13 +92,10 @@ namespace SparkleLib {
string [] debug_lines = debug_log.Split (Environment.NewLine.ToCharArray ());
int line_count = 50;
if (debug_lines.Length > line_count) {
crash_report += string.Join (Environment.NewLine, debug_lines,
(debug_lines.Length - line_count), line_count) + n;
} else {
if (debug_lines.Length > line_count)
crash_report += string.Join (n, debug_lines, (debug_lines.Length - line_count), line_count) + n;
else
crash_report += debug_log + n;
}
}
File.WriteAllText (crash_report_file_path, crash_report);

View file

@ -1,11 +1,11 @@
ASSEMBLY = SparkleLib
ASSEMBLY = Sparkles
TARGET = library
ASSEMBLY_INFO_SOURCE = Defines.cs
ASSEMBLY_INFO_SOURCE = InstallationInfo.Directory.cs
SOURCES = \
AuthenticationInfo.cs \
Backend.cs \
InstallationInfo.cs \
BaseFetcher.cs \
BaseListener.cs \
BaseRepository.cs \
@ -15,6 +15,7 @@ SOURCES = \
Extensions.cs \
ListenerFactory.cs \
Logger.cs \
Preset.cs \
SSHAuthenticationInfo.cs \
SSHFetcher.cs \
TcpListener.cs \
@ -32,3 +33,4 @@ uninstall-hook:
done;
include $(top_srcdir)/build/build.mk

View file

@ -22,12 +22,12 @@ using IO = System.IO;
namespace SparkleShare {
public class Plugin : XmlDocument {
public class Preset : XmlDocument {
public static string PluginsPath = "";
public static string PresetsPath = "";
public static string LocalPluginsPath = IO.Path.Combine (
Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "sparkleshare", "plugins");
public static string LocalPresetsPath = IO.Path.Combine (
Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "sparkleshare", "presets");
new public string Name { get { return GetValue ("info", "name"); } }
public string Description { get { return GetValue ("info", "description"); } }
@ -42,12 +42,12 @@ namespace SparkleShare {
public string ImagePath {
get {
string image_file_name = GetValue ("info", "icon");
string image_path = IO.Path.Combine (this.plugin_directory, image_file_name);
string image_path = IO.Path.Combine (preset_directory, image_file_name);
if (IO.File.Exists (image_path))
return image_path;
else
return IO.Path.Combine (PluginsPath, image_file_name);
return IO.Path.Combine (PresetsPath, image_file_name);
}
}
@ -62,27 +62,29 @@ namespace SparkleShare {
}
}
private string plugin_directory;
string preset_directory;
public Plugin (string plugin_path)
public Preset (string preset_path)
{
this.plugin_directory = System.IO.Path.GetDirectoryName (plugin_path);
Load (plugin_path);
preset_directory = IO.Path.GetDirectoryName (preset_path);
Load (preset_path);
}
public static Plugin Create (string name, string description, string address_value,
// TODO: Gitlab preset
public static Preset Create (string name, string description, string address_value,
string address_example, string path_value, string path_example)
{
string plugin_path = System.IO.Path.Combine (LocalPluginsPath, name + ".xml");
string preset_path = IO.Path.Combine (LocalPresetsPath, name + ".xml");
if (IO.File.Exists (plugin_path))
if (IO.File.Exists (preset_path))
return null;
string plugin_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
// TODO: Don't write maually
string preset_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<sparkleshare>" +
" <plugin>" +
" <preset>" +
" <info>" +
" <name>" + name + "</name>" +
" <description>" + description + "</description>" +
@ -96,23 +98,23 @@ namespace SparkleShare {
" <value>" + path_value + "</value>" +
" <example>" + path_example + "</example>" +
" </path>" +
" </plugin>" +
" </preset>" +
"</sparkleshare>";
plugin_xml = plugin_xml.Replace ("<value></value>", "<value/>");
plugin_xml = plugin_xml.Replace ("<example></example>", "<example/>");
preset_xml = preset_xml.Replace ("<value></value>", "<value/>");
preset_xml = preset_xml.Replace ("<example></example>", "<example/>");
if (!IO.Directory.Exists (LocalPluginsPath))
IO.Directory.CreateDirectory (LocalPluginsPath);
if (!IO.Directory.Exists (LocalPresetsPath))
IO.Directory.CreateDirectory (LocalPresetsPath);
IO.File.WriteAllText (plugin_path, plugin_xml);
return new Plugin (plugin_path);
IO.File.WriteAllText (preset_path, preset_xml);
return new Preset (preset_path);
}
private string GetValue (string a, string b)
{
XmlNode node = SelectSingleNode ("/sparkleshare/plugin/" + a + "/" + b + "/text()");
XmlNode node = SelectSingleNode ("/sparkleshare/preset/" + a + "/" + b + "/text()");
if (node != null && !string.IsNullOrEmpty (node.Value))
return node.Value;
@ -120,4 +122,4 @@ namespace SparkleShare {
return null;
}
}
}
}

View file

@ -20,7 +20,7 @@ using System.Net;
using IO = System.IO;
namespace SparkleLib {
namespace Sparkles {
public class SSHAuthenticationInfo : AuthenticationInfo {

View file

@ -20,7 +20,7 @@ using System.Diagnostics;
using System.IO;
using System.Security.Cryptography;
namespace SparkleLib {
namespace Sparkles {
public abstract class SSHFetcher : BaseFetcher {

View file

@ -7,8 +7,8 @@
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2C914413-B31C-4362-93C7-1AE34F09112A}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>SparkleLib</RootNamespace>
<AssemblyName>SparkleLib</AssemblyName>
<RootNamespace>Sparkles</RootNamespace>
<AssemblyName>Sparkles</AssemblyName>
<ReleaseVersion>
</ReleaseVersion>
</PropertyGroup>
@ -32,11 +32,10 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Backend.cs" />
<Compile Include="Configuration.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="Logger.cs" />
<Compile Include="Defines.cs" />
<Compile Include="InstallationInfo.Directory.cs" />
<Compile Include="Command.cs" />
<Compile Include="SSHFetcher.cs">
<Link>Fetcher\SSHFetcher.cs</Link>
@ -71,6 +70,8 @@
<Compile Include="Watcher.cs">
<Link>Repository\Watcher.cs</Link>
</Compile>
<Compile Include="InstallationInfo.cs" />
<Compile Include="Preset.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Fetcher\" />

View file

@ -20,7 +20,7 @@ using System.Net.Sockets;
using System.Text;
using System.Threading;
namespace SparkleLib {
namespace Sparkles {
public class TcpListener : BaseListener {
@ -82,7 +82,7 @@ namespace SparkleLib {
if (this.socket != null)
this.socket.Close ();
OnDisconnected (SparkleLib.DisconnectReason.TimeOut, e.Message);
OnDisconnected (Sparkles.DisconnectReason.TimeOut, e.Message);
return;
}

View file

@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace SparkleLib {
namespace Sparkles {
public class User {

2
SparkleLib/Watcher.cs → Sparkles/Watcher.cs Executable file → Normal file
View file

@ -17,7 +17,7 @@
using System.IO;
namespace SparkleLib {
namespace Sparkles {
public class Watcher : FileSystemWatcher {

View file

@ -4,3 +4,4 @@ EXTRA_DIST = \
icon-theme-installer
MAINTAINERCLEANFILES = Makefile.in

View file

@ -11,15 +11,14 @@ LINK_MONO_POSIX = -r:Mono.Posix
LINK_GLIB = $(GLIBSHARP_LIBS)
LINK_GTK = $(GTKSHARP_LIBS)
LINK_GNOME = $(GNOME_SHARP_LIBS)
LINK_WEBKIT = $(WEBKITGTK_SHARP_LIBS)
LINK_APP_INDICATOR = $(APP_INDICATOR_LIBS)
REF_SPARKLELIB = $(LINK_SYSTEM) $(LINK_MONO_POSIX)
LINK_SPARKLELIB = -r:$(DIR_BIN)/SparkleLib.dll
LINK_SPARKLELIB_DEPS = $(REF_SPARKLELIB) $(LINK_SPARKLELIB)
REF_SPARKLES = $(LINK_SYSTEM) $(LINK_MONO_POSIX)
LINK_SPARKLES = -r:$(DIR_BIN)/Sparkles.dll
LINK_SPARKLES_DEPS = $(REF_SPARKLES) $(LINK_SPARKLES)
REF_SPARKLESHARE = $(LINK_GTK) $(LINK_SPARKLELIB_DEPS) $(LINK_APP_INDICATOR) $(LINK_WEBKIT)
REF_SPARKLESHARE = $(LINK_GTK) $(LINK_SPARKLES_DEPS) $(LINK_APP_INDICATOR) $(LINK_WEBKIT)
# Cute hack to replace a space with something
colon:= :

View file

@ -1,3 +1,2 @@
include $(top_srcdir)/build/build.environment.mk
include $(top_srcdir)/build/build.rules.mk

View file

@ -75,4 +75,3 @@ EXTRA_DIST = $(SOURCES_BUILD) $(RESOURCES_EXPANDED)
CLEANFILES = $(OUTPUT_FILES) $(ASSEMBLY_FILE).config
DISTCLEANFILES = *.pidb
MAINTAINERCLEANFILES = Makefile.in

View file

@ -4,13 +4,13 @@ if [ "$1" = "" ]; then
echo "No version number specified. Usage: ./bump-version.sh VERSION_NUMBER"
else
sed -i.bak "s/ Version='[^']*'/ Version='$1'/" ../SparkleShare/Windows/SparkleShare.wxs
sed -i.bak "s/assembly:AssemblyVersion *(\"[^\"]*\")/assembly:AssemblyVersion (\"$1\")/" ../SparkleLib/Defines.cs
sed -i.bak "s/assembly:AssemblyVersion *(\"[^\"]*\")/assembly:AssemblyVersion (\"$1\")/" ../Sparkles/InstallationInfo.Directory.cs
sed -i.bak "s/m4_define(.sparkleshare_version[^)]*)/m4_define([sparkleshare_version], [$1])/" ../configure.ac
cat ../SparkleShare/Mac/Info.plist | eval "sed -e '/<key>CFBundleShortVersionString<\/key>/{N;s#<string>.*<\/string>#<string>$1<\/string>#;}'" > ../SparkleShare/Mac/Info.plist.tmp
cat ../SparkleShare/Mac/Info.plist.tmp | eval "sed -e '/<key>CFBundleVersion<\/key>/{N;s#<string>.*<\/string>#<string>$1<\/string>#;}'" > ../SparkleShare/Mac/Info.plist
rm ../SparkleShare/Mac/Info.plist.tmp
rm ../SparkleShare/Windows/SparkleShare.wxs.bak
rm ../SparkleLib/Defines.cs.bak
rm ../Sparkles/InstallationInfo.Directory.cs.bak
rm ../configure.ac.bak
fi

View file

@ -109,12 +109,12 @@ build/Makefile
build/m4/Makefile
build/m4/shave/shave
build/m4/shave/shave-libtool
SparkleLib/Defines.cs
SparkleLib/Makefile
SparkleLib/Git/Makefile
Sparkles/InstallationInfo.Directory.cs
Sparkles/Makefile
Sparkles/Git/Makefile
SparkleShare/Common/Makefile
SparkleShare/Common/HTML/Makefile
SparkleShare/Common/Plugins/Makefile
SparkleShare/Common/Presets/Makefile
SparkleShare/Common/Pixmaps/Makefile
SparkleShare/Linux/Makefile
SparkleShare/Linux/Pixmaps/Makefile