forked from enlightenment/enlightenment
only pop a single dialog to notify about all fail themes in theme dialog
popping a million dialogs is super annoying
This commit is contained in:
parent
b078599fdd
commit
35594d43f9
|
@ -28,6 +28,7 @@ struct _E_Config_Dialog_Data
|
||||||
|
|
||||||
/* Dialog */
|
/* Dialog */
|
||||||
Evas_Object *win_import;
|
Evas_Object *win_import;
|
||||||
|
Ecore_Job *theme_check;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -567,12 +568,25 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_open_test_cb(void *file)
|
_open_test_cb(void *data)
|
||||||
{
|
{
|
||||||
if (!edje_file_group_exists(eet_file_get(file), "e/desktop/background"))
|
E_Config_Dialog_Data *cfdata = data;
|
||||||
e_util_dialog_show(_("Theme File Error"),
|
Eina_List *l, *fails = NULL;
|
||||||
_("%s is probably not an E theme!"),
|
Eet_File *file;
|
||||||
eet_file_get(file));
|
Eina_Strbuf *buf;
|
||||||
|
|
||||||
|
cfdata->theme_check = NULL;
|
||||||
|
EINA_LIST_FOREACH(cfdata->themes, l, file)
|
||||||
|
if (!edje_file_group_exists(eet_file_get(file), "e/desktop/background"))
|
||||||
|
fails = eina_list_append(fails, file);
|
||||||
|
if (!fails) return;
|
||||||
|
buf = eina_strbuf_new();
|
||||||
|
EINA_LIST_FREE(fails, file)
|
||||||
|
eina_strbuf_append_printf(buf, "<b>%s</b><ps/>", eet_file_get(file));
|
||||||
|
e_util_dialog_show(_("Theme File Error"),
|
||||||
|
_("The listed files are probably not E themes:<ps/>%s"),
|
||||||
|
eina_strbuf_string_get(buf));
|
||||||
|
eina_strbuf_free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -581,7 +595,8 @@ _open_done_cb(void *data, Eio_File *handler, Eet_File *file)
|
||||||
E_Config_Dialog_Data *cfdata = data;
|
E_Config_Dialog_Data *cfdata = data;
|
||||||
cfdata->themes = eina_list_append(cfdata->themes, file);
|
cfdata->themes = eina_list_append(cfdata->themes, file);
|
||||||
cfdata->theme_init = eina_list_remove(cfdata->theme_init, handler);
|
cfdata->theme_init = eina_list_remove(cfdata->theme_init, handler);
|
||||||
ecore_job_add(_open_test_cb, file);
|
if (!cfdata->theme_init)
|
||||||
|
cfdata->theme_check = ecore_job_add(_open_test_cb, cfdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -652,6 +667,7 @@ _free_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
|
||||||
eio_file_cancel(ls);
|
eio_file_cancel(ls);
|
||||||
EINA_LIST_FREE(cfdata->themes, ef)
|
EINA_LIST_FREE(cfdata->themes, ef)
|
||||||
eet_close(ef);
|
eet_close(ef);
|
||||||
|
E_FREE_FUNC(cfdata->theme_check, ecore_job_del);
|
||||||
if (cfdata->eio[0] || cfdata->eio[1] || cfdata->themes || cfdata->theme_init)
|
if (cfdata->eio[0] || cfdata->eio[1] || cfdata->themes || cfdata->theme_init)
|
||||||
cfdata->free = EINA_TRUE;
|
cfdata->free = EINA_TRUE;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue