Move the final pieces of logic from [intro] to [controller]
This commit is contained in:
parent
8bf57aa96e
commit
64013dc659
Binary file not shown.
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 216 B |
|
@ -421,12 +421,19 @@ namespace SparkleShare {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void OpenSparkleShareFolder ()
|
public void OpenSparkleShareFolder ()
|
||||||
|
{
|
||||||
|
|
||||||
|
OpenSparkleShareFolder ("");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OpenSparkleShareFolder (string subfolder)
|
||||||
{
|
{
|
||||||
|
|
||||||
Process process = new Process ();
|
Process process = new Process ();
|
||||||
process.StartInfo.Arguments = SparklePaths.SparklePath;
|
process.StartInfo.Arguments = SparkleHelpers.CombineMore (SparklePaths.SparklePath,
|
||||||
|
subfolder).Replace (" ", "\\ "); // Escape space-characters
|
||||||
|
|
||||||
string open_command_path = SparkleHelpers.CombineMore (Path.VolumeSeparatorChar.ToString (),
|
string open_command_path = SparkleHelpers.CombineMore (Path.VolumeSeparatorChar.ToString (),
|
||||||
"usr", "bin");
|
"usr", "bin");
|
||||||
|
@ -717,6 +724,8 @@ namespace SparkleShare {
|
||||||
public void Quit ()
|
public void Quit ()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// TODO: Pop up a warning when quitting whilst syncing
|
||||||
|
|
||||||
foreach (SparkleRepo repo in Repositories)
|
foreach (SparkleRepo repo in Repositories)
|
||||||
repo.Dispose ();
|
repo.Dispose ();
|
||||||
|
|
||||||
|
|
|
@ -488,17 +488,9 @@ namespace SparkleShare {
|
||||||
// A button that opens the synced folder
|
// A button that opens the synced folder
|
||||||
Button open_folder_button = new Button (_("Open Folder"));
|
Button open_folder_button = new Button (_("Open Folder"));
|
||||||
|
|
||||||
open_folder_button.Clicked += delegate (object o, EventArgs args) {
|
open_folder_button.Clicked += delegate {
|
||||||
|
|
||||||
string path = SparkleHelpers.CombineMore (SparklePaths.SparklePath, folder_name);
|
SparkleShare.Controller.OpenSparkleShareFolder (folder_name);
|
||||||
|
|
||||||
Process process = new Process ();
|
|
||||||
process.StartInfo.FileName = "xdg-open";
|
|
||||||
process.StartInfo.Arguments = path.Replace (" ", "\\ "); // Escape space-characters
|
|
||||||
process.Start ();
|
|
||||||
|
|
||||||
if (ServerFormOnly)
|
|
||||||
Destroy ();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -622,6 +614,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
finish_button.Clicked += delegate (object o, EventArgs args) {
|
finish_button.Clicked += delegate (object o, EventArgs args) {
|
||||||
|
|
||||||
|
// TODO: This can probably go away as we're
|
||||||
|
// now always showing the status icon even without folders
|
||||||
if (SparkleUI.StatusIcon == null)
|
if (SparkleUI.StatusIcon == null)
|
||||||
SparkleUI.StatusIcon = new SparkleStatusIcon ();
|
SparkleUI.StatusIcon = new SparkleStatusIcon ();
|
||||||
else
|
else
|
||||||
|
@ -708,7 +702,7 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Checks if a url is a valid git url
|
// Checks if a url is a valid git url TODO: broken
|
||||||
private static bool IsGitUrl (string url)
|
private static bool IsGitUrl (string url)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue