[controller] Make OpenSparkleShareFolder abstract and implement a linux version
This commit is contained in:
parent
98143d214a
commit
9e8262a0b7
|
@ -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 = "";
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue