diff options
author | Christopher Michael <cpmichael1@comcast.net> | 2009-12-03 03:41:24 +0000 |
---|---|---|
committer | Christopher Michael <cpmichael1@comcast.net> | 2009-12-03 03:41:24 +0000 |
commit | 4042dda53ac0d26f78fd83c0d0a4dae9a8e6bcb8 (patch) | |
tree | a18eb1060bbdaae1f1e57768c01f7095e7f729b2 /src/modules/conf_theme | |
parent | 61c451f0112937b151f9ec1ea6f54ed2d2212a47 (diff) | |
download | enlightenment-4042dda53ac0d26f78fd83c0d0a4dae9a8e6bcb8.tar.gz |
Use proper config dialog window class, so that when the module gets
unloaded, any existing dialogs are killed. This stops a crash that was
happening if the module was unloaded while the dialog was shown.
SVN revision: 44153
Diffstat (limited to 'src/modules/conf_theme')
-rw-r--r-- | src/modules/conf_theme/e_int_config_theme.c | 98 | ||||
-rw-r--r-- | src/modules/conf_theme/e_mod_main.c | 36 |
2 files changed, 66 insertions, 68 deletions
diff --git a/src/modules/conf_theme/e_int_config_theme.c b/src/modules/conf_theme/e_int_config_theme.c index 10bd54c5e1..06670019e5 100644 --- a/src/modules/conf_theme/e_int_config_theme.c +++ b/src/modules/conf_theme/e_int_config_theme.c @@ -6,14 +6,14 @@ #include "e_int_config_theme_import.h" #include "e_int_config_theme_web.h" -static void *_create_data (E_Config_Dialog *cfd); -static void _free_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); -static void _fill_data (E_Config_Dialog_Data *cfdata); -static int _basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); -static Evas_Object *_basic_create_widgets (E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); -static int _advanced_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); -static Evas_Object *_advanced_create_widgets (E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); -static Eina_List *_get_theme_categories_list (void); +static void *_create_data(E_Config_Dialog *cfd); +static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); +static void _fill_data(E_Config_Dialog_Data *cfdata); +static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); +static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); +static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); +static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); +static Eina_List *_get_theme_categories_list(void); struct _E_Config_Dialog_Data { @@ -31,43 +31,44 @@ struct _E_Config_Dialog_Data /* Advanced */ Evas_Object *o_categories_ilist; Evas_Object *o_files_ilist; - int personal_file_count; - Eina_List *theme_list; - Eina_List *parts_list; + int personal_file_count; + Eina_List *theme_list; + Eina_List *parts_list; /* Dialog */ - E_Win *win_import; + E_Win *win_import; E_Dialog *dia_web; }; -static const char *parts_list[] = { - "about:e/widgets/about/main", - "borders:e/widgets/border/default/border", - "background:e/desktop/background", - "configure:e/widgets/configure/main", - "dialog:e/widgets/dialog/main", - "dnd:ZZZ", - "error:e/error/main", - "exebuf:e/widgets/exebuf/main", - "fileman:ZZZ", - "gadman:e/gadman/control", - "icons:ZZZ", - "menus:ZZZ", - "modules:ZZZ", - "modules/pager:e/widgets/pager/popup", - "modules/ibar:ZZZ", - "modules/ibox:ZZZ", - "modules/clock:e/modules/clock/main", - "modules/battery:e/modules/battery/main", - "modules/cpufreq:e/modules/cpufreq/main", - "modules/start:e/modules/start/main", - "modules/temperature:e/modules/temperature/main", - "pointer:e/pointer", - "shelf:e/shelf/default/base", - "transitions:ZZZ", - "widgets:ZZZ", - "winlist:e/widgets/winlist/main", - NULL +static const char *parts_list[] = +{ + "about:e/widgets/about/main", + "borders:e/widgets/border/default/border", + "background:e/desktop/background", + "configure:e/widgets/configure/main", + "dialog:e/widgets/dialog/main", + "dnd:ZZZ", + "error:e/error/main", + "exebuf:e/widgets/exebuf/main", + "fileman:ZZZ", + "gadman:e/gadman/control", + "icons:ZZZ", + "menus:ZZZ", + "modules:ZZZ", + "modules/pager:e/widgets/pager/popup", + "modules/ibar:ZZZ", + "modules/ibox:ZZZ", + "modules/clock:e/modules/clock/main", + "modules/battery:e/modules/battery/main", + "modules/cpufreq:e/modules/cpufreq/main", + "modules/start:e/modules/start/main", + "modules/temperature:e/modules/temperature/main", + "pointer:e/pointer", + "shelf:e/shelf/default/base", + "transitions:ZZZ", + "widgets:ZZZ", + "winlist:e/widgets/winlist/main", + NULL }; EAPI E_Config_Dialog * @@ -76,19 +77,19 @@ e_int_config_theme(E_Container *con, const char *params __UNUSED__) E_Config_Dialog *cfd; E_Config_Dialog_View *v; - if (e_config_dialog_find("E", "appearance/theme")) return NULL; + if (e_config_dialog_find("E", "_config_theme_dialog")) return NULL; v = E_NEW(E_Config_Dialog_View, 1); - v->create_cfdata = _create_data; - v->free_cfdata = _free_data; - v->basic.apply_cfdata = _basic_apply_data; - v->basic.create_widgets = _basic_create_widgets; - v->advanced.apply_cfdata = _advanced_apply_data; + v->create_cfdata = _create_data; + v->free_cfdata = _free_data; + v->basic.apply_cfdata = _basic_apply_data; + v->basic.create_widgets = _basic_create_widgets; + v->advanced.apply_cfdata = _advanced_apply_data; v->advanced.create_widgets = _advanced_create_widgets; v->override_auto_apply = 1; cfd = e_config_dialog_new(con, _("Theme Selector"), - "E", "appearance/theme", + "E", "_config_theme_dialog", "preferences-desktop-theme", 0, v, NULL); return cfd; } @@ -130,7 +131,8 @@ e_int_config_theme_update(E_Config_Dialog *dia, char *file) e_widget_flist_path_set(cfdata->o_fm, path, "/"); if (cfdata->o_preview) - e_widget_preview_edje_set(cfdata->o_preview, cfdata->theme, "e/desktop/background"); + e_widget_preview_edje_set(cfdata->o_preview, cfdata->theme, + "e/desktop/background"); if (cfdata->o_fm) e_widget_change(cfdata->o_fm); } diff --git a/src/modules/conf_theme/e_mod_main.c b/src/modules/conf_theme/e_mod_main.c index 1e9018c92f..292bb4e65f 100644 --- a/src/modules/conf_theme/e_mod_main.c +++ b/src/modules/conf_theme/e_mod_main.c @@ -4,27 +4,13 @@ #include "e.h" #include "e_mod_main.h" -/***************************************************************************/ -/**/ /* 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 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_Int_Menu_Augmentation *maug = NULL; -/**/ -/***************************************************************************/ - -/***************************************************************************/ -/**/ - -/**/ -/***************************************************************************/ - -/***************************************************************************/ -/**/ /* module setup */ EAPI E_Module_Api e_modapi = { @@ -35,9 +21,15 @@ EAPI E_Module_Api e_modapi = EAPI void * e_modapi_init(E_Module *m) { - e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "preferences-appearance"); - e_configure_registry_item_add("appearance/theme", 20, _("Theme"), NULL, "preferences-desktop-theme", e_int_config_theme); - maug = e_int_menus_menu_augmentation_add_sorted("config/1", _("Theme"), _e_mod_menu_add, NULL, NULL, NULL); + e_configure_registry_category_add("appearance", 10, _("Look"), NULL, + "preferences-appearance"); + e_configure_registry_item_add("appearance/theme", 20, _("Theme"), NULL, + "preferences-desktop-theme", + e_int_config_theme); + + maug = + e_int_menus_menu_augmentation_add_sorted("config/1", _("Theme"), + _e_mod_menu_add, NULL, NULL, NULL); conf_module = m; e_module_delayed_set(m, 1); @@ -48,13 +40,17 @@ EAPI int e_modapi_shutdown(E_Module *m) { 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_category_del("appearance"); conf_module = NULL; |