[gnome-session] gsm: Move all icon names to gsm-icon-names.h with defines



commit 962d6014d85f2551b1e9cb3900d1f2c3cb0a5bc8
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Mar 22 18:27:58 2011 +0100

    gsm: Move all icon names to gsm-icon-names.h with defines
    
    This makes it much easier to know what we use and to change things when
    needed.

 gnome-session/gsm-fail-whale-dialog.c |    8 +++++---
 gnome-session/gsm-icon-names.h        |   30 ++++++++++++++++++++++++++++++
 gnome-session/gsm-inhibit-dialog.c    |    5 +++--
 gnome-session/gsm-logout-dialog.c     |    4 +---
 gnome-session/gsm-manager.c           |    5 +++--
 gnome-session/gsm-xsmp-client.c       |    3 ++-
 6 files changed, 44 insertions(+), 11 deletions(-)
---
diff --git a/gnome-session/gsm-fail-whale-dialog.c b/gnome-session/gsm-fail-whale-dialog.c
index 30cf307..8963c24 100644
--- a/gnome-session/gsm-fail-whale-dialog.c
+++ b/gnome-session/gsm-fail-whale-dialog.c
@@ -23,10 +23,12 @@
 
 #include <config.h>
 
+#include <glib/gi18n.h>
+
 #include "gsm-fail-whale-dialog.h"
-#include "gsm-manager.h"
 
-#include <glib/gi18n.h>
+#include "gsm-icon-names.h"
+#include "gsm-manager.h"
 
 #define GSM_FAIL_WHALE_DIALOG_GET_PRIVATE(o)                                \
         (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_FAIL_WHALE_DIALOG, GsmFailWhaleDialogPrivate))
@@ -268,7 +270,7 @@ gsm_fail_whale_dialog_we_failed (GsmFailWhaleDialogFailType fail_type,
 
         gtk_window_set_title (GTK_WINDOW (fail_dialog), "");
 
-        gtk_window_set_icon_name (GTK_WINDOW (fail_dialog), "gtk-error");
+        gtk_window_set_icon_name (GTK_WINDOW (fail_dialog), GSM_ICON_COMPUTER_FAIL);
         gtk_window_set_position (GTK_WINDOW (fail_dialog), GTK_WIN_POS_CENTER_ALWAYS);
 
         switch (fail_type) {
diff --git a/gnome-session/gsm-icon-names.h b/gnome-session/gsm-icon-names.h
new file mode 100644
index 0000000..8bae634
--- /dev/null
+++ b/gnome-session/gsm-icon-names.h
@@ -0,0 +1,30 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2011 Novell, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef __GSM_ICON_NAMES_H__
+#define __GSM_ICON_NAMES_H__
+
+#define GSM_ICON_COMPUTER_FAIL       "computer-fail"
+#define GSM_ICON_INHIBITOR_DEFAULT   "gnome-windows"
+#define GSM_ICON_LOGOUT              "system-log-out"
+#define GSM_ICON_SHUTDOWN            "system-shutdown"
+#define GSM_ICON_XSMP_DEFAULT        "system-run"
+
+#endif /*__GSM_ICON_NAMES_H__ */
diff --git a/gnome-session/gsm-inhibit-dialog.c b/gnome-session/gsm-inhibit-dialog.c
index 2678caa..1fa08e9 100644
--- a/gnome-session/gsm-inhibit-dialog.c
+++ b/gnome-session/gsm-inhibit-dialog.c
@@ -35,6 +35,7 @@
 #include "gsm-inhibit-dialog.h"
 #include "gsm-store.h"
 #include "gsm-client.h"
+#include "gsm-icon-names.h"
 #include "gsm-inhibitor.h"
 #include "eggdesktopfile.h"
 #include "gsm-util.h"
@@ -594,7 +595,7 @@ add_inhibitor (GsmInhibitDialog *dialog,
 
         if (pixbuf == NULL) {
                 pixbuf = _load_icon (gtk_icon_theme_get_default (),
-                                     "gnome-windows",
+                                     GSM_ICON_INHIBITOR_DEFAULT,
                                      DEFAULT_ICON_SIZE,
                                      DEFAULT_ICON_SIZE,
                                      DEFAULT_ICON_SIZE,
@@ -1097,7 +1098,7 @@ gsm_inhibit_dialog_init (GsmInhibitDialog *dialog)
         gtk_container_add (GTK_CONTAINER (content_area), widget);
 
         gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
-        gtk_window_set_icon_name (GTK_WINDOW (dialog), "system-log-out");
+        gtk_window_set_icon_name (GTK_WINDOW (dialog), GSM_ICON_LOGOUT);
         gtk_window_set_title (GTK_WINDOW (dialog), "");
         g_object_set (dialog,
                       "resizable", FALSE,
diff --git a/gnome-session/gsm-logout-dialog.c b/gnome-session/gsm-logout-dialog.c
index 7ecfdae..8def606 100644
--- a/gnome-session/gsm-logout-dialog.c
+++ b/gnome-session/gsm-logout-dialog.c
@@ -31,6 +31,7 @@
 
 #include "gsm-logout-dialog.h"
 #include "gsm-consolekit.h"
+#include "gsm-icon-names.h"
 #include "gdm.h"
 
 #define GSM_LOGOUT_DIALOG_GET_PRIVATE(o)                                \
@@ -39,9 +40,6 @@
 /* Shared with gsm-fail-whale-dialog.c */
 #define AUTOMATIC_ACTION_TIMEOUT 60
 
-#define GSM_ICON_LOGOUT   "system-log-out"
-#define GSM_ICON_SHUTDOWN "system-shutdown"
-
 typedef enum {
         GSM_DIALOG_LOGOUT_TYPE_LOGOUT,
         GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index 454c501..6abe04a 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -60,6 +60,7 @@
 #include "gdm.h"
 #include "gsm-logout-dialog.h"
 #include "gsm-fail-whale-dialog.h"
+#include "gsm-icon-names.h"
 #include "gsm-inhibit-dialog.h"
 #include "gsm-consolekit.h"
 #include "gsm-session-save.h"
@@ -1303,9 +1304,9 @@ show_fallback_dialog (const char *title,
                                          GTK_BUTTONS_CLOSE,
                                          title);
 
-        gtk_window_set_icon_name (GTK_WINDOW (dialog), "computer-fail");
+        gtk_window_set_icon_name (GTK_WINDOW (dialog), GSM_ICON_COMPUTER_FAIL);
 
-        image = gtk_image_new_from_icon_name ("computer-fail",
+        image = gtk_image_new_from_icon_name (GSM_ICON_COMPUTER_FAIL,
                                               gsm_util_get_computer_fail_icon_size ());
         gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (dialog), image);
 
diff --git a/gnome-session/gsm-xsmp-client.c b/gnome-session/gsm-xsmp-client.c
index 0c44855..341f0ab 100644
--- a/gnome-session/gsm-xsmp-client.c
+++ b/gnome-session/gsm-xsmp-client.c
@@ -36,6 +36,7 @@
 
 #include "gsm-util.h"
 #include "gsm-autostart-app.h"
+#include "gsm-icon-names.h"
 #include "gsm-manager.h"
 
 #define GsmDesktopFile "_GSM_DesktopFile"
@@ -562,7 +563,7 @@ set_desktop_file_keys_from_client (GsmClient *client,
         g_key_file_set_string (keyfile,
                                G_KEY_FILE_DESKTOP_GROUP,
                                G_KEY_FILE_DESKTOP_KEY_ICON,
-                               "system-run");
+                               GSM_ICON_XSMP_DEFAULT);
 
         g_key_file_set_string (keyfile,
                                G_KEY_FILE_DESKTOP_GROUP,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]