mac controller: fix coding style and whitespace
This commit is contained in:
parent
de5f86b3a4
commit
dfa4ab4675
|
@ -15,13 +15,14 @@
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
using MonoMac.Foundation;
|
using MonoMac.Foundation;
|
||||||
using MonoMac.AppKit;
|
using MonoMac.AppKit;
|
||||||
using MonoMac.ObjCRuntime;
|
using MonoMac.ObjCRuntime;
|
||||||
using SparkleLib;
|
using SparkleLib;
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace SparkleShare {
|
namespace SparkleShare {
|
||||||
|
|
||||||
|
@ -29,19 +30,13 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public override void EnableSystemAutostart ()
|
public override void EnableSystemAutostart ()
|
||||||
{
|
{
|
||||||
|
|
||||||
// N/A
|
// N/A
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Installs a launcher so the user can launch SparkleShare
|
|
||||||
// from the Internet category if needed
|
|
||||||
public override void InstallLauncher ()
|
public override void InstallLauncher ()
|
||||||
{
|
{
|
||||||
|
|
||||||
// N/A
|
// N/A
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,102 +44,74 @@ namespace SparkleShare {
|
||||||
// list of bookmarked places
|
// list of bookmarked places
|
||||||
public override void AddToBookmarks ()
|
public override void AddToBookmarks ()
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Creates the SparkleShare folder in the user's home folder
|
// Creates the SparkleShare folder in the user's home folder
|
||||||
public override bool CreateSparkleShareFolder ()
|
public override bool CreateSparkleShareFolder ()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!Directory.Exists (SparklePaths.SparklePath)) {
|
if (!Directory.Exists (SparklePaths.SparklePath)) {
|
||||||
|
|
||||||
Directory.CreateDirectory (SparklePaths.SparklePath);
|
Directory.CreateDirectory (SparklePaths.SparklePath);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Opens the SparkleShare folder or an (optional) subfolder
|
// Opens the SparkleShare folder or an (optional) subfolder
|
||||||
public override void OpenSparkleShareFolder (string subfolder)
|
public override void OpenSparkleShareFolder (string subfolder)
|
||||||
{
|
{
|
||||||
|
|
||||||
string folder = Path.Combine (SparklePaths.SparklePath, subfolder);
|
string folder = Path.Combine (SparklePaths.SparklePath, subfolder);
|
||||||
folder.Replace (" ", "\\ "); // Escape space-characters
|
folder.Replace (" ", "\\ "); // Escape space-characters
|
||||||
|
|
||||||
NSWorkspace.SharedWorkspace.OpenFile (folder);
|
NSWorkspace.SharedWorkspace.OpenFile (folder);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override string EventLogHTML
|
public override string EventLogHTML
|
||||||
{
|
{
|
||||||
|
|
||||||
get {
|
get {
|
||||||
|
|
||||||
string resource_path = NSBundle.MainBundle.ResourcePath;
|
string resource_path = NSBundle.MainBundle.ResourcePath;
|
||||||
|
string html_path = Path.Combine (resource_path, "HTML", "event-log.html");
|
||||||
string html_path = Path.Combine (resource_path, "HTML", "event-log.html");
|
|
||||||
|
|
||||||
StreamReader reader = new StreamReader (html_path);
|
StreamReader reader = new StreamReader (html_path);
|
||||||
string html = reader.ReadToEnd ();
|
string html = reader.ReadToEnd ();
|
||||||
reader.Close ();
|
reader.Close ();
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override string DayEntryHTML
|
public override string DayEntryHTML
|
||||||
{
|
{
|
||||||
|
|
||||||
get {
|
get {
|
||||||
|
|
||||||
string resource_path = NSBundle.MainBundle.ResourcePath;
|
string resource_path = NSBundle.MainBundle.ResourcePath;
|
||||||
|
string html_path = Path.Combine (resource_path, "HTML", "day-entry.html");
|
||||||
string html_path = Path.Combine (resource_path, "HTML", "day-entry.html");
|
|
||||||
|
|
||||||
StreamReader reader = new StreamReader (html_path);
|
StreamReader reader = new StreamReader (html_path);
|
||||||
string html = reader.ReadToEnd ();
|
string html = reader.ReadToEnd ();
|
||||||
reader.Close ();
|
reader.Close ();
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override string EventEntryHTML
|
public override string EventEntryHTML
|
||||||
{
|
{
|
||||||
|
|
||||||
get {
|
get {
|
||||||
|
|
||||||
string resource_path = NSBundle.MainBundle.ResourcePath;
|
string resource_path = NSBundle.MainBundle.ResourcePath;
|
||||||
|
string html_path = Path.Combine (resource_path, "HTML", "event-entry.html");
|
||||||
string html_path = Path.Combine (resource_path, "HTML", "event-entry.html");
|
|
||||||
|
|
||||||
StreamReader reader = new StreamReader (html_path);
|
StreamReader reader = new StreamReader (html_path);
|
||||||
string html = reader.ReadToEnd ();
|
string html = reader.ReadToEnd ();
|
||||||
reader.Close ();
|
reader.Close ();
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue