Hide the Credits button iff there are no credits to show. Bug #402806.

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=/branches/gtk-2-10/; revision=17243
This commit is contained in:
Christian Persch
2007-01-31 18:41:21 +00:00
committed by Christian Persch
parent 6cfd2ff7a3
commit 57a0ed7747
2 changed files with 30 additions and 8 deletions

View File

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

View File

@@ -1254,6 +1254,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
@@ -1279,8 +1297,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");
}
@@ -1335,8 +1352,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");
}
@@ -1391,8 +1407,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");
}
@@ -1458,8 +1473,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");
}