// child =
//}
if (node->type == XML_ELEMENT_NODE){
- fprintf(stderr, "%s => %s\n", node->name, xmlNodeGetContent(node));
+ //fprintf(stderr, "%s => %s\n", node->name, xmlNodeGetContent(node));
g_hash_table_insert(hash, g_strdup(node->name), g_strdup(xmlNodeGetContent(node)));
}
}
if(!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
continue;
+ /* TO DO read only *.xml files */
if(dp->d_type == DT_REG || dp->d_type == DT_LNK){
store = g_slist_append(store, parse_theme(g_strdup_printf("%s%s", EXTHEME_PATH, dp->d_name)));
}
}
/********************************************************************************/
void
-set_button_image(GtkWidget * button, gchar *theme, gboolean enable){
+set_button_image(GtkWidget * button, Animation_WallpaperPrivate *priv, gboolean enable){
GtkWidget * image = NULL;
GdkPixbuf * pixbuf = NULL;
gchar *str = NULL;
- if (enable)
- str = g_strdup_printf( "%s/%s/%s", THEME_PATH,
- theme, "icon.png");
- else
- str = g_strdup_printf( "%s/%s/%s", THEME_PATH,
- theme, "icond.png");
+ gchar *icon_on = NULL;
+ gchar *icon_off = NULL;
+ GSList *store = priv->extheme_list;
+ while (store){
+ if (!strcmp(priv->theme, g_hash_table_lookup(store->data, "name"))){
+ icon_on = g_strdup(g_hash_table_lookup(store->data, "icon_on"));
+ icon_off = g_strdup(g_hash_table_lookup(store->data, "icon_off"));
+ break;
+ }
+ store = g_list_next(store);
+ }
+ if (enable){
+ if (icon_on)
+ str = g_strdup_printf("%s", icon_on);
+ else
+ str = g_strdup_printf( "%s/%s/%s", THEME_PATH,
+ priv->theme, "icon.png");
+ }else {
+ if (icon_off)
+ str = g_strdup_printf("%s", icon_off);
+ else
+ str = g_strdup_printf( "%s/%s/%s", THEME_PATH,
+ priv->theme, "icond.png");
+ }
+ fprintf(stderr, "icon = %s\n", str);
pixbuf = gdk_pixbuf_new_from_file_at_size (str,
- 100,
- 60,
- NULL);
+ 100,
+ 60,
+ NULL);
if (str)
g_free(str);
+ if (icon_on)
+ g_free(icon_on);
+ if (icon_off)
+ g_free(icon_off);
if (pixbuf){
image = gtk_image_new_from_pixbuf (pixbuf);
g_object_unref(G_OBJECT(pixbuf));
HILDON_BUTTON_ARRANGEMENT_VERTICAL);
g_object_set_data(G_OBJECT(button), "view", GINT_TO_POINTER(view));
g_object_set_data(G_OBJECT(button), "priv", priv);
- set_button_image(button, priv->theme, check_applet_state(view));
+ set_button_image(button, priv, check_applet_state(view));
g_signal_connect(button, "clicked", G_CALLBACK(theme_button_clicked), priv);
hildon_button_set_image_position (HILDON_BUTTON (button), GTK_POS_RIGHT);
return button;
while (store){
if (!strcmp(hildon_button_get_value(HILDON_BUTTON (theme_button)), _(g_hash_table_lookup(store->data, "name")))){
priv->theme = g_strdup(g_hash_table_lookup(store->data, "name"));
+ //priv->hash_theme = store->data;
break;
}
store = g_slist_next(store);
if (check_applet_state(view))
stop_applet(view);
- set_button_image(button, priv->theme, check_applet_state(view));
+ set_button_image(button, priv, check_applet_state(view));
break;
default:
case GTK_RESPONSE_OK: