}
}
}
+/*******************************************************************************/
+gint
+get_count_themes_from_config(gchar *theme_name){
+ GConfClient *gconf_client;
+ gint i, count;
+ gchar *str, *value;
+
+ gconf_client = gconf_client_get_default();
+ if (!gconf_client) {
+ fprintf(stderr, _("Failed to initialize GConf. Quitting.\n"));
+ return FALSE;
+ }
+ /* get count such themes */
+ count = 0;
+ for (i=1; i<=9; i++){
+ str = g_strdup_printf("%s%i", GCONF_KEY_THEME, i);
+ value = gconf_client_get_string(gconf_client, str, NULL);
+ if (str){
+ g_free(str);
+ str = NULL;
+ }
+ if (value && !strcmp(value, theme_name)){
+ count++;
+ }
+
+ }
+ //fprintf(stderr, "get count_theme from config = %d\n", count);
+ return count;
+}
+
g_free(text);
}
/*******************************************************************************/
+void
+show_duplicate_theme (GtkWidget *widget, gchar *theme_name){
+ gchar *text;
+ text = g_strdup_printf(_("Theme %s has already been selected"), theme_name);
+ hildon_banner_show_information(GTK_WIDGET(widget), NULL, text);
+ g_free(text);
+}
+
+/*******************************************************************************/
void
lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
gint result;
GtkWidget *button1 = NULL;
GtkWidget *rich_animation_button = NULL;
gint view = priv->view;
+ gint count;
window = gtk_dialog_new();
priv->window = window;
GSList *store = priv->extheme_list;
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"));
+ gchar *copies = g_hash_table_lookup(store->data, "copies");
+ //fprintf(stderr, "copies = %s\n", copies);
+ if (copies){
+ count = atoi(copies);
+ }else count = 10;
+ if (count > get_count_themes_from_config(g_hash_table_lookup(store->data, "name")))
+ priv->theme = g_strdup(g_hash_table_lookup(store->data, "name"));
+ else
+ show_duplicate_theme(button, g_hash_table_lookup(store->data, "name"));
//priv->hash_theme = store->data;
break;
}
void additional_parametr_for_theme_video(GtkWidget *vbox, Animation_WallpaperPrivate *priv);
GSList * get_list_exthemes(void);
void show_problem_package (GtkWidget *widget, gchar *package_name);
+void show_duplicate_theme (GtkWidget *widget, gchar *theme_name);
void changed_value_one_in_all_cb (GtkWidget *toggle, Animation_WallpaperPrivate *priv);
void save_one_in_all_views_to_config(gboolean one_in_all_views);
gboolean cb_timeout_settings(GtkWidget *window);