* make the header icon hack somewhat work for maemo too
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Sat, 21 Apr 2007 18:26:48 +0000 (18:26 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Sat, 21 Apr 2007 18:26:48 +0000 (18:26 +0000)
pmo-trunk-r1627

src/maemo/modest-icon-names.h
src/maemo/modest-platform.c

index eb059b6..12681e5 100644 (file)
 
 /* modest-tny-icon-names.h */
 
 
 /* modest-tny-icon-names.h */
 
-/*
- * FIXME: this should go the front-end dirs,
- * with specific icons
- */
 
 #ifndef __MODEST_TNY_ICON_NAMES_H__
 #define __MODEST_TNY_ICON_NAMES_H__
 
 #ifndef __MODEST_TNY_ICON_NAMES_H__
 #define __MODEST_TNY_ICON_NAMES_H__
 #define MODEST_HEADER_ICON_DELETED             "qgn_list_messagin_mail_deleted"
 #define MODEST_HEADER_ICON_ATTACH              "qgn_list_gene_attacpap"
 
 #define MODEST_HEADER_ICON_DELETED             "qgn_list_messagin_mail_deleted"
 #define MODEST_HEADER_ICON_ATTACH              "qgn_list_gene_attacpap"
 
-#define MODEST_HEADER_ICON_ATTACH_HIGH_PRIORITY "qgn_list_gene_high_attacpap"
-#define MODEST_HEADER_ICON_ATTACH_LOW_PRIORITY  "qgn_list_gene_low_attacpap"
-#define MODEST_HEADER_ICON_ATTACH_NORM_PRIORITY "qgn_list_gene_norm_attacpap"
+#define MODEST_HEADER_ICON_ATTACH_HIGH_PRIORITY PIXMAP_PREFIX "qgn_list_gene_high_attacpap.png"
+#define MODEST_HEADER_ICON_ATTACH_LOW_PRIORITY  PIXMAP_PREFIX "qgn_list_gene_low_attacpap.png"
+#define MODEST_HEADER_ICON_ATTACH_NORM_PRIORITY PIXMAP_PREFIX "qgn_list_gene_norm_attacpap.png"
 
 
-#define MODEST_HEADER_ICON_HIGH_PRIORITY        "qgn_list_messaging_high_noatt"
-#define MODEST_HEADER_ICON_LOW_PRIORITY         "qgn_list_messaging_low_noatt"
+#define MODEST_HEADER_ICON_HIGH_PRIORITY        PIXMAP_PREFIX "qgn_list_messaging_high_noatt.png"
+#define MODEST_HEADER_ICON_LOW_PRIORITY         PIXMAP_PREFIX "qgn_list_messaging_low_noatt.png"
 
 #define MODEST_FOLDER_ICON_OPEN                        "qgn_list_gene_fldr_opn"
 #define MODEST_FOLDER_ICON_CLOSED              "qgn_list_gene_fldr_cls"
 
 #define MODEST_FOLDER_ICON_OPEN                        "qgn_list_gene_fldr_opn"
 #define MODEST_FOLDER_ICON_CLOSED              "qgn_list_gene_fldr_cls"
index 2753090..0542ff8 100644 (file)
@@ -300,16 +300,26 @@ modest_platform_get_icon (const gchar *name)
 
        g_return_val_if_fail (name, NULL);
 
 
        g_return_val_if_fail (name, NULL);
 
+       if (g_str_has_suffix (name, ".png")) { /*FIXME: hack*/
+               pixbuf = gdk_pixbuf_new_from_file (name, &err);
+               if (!pixbuf) {
+                       g_printerr ("modest: error loading icon '%s': %s\n",
+                                   name, err->message);
+                       g_error_free (err);
+                       return NULL;
+               }
+               return pixbuf;
+       }
+
        current_theme = gtk_icon_theme_get_default ();
        pixbuf = gtk_icon_theme_load_icon (current_theme, name, 26,
                                           GTK_ICON_LOOKUP_NO_SVG,
                                           &err);
        if (!pixbuf) {
        current_theme = gtk_icon_theme_get_default ();
        pixbuf = gtk_icon_theme_load_icon (current_theme, name, 26,
                                           GTK_ICON_LOOKUP_NO_SVG,
                                           &err);
        if (!pixbuf) {
-               g_printerr ("modest: error while loading icon '%s': %s\n",
+               g_printerr ("modest: error loading theme icon '%s': %s\n",
                            name, err->message);
                g_error_free (err);
                            name, err->message);
                g_error_free (err);
-       }
-       
+       } 
        return pixbuf;
 }
 
        return pixbuf;
 }