[ui] be more efficient populating and fix threading issue

This commit is contained in:
Hylke Bons 2010-08-08 22:28:56 +01:00
parent 7dbab85b6a
commit 9c31c7f8e7

View file

@ -89,7 +89,7 @@ namespace SparkleShare {
CreateConfigurationFolders (); CreateConfigurationFolders ();
UpdateRepositories (); PopulateRepositories ();
// Don't create the window and status // Don't create the window and status
// icon when --disable-gui was given // icon when --disable-gui was given
@ -358,6 +358,7 @@ namespace SparkleShare {
Repositories.Add (repo); Repositories.Add (repo);
if (NotificationIcon != null)
Application.Invoke (delegate { NotificationIcon.CreateMenu (); }); Application.Invoke (delegate { NotificationIcon.CreateMenu (); });
} }
@ -379,29 +380,24 @@ namespace SparkleShare {
} }
if (NotificationIcon != null)
Application.Invoke (delegate { NotificationIcon.CreateMenu (); }); Application.Invoke (delegate { NotificationIcon.CreateMenu (); });
} }
// Updates the list of repositories with all the // Updates the list of repositories with all the
// folders in the SparkleShare folder // folders in the SparkleShare folder
public void UpdateRepositories () public void PopulateRepositories ()
{ {
Repositories = new List <SparkleRepo> (); Repositories = new List <SparkleRepo> ();
foreach (string folder_path in Directory.GetDirectories (SparklePaths.SparklePath)) { foreach (string folder_path in Directory.GetDirectories (SparklePaths.SparklePath))
AddRepository (folder_path); AddRepository (folder_path);
} }
// Update the list in the statusicon
if (NotificationIcon != null)
NotificationIcon.CreateMenu ();
}
// Warns the user implicitly that unicorns are actually lethal creatures // Warns the user implicitly that unicorns are actually lethal creatures
public static void CheckForUnicorns (string message) { public static void CheckForUnicorns (string message) {