From 57dc09aee9009c2c941eeae8b34546b6b32aaa5e Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 19 Nov 2010 01:25:57 +0000 Subject: [PATCH] Move the final pieces of logic from [intro] to [controller] --- .../Mac/SparkleShare/sparkleshare-idle.png | Bin 186 -> 216 bytes SparkleShare/SparkleController.cs | 13 +++++++++++-- SparkleShare/SparkleIntro.cs | 16 +++++----------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/SparkleShare/Mac/SparkleShare/sparkleshare-idle.png b/SparkleShare/Mac/SparkleShare/sparkleshare-idle.png index 7e52bead6f4df6b44ae8557791b9a496e5ce78c1..d9762e20be10991ed3cb4e401133c136bc9ba849 100644 GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2?f>5jgR3=G$9T=9=E0`etGTq8a>QWZRN6Vp?JQWH}u3s0un02O6Zz&&+h#EVY2qP&_bqw!b_K=cG);IFf#mN(u!HTb;%>3tqh*7 KelF{r5}E*BVNGrT literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4z;y8VjvbTtbI*vl5OIQm-DT-X7LTHkD|Z?KuQD^P;{V#jU-N)BVby9z Zvy?*ax%%zPJ^_tj@O1TaS?83{1OPcHIJ*D< diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 17e83608..4b956fa4 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -421,12 +421,19 @@ namespace SparkleShare { } - public void OpenSparkleShareFolder () { + + OpenSparkleShareFolder (""); + + } + public void OpenSparkleShareFolder (string subfolder) + { + 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 (), "usr", "bin"); @@ -717,6 +724,8 @@ namespace SparkleShare { public void Quit () { + // TODO: Pop up a warning when quitting whilst syncing + foreach (SparkleRepo repo in Repositories) repo.Dispose (); diff --git a/SparkleShare/SparkleIntro.cs b/SparkleShare/SparkleIntro.cs index a329517f..741d4c85 100644 --- a/SparkleShare/SparkleIntro.cs +++ b/SparkleShare/SparkleIntro.cs @@ -488,17 +488,9 @@ namespace SparkleShare { // A button that opens the synced 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); - - Process process = new Process (); - process.StartInfo.FileName = "xdg-open"; - process.StartInfo.Arguments = path.Replace (" ", "\\ "); // Escape space-characters - process.Start (); - - if (ServerFormOnly) - Destroy (); + SparkleShare.Controller.OpenSparkleShareFolder (folder_name); }; @@ -622,6 +614,8 @@ namespace SparkleShare { 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) SparkleUI.StatusIcon = new SparkleStatusIcon (); 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) {