[gnome-session] gsm: Use "computer-fail" icon from theme instead of our own sad-computer
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session] gsm: Use "computer-fail" icon from theme instead of our own sad-computer
- Date: Tue, 22 Mar 2011 16:59:24 +0000 (UTC)
commit fcdca87b80646c1a1617fe68f0c1c38515a54281
Author: Vincent Untz <vuntz gnome org>
Date: Tue Mar 22 17:58:46 2011 +0100
gsm: Use "computer-fail" icon from theme instead of our own sad-computer
https://bugzilla.gnome.org/show_bug.cgi?id=645396
data/Makefile.am | 3 +--
data/sad-computer.svgz | Bin 81624 -> 0 bytes
gnome-session/gsm-manager.c | 12 +++++-------
gnome-session/gsm-util.c | 11 +++++++++++
gnome-session/gsm-util.h | 3 +++
5 files changed, 20 insertions(+), 9 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index bf97c81..cdd3201 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -3,8 +3,7 @@ SUBDIRS = icons
uidir = $(pkgdatadir)
ui_DATA = \
session-properties.ui \
- gsm-inhibit-dialog.ui \
- sad-computer.svgz
+ gsm-inhibit-dialog.ui
xsessiondir = $(datadir)/xsessions
xsession_in_files = gnome.desktop.in
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index 6bc4770..454c501 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -1297,19 +1297,17 @@ show_fallback_dialog (const char *title,
const char *uri)
{
GtkWidget *dialog, *image, *link, *hbox;
- GdkPixbuf *pix;
dialog = gtk_message_dialog_new (NULL, 0,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_CLOSE,
title);
- pix = rsvg_pixbuf_from_file_at_size (DATA_DIR "/sad-computer.svgz", 128, 128, NULL);
- if (pix != NULL) {
- image = gtk_image_new_from_pixbuf (pix);
- gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (dialog), image);
- g_object_unref (pix);
- }
+ gtk_window_set_icon_name (GTK_WINDOW (dialog), "computer-fail");
+
+ image = gtk_image_new_from_icon_name ("computer-fail",
+ gsm_util_get_computer_fail_icon_size ());
+ gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (dialog), image);
if (description) {
gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog),
diff --git a/gnome-session/gsm-util.c b/gnome-session/gsm-util.c
index 9f28a1e..c3fda1d 100644
--- a/gnome-session/gsm-util.c
+++ b/gnome-session/gsm-util.c
@@ -495,3 +495,14 @@ gsm_util_setenv (const char *variable,
g_error_free (bus_error);
}
}
+
+GtkIconSize
+gsm_util_get_computer_fail_icon_size (void)
+{
+ static GtkIconSize icon_size = 0;
+
+ if (icon_size == 0)
+ icon_size = gtk_icon_size_register ("gnome-session-computer-fail", 128, 128);
+
+ return icon_size;
+}
diff --git a/gnome-session/gsm-util.h b/gnome-session/gsm-util.h
index 82fa3dd..de1bd6a 100644
--- a/gnome-session/gsm-util.h
+++ b/gnome-session/gsm-util.h
@@ -21,6 +21,7 @@
#define __GSM_UTIL_H__
#include <glib.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
@@ -51,6 +52,8 @@ char * gsm_util_generate_startup_id (void);
void gsm_util_setenv (const char *variable,
const char *value);
+GtkIconSize gsm_util_get_computer_fail_icon_size (void);
+
G_END_DECLS
#endif /* __GSM_UTIL_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]