[controller] Make OpenSparkleShareFolder abstract and implement a linux version

This commit is contained in:
Hylke Bons 2010-11-27 20:24:57 +00:00
parent 2e6ece3667
commit 7a497997b5
3 changed files with 32 additions and 41 deletions

View file

@ -1012,15 +1012,18 @@ namespace SparkleLib {
private string FormatCommitMessage ()
{
/// RepositoryStatus contains the following properties (all HashSet <string>)
/// * Added ---> added and staged
/// * MergeConflict --->
/// * Missing ---> removed but not staged
/// * Modified ---> modified but not staged
/// * Removed ---> removed and staged
/// * Staged ---> modified and staged
/// * Untracked ---> added but not staged
/// Because we create the commit message, we only need to consider the staged changes
// RepositoryStatus contains the following properties (all HashSet <string>)
//
// * Added ---> added and staged
// * MergeConflict --->
// * Missing ---> removed but not staged
// * Modified ---> modified but not staged
// * Removed ---> removed and staged
// * Staged ---> modified and staged
// * Untracked ---> added but not staged
//
// Because we create the commit message, we only need to consider the staged changes
RepositoryStatus status = Index.Status;
string file_name = "";

View file

@ -523,38 +523,7 @@ namespace SparkleShare {
}
public void OpenSparkleShareFolder (string subfolder)
{
Process process = new Process ();
process.StartInfo.Arguments = SparkleHelpers.CombineMore (SparklePaths.SparklePath,
subfolder).Replace (" ", "\\ "); // Escape space-characters
string open_command_path = SparkleHelpers.CombineMore (Path.VolumeSeparatorChar.ToString (),
"usr", "bin");
if (File.Exists (Path.Combine (open_command_path, "xdg-open"))) {
process.StartInfo.FileName = "xdg-open";
} else if (File.Exists (Path.Combine (open_command_path, "gnome-open"))) {
process.StartInfo.FileName = "gnome-open";
} else if (File.Exists (Path.Combine (open_command_path, "open"))) {
process.StartInfo.FileName = "open";
} else {
return;
}
process.Start ();
}
public abstract void OpenSparkleShareFolder (string subfolder);
// Adds the user's SparkleShare key to the ssh-agent,
// so all activity is done with this key

View file

@ -174,6 +174,25 @@ namespace SparkleShare {
return false;
}
public override void OpenSparkleShareFolder (string subfolder)
{
string open_command_path = SparkleHelpers.CombineMore (Path.VolumeSeparatorChar.ToString (),
"usr", "bin", "xdg-open");
if (!File.Exists (open_command_path))
return;
string folder = SparkleHelpers.CombineMore (SparklePaths.SparklePath, subfolder);
Process process = new Process ();
process.StartInfo.Arguments = folder.Replace (" ", "\\ "); // Escape space-characters
process.StartInfo.FileName = "xdg-open";
process.Start ();
}
}