Enlightenment CVS committal Author : onefang Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_int_config_apps.c e_int_config_apps.h e_int_config_startup.c Log Message: *Make the apps config dialog even more generic. *Use it from the startup config dialog. I'm too tired for aesthetics, someone please make the startup config dialog look pretty again. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_apps.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -3 -r1.43 -r1.44 --- e_int_config_apps.c 14 Nov 2006 21:44:34 -0000 1.43 +++ e_int_config_apps.c 16 Nov 2006 00:08:29 -0000 1.44 @@ -46,14 +46,16 @@ struct _E_Config_Once { + const char *title; const char *label; + const char *path; int (*func) (void *data, const char *path); void *data; }; EAPI E_Config_Dialog * -e_int_config_apps_once(E_Container *con, const char *label, int (*func) (void *data, const char *path), void *data) +e_int_config_apps_once(E_Container *con, const char *title, const char *label, const char *path, int (*func) (void *data, const char *path), void *data) { E_Config_Dialog *cfd; E_Config_Dialog_View *v; @@ -65,12 +67,14 @@ v->free_cfdata = _free_data; v->basic.create_widgets = _basic_create_widgets; - if (func) + if ((path) || (func)) { once = E_NEW(struct _E_Config_Once, 1); if (once) { + once->title = title; once->label = label; + once->path = path; once->func = func; once->data = data; } @@ -87,7 +91,7 @@ e_int_config_apps(E_Container *con) { if (e_config_dialog_find("E", "_config_applications_dialog")) return NULL; - return e_int_config_apps_once(con, NULL, NULL, NULL); + return e_int_config_apps_once(con, NULL, NULL, NULL, NULL, NULL); } static void @@ -429,6 +433,7 @@ E_Fm2_Icon_Info *ici; const char *realpath; char buf[4096]; + int do_it = 1; cfdata = data1; if (!cfdata->gui.o_fm_all) return; @@ -454,9 +459,13 @@ struct _E_Config_Once *once = NULL; once = cfdata->cfd->data; - once->func(once->data, buf); + if (once->func) + { + once->func(once->data, buf); + do_it = 0; + } } - else + if (do_it) { if (!cfdata->gui.o_fm) return; @@ -648,7 +657,7 @@ e_widget_framelist_object_append(of, mt); mt = NULL; - if (once) + if ((once) && (once->label)) mt = e_widget_button_add(evas, _(once->label), "enlightenment/e", _cb_button_add, cfdata, NULL); /* @@ -671,9 +680,12 @@ e_widget_table_object_append(ot, of, 0, 0, 2, 4, 1, 1, 1, 1); - if (!once) + if ((!once) || (once->path)) { - of = e_widget_framelist_add(evas, _("Bars, Menus, etc."), 0); + if ((once) && (once->title)) + of = e_widget_framelist_add(evas, once->title, 0); + else + of = e_widget_framelist_add(evas, _("Bars, Menus, etc."), 0); mt = e_widget_button_add(evas, _("Go up a Directory"), "widget/up_dir", _cb_button_up, cfdata, NULL); @@ -712,7 +724,10 @@ evas_object_smart_callback_add(mt, "changed", _cb_files_changed, cfdata); e_fm2_icon_menu_start_extend_callback_set(mt, _cb_files_add_edited, cfdata); - e_fm2_path_set(cfdata->gui.o_fm, cfdata->path, "/"); + if ((once) && (once->path)) + e_fm2_path_set(cfdata->gui.o_fm, once->path, "/"); + else + e_fm2_path_set(cfdata->gui.o_fm, cfdata->path, "/"); e_fm2_window_object_set(cfdata->gui.o_fm, E_OBJECT(cfd->dia->win)); ob = e_widget_scrollframe_pan_add(evas, mt, @@ -743,13 +758,10 @@ e_widget_framelist_object_append(of, mt); e_widget_disabled_set(cfdata->gui.o_move_down_button, 1); */ - if (!once) - { mt = e_widget_button_add(evas, _("Regenerate/update \"Applications\" Menu"), "enlightenment/regenerate_menus", _cb_button_regen, cfdata, NULL); cfdata->gui.o_regen_button = mt; e_widget_framelist_object_append(of, mt); - } e_widget_table_object_append(ot, of, 2, 0, 2, 4, 1, 1, 1, 1); } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_apps.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_int_config_apps.h 30 Aug 2006 10:06:32 -0000 1.2 +++ e_int_config_apps.h 16 Nov 2006 00:08:29 -0000 1.3 @@ -7,7 +7,7 @@ #define E_INT_CONFIG_APPS_H EAPI E_Config_Dialog *e_int_config_apps(E_Container *con); -EAPI E_Config_Dialog *e_int_config_apps_once(E_Container *con, const char *label, int (*func) (void *data, const char *path), void *data); +EAPI E_Config_Dialog *e_int_config_apps_once(E_Container *con, const char *title, const char *label, const char *path, int (*func) (void *data, const char *path), void *data); #endif #endif =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_startup.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- e_int_config_startup.c 31 Oct 2006 14:56:28 -0000 1.22 +++ e_int_config_startup.c 16 Nov 2006 00:08:29 -0000 1.23 @@ -166,6 +166,30 @@ } static void +_cb_button_add_startup(void *data1, void *data2) +{ + const char *homedir; + char path[PATH_MAX]; + + homedir = e_user_homedir_get(); + snprintf(path, sizeof(path), "%s/.e/e/applications/startup", homedir); + e_int_config_apps_once(e_container_current_get(e_manager_current_get()), + "Startup", NULL, path, NULL, NULL); +} + +static void +_cb_button_add_restart(void *data1, void *data2) +{ + const char *homedir; + char path[PATH_MAX]; + + homedir = e_user_homedir_get(); + snprintf(path, sizeof(path), "%s/.e/e/applications/restart", homedir); + e_int_config_apps_once(e_container_current_get(e_manager_current_get()), + "Restart", NULL, path, NULL, NULL); +} + +static void _fill_data(E_Config_Dialog_Data *cfdata) { char path[4096]; @@ -345,6 +369,14 @@ o = e_widget_check_add(evas, _("Show Splash Screen on Login"), &(cfdata->show_splash)); e_widget_table_object_append(ot, o, 1, 3, 1, 1, 1, 0, 0, 0); - + + o = e_widget_button_add(evas, _("Add startup Application"), "enlightenment/e", + _cb_button_add_startup, cfdata, NULL); + e_widget_table_object_append(ot, o, 0, 3, 1, 1, 1, 0, 0, 0); + + o = e_widget_button_add(evas, _("Add restart Application"), "enlightenment/e", + _cb_button_add_restart, cfdata, NULL); + e_widget_table_object_append(ot, o, 0, 4, 1, 1, 1, 0, 0, 0); + return ot; } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs