fix and move the code into capplet_set_icon.

2002-06-27  Jody Goldberg <jody@gnome.org>

	* gnome-keybinding-properties.c (setup_dialog) : fix and move the code
	  into capplet_set_icon.

2002-06-27  Jody Goldberg <jody@gnome.org>

	http://bugzilla.gnome.org/show_bug.cgi?id=86593
	* main.c (setup_dialog) : watch for missing icons

2002-06-27  Jody Goldberg <jody@gnome.org>

	* capplet-util.c (capplet_set_icon) : new util.
This commit is contained in:
Jody Goldberg 2002-06-27 18:30:15 +00:00 committed by Jody Goldberg
parent 5719b6cda4
commit 1eeebe40c9
7 changed files with 43 additions and 16 deletions

View file

@ -1,3 +1,7 @@
2002-06-27 Jody Goldberg <jody@gnome.org>
* capplet-util.c (capplet_set_icon) : new util.
2002-06-21 Stephen Browne <stephen.browne@sun.com>
* wm-common.[ch] : added new files to expose

View file

@ -314,6 +314,7 @@ capplet_error_dialog (GtkWindow *parent, char const *msg, GError *err)
g_error_free (err);
}
}
/**
* capplet_help :
* @parent :
@ -339,3 +340,28 @@ capplet_help (GtkWindow *parent, char const *helpfile, char const *section)
_("There was an error displaying help: %s"),
error);
}
/**
* capplet_set_icon :
* @window :
* @file_name :
*
* A quick utility routine to avoid the cut-n-paste of bogus code
* that caused several bugs.
**/
void
capplet_set_icon (GtkWidget *window, char const *icon_file_name)
{
char *path = gnome_program_locate_file (NULL,
GNOME_FILE_DOMAIN_APP_PIXMAP,
icon_file_name, TRUE, NULL);
if (path != NULL) {
GdkPixbuf *icon_pixbuf = gdk_pixbuf_new_from_file (path, NULL);
if (icon_pixbuf != NULL) {
gtk_window_set_icon (GTK_WINDOW (window), icon_pixbuf);
g_object_unref (icon_pixbuf);
}
g_free (path);
}
}

View file

@ -92,5 +92,6 @@ void capplet_init (int argc,
void capplet_error_dialog (GtkWindow *parent, char const *msg, GError *err);
void capplet_help (GtkWindow *parent, char const *helpfile, char const *section);
void capplet_set_icon (GtkWidget *window, char const *icon_file_name);
#endif /* __CAPPLET_UTIL_H */

View file

@ -1,3 +1,8 @@
2002-06-27 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=86593
* main.c (setup_dialog) : watch for missing icons
2002-06-17 Jody Goldberg <jody@gnome.org>
* Release 2.0.0

View file

@ -45,8 +45,6 @@ setup_dialog (GladeXML *dialog)
GConfClient *client;
GtkWidget *widget;
GObject *peditor;
gchar *filename;
GdkPixbuf *icon_pixbuf;
client = gconf_client_get_default ();
@ -61,11 +59,7 @@ setup_dialog (GladeXML *dialog)
PEDITOR_FONT_COMBINED, NULL);
widget = WID ("font_dialog");
filename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP, "keyboard-shortcut.png", TRUE, NULL);
icon_pixbuf = gdk_pixbuf_new_from_file ("font-capplet.png", NULL);
gtk_window_set_icon (GTK_WINDOW (widget), icon_pixbuf);
g_free (filename);
g_object_unref (icon_pixbuf);
capplet_set_icon (widget, "font-capplet.png");
gtk_widget_show (widget);
g_signal_connect (G_OBJECT (widget),

View file

@ -1,3 +1,8 @@
2002-06-27 Jody Goldberg <jody@gnome.org>
* gnome-keybinding-properties.c (setup_dialog) : fix and move the code
into capplet_set_icon.
2002-06-26 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=86575

View file

@ -685,8 +685,6 @@ setup_dialog (GladeXML *dialog)
GtkWidget *widget;
gboolean found_keys = FALSE;
GList *list;
GdkPixbuf *icon_pixbuf;
gchar *filename;
client = gconf_client_get_default ();
@ -758,13 +756,7 @@ setup_dialog (GladeXML *dialog)
reload_key_entries (wm_common_get_current_window_manager(), dialog);
widget = WID ("gnome-keybinding-dialog");
filename = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP, "keyboard-shortcut.png", TRUE, NULL);
icon_pixbuf = gdk_pixbuf_new_from_file ("keyboard-shortcut.png", NULL);
if (icon_pixbuf != NULL) {
gtk_window_set_icon (GTK_WINDOW (widget), icon_pixbuf);
g_object_unref (icon_pixbuf);
}
g_free (filename);
capplet_set_icon (widget, "keyboard-shortcut.png");
gtk_widget_show (widget);
g_signal_connect (G_OBJECT (widget), "response", G_CALLBACK(cb_dialog_response), NULL);