summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Hallendal <micke@codefactory.se>2003-06-03 21:58:37 +0000
committerMikael Hallendal <hallski@src.gnome.org>2003-06-03 21:58:37 +0000
commit9b792aae26508ee6cdb4bf6e2efca3870b8266e6 (patch)
treea95748fefc2de4e042fd1fd2a15e7a230ed1c376
parent2e6a6895e304116b322339bf89bddc130765e5e5 (diff)
downloadyelp-9b792aae26508ee6cdb4bf6e2efca3870b8266e6.tar.gz
- If About window is already showing, don't create another one. Patch by
2003-06-03 Mikael Hallendal <micke@codefactory.se> * src/yelp-window.c: (window_about_cb): - If About window is already showing, don't create another one. Patch by Steve Chaplin, fixes #113906
-rw-r--r--ChangeLog6
-rw-r--r--src/yelp-window.c48
2 files changed, 34 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 26ca9b63..6cb8cc6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2003-06-03 Mikael Hallendal <micke@codefactory.se>
+ * src/yelp-window.c: (window_about_cb):
+ - If About window is already showing, don't create another one.
+ Patch by Steve Chaplin, fixes #113906
+
+2003-06-03 Mikael Hallendal <micke@codefactory.se>
+
* src/yelp-view-content.c: (content_reader_finished_cb):
- Use gtp_tree_view_expand_to_path to expand the tree instead of callin
gtk_tree_view_expand_path on all parents. Fixes #113977
diff --git a/src/yelp-window.c b/src/yelp-window.c
index d69ddd8b..30f234a9 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -664,26 +664,34 @@ window_go_index_cb (gpointer data, guint section, GtkWidget *widget)
static void
window_about_cb (gpointer data, guint section, GtkWidget *widget)
{
- GtkWidget *about;
- const gchar *authors[] = {
- "Mikael Hallendal <micke@codefactory.se>",
- "Alexander Larsson <alexl@redhat.com>",
- NULL
- };
- /* Note to translators: put here your name (and address) so it
- * will shop up in the "about" box */
- gchar *translator_credits = _("translator_credits");
-
- about = gnome_about_new (PACKAGE, VERSION,
- "Copyright 2001-2002 Mikael Hallendal <micke@codefactory.se>",
- _("Help Browser for GNOME 2.0"),
- authors,
- NULL,
- strcmp (translator_credits, "translator_credits") != 0 ? translator_credits : NULL,
- window_load_icon ());
-
- gtk_window_set_transient_for (GTK_WINDOW (about), GTK_WINDOW (data));
- gtk_widget_show (about);
+ static GtkWidget *about = NULL;
+
+ if (about == NULL) {
+ const gchar *authors[] = {
+ "Mikael Hallendal <micke@codefactory.se>",
+ "Alexander Larsson <alexl@redhat.com>",
+ NULL
+ };
+ /* Note to translators: put here your name (and address) so it
+ * will shop up in the "about" box */
+ gchar *translator_credits = _("translator_credits");
+
+ about = gnome_about_new (PACKAGE, VERSION,
+ "Copyright 2001-2002 Mikael Hallendal <micke@codefactory.se>",
+ _("A Help Browser for GNOME"),
+ authors,
+ NULL,
+ strcmp (translator_credits, "translator_credits") != 0 ? translator_credits : NULL,
+ window_load_icon ());
+
+ /* set the widget pointer to NULL when the widget is destroyed */
+ g_signal_connect (G_OBJECT (about), "destroy",
+ G_CALLBACK (gtk_widget_destroyed),
+ &about);
+ gtk_window_set_transient_for (GTK_WINDOW (about), GTK_WINDOW (data));
+ }
+
+ gtk_window_present (GTK_WINDOW (about));
}
static gboolean