[bubble] don't open a new event log if one already exists
This commit is contained in:
parent
2255d72aa2
commit
3368d40ec8
|
@ -273,24 +273,7 @@ namespace SparkleShare {
|
|||
|
||||
return delegate {
|
||||
|
||||
SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) {
|
||||
return l.LocalPath.Equals (path);
|
||||
});
|
||||
|
||||
// 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
|
||||
if (log == null) {
|
||||
|
||||
SparkleUI.OpenLogs.Add (new SparkleLog (path));
|
||||
SparkleUI.OpenLogs [SparkleUI.OpenLogs.Count - 1].ShowAll ();
|
||||
SparkleUI.OpenLogs [SparkleUI.OpenLogs.Count - 1].Present ();
|
||||
|
||||
} else {
|
||||
|
||||
log.ShowAll ();
|
||||
log.Present ();
|
||||
|
||||
}
|
||||
SparkleShare.UI.AddEventLog (path);
|
||||
|
||||
};
|
||||
|
||||
|
@ -390,7 +373,7 @@ namespace SparkleShare {
|
|||
|
||||
}
|
||||
|
||||
class SparkleMenuItem : ImageMenuItem {
|
||||
public class SparkleMenuItem : ImageMenuItem {
|
||||
|
||||
public SparkleMenuItem (string text) : base (text)
|
||||
{
|
||||
|
|
|
@ -150,10 +150,7 @@ namespace SparkleShare {
|
|||
bubble.Icon = SparkleUIHelpers.GetIcon ("avatar-default", 32);
|
||||
|
||||
bubble.AddAction ("", "Show Events", delegate {
|
||||
|
||||
SparkleLog log = new SparkleLog (repository_path);
|
||||
log.ShowAll ();
|
||||
|
||||
AddEventLog (repository_path);
|
||||
});
|
||||
|
||||
bubble.Show ();
|
||||
|
@ -202,6 +199,31 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
|
||||
public void AddEventLog (string path)
|
||||
{
|
||||
|
||||
SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) {
|
||||
return l.LocalPath.Equals (path);
|
||||
});
|
||||
|
||||
// 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
|
||||
if (log == null) {
|
||||
|
||||
OpenLogs.Add (new SparkleLog (path));
|
||||
OpenLogs [OpenLogs.Count - 1].ShowAll ();
|
||||
OpenLogs [OpenLogs.Count - 1].Present ();
|
||||
|
||||
} else {
|
||||
|
||||
log.ShowAll ();
|
||||
log.Present ();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Runs the application
|
||||
public void Run ()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue