Only allow for one about dialog to be open at the same time

This commit is contained in:
Hylke Bons 2011-07-15 01:31:40 +01:00
parent 27629c067e
commit c2a9692247
3 changed files with 13 additions and 2 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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