[controller] Make OpenSparkleShareFolder abstract and implement a linux version
This commit is contained in:
parent
2e6ece3667
commit
7a497997b5
|
@ -1012,15 +1012,18 @@ namespace SparkleLib {
|
||||||
private string FormatCommitMessage ()
|
private string FormatCommitMessage ()
|
||||||
{
|
{
|
||||||
|
|
||||||
/// RepositoryStatus contains the following properties (all HashSet <string>)
|
// RepositoryStatus contains the following properties (all HashSet <string>)
|
||||||
/// * Added ---> added and staged
|
//
|
||||||
/// * MergeConflict --->
|
// * Added ---> added and staged
|
||||||
/// * Missing ---> removed but not staged
|
// * MergeConflict --->
|
||||||
/// * Modified ---> modified but not staged
|
// * Missing ---> removed but not staged
|
||||||
/// * Removed ---> removed and staged
|
// * Modified ---> modified but not staged
|
||||||
/// * Staged ---> modified and staged
|
// * Removed ---> removed and staged
|
||||||
/// * Untracked ---> added but not staged
|
// * Staged ---> modified and staged
|
||||||
/// Because we create the commit message, we only need to consider the staged changes
|
// * Untracked ---> added but not staged
|
||||||
|
//
|
||||||
|
// Because we create the commit message, we only need to consider the staged changes
|
||||||
|
|
||||||
RepositoryStatus status = Index.Status;
|
RepositoryStatus status = Index.Status;
|
||||||
|
|
||||||
string file_name = "";
|
string file_name = "";
|
||||||
|
|
|
@ -523,38 +523,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OpenSparkleShareFolder (string subfolder)
|
public abstract 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 ();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Adds the user's SparkleShare key to the ssh-agent,
|
// Adds the user's SparkleShare key to the ssh-agent,
|
||||||
// so all activity is done with this key
|
// so all activity is done with this key
|
||||||
|
|
|
@ -175,6 +175,25 @@ namespace SparkleShare {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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 ();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue