From 52edee5585c7b89d583a99cd33979e4b697bbd8c Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 15 Jul 2011 01:31:40 +0100 Subject: [PATCH] Only allow for one about dialog to be open at the same time --- SparkleShare/SparkleAbout.cs | 5 +++++ SparkleShare/SparkleStatusIcon.cs | 9 +++++++-- SparkleShare/SparkleUI.cs | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/SparkleShare/SparkleAbout.cs b/SparkleShare/SparkleAbout.cs index 830d6310..ffa5b000 100644 --- a/SparkleShare/SparkleAbout.cs +++ b/SparkleShare/SparkleAbout.cs @@ -41,6 +41,11 @@ namespace SparkleShare { public SparkleAbout () : base ("") { + DeleteEvent += delegate (object o, DeleteEventArgs args) { + HideAll (); + args.RetVal = true; + }; + DefaultSize = new Gdk.Size (600, 260); Resizable = false; BorderWidth = 0; diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index b833c60f..8090febf 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -275,8 +275,13 @@ namespace SparkleShare { MenuItem about_item = new MenuItem (_("About SparkleShare")); about_item.Activated += delegate { - SparkleAbout about = new SparkleAbout (); - about.ShowAll (); + Application.Invoke (delegate { + if (SparkleUI.About == null) + SparkleUI.About = new SparkleAbout (); + + SparkleUI.About.ShowAll (); + SparkleUI.About.Present (); + }); }; Menu.Add (about_item); diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index 3f6320e5..1a298c1e 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -35,6 +35,7 @@ namespace SparkleShare { public static SparkleStatusIcon StatusIcon; public static SparkleEventLog EventLog; public static SparkleSetup Setup; + public static SparkleAbout About; // Short alias for the translations