From d4735cb74914b457414851a34f7f84502f9cd78f Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 11 Sep 2010 10:52:10 +0100 Subject: [PATCH] [repo] set syncing state before firing event, [statusicon] update state after populating list and change some strings --- SparkleLib/SparkleRepo.cs | 13 ++++++------- SparkleShare/SparkleLog.cs | 4 +++- SparkleShare/SparkleStatusIcon.cs | 8 ++++++-- SparkleShare/SparkleUI.cs | 2 ++ 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/SparkleLib/SparkleRepo.cs b/SparkleLib/SparkleRepo.cs index cbd95993..333e2d65 100644 --- a/SparkleLib/SparkleRepo.cs +++ b/SparkleLib/SparkleRepo.cs @@ -378,6 +378,8 @@ namespace SparkleLib { args = new SparkleEventArgs ("FetchingFinished"); + IsSyncing = false; + if (FetchingFinished != null) FetchingFinished (this, args); @@ -387,8 +389,6 @@ namespace SparkleLib { CurrentHash = GetCurrentHash (); - IsSyncing = false; - }; } @@ -766,7 +766,7 @@ namespace SparkleLib { unix_timestamp = -3600 * int.Parse (timezone.Substring (1, 2)); process.StartInfo.FileName = "git"; - process.StartInfo.Arguments = "log --format=\"%at\t%an\t%ae\t%H\t%ad\" -" + count; + process.StartInfo.Arguments = "log --format=\"%at\t%an\t%ae\t%H\" -" + count; process.Start (); process.WaitForExit (); @@ -784,10 +784,9 @@ namespace SparkleLib { string [] parts = Regex.Split (line, "\t"); int local_timestamp = unix_timestamp + int.Parse (parts [0]); - - string user_name = parts [1]; - string user_email = parts [2]; - string hash = parts [3]; + string user_name = parts [1]; + string user_email = parts [2]; + string hash = parts [3]; DateTime date_time = SparkleHelpers.UnixTimestampToDateTime (local_timestamp); diff --git a/SparkleShare/SparkleLog.cs b/SparkleShare/SparkleLog.cs index 29274860..5d761366 100644 --- a/SparkleShare/SparkleLog.cs +++ b/SparkleShare/SparkleLog.cs @@ -383,10 +383,12 @@ namespace SparkleShare { hbox.PackStart (vbox, true, true, 0); hbox.PackStart (new Label (""), false, false, 12); - layout_vertical.PackStart (hbox, true, true, 24); + layout_vertical.PackStart (hbox, true, true, 18); } + layout_vertical.PackStart (new Label (""), true, true, 3); + } ScrolledWindow = new ScrolledWindow (); diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index dfb76c30..dd00f429 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -274,7 +274,7 @@ namespace SparkleShare { } else { - MenuItem no_folders_item = new MenuItem (_("No Shared Folders Yet")) { + MenuItem no_folders_item = new MenuItem (_("No Remote Folders Yet")) { Sensitive = false }; @@ -404,7 +404,11 @@ namespace SparkleShare { // The first frame is the idle icon Application.Invoke (delegate { SetPixbuf (AnimationFrames [0]); }); - StateText = _("Up to date") + " (" + FormatFileSize (FolderSize) + ")"; + + if (SparkleUI.Repositories.Count > 0) + StateText = _("Up to date") + " (" + FormatFileSize (FolderSize) + ")"; + else + StateText += _("Welcome to SparkleShare!"); } diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index 4146bb82..91ef2a93 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -457,6 +457,8 @@ namespace SparkleShare { foreach (string folder_path in Directory.GetDirectories (SparklePaths.SparklePath)) AddRepository (folder_path); + StatusIcon.ShowState (); + }