fix coding style
This commit is contained in:
parent
90eda6daf6
commit
db0436018b
|
@ -123,7 +123,7 @@ namespace SparkleShare {
|
||||||
new SparkleBubble (_("Syncing folder ‘") + RepoName + "’",
|
new SparkleBubble (_("Syncing folder ‘") + RepoName + "’",
|
||||||
_("SparkleShare will notify you when this is done."));
|
_("SparkleShare will notify you when this is done."));
|
||||||
|
|
||||||
Process Process = new Process();
|
Process Process = new Process ();
|
||||||
Process.EnableRaisingEvents = true;
|
Process.EnableRaisingEvents = true;
|
||||||
Process.StartInfo.RedirectStandardOutput = true;
|
Process.StartInfo.RedirectStandardOutput = true;
|
||||||
Process.StartInfo.UseShellExecute = false;
|
Process.StartInfo.UseShellExecute = false;
|
||||||
|
@ -152,7 +152,7 @@ namespace SparkleShare {
|
||||||
Process.StartInfo.Arguments =
|
Process.StartInfo.Arguments =
|
||||||
SparkleHelpers.CombineMore
|
SparkleHelpers.CombineMore
|
||||||
(SparklePaths.SparklePath, RepoName);
|
(SparklePaths.SparklePath, RepoName);
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ namespace SparkleShare {
|
||||||
Process.StartInfo.Arguments =
|
Process.StartInfo.Arguments =
|
||||||
SparkleHelpers.CombineMore (
|
SparkleHelpers.CombineMore (
|
||||||
SparklePaths.SparklePath, RepoName);
|
SparklePaths.SparklePath, RepoName);
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace SparkleShare {
|
||||||
MD5 md5 = new MD5CryptoServiceProvider ();
|
MD5 md5 = new MD5CryptoServiceProvider ();
|
||||||
Byte[] Bytes = ASCIIEncoding.Default.GetBytes (s);
|
Byte[] Bytes = ASCIIEncoding.Default.GetBytes (s);
|
||||||
Byte[] EncodedBytes = md5.ComputeHash (Bytes);
|
Byte[] EncodedBytes = md5.ComputeHash (Bytes);
|
||||||
return BitConverter.ToString(EncodedBytes).ToLower ().Replace ("-", "");
|
return BitConverter.ToString (EncodedBytes).ToLower ().Replace ("-", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Makes it possible to combine more than
|
// Makes it possible to combine more than
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace SparkleShare {
|
||||||
public static string SparkleTmpPath = "/tmp/sparkleshare";
|
public static string SparkleTmpPath = "/tmp/sparkleshare";
|
||||||
|
|
||||||
public static string HomePath =
|
public static string HomePath =
|
||||||
Environment.GetEnvironmentVariable("HOME");
|
Environment.GetEnvironmentVariable ("HOME");
|
||||||
|
|
||||||
public static string SparklePath = Path.Combine (HomePath ,"SparkleShare");
|
public static string SparklePath = Path.Combine (HomePath ,"SparkleShare");
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public SparkleRepo (string RepoPath) {
|
public SparkleRepo (string RepoPath) {
|
||||||
|
|
||||||
Process = new Process();
|
Process = new Process ();
|
||||||
Process.EnableRaisingEvents = false;
|
Process.EnableRaisingEvents = false;
|
||||||
Process.StartInfo.RedirectStandardOutput = true;
|
Process.StartInfo.RedirectStandardOutput = true;
|
||||||
Process.StartInfo.UseShellExecute = false;
|
Process.StartInfo.UseShellExecute = false;
|
||||||
|
@ -56,20 +56,20 @@ namespace SparkleShare {
|
||||||
UserName = "Anonymous";
|
UserName = "Anonymous";
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "config --get user.name";
|
Process.StartInfo.Arguments = "config --get user.name";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
UserName = Process.StandardOutput.ReadToEnd ().Trim ();
|
UserName = Process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
|
|
||||||
// Get user.email, example: "user@github.com"
|
// Get user.email, example: "user@github.com"
|
||||||
UserEmail = "not.set@git-scm.com";
|
UserEmail = "not.set@git-scm.com";
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "config --get user.email";
|
Process.StartInfo.Arguments = "config --get user.email";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
UserEmail = Process.StandardOutput.ReadToEnd ().Trim ();
|
UserEmail = Process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
|
|
||||||
// Get remote.origin.url, example: "ssh://git@github.com/user/repo"
|
// Get remote.origin.url, example: "ssh://git@github.com/user/repo"
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "config --get remote.origin.url";
|
Process.StartInfo.Arguments = "config --get remote.origin.url";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
RemoteOriginUrl = Process.StandardOutput.ReadToEnd ().Trim ();
|
RemoteOriginUrl = Process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
|
|
||||||
// Get the repository name, example: "Project"
|
// Get the repository name, example: "Project"
|
||||||
|
@ -86,7 +86,7 @@ namespace SparkleShare {
|
||||||
// Get hash of the current commit
|
// Get hash of the current commit
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "rev-list --max-count=1 HEAD";
|
Process.StartInfo.Arguments = "rev-list --max-count=1 HEAD";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
CurrentHash = Process.StandardOutput.ReadToEnd ().Trim ();
|
CurrentHash = Process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
|
|
||||||
// Watch the repository's folder
|
// Watch the repository's folder
|
||||||
|
@ -94,9 +94,9 @@ namespace SparkleShare {
|
||||||
Watcher.IncludeSubdirectories = true;
|
Watcher.IncludeSubdirectories = true;
|
||||||
Watcher.EnableRaisingEvents = true;
|
Watcher.EnableRaisingEvents = true;
|
||||||
Watcher.Filter = "*";
|
Watcher.Filter = "*";
|
||||||
Watcher.Changed += new FileSystemEventHandler(OnFileActivity);
|
Watcher.Changed += new FileSystemEventHandler (OnFileActivity);
|
||||||
Watcher.Created += new FileSystemEventHandler(OnFileActivity);
|
Watcher.Created += new FileSystemEventHandler (OnFileActivity);
|
||||||
Watcher.Deleted += new FileSystemEventHandler(OnFileActivity);
|
Watcher.Deleted += new FileSystemEventHandler (OnFileActivity);
|
||||||
|
|
||||||
// Fetch remote changes every 20 seconds
|
// Fetch remote changes every 20 seconds
|
||||||
FetchTimer = new Timer ();
|
FetchTimer = new Timer ();
|
||||||
|
@ -105,7 +105,7 @@ namespace SparkleShare {
|
||||||
Fetch ();
|
Fetch ();
|
||||||
};
|
};
|
||||||
|
|
||||||
FetchTimer.Start();
|
FetchTimer.Start ();
|
||||||
BufferTimer = new Timer ();
|
BufferTimer = new Timer ();
|
||||||
|
|
||||||
BufferTimer.Elapsed += delegate (object o, ElapsedEventArgs args) {
|
BufferTimer.Elapsed += delegate (object o, ElapsedEventArgs args) {
|
||||||
|
@ -132,7 +132,7 @@ namespace SparkleShare {
|
||||||
public void OnFileActivity (object o, FileSystemEventArgs args) {
|
public void OnFileActivity (object o, FileSystemEventArgs args) {
|
||||||
WatcherChangeTypes wct = args.ChangeType;
|
WatcherChangeTypes wct = args.ChangeType;
|
||||||
if (!ShouldIgnore (args.Name)) {
|
if (!ShouldIgnore (args.Name)) {
|
||||||
Console.WriteLine ("[Event][" + Name + "] " + wct.ToString() +
|
Console.WriteLine ("[Event][" + Name + "] " + wct.ToString () +
|
||||||
" '" + args.Name + "'");
|
" '" + args.Name + "'");
|
||||||
StartBufferTimer ();
|
StartBufferTimer ();
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ namespace SparkleShare {
|
||||||
Console.WriteLine ("[Buffer][" + Name + "] " +
|
Console.WriteLine ("[Buffer][" + Name + "] " +
|
||||||
"Waiting for more changes...");
|
"Waiting for more changes...");
|
||||||
|
|
||||||
BufferTimer.Start();
|
BufferTimer.Start ();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
FetchTimer.Start ();
|
FetchTimer.Start ();
|
||||||
|
|
||||||
BufferTimer.Start();
|
BufferTimer.Start ();
|
||||||
Console.WriteLine ("[Buffer][" + Name + "] " +
|
Console.WriteLine ("[Buffer][" + Name + "] " +
|
||||||
"Waiting for more changes...");
|
"Waiting for more changes...");
|
||||||
}
|
}
|
||||||
|
@ -176,13 +176,13 @@ namespace SparkleShare {
|
||||||
// Clones a remote repo
|
// Clones a remote repo
|
||||||
public void Clone () {
|
public void Clone () {
|
||||||
Process.StartInfo.Arguments = "clone " + RemoteOriginUrl;
|
Process.StartInfo.Arguments = "clone " + RemoteOriginUrl;
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
|
|
||||||
// Add a gitignore file
|
// Add a gitignore file
|
||||||
TextWriter Writer = new StreamWriter(LocalPath + ".gitignore");
|
TextWriter Writer = new StreamWriter (LocalPath + ".gitignore");
|
||||||
Writer.WriteLine("*~"); // Ignore gedit swap files
|
Writer.WriteLine ("*~"); // Ignore gedit swap files
|
||||||
Writer.WriteLine(".*.sw?"); // Ignore vi swap files
|
Writer.WriteLine (".*.sw?"); // Ignore vi swap files
|
||||||
Writer.Close();
|
Writer.Close ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stages the made changes
|
// Stages the made changes
|
||||||
|
@ -190,7 +190,7 @@ namespace SparkleShare {
|
||||||
BufferTimer.Stop ();
|
BufferTimer.Stop ();
|
||||||
Console.WriteLine ("[Git][" + Name + "] Staging changes...");
|
Console.WriteLine ("[Git][" + Name + "] Staging changes...");
|
||||||
Process.StartInfo.Arguments = "add --all";
|
Process.StartInfo.Arguments = "add --all";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
Console.WriteLine ("[Git][" + Name + "] Changes staged.");
|
Console.WriteLine ("[Git][" + Name + "] Changes staged.");
|
||||||
// SparkleUI.NotificationIcon.SetSyncingState ();
|
// SparkleUI.NotificationIcon.SetSyncingState ();
|
||||||
|
@ -202,7 +202,7 @@ namespace SparkleShare {
|
||||||
Console.WriteLine ("[Commit][" + Name + "] " + Message);
|
Console.WriteLine ("[Commit][" + Name + "] " + Message);
|
||||||
Console.WriteLine ("[Git][" + Name + "] Commiting changes...");
|
Console.WriteLine ("[Git][" + Name + "] Commiting changes...");
|
||||||
Process.StartInfo.Arguments = "commit -m \"" + Message + "\"";
|
Process.StartInfo.Arguments = "commit -m \"" + Message + "\"";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
Console.WriteLine ("[Git][" + Name + "] Changes commited.");
|
Console.WriteLine ("[Git][" + Name + "] Changes commited.");
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ namespace SparkleShare {
|
||||||
// SparkleUI.NotificationIcon.SetSyncingState ();
|
// SparkleUI.NotificationIcon.SetSyncingState ();
|
||||||
Console.WriteLine ("[Git][" + Name + "] Fetching changes... ");
|
Console.WriteLine ("[Git][" + Name + "] Fetching changes... ");
|
||||||
Process.StartInfo.Arguments = "fetch -v";
|
Process.StartInfo.Arguments = "fetch -v";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
string Output = Process.StandardOutput.ReadToEnd ().Trim (); // TODO: This doesn't work :(
|
string Output = Process.StandardOutput.ReadToEnd ().Trim (); // TODO: This doesn't work :(
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
Console.WriteLine ("[Git][" + Name + "] Changes fetched.");
|
Console.WriteLine ("[Git][" + Name + "] Changes fetched.");
|
||||||
|
@ -231,7 +231,7 @@ namespace SparkleShare {
|
||||||
Console.WriteLine ("[Git][" + Name + "] Rebasing fetched changes... ");
|
Console.WriteLine ("[Git][" + Name + "] Rebasing fetched changes... ");
|
||||||
Process.StartInfo.Arguments = "rebase origin";
|
Process.StartInfo.Arguments = "rebase origin";
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
Console.WriteLine ("[Git][" + Name + "] Changes rebased.");
|
Console.WriteLine ("[Git][" + Name + "] Changes rebased.");
|
||||||
string Output = Process.StandardOutput.ReadToEnd ().Trim ();
|
string Output = Process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
Process.StartInfo.Arguments = "status";
|
Process.StartInfo.Arguments = "status";
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
Output = Process.StandardOutput.ReadToEnd ().Trim ();
|
Output = Process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
|
|
||||||
foreach (string Line in Regex.Split (Output, "\n")) {
|
foreach (string Line in Regex.Split (Output, "\n")) {
|
||||||
|
@ -257,11 +257,11 @@ namespace SparkleShare {
|
||||||
Process.StartInfo.Arguments
|
Process.StartInfo.Arguments
|
||||||
= "checkout --ours " + ProblemFileName;
|
= "checkout --ours " + ProblemFileName;
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
|
|
||||||
DateTime DateTime = new DateTime ();
|
DateTime DateTime = new DateTime ();
|
||||||
string TimeStamp =
|
string TimeStamp =
|
||||||
String.Format("{0:H:mm, d MMM yyyy}", DateTime);
|
String.Format ("{0:H:mm, d MMM yyyy}", DateTime);
|
||||||
|
|
||||||
File.Move (ProblemFileName,
|
File.Move (ProblemFileName,
|
||||||
ProblemFileName + " (" + UserName + " - " +
|
ProblemFileName + " (" + UserName + " - " +
|
||||||
|
@ -270,7 +270,7 @@ namespace SparkleShare {
|
||||||
Process.StartInfo.Arguments
|
Process.StartInfo.Arguments
|
||||||
= "checkout --theirs " + ProblemFileName;
|
= "checkout --theirs " + ProblemFileName;
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
|
|
||||||
ShowEventBubble ("A mid-air collision happened!\n" +
|
ShowEventBubble ("A mid-air collision happened!\n" +
|
||||||
"SparkleShare made a copy of your file.",
|
"SparkleShare made a copy of your file.",
|
||||||
|
@ -285,7 +285,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
Process.StartInfo.Arguments = "rebase --continue";
|
Process.StartInfo.Arguments = "rebase --continue";
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
Console.WriteLine ("[Git][" + Name + "] Conflict resolved.");
|
Console.WriteLine ("[Git][" + Name + "] Conflict resolved.");
|
||||||
|
|
||||||
Push ();
|
Push ();
|
||||||
|
@ -295,19 +295,19 @@ namespace SparkleShare {
|
||||||
|
|
||||||
// Get the last committer e-mail
|
// Get the last committer e-mail
|
||||||
Process.StartInfo.Arguments = "log --format=\"%ae\" -1";
|
Process.StartInfo.Arguments = "log --format=\"%ae\" -1";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
string LastCommitEmail =
|
string LastCommitEmail =
|
||||||
Process.StandardOutput.ReadToEnd ().Trim ();
|
Process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
|
|
||||||
// Get the last commit message
|
// Get the last commit message
|
||||||
Process.StartInfo.Arguments = "log --format=\"%s\" -1";
|
Process.StartInfo.Arguments = "log --format=\"%s\" -1";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
string LastCommitMessage =
|
string LastCommitMessage =
|
||||||
Process.StandardOutput.ReadToEnd ().Trim ();
|
Process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
|
|
||||||
// Get the last commiter
|
// Get the last commiter
|
||||||
Process.StartInfo.Arguments = "log --format=\"%an\" -1";
|
Process.StartInfo.Arguments = "log --format=\"%an\" -1";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
string LastCommitUserName =
|
string LastCommitUserName =
|
||||||
Process.StandardOutput.ReadToEnd ().Trim ();
|
Process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ namespace SparkleShare {
|
||||||
public void Push () {
|
public void Push () {
|
||||||
Console.WriteLine ("[Git][" + Name + "] Pushing changes...");
|
Console.WriteLine ("[Git][" + Name + "] Pushing changes...");
|
||||||
Process.StartInfo.Arguments = "push";
|
Process.StartInfo.Arguments = "push";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
Console.WriteLine ("[Git][" + Name + "] Changes pushed.");
|
Console.WriteLine ("[Git][" + Name + "] Changes pushed.");
|
||||||
// SparkleUI.NotificationIcon.SetIdleState ();
|
// SparkleUI.NotificationIcon.SetIdleState ();
|
||||||
|
@ -366,7 +366,7 @@ namespace SparkleShare {
|
||||||
int FilesDeleted = 0;
|
int FilesDeleted = 0;
|
||||||
|
|
||||||
Process.StartInfo.Arguments = "status";
|
Process.StartInfo.Arguments = "status";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
string Output = Process.StandardOutput.ReadToEnd ();
|
string Output = Process.StandardOutput.ReadToEnd ();
|
||||||
|
|
||||||
foreach (string Line in Regex.Split (Output, "\n")) {
|
foreach (string Line in Regex.Split (Output, "\n")) {
|
||||||
|
@ -465,7 +465,7 @@ namespace SparkleShare {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Process.StartInfo.Arguments = LocalPath;
|
Process.StartInfo.Arguments = LocalPath;
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
|
@ -38,13 +38,13 @@ namespace SparkleShare {
|
||||||
Catalog.Init ("i18n", "locale");
|
Catalog.Init ("i18n", "locale");
|
||||||
|
|
||||||
// Check if git is installed
|
// Check if git is installed
|
||||||
Process Process = new Process();
|
Process Process = new Process ();
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.RedirectStandardOutput = true;
|
Process.StartInfo.RedirectStandardOutput = true;
|
||||||
Process.StartInfo.UseShellExecute = false;
|
Process.StartInfo.UseShellExecute = false;
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
|
|
||||||
if (Process.StandardOutput.ReadToEnd().IndexOf ("version") == -1) {
|
if (Process.StandardOutput.ReadToEnd ().IndexOf ("version") == -1) {
|
||||||
Console.WriteLine (_("Git wasn't found."));
|
Console.WriteLine (_("Git wasn't found."));
|
||||||
Console.WriteLine (_("You can get Git from http://git-scm.com/."));
|
Console.WriteLine (_("You can get Git from http://git-scm.com/."));
|
||||||
Environment.Exit (0);
|
Environment.Exit (0);
|
||||||
|
@ -52,8 +52,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
// Don't allow running as root
|
// Don't allow running as root
|
||||||
Process.StartInfo.FileName = "whoami";
|
Process.StartInfo.FileName = "whoami";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
if (Process.StandardOutput.ReadToEnd().Trim ().Equals ("root")) {
|
if (Process.StandardOutput.ReadToEnd ().Trim ().Equals ("root")) {
|
||||||
Console.WriteLine (_("Sorry, you can't run SparkleShare with these permissions."));
|
Console.WriteLine (_("Sorry, you can't run SparkleShare with these permissions."));
|
||||||
Console.WriteLine (_("Things will go utterly wrong."));
|
Console.WriteLine (_("Things will go utterly wrong."));
|
||||||
Environment.Exit (0);
|
Environment.Exit (0);
|
||||||
|
|
|
@ -46,14 +46,14 @@ namespace SparkleShare {
|
||||||
|
|
||||||
Activate += delegate {
|
Activate += delegate {
|
||||||
|
|
||||||
Menu Menu = new Menu();
|
Menu Menu = new Menu ();
|
||||||
|
|
||||||
MenuItem StatusItem = new MenuItem (_("Everything is up to date"));
|
MenuItem StatusItem = new MenuItem (_("Everything is up to date"));
|
||||||
StatusItem.Sensitive = false;
|
StatusItem.Sensitive = false;
|
||||||
Menu.Add (StatusItem);
|
Menu.Add (StatusItem);
|
||||||
Menu.Add (new SeparatorMenuItem ());
|
Menu.Add (new SeparatorMenuItem ());
|
||||||
|
|
||||||
Action FolderAction = new Action("", "SparkleShare Folder");
|
Action FolderAction = new Action ("", "SparkleShare Folder");
|
||||||
FolderAction.IconName = "folder-sparkleshare";
|
FolderAction.IconName = "folder-sparkleshare";
|
||||||
FolderAction.IsImportant = true;
|
FolderAction.IsImportant = true;
|
||||||
FolderAction.Activated += delegate {
|
FolderAction.Activated += delegate {
|
||||||
|
@ -67,7 +67,7 @@ namespace SparkleShare {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Process.StartInfo.Arguments = SparklePaths.SparklePath;
|
Process.StartInfo.Arguments = SparklePaths.SparklePath;
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
};
|
};
|
||||||
Menu.Add (FolderAction.CreateMenuItem ());
|
Menu.Add (FolderAction.CreateMenuItem ());
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (SparkleRepo SparkleRepo in SparkleShare.Repositories) {
|
foreach (SparkleRepo SparkleRepo in SparkleShare.Repositories) {
|
||||||
FolderItems [i] = new Action("", SparkleRepo.Name);
|
FolderItems [i] = new Action ("", SparkleRepo.Name);
|
||||||
FolderItems [i].IconName = "folder";
|
FolderItems [i].IconName = "folder";
|
||||||
FolderItems [i].IsImportant = true;
|
FolderItems [i].IsImportant = true;
|
||||||
FolderItems [i].Activated += CreateWindowDelegate (SparkleRepo);
|
FolderItems [i].Activated += CreateWindowDelegate (SparkleRepo);
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public SparkleUI (bool HideUI) {
|
public SparkleUI (bool HideUI) {
|
||||||
|
|
||||||
Process Process = new Process();
|
Process Process = new Process ();
|
||||||
Process.EnableRaisingEvents = false;
|
Process.EnableRaisingEvents = false;
|
||||||
Process.StartInfo.RedirectStandardOutput = true;
|
Process.StartInfo.RedirectStandardOutput = true;
|
||||||
Process.StartInfo.UseShellExecute = false;
|
Process.StartInfo.UseShellExecute = false;
|
||||||
|
@ -53,7 +53,7 @@ namespace SparkleShare {
|
||||||
"folder-sparkleshare.png";
|
"folder-sparkleshare.png";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
|
|
||||||
// Add the SparkleShare folder to the bookmarks
|
// Add the SparkleShare folder to the bookmarks
|
||||||
switch (SparklePlatform.Name) {
|
switch (SparklePlatform.Name) {
|
||||||
|
@ -64,7 +64,7 @@ namespace SparkleShare {
|
||||||
if (File.Exists (BookmarksFileName)) {
|
if (File.Exists (BookmarksFileName)) {
|
||||||
TextWriter TextWriter = File.AppendText (BookmarksFileName);
|
TextWriter TextWriter = File.AppendText (BookmarksFileName);
|
||||||
TextWriter.WriteLine ("file://" + SparklePath + " SparkleShare");
|
TextWriter.WriteLine ("file://" + SparklePath + " SparkleShare");
|
||||||
TextWriter.Close();
|
TextWriter.Close ();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -100,7 +100,7 @@ namespace SparkleShare {
|
||||||
"[synced]";
|
"[synced]";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ namespace SparkleShare {
|
||||||
SparkleDialog.ShowAll ();
|
SparkleDialog.ShowAll ();
|
||||||
/* Process.StartInfo.FileName = "xdg-open";
|
/* Process.StartInfo.FileName = "xdg-open";
|
||||||
Process.StartInfo.Arguments = SparklePaths.SparklePath;
|
Process.StartInfo.Arguments = SparklePaths.SparklePath;
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
*/
|
*/
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ namespace SparkleShare {
|
||||||
Watcher.EnableRaisingEvents = true;
|
Watcher.EnableRaisingEvents = true;
|
||||||
Watcher.Created += delegate (object o, FileSystemEventArgs args) {
|
Watcher.Created += delegate (object o, FileSystemEventArgs args) {
|
||||||
WatcherChangeTypes wct = args.ChangeType;
|
WatcherChangeTypes wct = args.ChangeType;
|
||||||
Console.WriteLine ("[Event][SparkleShare] " + wct.ToString() +
|
Console.WriteLine ("[Event][SparkleShare] " + wct.ToString () +
|
||||||
" '" + args.Name + "'");
|
" '" + args.Name + "'");
|
||||||
SparkleDialog SparkleDialog = new SparkleDialog ();
|
SparkleDialog SparkleDialog = new SparkleDialog ();
|
||||||
SparkleDialog.ShowAll ();
|
SparkleDialog.ShowAll ();
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace SparkleShare {
|
||||||
typeof (string),
|
typeof (string),
|
||||||
typeof (string));
|
typeof (string));
|
||||||
|
|
||||||
Process Process = new Process();
|
Process Process = new Process ();
|
||||||
Process.EnableRaisingEvents = false;
|
Process.EnableRaisingEvents = false;
|
||||||
Process.StartInfo.RedirectStandardOutput = true;
|
Process.StartInfo.RedirectStandardOutput = true;
|
||||||
Process.StartInfo.UseShellExecute = false;
|
Process.StartInfo.UseShellExecute = false;
|
||||||
|
@ -112,9 +112,9 @@ namespace SparkleShare {
|
||||||
// We're using the snowman here to separate messages :)
|
// We're using the snowman here to separate messages :)
|
||||||
Process.StartInfo.Arguments =
|
Process.StartInfo.Arguments =
|
||||||
"log --format=\"%at☃%s☃%an☃%cr☃%ae\" -25";
|
"log --format=\"%at☃%s☃%an☃%cr☃%ae\" -25";
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
|
|
||||||
Output += "\n" + Process.StandardOutput.ReadToEnd().Trim ();
|
Output += "\n" + Process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
|
|
||||||
Output = Output.TrimStart ("\n".ToCharArray ());
|
Output = Output.TrimStart ("\n".ToCharArray ());
|
||||||
string [] Lines = Regex.Split (Output, "\n");
|
string [] Lines = Regex.Split (Output, "\n");
|
||||||
|
@ -189,7 +189,7 @@ namespace SparkleShare {
|
||||||
Columns [2].Expand = true;
|
Columns [2].Expand = true;
|
||||||
Columns [1].MinWidth = 350;
|
Columns [1].MinWidth = 350;
|
||||||
|
|
||||||
LogView.CursorChanged += delegate(object o, EventArgs args) {
|
LogView.CursorChanged += delegate (object o, EventArgs args) {
|
||||||
TreeModel Model;
|
TreeModel Model;
|
||||||
if (LogView.Selection.GetSelected (out Model, out Iter)) {
|
if (LogView.Selection.GetSelected (out Model, out Iter)) {
|
||||||
SelectedEmail = (string) Model.GetValue (Iter, 4);
|
SelectedEmail = (string) Model.GetValue (Iter, 4);
|
||||||
|
@ -216,9 +216,9 @@ namespace SparkleShare {
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "log --format=\"%an☃%ae\" -50";
|
Process.StartInfo.Arguments = "log --format=\"%an☃%ae\" -50";
|
||||||
Process.StartInfo.WorkingDirectory = SparkleRepo.LocalPath;
|
Process.StartInfo.WorkingDirectory = SparkleRepo.LocalPath;
|
||||||
Process.Start();
|
Process.Start ();
|
||||||
|
|
||||||
string Output = Process.StandardOutput.ReadToEnd().Trim ();
|
string Output = Process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
string [] People = new string [50];
|
string [] People = new string [50];
|
||||||
string [] Lines = Regex.Split (Output, "\n");
|
string [] Lines = Regex.Split (Output, "\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue