Places: create/destroy the e menu augmentation on config apply (no more e restart required to apply the config)
SVN revision: 74457
This commit is contained in:
parent
3566436355
commit
1074da1961
|
@ -196,5 +196,6 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
|
|
||||||
e_config_save_queue();
|
e_config_save_queue();
|
||||||
places_update_all_gadgets();
|
places_update_all_gadgets();
|
||||||
|
places_menu_augmentation();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ static void _places_cb_menu_configure(void *data, E_Menu *mn, E_Menu_Item *mi);
|
||||||
/* Local Variables */
|
/* Local Variables */
|
||||||
static E_Config_DD *conf_edd = NULL;
|
static E_Config_DD *conf_edd = NULL;
|
||||||
static E_Config_DD *conf_item_edd = NULL;
|
static E_Config_DD *conf_item_edd = NULL;
|
||||||
|
static E_Int_Menu_Augmentation *maug = NULL;
|
||||||
Eina_List *instances = NULL;
|
Eina_List *instances = NULL;
|
||||||
Config *places_conf = NULL;
|
Config *places_conf = NULL;
|
||||||
extern Eina_List *volumes;
|
extern Eina_List *volumes;
|
||||||
|
@ -137,18 +138,11 @@ e_modapi_init(E_Module *m)
|
||||||
e_gadcon_provider_register(&_gc_class);
|
e_gadcon_provider_register(&_gc_class);
|
||||||
places_init();
|
places_init();
|
||||||
|
|
||||||
if (places_conf->show_menu)
|
places_menu_augmentation();
|
||||||
{
|
|
||||||
E_Int_Menu_Augmentation *maug;
|
|
||||||
maug = e_int_menus_menu_augmentation_add("main/1",
|
|
||||||
places_augmentation,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
e_modapi_shutdown(E_Module *m)
|
e_modapi_shutdown(E_Module *m)
|
||||||
{
|
{
|
||||||
|
@ -161,6 +155,13 @@ e_modapi_shutdown(E_Module *m)
|
||||||
if (places_conf->cfd) e_object_del(E_OBJECT(places_conf->cfd));
|
if (places_conf->cfd) e_object_del(E_OBJECT(places_conf->cfd));
|
||||||
places_conf->cfd = NULL;
|
places_conf->cfd = NULL;
|
||||||
|
|
||||||
|
/* Remove the main menu item */
|
||||||
|
if (maug)
|
||||||
|
{
|
||||||
|
e_int_menus_menu_augmentation_del("main/1", maug);
|
||||||
|
maug = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Tell E the module is now unloaded. Gets removed from shelves, etc. */
|
/* Tell E the module is now unloaded. Gets removed from shelves, etc. */
|
||||||
places_conf->module = NULL;
|
places_conf->module = NULL;
|
||||||
e_gadcon_provider_unregister(&_gc_class);
|
e_gadcon_provider_unregister(&_gc_class);
|
||||||
|
@ -179,6 +180,19 @@ e_modapi_save(E_Module *m)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
places_menu_augmentation(void)
|
||||||
|
{
|
||||||
|
if (places_conf->show_menu && (!maug))
|
||||||
|
maug = e_int_menus_menu_augmentation_add("main/1", places_augmentation,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
else if ((!places_conf->show_menu) && maug)
|
||||||
|
{
|
||||||
|
e_int_menus_menu_augmentation_del("main/1", maug);
|
||||||
|
maug = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Gadcon Functions */
|
/* Gadcon Functions */
|
||||||
static E_Gadcon_Client *
|
static E_Gadcon_Client *
|
||||||
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||||
|
|
|
@ -65,6 +65,7 @@ EAPI int e_modapi_shutdown(E_Module *m);
|
||||||
EAPI int e_modapi_save(E_Module *m);
|
EAPI int e_modapi_save(E_Module *m);
|
||||||
|
|
||||||
E_Config_Dialog *e_int_config_places_module(E_Container *con, const char *params);
|
E_Config_Dialog *e_int_config_places_module(E_Container *con, const char *params);
|
||||||
|
void places_menu_augmentation(void);
|
||||||
|
|
||||||
extern Config *places_conf;
|
extern Config *places_conf;
|
||||||
extern Eina_List *instances;
|
extern Eina_List *instances;
|
||||||
|
|
Loading…
Reference in New Issue