forked from enlightenment/efl
1. need calls return runtime failure if elm doesnt have the feature.
2. elm config dont use desktops if no efreet. SVN revision: 53945
This commit is contained in:
parent
5074503bba
commit
ef82b1451c
|
@ -684,13 +684,15 @@ static void
|
|||
_profiles_list_selected_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
|
||||
{
|
||||
const char *cur_profile = NULL;
|
||||
Efreet_Desktop *desk = NULL;
|
||||
char *pdir, buf[PATH_MAX];
|
||||
const char *sel_profile;
|
||||
Eina_Bool cur_selected;
|
||||
const char *prof_name;
|
||||
Evas_Object *en;
|
||||
|
||||
#ifdef ELM_EFREET
|
||||
Efreet_Desktop *desk = NULL;
|
||||
#endif
|
||||
|
||||
sel_profile = data;
|
||||
if (!sel_profile)
|
||||
return;
|
||||
|
@ -708,12 +710,12 @@ _profiles_list_selected_cb(void *data, Evas_Object *obj, void *event_info __UNUS
|
|||
/* other than curr *\/ */
|
||||
|
||||
pdir = elm_profile_dir_get(sel_profile);
|
||||
#ifdef ELM_EFREET
|
||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
|
||||
desk = efreet_desktop_new(buf);
|
||||
|
||||
if ((desk) && (desk->name))
|
||||
prof_name = desk->name;
|
||||
if ((desk) && (desk->name)) prof_name = desk->name;
|
||||
else
|
||||
#endif
|
||||
prof_name = cur_profile;
|
||||
|
||||
snprintf(buf, sizeof(buf), "<hilight>Selected profile: %s</><br>",
|
||||
|
@ -721,13 +723,15 @@ _profiles_list_selected_cb(void *data, Evas_Object *obj, void *event_info __UNUS
|
|||
elm_label_label_set(evas_object_data_get(obj, "prof_name_lbl"), buf);
|
||||
|
||||
en = evas_object_data_get(obj, "prof_desc_entry");
|
||||
if (desk)
|
||||
elm_scrolled_entry_entry_set(en, desk->comment);
|
||||
#ifdef ELM_EFREET
|
||||
if (desk) elm_scrolled_entry_entry_set(en, desk->comment);
|
||||
else
|
||||
#endif
|
||||
elm_scrolled_entry_entry_set(en, "Unknown");
|
||||
|
||||
if (desk)
|
||||
efreet_desktop_free(desk);
|
||||
#ifdef ELM_EFREET
|
||||
if (desk) efreet_desktop_free(desk);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -742,41 +746,40 @@ _profiles_list_fill(Evas_Object *l_widget, Eina_List *p_names)
|
|||
return;
|
||||
|
||||
elm_list_clear(l_widget);
|
||||
efreet_init();
|
||||
|
||||
cur_profile = elm_profile_get();
|
||||
|
||||
EINA_LIST_FOREACH(p_names, l, profile)
|
||||
{
|
||||
Efreet_Desktop *desk = NULL;
|
||||
char buf[PATH_MAX], *pdir;
|
||||
const char *label, *ext;
|
||||
Evas_Object *ic;
|
||||
Elm_List_Item *it;
|
||||
|
||||
#ifdef ELM_EFREET
|
||||
Efreet_Desktop *desk = NULL;
|
||||
#endif
|
||||
|
||||
pdir = elm_profile_dir_get(profile);
|
||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
|
||||
|
||||
desk = efreet_desktop_new(buf);
|
||||
label = profile;
|
||||
|
||||
if ((desk) && (desk->name))
|
||||
label = desk->name;
|
||||
|
||||
|
||||
#ifdef ELM_EFREET
|
||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
|
||||
desk = efreet_desktop_new(buf);
|
||||
if ((desk) && (desk->name)) label = desk->name;
|
||||
#endif
|
||||
|
||||
buf[0] = 0;
|
||||
if (pdir)
|
||||
snprintf(buf, sizeof(buf), "%s/icon.edj", pdir);
|
||||
if (pdir) snprintf(buf, sizeof(buf), "%s/icon.edj", pdir);
|
||||
#ifdef ELM_EFREET
|
||||
if ((desk) && (desk->icon) && (pdir))
|
||||
snprintf(buf, sizeof(buf), "%s/%s", pdir, desk->icon);
|
||||
#endif
|
||||
ic = elm_icon_add(l_widget);
|
||||
|
||||
ext = strrchr(buf, '.');
|
||||
if (ext)
|
||||
{
|
||||
if (!strcmp(ext, ".edj"))
|
||||
elm_icon_file_set(ic, buf, "icon");
|
||||
else
|
||||
elm_icon_file_set(ic, buf, NULL);
|
||||
if (!strcmp(ext, ".edj")) elm_icon_file_set(ic, buf, "icon");
|
||||
else elm_icon_file_set(ic, buf, NULL);
|
||||
}
|
||||
|
||||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL,
|
||||
|
@ -792,14 +795,12 @@ _profiles_list_fill(Evas_Object *l_widget, Eina_List *p_names)
|
|||
if (pdir)
|
||||
free(pdir);
|
||||
|
||||
if (desk)
|
||||
efreet_desktop_free(desk);
|
||||
#ifdef ELM_EFREET
|
||||
if (desk) efreet_desktop_free(desk);
|
||||
#endif
|
||||
}
|
||||
|
||||
efreet_shutdown();
|
||||
|
||||
if (sel_it)
|
||||
elm_list_item_selected_set(sel_it, EINA_TRUE);
|
||||
if (sel_it) elm_list_item_selected_set(sel_it, EINA_TRUE);
|
||||
elm_list_go(l_widget);
|
||||
}
|
||||
|
||||
|
@ -1072,6 +1073,9 @@ elm_main(int argc, char **argv)
|
|||
/* put here any init code specific to this app like parsing args, etc. */
|
||||
if (!quiet)
|
||||
{
|
||||
#ifdef ELM_EFREET
|
||||
elm_need_efreet();
|
||||
#endif
|
||||
status_win(); /* create main window */
|
||||
if (!interactive)
|
||||
ecore_timer_add(2.0, _exit_timer, NULL);
|
||||
|
|
|
@ -108,16 +108,18 @@ test_icon_desktops(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve
|
|||
evas_object_show(gl);
|
||||
|
||||
#ifdef ELM_EFREET
|
||||
elm_need_efreet();
|
||||
desktops = efreet_util_desktop_name_glob_list("*");
|
||||
if (desktops)
|
||||
if (elm_need_efreet())
|
||||
{
|
||||
Efreet_Desktop *d;
|
||||
|
||||
EINA_LIST_FREE(desktops, d)
|
||||
elm_genlist_item_append(gl, &it_desk, d,
|
||||
NULL, ELM_GENLIST_ITEM_NONE,
|
||||
desktop_sel, NULL);
|
||||
desktops = efreet_util_desktop_name_glob_list("*");
|
||||
if (desktops)
|
||||
{
|
||||
Efreet_Desktop *d;
|
||||
|
||||
EINA_LIST_FREE(desktops, d)
|
||||
elm_genlist_item_append(gl, &it_desk, d,
|
||||
NULL, ELM_GENLIST_ITEM_NONE,
|
||||
desktop_sel, NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -308,9 +308,9 @@ extern "C" {
|
|||
EAPI int elm_quicklaunch_fallback(int argc, char **argv);
|
||||
EAPI char *elm_quicklaunch_exe_path_get(const char *exe);
|
||||
|
||||
EAPI void elm_need_efreet(void);
|
||||
EAPI void elm_need_e_dbus(void);
|
||||
EAPI void elm_need_ethumb(void);
|
||||
EAPI Eina_Bool elm_need_efreet(void);
|
||||
EAPI Eina_Bool elm_need_e_dbus(void);
|
||||
EAPI Eina_Bool elm_need_ethumb(void);
|
||||
|
||||
EAPI Eina_Bool elm_policy_set(unsigned int policy, int value);
|
||||
EAPI int elm_policy_get(unsigned int policy);
|
||||
|
|
|
@ -363,13 +363,16 @@ elm_shutdown(void)
|
|||
#ifdef ELM_EDBUS
|
||||
static int _elm_need_e_dbus = 0;
|
||||
#endif
|
||||
EAPI void
|
||||
EAPI Eina_Bool
|
||||
elm_need_e_dbus(void)
|
||||
{
|
||||
#ifdef ELM_EDBUS
|
||||
if (_elm_need_e_dbus++) return;
|
||||
if (_elm_need_e_dbus++) return EINA_TRUE;
|
||||
e_dbus_init();
|
||||
e_hal_init();
|
||||
return EINA_TRUE;
|
||||
#else
|
||||
return EINA_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -388,11 +391,11 @@ _elm_unneed_e_dbus(void)
|
|||
#ifdef ELM_EFREET
|
||||
static int _elm_need_efreet = 0;
|
||||
#endif
|
||||
EAPI void
|
||||
EAPI Eina_Bool
|
||||
elm_need_efreet(void)
|
||||
{
|
||||
#ifdef ELM_EFREET
|
||||
if (_elm_need_efreet++) return;
|
||||
if (_elm_need_efreet++) return EINA_TRUE;
|
||||
efreet_init();
|
||||
efreet_mime_init();
|
||||
efreet_trash_init();
|
||||
|
@ -410,6 +413,9 @@ elm_need_efreet(void)
|
|||
}
|
||||
}
|
||||
*/
|
||||
return EINA_TRUE;
|
||||
#else
|
||||
return EINA_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -392,14 +392,17 @@ _elm_thumb_dropcb(void *data __UNUSED__, Evas_Object *o, Elm_Selection_Data *dro
|
|||
*
|
||||
* @ingroup Thumb
|
||||
*/
|
||||
EAPI void
|
||||
EAPI Eina_Bool
|
||||
elm_need_ethumb(void)
|
||||
{
|
||||
#ifdef ELM_ETHUMB
|
||||
if (_elm_need_ethumb++) return;
|
||||
if (_elm_need_ethumb++) return EINA_TRUE;
|
||||
ELM_ECORE_EVENT_ETHUMB_CONNECT = ecore_event_type_new();
|
||||
ethumb_client_init();
|
||||
_elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL, NULL);
|
||||
return EINA_TRUE;
|
||||
#else
|
||||
return EINA_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue