[gnome-session] fail-whale: clean up some deprecations
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session] fail-whale: clean up some deprecations
- Date: Fri, 12 Dec 2014 15:36:24 +0000 (UTC)
commit db77b3ef67acf651aafdb950db6a1f0ce506cd46
Author: Ray Strode <rstrode redhat com>
Date: Fri Dec 12 10:35:54 2014 -0500
fail-whale: clean up some deprecations
gnome-session/gsm-fail-whale-dialog.c | 34 ++++++++++++--------------------
1 files changed, 13 insertions(+), 21 deletions(-)
---
diff --git a/gnome-session/gsm-fail-whale-dialog.c b/gnome-session/gsm-fail-whale-dialog.c
index e484048..ca769bc 100644
--- a/gnome-session/gsm-fail-whale-dialog.c
+++ b/gnome-session/gsm-fail-whale-dialog.c
@@ -266,28 +266,17 @@ on_logout_clicked (GtkWidget *button,
gtk_main_quit ();
}
-static 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;
-}
-
static void
setup_window (GsmFailWhaleDialog *fail_dialog)
{
GsmFailWhaleDialogPrivate *priv;
- GtkWidget *alignment;
GtkWidget *box;
GtkWidget *image;
GtkWidget *label;
GtkWidget *message_label;
GtkWidget *button_box;
GtkWidget *button;
+ GdkPixbuf *fail_icon;
char *markup;
priv = fail_dialog->priv;
@@ -302,18 +291,21 @@ setup_window (GsmFailWhaleDialog *fail_dialog)
/* only works if there is a window manager which is unlikely */
gtk_window_fullscreen (GTK_WINDOW (fail_dialog));
- alignment = gtk_alignment_new (0.5, 0.5, 1, 1);
- gtk_widget_show (alignment);
- gtk_container_add (GTK_CONTAINER (fail_dialog), alignment);
- g_object_set (alignment, "valign", GTK_ALIGN_CENTER, NULL);
-
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
+ gtk_widget_set_valign (box, GTK_ALIGN_CENTER);
gtk_widget_show (box);
- gtk_container_add (GTK_CONTAINER (alignment), box);
- image = gtk_image_new_from_icon_name (GSM_ICON_COMPUTER_FAIL,
- gsm_util_get_computer_fail_icon_size ());
- g_object_set (image, "use-fallback", TRUE, NULL);
+ gtk_container_add (GTK_CONTAINER (fail_dialog), box);
+
+ fail_icon = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
+ GSM_ICON_COMPUTER_FAIL,
+ 128,
+ 0,
+ NULL);
+ if (fail_icon != NULL) {
+ image = gtk_image_new_from_pixbuf (fail_icon);
+ g_object_unref (fail_icon);
+ }
gtk_widget_show (image);
gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]