forked from enlightenment/enlightenment
Move fixed menu entries into modules.
SVN revision: 31139
This commit is contained in:
parent
7815990fd9
commit
3bfec3d628
|
@ -760,30 +760,12 @@ _e_int_menus_virtuals_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
e_desk_show(desk);
|
e_desk_show(desk);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_e_int_menus_background_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
e_configure_registry_call("appearance/wallpaper", m->zone->container, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_int_menus_theme_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
e_configure_registry_call("appearance/theme", m->zone->container, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_int_menus_module_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
|
_e_int_menus_module_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
{
|
{
|
||||||
e_configure_registry_call("extensions/modules", m->zone->container, NULL);
|
e_configure_registry_call("extensions/modules", m->zone->container, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_e_int_menus_shelf_item_cb(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
||||||
{
|
|
||||||
e_configure_registry_call("extensions/shelves", m->zone->container, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_int_menus_config_pre_cb(void *data, E_Menu *m)
|
_e_int_menus_config_pre_cb(void *data, E_Menu *m)
|
||||||
{
|
{
|
||||||
|
@ -800,34 +782,9 @@ _e_int_menus_config_pre_cb(void *data, E_Menu *m)
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/configuration");
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/configuration");
|
||||||
e_menu_item_callback_set(mi, _e_int_menus_config_item_cb, NULL);
|
e_menu_item_callback_set(mi, _e_int_menus_config_item_cb, NULL);
|
||||||
|
|
||||||
l = evas_hash_find(_e_int_menus_augmentation, "config/1");
|
|
||||||
if (l)
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
mi = e_menu_item_new(m);
|
||||||
e_menu_item_separator_set(mi, 1);
|
e_menu_item_separator_set(mi, 1);
|
||||||
|
|
||||||
_e_int_menus_augmentation_add(m, l);
|
|
||||||
}
|
|
||||||
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
|
|
||||||
if (e_configure_registry_exists("appearance/wallpaper"))
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Wallpaper"));
|
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/background");
|
|
||||||
e_menu_item_callback_set(mi, _e_int_menus_background_item_cb, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e_configure_registry_exists("appearance/theme"))
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, _("Theme"));
|
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/themes");
|
|
||||||
e_menu_item_callback_set(mi, _e_int_menus_theme_item_cb, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e_configure_registry_exists("extensions/modules"))
|
if (e_configure_registry_exists("extensions/modules"))
|
||||||
{
|
{
|
||||||
mi = e_menu_item_new(m);
|
mi = e_menu_item_new(m);
|
||||||
|
@ -836,12 +793,10 @@ _e_int_menus_config_pre_cb(void *data, E_Menu *m)
|
||||||
e_menu_item_callback_set(mi, _e_int_menus_module_item_cb, NULL);
|
e_menu_item_callback_set(mi, _e_int_menus_module_item_cb, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e_configure_registry_exists("extensions/shelves"))
|
l = evas_hash_find(_e_int_menus_augmentation, "config/1");
|
||||||
|
if (l)
|
||||||
{
|
{
|
||||||
mi = e_menu_item_new(m);
|
_e_int_menus_augmentation_add(m, l);
|
||||||
e_menu_item_label_set(mi, _("Shelves"));
|
|
||||||
e_util_menu_item_edje_icon_set(mi, "enlightenment/shelf");
|
|
||||||
e_menu_item_callback_set(mi, _e_int_menus_shelf_item_cb, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
l = evas_hash_find(_e_int_menus_augmentation, "config/2");
|
l = evas_hash_find(_e_int_menus_augmentation, "config/2");
|
||||||
|
@ -1515,22 +1470,12 @@ _e_int_menus_augmentation_add(E_Menu *m, Evas_List *augmentation)
|
||||||
{
|
{
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
E_Menu_Item *mi;
|
E_Menu_Item *mi;
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
for (l = augmentation; l; l = l->next)
|
for (l = augmentation; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_Int_Menu_Augmentation *aug;
|
E_Int_Menu_Augmentation *aug;
|
||||||
|
|
||||||
aug = l->data;
|
aug = l->data;
|
||||||
|
|
||||||
if (i)
|
|
||||||
{
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
i++;
|
|
||||||
|
|
||||||
if (aug->add.func)
|
if (aug->add.func)
|
||||||
aug->add.func(aug->add.data, m);
|
aug->add.func(aug->add.data, m);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,12 @@ EAPI int
|
||||||
e_modapi_shutdown(E_Module *m)
|
e_modapi_shutdown(E_Module *m)
|
||||||
{
|
{
|
||||||
E_Config_Dialog *cfd;
|
E_Config_Dialog *cfd;
|
||||||
|
/* remove module-supplied menu additions */
|
||||||
|
if (maug)
|
||||||
|
{
|
||||||
|
e_int_menus_menu_augmentation_del("config/1", maug);
|
||||||
|
maug = NULL;
|
||||||
|
}
|
||||||
while ((cfd = e_config_dialog_get("E", "_config_profiles_dialog"))) e_object_del(E_OBJECT(cfd));
|
while ((cfd = e_config_dialog_get("E", "_config_profiles_dialog"))) e_object_del(E_OBJECT(cfd));
|
||||||
e_configure_registry_item_del("advanced/profiles");
|
e_configure_registry_item_del("advanced/profiles");
|
||||||
e_configure_registry_category_del("advanced");
|
e_configure_registry_category_del("advanced");
|
||||||
|
|
|
@ -8,7 +8,11 @@
|
||||||
/**/
|
/**/
|
||||||
/* actual module specifics */
|
/* actual module specifics */
|
||||||
|
|
||||||
|
static void _e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_mod_menu_add(void *data, E_Menu *m);
|
||||||
|
|
||||||
static E_Module *conf_module = NULL;
|
static E_Module *conf_module = NULL;
|
||||||
|
static E_Int_Menu_Augmentation *maug = NULL;
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
@ -33,6 +37,8 @@ e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
e_configure_registry_category_add("extensions", 90, _("Extensions"), NULL, "enlightenment/extensions");
|
e_configure_registry_category_add("extensions", 90, _("Extensions"), NULL, "enlightenment/extensions");
|
||||||
e_configure_registry_item_add("extensions/shelves", 20, _("Shelves"), NULL, "enlightenment/shelf", e_int_config_shelf);
|
e_configure_registry_item_add("extensions/shelves", 20, _("Shelves"), NULL, "enlightenment/shelf", e_int_config_shelf);
|
||||||
|
maug = e_int_menus_menu_augmentation_add("config/1", _e_mod_menu_add, NULL, NULL, NULL);
|
||||||
|
|
||||||
conf_module = m;
|
conf_module = m;
|
||||||
e_module_delayed_set(m, 1);
|
e_module_delayed_set(m, 1);
|
||||||
return m;
|
return m;
|
||||||
|
@ -42,6 +48,12 @@ EAPI int
|
||||||
e_modapi_shutdown(E_Module *m)
|
e_modapi_shutdown(E_Module *m)
|
||||||
{
|
{
|
||||||
E_Config_Dialog *cfd;
|
E_Config_Dialog *cfd;
|
||||||
|
/* remove module-supplied menu additions */
|
||||||
|
if (maug)
|
||||||
|
{
|
||||||
|
e_int_menus_menu_augmentation_del("config/1", maug);
|
||||||
|
maug = NULL;
|
||||||
|
}
|
||||||
while ((cfd = e_config_dialog_get("E", "_config_shelf_dialog"))) e_object_del(E_OBJECT(cfd));
|
while ((cfd = e_config_dialog_get("E", "_config_shelf_dialog"))) e_object_del(E_OBJECT(cfd));
|
||||||
e_configure_registry_item_del("extensions/shelves");
|
e_configure_registry_item_del("extensions/shelves");
|
||||||
e_configure_registry_category_del("extensions");
|
e_configure_registry_category_del("extensions");
|
||||||
|
@ -63,3 +75,22 @@ e_modapi_about(E_Module *m)
|
||||||
_("Configuration dialog for shelves."));
|
_("Configuration dialog for shelves."));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* menu item callback(s) */
|
||||||
|
static void
|
||||||
|
_e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
e_configure_registry_call("extensions/shelves", m->zone->container, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* menu item add hook */
|
||||||
|
static void
|
||||||
|
_e_mod_menu_add(void *data, E_Menu *m)
|
||||||
|
{
|
||||||
|
E_Menu_Item *mi;
|
||||||
|
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Shelves"));
|
||||||
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/shelf");
|
||||||
|
e_menu_item_callback_set(mi, _e_mod_run_cb, NULL);
|
||||||
|
}
|
||||||
|
|
|
@ -8,7 +8,11 @@
|
||||||
/**/
|
/**/
|
||||||
/* actual module specifics */
|
/* actual module specifics */
|
||||||
|
|
||||||
|
static void _e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_mod_menu_add(void *data, E_Menu *m);
|
||||||
|
|
||||||
static E_Module *conf_module = NULL;
|
static E_Module *conf_module = NULL;
|
||||||
|
static E_Int_Menu_Augmentation *maug = NULL;
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
@ -33,6 +37,8 @@ e_modapi_init(E_Module *m)
|
||||||
{
|
{
|
||||||
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance");
|
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance");
|
||||||
e_configure_registry_item_add("appearance/theme", 20, _("Theme"), NULL, "enlightenment/themes", e_int_config_theme);
|
e_configure_registry_item_add("appearance/theme", 20, _("Theme"), NULL, "enlightenment/themes", e_int_config_theme);
|
||||||
|
maug = e_int_menus_menu_augmentation_add("config/1", _e_mod_menu_add, NULL, NULL, NULL);
|
||||||
|
|
||||||
conf_module = m;
|
conf_module = m;
|
||||||
e_module_delayed_set(m, 1);
|
e_module_delayed_set(m, 1);
|
||||||
return m;
|
return m;
|
||||||
|
@ -42,6 +48,12 @@ EAPI int
|
||||||
e_modapi_shutdown(E_Module *m)
|
e_modapi_shutdown(E_Module *m)
|
||||||
{
|
{
|
||||||
E_Config_Dialog *cfd;
|
E_Config_Dialog *cfd;
|
||||||
|
/* remove module-supplied menu additions */
|
||||||
|
if (maug)
|
||||||
|
{
|
||||||
|
e_int_menus_menu_augmentation_del("config/1", maug);
|
||||||
|
maug = NULL;
|
||||||
|
}
|
||||||
while ((cfd = e_config_dialog_get("E", "_config_theme_dialog"))) e_object_del(E_OBJECT(cfd));
|
while ((cfd = e_config_dialog_get("E", "_config_theme_dialog"))) e_object_del(E_OBJECT(cfd));
|
||||||
e_configure_registry_item_del("appearance/theme");
|
e_configure_registry_item_del("appearance/theme");
|
||||||
e_configure_registry_category_del("appearance");
|
e_configure_registry_category_del("appearance");
|
||||||
|
@ -63,3 +75,22 @@ e_modapi_about(E_Module *m)
|
||||||
_("Configuration dialog for theme."));
|
_("Configuration dialog for theme."));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* menu item callback(s) */
|
||||||
|
static void
|
||||||
|
_e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
e_configure_registry_call("appearance/theme", m->zone->container, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* menu item add hook */
|
||||||
|
static void
|
||||||
|
_e_mod_menu_add(void *data, E_Menu *m)
|
||||||
|
{
|
||||||
|
E_Menu_Item *mi;
|
||||||
|
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Theme"));
|
||||||
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/themes");
|
||||||
|
e_menu_item_callback_set(mi, _e_mod_run_cb, NULL);
|
||||||
|
}
|
||||||
|
|
|
@ -8,7 +8,11 @@
|
||||||
/**/
|
/**/
|
||||||
/* actual module specifics */
|
/* actual module specifics */
|
||||||
|
|
||||||
|
static void _e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
|
static void _e_mod_menu_add(void *data, E_Menu *m);
|
||||||
|
|
||||||
static E_Module *conf_module = NULL;
|
static E_Module *conf_module = NULL;
|
||||||
|
static E_Int_Menu_Augmentation *maug = NULL;
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
@ -35,6 +39,8 @@ e_modapi_init(E_Module *m)
|
||||||
e_configure_registry_item_add("appearance/wallpaper", 10, _("Wallpaper"), NULL, "enlightenment/background", e_int_config_wallpaper);
|
e_configure_registry_item_add("appearance/wallpaper", 10, _("Wallpaper"), NULL, "enlightenment/background", e_int_config_wallpaper);
|
||||||
e_configure_registry_category_add("internal", -1, _("Internal"), NULL, "enlightenment/internal");
|
e_configure_registry_category_add("internal", -1, _("Internal"), NULL, "enlightenment/internal");
|
||||||
e_configure_registry_item_add("internal/wallpaper_desk", -1, _("Wallpaper"), NULL, "enlightenment/windows", e_int_config_wallpaper_desk);
|
e_configure_registry_item_add("internal/wallpaper_desk", -1, _("Wallpaper"), NULL, "enlightenment/windows", e_int_config_wallpaper_desk);
|
||||||
|
maug = e_int_menus_menu_augmentation_add("config/1", _e_mod_menu_add, NULL, NULL, NULL);
|
||||||
|
|
||||||
conf_module = m;
|
conf_module = m;
|
||||||
e_module_delayed_set(m, 1);
|
e_module_delayed_set(m, 1);
|
||||||
return m;
|
return m;
|
||||||
|
@ -44,6 +50,12 @@ EAPI int
|
||||||
e_modapi_shutdown(E_Module *m)
|
e_modapi_shutdown(E_Module *m)
|
||||||
{
|
{
|
||||||
E_Config_Dialog *cfd;
|
E_Config_Dialog *cfd;
|
||||||
|
/* remove module-supplied menu additions */
|
||||||
|
if (maug)
|
||||||
|
{
|
||||||
|
e_int_menus_menu_augmentation_del("config/1", maug);
|
||||||
|
maug = NULL;
|
||||||
|
}
|
||||||
while ((cfd = e_config_dialog_get("E", "_config_wallpaper_dialog"))) e_object_del(E_OBJECT(cfd));
|
while ((cfd = e_config_dialog_get("E", "_config_wallpaper_dialog"))) e_object_del(E_OBJECT(cfd));
|
||||||
e_configure_registry_item_del("internal/wallpaper_desk");
|
e_configure_registry_item_del("internal/wallpaper_desk");
|
||||||
e_configure_registry_category_del("internal");
|
e_configure_registry_category_del("internal");
|
||||||
|
@ -67,3 +79,22 @@ e_modapi_about(E_Module *m)
|
||||||
_("Configuration dialog for wallpaper configuration."));
|
_("Configuration dialog for wallpaper configuration."));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* menu item callback(s) */
|
||||||
|
static void
|
||||||
|
_e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
|
{
|
||||||
|
e_configure_registry_call("appearance/wallpaper", m->zone->container, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* menu item add hook */
|
||||||
|
static void
|
||||||
|
_e_mod_menu_add(void *data, E_Menu *m)
|
||||||
|
{
|
||||||
|
E_Menu_Item *mi;
|
||||||
|
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, _("Wallpaper"));
|
||||||
|
e_util_menu_item_edje_icon_set(mi, "enlightenment/background");
|
||||||
|
e_menu_item_callback_set(mi, _e_mod_run_cb, NULL);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue