mac ui: fix coding style and whitespace

This commit is contained in:
Hylke Bons 2011-05-13 00:50:57 +01:00
parent 4288cc3a19
commit 24e58b1e25

View file

@ -46,7 +46,6 @@ namespace SparkleShare {
public SparkleUI () public SparkleUI ()
{ {
// Initialize the application // Initialize the application
Application.Init (); Application.Init ();
@ -57,33 +56,25 @@ namespace SparkleShare {
OpenLogs = new List <SparkleLog> (); OpenLogs = new List <SparkleLog> ();
if (SparkleShare.Controller.FirstRun) { if (SparkleShare.Controller.FirstRun) {
Intro = new SparkleIntro (); Intro = new SparkleIntro ();
Intro.ShowAccountForm (); Intro.ShowAccountForm ();
} }
SparkleShare.Controller.OnQuitWhileSyncing += delegate { SparkleShare.Controller.OnQuitWhileSyncing += delegate {
// TODO: Pop up a warning when quitting whilst syncing // TODO: Pop up a warning when quitting whilst syncing
}; };
SparkleShare.Controller.OnInvitation += delegate (string server, string folder, string token) { SparkleShare.Controller.OnInvitation += delegate (string server, string folder, string token) {
Application.Invoke (delegate { Application.Invoke (delegate {
SparkleIntro intro = new SparkleIntro (); SparkleIntro intro = new SparkleIntro ();
intro.ShowInvitationPage (server, folder, token); intro.ShowInvitationPage (server, folder, token);
}); });
}; };
// Show a bubble when there are new changes // Show a bubble when there are new changes
SparkleShare.Controller.NotificationRaised += delegate (string user_name, string user_email, SparkleShare.Controller.NotificationRaised += delegate (string user_name, string user_email,
string message, string repository_path) { string message, string repository_path) {
Application.Invoke (delegate { Application.Invoke (delegate {
foreach (SparkleLog log in OpenLogs) { foreach (SparkleLog log in OpenLogs) {
if (log.LocalPath.Equals (repository_path)) if (log.LocalPath.Equals (repository_path))
log.UpdateEventLog (); log.UpdateEventLog ();
@ -92,7 +83,6 @@ namespace SparkleShare {
if (!SparkleShare.Controller.NotificationsEnabled) if (!SparkleShare.Controller.NotificationsEnabled)
return; return;
SparkleBubble bubble = new SparkleBubble (user_name, message); SparkleBubble bubble = new SparkleBubble (user_name, message);
string avatar_file_path = SparkleUIHelpers.GetAvatar (user_email, 32); string avatar_file_path = SparkleUIHelpers.GetAvatar (user_email, 32);
@ -106,54 +96,37 @@ namespace SparkleShare {
}); });
bubble.Show (); bubble.Show ();
}); });
}; };
// Show a bubble when there was a conflict // Show a bubble when there was a conflict
SparkleShare.Controller.ConflictNotificationRaised += delegate { SparkleShare.Controller.ConflictNotificationRaised += delegate {
Application.Invoke (delegate { Application.Invoke (delegate {
string title = _("Ouch! Mid-air collision!"); string title = _("Ouch! Mid-air collision!");
string subtext = _("Don't worry, SparkleShare made a copy of each conflicting file."); string subtext = _("Don't worry, SparkleShare made a copy of each conflicting file.");
new SparkleBubble (title, subtext).Show (); new SparkleBubble (title, subtext).Show ();
}); });
}; };
SparkleShare.Controller.AvatarFetched += delegate { SparkleShare.Controller.AvatarFetched += delegate {
Application.Invoke (delegate { Application.Invoke (delegate {
foreach (SparkleLog log in OpenLogs) foreach (SparkleLog log in OpenLogs)
log.UpdateEventLog (); log.UpdateEventLog ();
}); });
}; };
SparkleShare.Controller.OnIdle += delegate { SparkleShare.Controller.OnIdle += delegate {
Application.Invoke (delegate { Application.Invoke (delegate {
foreach (SparkleLog log in OpenLogs) foreach (SparkleLog log in OpenLogs)
log.UpdateEventLog (); log.UpdateEventLog ();
}); });
}; };
} }
public void AddEventLog (string path) public void AddEventLog (string path)
{ {
SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) { SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) {
return l.LocalPath.Equals (path); return l.LocalPath.Equals (path);
}); });
@ -161,29 +134,20 @@ namespace SparkleShare {
// Check whether the log is already open, create a new one if // Check whether the log is already open, create a new one if
// that's not the case or present it to the user if it is // that's not the case or present it to the user if it is
if (log == null) { if (log == null) {
OpenLogs.Add (new SparkleLog (path)); OpenLogs.Add (new SparkleLog (path));
OpenLogs [OpenLogs.Count - 1].ShowAll (); OpenLogs [OpenLogs.Count - 1].ShowAll ();
OpenLogs [OpenLogs.Count - 1].Present (); OpenLogs [OpenLogs.Count - 1].Present ();
} else { } else {
log.ShowAll (); log.ShowAll ();
log.Present (); log.Present ();
} }
} }
// Runs the application // Runs the application
public void Run () public void Run ()
{ {
Application.Run (); Application.Run ();
} }
} }
} }