From ea4e2d78403fad7f86a4fed3c0a640c2eb022f7c Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 1 Nov 2014 20:08:19 +0000 Subject: [PATCH] statusicon controller: Remove redundant method and add note logic --- SparkleShare/SparkleStatusIconController.cs | 22 +++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/SparkleShare/SparkleStatusIconController.cs b/SparkleShare/SparkleStatusIconController.cs index 5208f3f1..6431a248 100755 --- a/SparkleShare/SparkleStatusIconController.cs +++ b/SparkleShare/SparkleStatusIconController.cs @@ -310,19 +310,25 @@ namespace SparkleShare { public void PauseClicked (string project) { - GetRepoByName (project).Pause (); + Program.Controller.GetRepoByName (project).Pause (); UpdateMenuEvent (CurrentState); } public void ResumeClicked (string project) { - new Thread (() => GetRepoByName (project).Resume ("")).Start (); + if (Program.Controller.GetRepoByName (project).UnsyncedChanges.Count > 0) { + Program.Controller.ShowNoteWindow (project); + + } else { + new Thread (() => Program.Controller.GetRepoByName (project).Resume ("")).Start (); + } + UpdateMenuEvent (CurrentState); } public void TryAgainClicked (string project) { - new Thread (() => GetRepoByName (project).ForceRetry ()).Start (); + new Thread (() => Program.Controller.GetRepoByName (project).ForceRetry ()).Start (); } @@ -361,15 +367,5 @@ namespace SparkleShare { Projects = projects.ToArray (); } } - - - private SparkleRepoBase GetRepoByName (string name) - { - foreach (SparkleRepoBase repo in Program.Controller.Repositories) - if (repo.Name.Equals (name)) - return repo; - - return null; - } } }