]> Pileus Git - ~andy/gtk/commitdiff
Hide the Credits button iff there are no credits to show. Bug #402806.
authorChristian Persch <chpe@svn.gnome.org>
Wed, 31 Jan 2007 18:40:32 +0000 (18:40 +0000)
committerChristian Persch <chpe@src.gnome.org>
Wed, 31 Jan 2007 18:40:32 +0000 (18:40 +0000)
2007-01-31  Christian Persch  <chpe@svn.gnome.org>

* gtk/gtkaboutdialog.c: (update_credits_button_visibility),
(gtk_about_dialog_set_authors), (gtk_about_dialog_set_documenters),
(gtk_about_dialog_set_artists),
(gtk_about_dialog_set_translator_credits): Hide the Credits button iff
there are no credits to show. Bug #402806.

svn path=/trunk/; revision=17242

ChangeLog
gtk/gtkaboutdialog.c

index e5869e6cd8dced4bb45015ada67cc134fabff80a..34c3089e107d5ef55a3381759073ba0318c65127 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-01-31  Christian Persch  <chpe@svn.gnome.org>
+
+       * gtk/gtkaboutdialog.c: (update_credits_button_visibility),
+       (gtk_about_dialog_set_authors), (gtk_about_dialog_set_documenters),
+       (gtk_about_dialog_set_artists),
+       (gtk_about_dialog_set_translator_credits): Hide the Credits button iff
+       there are no credits to show. Bug #402806.
+
 2007-01-31  Tor Lillqvist  <tml@novell.com>
 
        * gdk/win32/gdkinput-win32.c (print_cursor): New debugging
index fdbc18daa1e0b72b855bbcdcd3a0a9b2351cbee1..863ac53ca88f7c36f0156dee6b0d6b884340bd26 100644 (file)
@@ -1219,6 +1219,24 @@ gtk_about_dialog_get_authors (GtkAboutDialog *about)
   return (const gchar * const *) priv->authors;
 }
 
+static void
+update_credits_button_visibility (GtkAboutDialog *about)
+{
+  GtkAboutDialogPrivate *priv = about->private_data;
+  gboolean show;
+
+  show = priv->authors != NULL ||
+         priv->documenters != NULL ||
+         priv->artists != NULL ||
+         (priv->translator_credits != NULL &&
+          strcmp (priv->translator_credits, "translator_credits") &&
+          strcmp (priv->translator_credits, "translator-credits"));
+  if (show)
+    gtk_widget_show (priv->credits_button);
+  else
+    gtk_widget_hide (priv->credits_button);
+}
+
 /**
  * gtk_about_dialog_set_authors:
  * @about: a #GtkAboutDialog
@@ -1244,8 +1262,7 @@ gtk_about_dialog_set_authors (GtkAboutDialog  *about,
   priv->authors = g_strdupv ((gchar **)authors);
   g_strfreev (tmp);
 
-  if (priv->authors != NULL)
-    gtk_widget_show (priv->credits_button);
+  update_credits_button_visibility (about);
 
   g_object_notify (G_OBJECT (about), "authors");
 }
@@ -1300,8 +1317,7 @@ gtk_about_dialog_set_documenters (GtkAboutDialog *about,
   priv->documenters = g_strdupv ((gchar **)documenters);
   g_strfreev (tmp);
 
-  if (priv->documenters != NULL)
-    gtk_widget_show (priv->credits_button);
+  update_credits_button_visibility (about);
 
   g_object_notify (G_OBJECT (about), "documenters");
 }
@@ -1356,8 +1372,7 @@ gtk_about_dialog_set_artists (GtkAboutDialog *about,
   priv->artists = g_strdupv ((gchar **)artists);
   g_strfreev (tmp);
 
-  if (priv->artists != NULL)
-    gtk_widget_show (priv->credits_button);
+  update_credits_button_visibility (about);
 
   g_object_notify (G_OBJECT (about), "artists");
 }
@@ -1423,8 +1438,7 @@ gtk_about_dialog_set_translator_credits (GtkAboutDialog *about,
   priv->translator_credits = g_strdup (translator_credits);
   g_free (tmp);
 
-  if (priv->translator_credits != NULL)
-    gtk_widget_show (priv->credits_button);
+  update_credits_button_visibility (about);
 
   g_object_notify (G_OBJECT (about), "translator-credits");
 }