From: Enlightenment C. <no...@cv...> - 2006-08-11 17:06:05
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit.h exhibit_options.c Log Message: - Gui part of "Open in ..." options. =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- exhibit.h 11 Aug 2006 02:30:57 -0000 1.27 +++ exhibit.h 11 Aug 2006 17:06:03 -0000 1.28 @@ -111,6 +111,15 @@ Etk_Combobox_Item *sort_size; Etk_Combobox_Item *sort_name; Etk_Combobox_Item *sort_resolution; + + Etk_Widget *app1; + Etk_Widget *app2; + Etk_Widget *app3; + Etk_Widget *app4; + Etk_Widget *app1_cmd; + Etk_Widget *app2_cmd; + Etk_Widget *app3_cmd; + Etk_Widget *app4_cmd; }; struct _Ex_Tab =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_options.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- exhibit_options.c 11 Aug 2006 02:30:57 -0000 1.9 +++ exhibit_options.c 11 Aug 2006 17:06:03 -0000 1.10 @@ -651,7 +651,7 @@ etk_signal_connect("active_item_changed", ETK_OBJECT(dialog->default_sort), ETK_CALLBACK(_ex_options_combobox_active_item_changed_cb), NULL); - + if (e->options->default_sort == EX_SORT_BY_DATE) etk_combobox_active_item_set(ETK_COMBOBOX(dialog->default_sort), dialog->sort_date); else if (e->options->default_sort == EX_SORT_BY_SIZE) @@ -668,10 +668,72 @@ static Etk_Widget * _ex_options_page_4_create() { - Etk_Widget *vbox; + Etk_Widget *vbox, *vbox2; + Etk_Widget *frame, *table; + Etk_Widget *label; + Ex_Options_Dialog *dialog = e->opt_dialog; vbox = etk_vbox_new(ETK_FALSE, 3); - + + frame = etk_frame_new("Open in ..."); + etk_box_pack_start(ETK_BOX(vbox), frame, ETK_FALSE, ETK_FALSE, 5); + vbox2 = etk_vbox_new(ETK_FALSE, 0); + etk_container_add(ETK_CONTAINER(frame), vbox2); + + label = etk_label_new("Hint: application command has %s as file argument."); + etk_box_pack_start(ETK_BOX(vbox2), label, ETK_FALSE, ETK_FALSE, 5); + etk_box_pack_start(ETK_BOX(vbox2), etk_hseparator_new(), ETK_FALSE, ETK_FALSE, 5); + + table = etk_table_new(3, 5, ETK_FALSE); + etk_box_pack_start(ETK_BOX(vbox2), table, ETK_FALSE, ETK_FALSE, 0); + + label = etk_label_new("Menu display"); + etk_table_attach(ETK_TABLE(table), label, 1, 1, 0, 0, 0, 0, + ETK_FILL_POLICY_NONE); + label = etk_label_new("Command"); + etk_table_attach(ETK_TABLE(table), label, 2, 2, 0, 0, 0, 0, + ETK_FILL_POLICY_NONE); + + label = etk_label_new("Application 1"); + etk_table_attach(ETK_TABLE(table), label, 0, 0, 1, 1, 5, 0, + ETK_FILL_POLICY_NONE); + dialog->app1 = etk_entry_new(); + etk_table_attach(ETK_TABLE(table), dialog->app1, 1, 1, 1, 1, 0, 0, + ETK_FILL_POLICY_NONE); + dialog->app1_cmd = etk_entry_new(); + etk_table_attach(ETK_TABLE(table), dialog->app1_cmd, 2, 2, 1, 1, 0, 0, + ETK_FILL_POLICY_NONE); + + label = etk_label_new("Application 2"); + etk_table_attach(ETK_TABLE(table), label, 0, 0, 2, 2, 0, 0, + ETK_FILL_POLICY_NONE); + dialog->app2 = etk_entry_new(); + etk_table_attach(ETK_TABLE(table), dialog->app2, 1, 1, 2, 2, 0, 0, + ETK_FILL_POLICY_NONE); + dialog->app2_cmd = etk_entry_new(); + etk_table_attach(ETK_TABLE(table), dialog->app2_cmd, 2, 2, 2, 2, 0, 0, + ETK_FILL_POLICY_NONE); + + label = etk_label_new("Application 3"); + etk_table_attach(ETK_TABLE(table), label, 0, 0, 3, 3, 0, 0, + ETK_FILL_POLICY_NONE); + dialog->app3 = etk_entry_new(); + etk_table_attach(ETK_TABLE(table), dialog->app3, 1, 1, 3, 3, 0, 0, + ETK_FILL_POLICY_NONE); + dialog->app3_cmd = etk_entry_new(); + etk_table_attach(ETK_TABLE(table), dialog->app3_cmd, 2, 2, 3, 3, 0, 0, + ETK_FILL_POLICY_NONE); + + label = etk_label_new("Application 4"); + etk_table_attach(ETK_TABLE(table), label, 0, 0, 4, 4, 0, 0, + ETK_FILL_POLICY_NONE); + dialog->app4 = etk_entry_new(); + etk_table_attach(ETK_TABLE(table), dialog->app4, 1, 1, 4, 4, 0, 0, + ETK_FILL_POLICY_NONE); + dialog->app4_cmd = etk_entry_new(); + etk_table_attach(ETK_TABLE(table), dialog->app4_cmd, 2, 2, 4, 4, 0, 0, + ETK_FILL_POLICY_NONE); + return vbox; } |
From: Enlightenment C. <no...@cv...> - 2006-08-13 16:51:17
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit.h exhibit_options.c Log Message: - Save the custom setting from "run in..." You might want to rm ~/.e/exhibit/config.eet on this change. =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- exhibit.h 11 Aug 2006 17:06:03 -0000 1.28 +++ exhibit.h 13 Aug 2006 16:51:13 -0000 1.29 @@ -76,6 +76,10 @@ char *app2; char *app3; char *app4; + char *app1_cmd; + char *app2_cmd; + char *app3_cmd; + char *app4_cmd; char *fav_path; =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_options.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- exhibit_options.c 11 Aug 2006 17:06:03 -0000 1.10 +++ exhibit_options.c 13 Aug 2006 16:51:13 -0000 1.11 @@ -20,6 +20,13 @@ (eed) = NULL; \ } +#define APP_NEW(d, e) \ + if (etk_entry_text_get(ETK_ENTRY(d))) \ + { \ + E_FREE(e); \ + e = strdup(etk_entry_text_get(ETK_ENTRY(d))); \ + } + #define CFG_OPTIONS_NEWI(str, it, type) EET_DATA_DESCRIPTOR_ADD_BASIC(_ex_config_options_edd, Ex_Options, str, it, type) #define VER_NEWI(str, it, type) EET_DATA_DESCRIPTOR_ADD_BASIC(_ex_config_version_edd, Ex_Config_Version, str, it, type) @@ -88,6 +95,10 @@ CFG_OPTIONS_NEWI("a2", app2, EET_T_STRING); CFG_OPTIONS_NEWI("a3", app3, EET_T_STRING); CFG_OPTIONS_NEWI("a4", app4, EET_T_STRING); + CFG_OPTIONS_NEWI("a1_cmd", app1_cmd, EET_T_STRING); + CFG_OPTIONS_NEWI("a2_cmd", app2_cmd, EET_T_STRING); + CFG_OPTIONS_NEWI("a3_cmd", app3_cmd, EET_T_STRING); + CFG_OPTIONS_NEWI("a4_cmd", app4_cmd, EET_T_STRING); CFG_OPTIONS_NEWI("fp", fav_path, EET_T_STRING); CFG_OPTIONS_NEWI("bt", blur_thresh, EET_T_DOUBLE); CFG_OPTIONS_NEWI("st", sharpen_thresh, EET_T_DOUBLE); @@ -176,10 +187,14 @@ /* TODO: free values before allocating if e->options != NULL */ - e->options->app1 = NULL; - e->options->app2 = NULL; - e->options->app3 = NULL; + e->options->app1 = strdup("The Gimp"); + e->options->app1_cmd = strdup("gimp %s"); + e->options->app2 = strdup("Xv"); + e->options->app2_cmd = strdup("xv %s"); + e->options->app3 = strdup("Xpaint"); + e->options->app3_cmd = strdup("xpaint %s"); e->options->app4 = NULL; + e->options->app4_cmd = NULL; e->options->fav_path = NULL; e->options->blur_thresh = EX_DEFAULT_BLUR_THRESH; e->options->sharpen_thresh = EX_DEFAULT_SHARPEN_THRESH; @@ -201,6 +216,10 @@ E_FREE(e->options->app2); E_FREE(e->options->app3); E_FREE(e->options->app4); + E_FREE(e->options->app1_cmd); + E_FREE(e->options->app2_cmd); + E_FREE(e->options->app3_cmd); + E_FREE(e->options->app4_cmd); E_FREE(e->options->fav_path); E_FREE(e->options); } @@ -456,6 +475,18 @@ etk_tree_clear(ETK_TREE(e->cur_tab->itree)); _ex_main_populate_files(e, NULL); + /* RUN IN */ + APP_NEW(dialog->app1, e->options->app1); + APP_NEW(dialog->app1_cmd, e->options->app1_cmd); + APP_NEW(dialog->app2, e->options->app2); + APP_NEW(dialog->app2_cmd, e->options->app2_cmd); + APP_NEW(dialog->app3, e->options->app3); + APP_NEW(dialog->app3_cmd, e->options->app3_cmd); + APP_NEW(dialog->app4, e->options->app4); + APP_NEW(dialog->app4_cmd, e->options->app4_cmd); + + /* - Rebuild menus with settings */ + } static Etk_Widget * @@ -675,7 +706,7 @@ vbox = etk_vbox_new(ETK_FALSE, 3); - frame = etk_frame_new("Open in ..."); + frame = etk_frame_new("Run in ..."); etk_box_pack_start(ETK_BOX(vbox), frame, ETK_FALSE, ETK_FALSE, 5); vbox2 = etk_vbox_new(ETK_FALSE, 0); etk_container_add(ETK_CONTAINER(frame), vbox2); @@ -733,7 +764,27 @@ dialog->app4_cmd = etk_entry_new(); etk_table_attach(ETK_TABLE(table), dialog->app4_cmd, 2, 2, 4, 4, 0, 0, ETK_FILL_POLICY_NONE); - + + if (e->options->app1) + etk_entry_text_set(ETK_ENTRY(dialog->app1), e->options->app1); + if (e->options->app1_cmd) + etk_entry_text_set(ETK_ENTRY(dialog->app1_cmd), e->options->app1_cmd); + + if (e->options->app2) + etk_entry_text_set(ETK_ENTRY(dialog->app2), e->options->app2); + if (e->options->app2_cmd) + etk_entry_text_set(ETK_ENTRY(dialog->app2_cmd), e->options->app2_cmd); + + if (e->options->app3) + etk_entry_text_set(ETK_ENTRY(dialog->app3), e->options->app3); + if (e->options->app3_cmd) + etk_entry_text_set(ETK_ENTRY(dialog->app3_cmd), e->options->app3_cmd); + + if (e->options->app4) + etk_entry_text_set(ETK_ENTRY(dialog->app4), e->options->app4); + if (e->options->app4_cmd) + etk_entry_text_set(ETK_ENTRY(dialog->app4_cmd), e->options->app4_cmd); + return vbox; } |
From: Enlightenment C. <no...@cv...> - 2006-08-13 20:04:44
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit.h exhibit_image.c exhibit_image.h exhibit_main.c exhibit_menus.c exhibit_menus.h exhibit_options.c Log Message: - run in menu is not generated and usable from options. - rename function implemented =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -3 -r1.29 -r1.30 --- exhibit.h 13 Aug 2006 16:51:13 -0000 1.29 +++ exhibit.h 13 Aug 2006 20:04:43 -0000 1.30 @@ -191,7 +191,12 @@ Etk_Widget *resbar; Etk_Widget *zoombar; Etk_Widget *menu; - Etk_Widget *win; + Etk_Widget *win; + Etk_Widget *app1_menu; + Etk_Widget *app2_menu; + Etk_Widget *app3_menu; + Etk_Widget *app4_menu; + Etk_Widget *submenu; int zoom; int brightness; =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_image.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- exhibit_image.c 11 Aug 2006 02:30:57 -0000 1.30 +++ exhibit_image.c 13 Aug 2006 20:04:43 -0000 1.31 @@ -739,13 +739,94 @@ */ } + +static void +_ex_image_rename_dialog_response(Etk_Object *obj, int response_id, void *data) +{ + const char *string; + char *newpath; + char *oldpath; + int ret; + Ex_Tab *tab = e->cur_tab; + + switch(response_id) + { + case ETK_RESPONSE_OK: + string = etk_entry_text_get(ETK_ENTRY(data)); + newpath = malloc(PATH_MAX); + oldpath = malloc(PATH_MAX); + sprintf(newpath, "%s%s", tab->set_img_path, string); + sprintf(oldpath, "%s%s", tab->set_img_path, tab->cur_file); + D(("Renaming from %s -> %s\n", oldpath, newpath)); + + ret = rename(oldpath, newpath); + if (ret == -1) + _ex_main_dialog_show("Error renaming file!", ETK_MESSAGE_DIALOG_ERROR); + else + { + _ex_main_image_unset(); + etk_tree_clear(ETK_TREE(tab->itree)); + etk_tree_clear(ETK_TREE(tab->dtree)); + _ex_main_populate_files(e, NULL); + } + + E_FREE(newpath); + E_FREE(oldpath); + break; + default: + break; + } + + etk_object_destroy(ETK_OBJECT(obj)); +} + +void +_ex_image_rename() +{ + Ex_Tab *tab = e->cur_tab; + Etk_Widget *dialog; + Etk_Widget *entry; + Etk_Widget *label; + char string[PATH_MAX]; + char labeltext[PATH_MAX + 100]; + + sprintf(string, "%s%s", tab->set_img_path, tab->cur_file); + dialog = etk_dialog_new(); + + sprintf(labeltext, "Rename file '%s'", string); + + label = etk_label_new(labeltext); + + etk_dialog_pack_in_main_area(ETK_DIALOG(dialog), ETK_WIDGET(label), + ETK_FALSE, ETK_FALSE, 5, ETK_FALSE); + + label = etk_label_new("New filename"); + etk_dialog_pack_in_main_area(ETK_DIALOG(dialog), ETK_WIDGET(label), + ETK_FALSE, ETK_FALSE, 2, ETK_FALSE); + + entry = etk_entry_new(); + + etk_dialog_pack_in_main_area(ETK_DIALOG(dialog), ETK_WIDGET(entry), + ETK_FALSE, ETK_FALSE, 0, ETK_FALSE); + + etk_dialog_button_add_from_stock(ETK_DIALOG(dialog), ETK_STOCK_DIALOG_OK, ETK_RESPONSE_OK); + etk_dialog_button_add_from_stock(ETK_DIALOG(dialog), ETK_STOCK_DIALOG_CANCEL, ETK_RESPONSE_CANCEL); + etk_signal_connect("response", ETK_OBJECT(dialog), + ETK_CALLBACK(_ex_image_rename_dialog_response), entry); + + etk_container_border_width_set(ETK_CONTAINER(dialog), 15); + etk_window_title_set(ETK_WINDOW(dialog), + _("Exhibit - rename")); + + etk_widget_show_all(dialog); +} + void _ex_image_run(const char *app) { Ecore_Exe *exe = NULL; char *tmp = NULL; - - D(("Application from menu: %s\n", app)); + char str[PATH_MAX]; tmp = malloc(PATH_MAX + 10); memset(tmp, 0, PATH_MAX + 10); @@ -753,12 +834,8 @@ if (!tmp) return; - if (!strcasecmp(app, "The Gimp")) - sprintf(tmp, "gimp %s%s", e->cur_tab->set_img_path, e->cur_tab->cur_file); - else if (!strcasecmp(app, "XV")) - sprintf(tmp, "xv %s%s", e->cur_tab->set_img_path, e->cur_tab->cur_file); - else if (!strcasecmp(app, "Xpaint")) - sprintf(tmp, "xpaint %s%s", e->cur_tab->set_img_path, e->cur_tab->cur_file); + sprintf(str, "%s%s", e->cur_tab->set_img_path, e->cur_tab->cur_file); + sprintf(tmp, app, str); if (strlen(tmp) <= 0) return; =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_image.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- exhibit_image.h 3 Aug 2006 13:12:17 -0000 1.10 +++ exhibit_image.h 13 Aug 2006 20:04:43 -0000 1.11 @@ -19,6 +19,7 @@ void _ex_image_save_as_cb(void *data); void _ex_image_save_as(Exhibit *e); void _ex_image_delete(Exhibit *e); +void _ex_image_rename(); void _ex_image_run(const char *app); void _ex_image_zoom(Etk_Image *im, int zoom); void _ex_image_brightness(Etk_Image *im, int brightness); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -3 -r1.63 -r1.64 --- exhibit_main.c 11 Aug 2006 02:30:57 -0000 1.63 +++ exhibit_main.c 13 Aug 2006 20:04:43 -0000 1.64 @@ -718,13 +718,11 @@ /* Run in submenu */ menu_item = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Run in ..."), ETK_STOCK_APPLICATION_X_EXECUTABLE, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_run_in_cb), e); - submenu = etk_menu_new(); - etk_menu_item_submenu_set(ETK_MENU_ITEM(menu_item), ETK_MENU(submenu)); + e->submenu = etk_menu_new(); + etk_menu_item_submenu_set(ETK_MENU_ITEM(menu_item), ETK_MENU(e->submenu)); + + _ex_menu_build_run_menu(); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("The Gimp"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_run_in_cb), NULL); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("XV"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_run_in_cb), NULL); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Xpaint"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_run_in_cb), NULL); - /* Continue "Edit" menu */ _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), NULL, NULL); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Rotate clockwise"), ETK_STOCK_GO_NEXT, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_rot_clockwise_cb), e); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- exhibit_menus.c 10 Aug 2006 17:05:48 -0000 1.26 +++ exhibit_menus.c 13 Aug 2006 20:04:43 -0000 1.27 @@ -18,6 +18,21 @@ "zoom_out" }; +void +_ex_menu_build_run_menu() +{ + + if (e->options->app1 && e->options->app1_cmd) + e->app1_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app1), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->submenu), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app1_cmd); + if (e->options->app2 && e->options->app2_cmd) + e->app2_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app2), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->submenu), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app2_cmd); + if (e->options->app3 && e->options->app3_cmd) + e->app3_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app3), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->submenu), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app3_cmd); + if (e->options->app4 && e->options->app4_cmd) + e->app4_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app4), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->submenu), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app4_cmd); + +} + Etk_Widget * _ex_menu_item_new(Ex_Menu_Item_Type item_type, const char *label, int stock_id, Etk_Menu_Shell *menu_shell, @@ -138,8 +153,13 @@ void _ex_menu_rename_cb(Etk_Object *obj, void *data) { + Exhibit *e = data; EX_MENU_ITEM_GET_RETURN(obj); - D(("rename\n")); + + if (!e->cur_tab->image_loaded) + return; + + _ex_image_rename(); } void @@ -187,14 +207,13 @@ void _ex_menu_run_in_cb(Etk_Object *obj, void *data) { - const char *app; + const char *cmd = data; EX_MENU_ITEM_GET_RETURN(obj); if (!e->cur_tab->image_loaded) return; - app = etk_menu_item_label_get(ETK_MENU_ITEM(obj)); - _ex_image_run(app); + _ex_image_run(cmd); } void =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_menus.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- exhibit_menus.h 3 Aug 2006 13:12:17 -0000 1.8 +++ exhibit_menus.h 13 Aug 2006 20:04:43 -0000 1.9 @@ -11,6 +11,8 @@ } Ex_Menu_Item_Type; Etk_Widget *_ex_menu_item_new(Ex_Menu_Item_Type item_type, const char *label, int stock_id, Etk_Menu_Shell *menu_shell, Etk_Signal_Callback_Function callback, void *data); + +void _ex_menu_build_run_menu(); void _ex_menu_new_window_cb(Etk_Object *obj, void *data); void _ex_menu_new_tab_cb(Etk_Object *obj, void *data); void _ex_menu_delete_tab_cb(Etk_Object *obj, void *data); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_options.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- exhibit_options.c 13 Aug 2006 16:51:13 -0000 1.11 +++ exhibit_options.c 13 Aug 2006 20:04:43 -0000 1.12 @@ -485,8 +485,12 @@ APP_NEW(dialog->app4, e->options->app4); APP_NEW(dialog->app4_cmd, e->options->app4_cmd); - /* - Rebuild menus with settings */ - + /* Rebuild the possible new menu */ + etk_menu_shell_remove(ETK_MENU_SHELL(e->submenu), ETK_MENU_ITEM(e->app1_menu)); + etk_menu_shell_remove(ETK_MENU_SHELL(e->submenu), ETK_MENU_ITEM(e->app2_menu)); + etk_menu_shell_remove(ETK_MENU_SHELL(e->submenu), ETK_MENU_ITEM(e->app3_menu)); + etk_menu_shell_remove(ETK_MENU_SHELL(e->submenu), ETK_MENU_ITEM(e->app4_menu)); + _ex_menu_build_run_menu(); } static Etk_Widget * |
From: Enlightenment C. <no...@cv...> - 2006-08-13 20:05:15
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit Modified Files: TODO Log Message: - run in menu is not generated and usable from options. - rename function implemented =================================================================== RCS file: /cvs/e/e17/proto/exhibit/TODO,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- TODO 10 Aug 2006 17:05:48 -0000 1.12 +++ TODO 13 Aug 2006 20:04:42 -0000 1.13 @@ -6,17 +6,15 @@ o TODO: ------ - menus - * rename - * "open in" should be generated from options * refresh * release notes * about -- options - * provide tab for "open in" applications o DONE: ------ ++ "open in" should be generated from options ++ rename + andy's comments feature + sorting + wheel changing / zooming @@ -33,6 +31,7 @@ + dialog (common options) + slide show speed + comments visibile / hidden by default (with remembering last state) + + provide tab for "open in" applications + key shotcuts + x - fit / unfit to window + s (slideshow) @@ -46,6 +45,7 @@ ------ - integrate with evfs for file tagging and categories - integrate with libgphoto for digicam interaction +- mass scaling for resizing for example pictures from your cam. - menus * search - image operations: @@ -63,6 +63,7 @@ * BUGS: ======= +- When typing 's' in the comment field you start slideshow. - fix autocomplete (combobox?) - if we're looking at a LOT of images and change dir before they have finished loading, then the images will thumbnail and load in the current dir |
From: Enlightenment C. <no...@cv...> - 2006-08-13 22:59:03
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_image.c exhibit_image.h exhibit_main.c exhibit_menus.c exhibit_menus.h exhibit_options.c Log Message: - Implemented refresh - Added the about dialog - Some other small fixes =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_image.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -3 -r1.31 -r1.32 --- exhibit_image.c 13 Aug 2006 20:04:43 -0000 1.31 +++ exhibit_image.c 13 Aug 2006 22:59:01 -0000 1.32 @@ -108,9 +108,8 @@ menu_item = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Run in ..."), ETK_STOCK_APPLICATION_X_EXECUTABLE, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_run_in_cb), e); submenu = etk_menu_new(); etk_menu_item_submenu_set(ETK_MENU_ITEM(menu_item), ETK_MENU(submenu)); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("The Gimp"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_run_in_cb), e); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("XV"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_run_in_cb), e); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Xpaint"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_run_in_cb), e); + _ex_menu_build_run_menu(submenu); + menu_item = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Favorites"), ETK_STOCK_EMBLEM_FAVORITE, ETK_MENU_SHELL(e->menu), ETK_CALLBACK(_ex_menu_run_in_cb), e); submenu = etk_menu_new(); etk_menu_item_submenu_set(ETK_MENU_ITEM(menu_item), ETK_MENU(submenu)); @@ -819,6 +818,15 @@ _("Exhibit - rename")); etk_widget_show_all(dialog); +} + +void +_ex_image_refresh() +{ + char file[PATH_MAX]; + + sprintf(file, "%s%s", e->cur_tab->set_img_path, e->cur_tab->cur_file); + _ex_main_image_set(e, file); } void =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_image.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- exhibit_image.h 13 Aug 2006 20:04:43 -0000 1.11 +++ exhibit_image.h 13 Aug 2006 22:59:01 -0000 1.12 @@ -20,6 +20,7 @@ void _ex_image_save_as(Exhibit *e); void _ex_image_delete(Exhibit *e); void _ex_image_rename(); +void _ex_image_refresh(); void _ex_image_run(const char *app); void _ex_image_zoom(Etk_Image *im, int zoom); void _ex_image_brightness(Etk_Image *im, int brightness); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -3 -r1.64 -r1.65 --- exhibit_main.c 13 Aug 2006 20:04:43 -0000 1.64 +++ exhibit_main.c 13 Aug 2006 22:59:01 -0000 1.65 @@ -433,18 +433,18 @@ etk_tree_row_fields_get(r, etk_tree_nth_col_get(ETK_TREE(e->cur_tab->itree), 0), NULL, &icol_string, etk_tree_nth_col_get(ETK_TREE(e->cur_tab->itree), 1),NULL); _ex_favorites_add(e, icol_string); } + else if(!strcmp(ev->key, "x")) + { + if(!e->cur_tab->fit_window) + _ex_tab_current_fit_to_window(e); + else + _ex_tab_current_zoom_one_to_one(e); + } + else if(!strcmp(ev->key, "s")) + { + _ex_main_window_slideshow_toggle(e); + } } - else if(!strcmp(ev->key, "x")) - { - if(!e->cur_tab->fit_window) - _ex_tab_current_fit_to_window(e); - else - _ex_tab_current_zoom_one_to_one(e); - } - else if(!strcmp(ev->key, "s")) - { - _ex_main_window_slideshow_toggle(e); - } } static void @@ -690,8 +690,6 @@ _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Save image"), ETK_STOCK_DOCUMENT_SAVE, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_save_image_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Save image as"), ETK_STOCK_DOCUMENT_SAVE, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_save_image_as_cb), e); _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), NULL, NULL); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Search"), ETK_STOCK_SYSTEM_SEARCH, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_search_cb), e); - _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), NULL, NULL); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Rename"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_rename_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Delete"), ETK_STOCK_X_DIRECTORY_TRASH, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_delete_cb), e); _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), NULL, NULL); @@ -721,7 +719,7 @@ e->submenu = etk_menu_new(); etk_menu_item_submenu_set(ETK_MENU_ITEM(menu_item), ETK_MENU(e->submenu)); - _ex_menu_build_run_menu(); + _ex_menu_build_run_menu(NULL); /* Continue "Edit" menu */ _ex_menu_item_new(EX_MENU_ITEM_SEPERATOR, NULL, ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), NULL, NULL); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- exhibit_menus.c 13 Aug 2006 20:04:43 -0000 1.27 +++ exhibit_menus.c 13 Aug 2006 22:59:01 -0000 1.28 @@ -19,17 +19,23 @@ }; void -_ex_menu_build_run_menu() +_ex_menu_build_run_menu(Etk_Widget *submenu) { + Etk_Widget *w; + + if (!submenu) + w = e->submenu; + else + w = submenu; if (e->options->app1 && e->options->app1_cmd) - e->app1_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app1), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->submenu), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app1_cmd); + e->app1_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app1), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(w), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app1_cmd); if (e->options->app2 && e->options->app2_cmd) - e->app2_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app2), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->submenu), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app2_cmd); + e->app2_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app2), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(w), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app2_cmd); if (e->options->app3 && e->options->app3_cmd) - e->app3_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app3), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->submenu), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app3_cmd); + e->app3_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app3), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(w), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app3_cmd); if (e->options->app4 && e->options->app4_cmd) - e->app4_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app4), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->submenu), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app4_cmd); + e->app4_menu = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _(e->options->app4), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(w), ETK_CALLBACK(_ex_menu_run_in_cb), e->options->app4_cmd); } @@ -399,7 +405,15 @@ _ex_menu_refresh_cb(Etk_Object *obj, void *data) { EX_MENU_ITEM_GET_RETURN(obj); - D(("refresh\n")); + + etk_tree_clear(ETK_TREE(e->cur_tab->itree)); + etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); + _ex_main_populate_files(e, NULL); + + if (!e->cur_tab->image_loaded) + return; + + _ex_image_refresh(); } void @@ -503,6 +517,88 @@ void _ex_menu_about_cb(Etk_Object *obj, void *data) { + static Etk_Widget *win = NULL; + Etk_Widget *frame; + Etk_Widget *vbox; + Etk_Widget *desctext; + Etk_Widget *abouttext; + Etk_Widget *helptext; + EX_MENU_ITEM_GET_RETURN(obj); - D(("about\n")); + + if(win) + { + etk_widget_show_all(win); + return; + } + + win = etk_dialog_new(); + etk_window_title_set(ETK_WINDOW(win), "About Exhibit"); + etk_signal_connect_swapped("delete_event", ETK_OBJECT(win), + ETK_CALLBACK(etk_window_hide_on_delete), win); + etk_signal_connect_swapped("response", ETK_OBJECT(win), + ETK_CALLBACK(etk_window_hide_on_delete), win); + etk_widget_size_request_set(win, 290, 405); + + vbox = etk_vbox_new(ETK_FALSE, 0); + frame = etk_frame_new("What is Exhibit?"); + desctext = etk_text_view_new(); + etk_widget_size_request_set(desctext, -1, 150); + etk_object_properties_set(ETK_OBJECT(desctext), + "focusable", ETK_FALSE, NULL); + etk_textblock_text_set(ETK_TEXT_VIEW(desctext)->textblock, + "<b>Exhibit</b> is an imageviewer that uses Etk as its toolkit. " + "Exhibit supports image previews for image types supported by " + "Evas and allows for directory changing using a point " + "and click interface or a text input box with " + "tab autocompletion support.\n\n" + "<p align=\"center\"><style effect=glow color1=#fa14 color2=#fe87>" + "<b>"VERSION"</b>" + "</style></p>", + ETK_TRUE); + etk_container_add(ETK_CONTAINER(frame), desctext); + etk_box_pack_start(ETK_BOX(vbox), frame, ETK_FALSE, ETK_FALSE, 0); + + frame = etk_frame_new("Authors"); + abouttext = etk_text_view_new(); + etk_widget_size_request_set(abouttext, -1, 75); + etk_object_properties_set(ETK_OBJECT(abouttext), + "focusable", ETK_FALSE, NULL); + etk_textblock_text_set(ETK_TEXT_VIEW(abouttext)->textblock, + "<b>Code:</b>\n" + "Hisham '<b>CodeWarrior</b>' Mardam Bey\n" + "Martin '<b>balony</b>' Sarajervi\n" + "Simon '<b>MoOm</b>' Treny", + ETK_TRUE); + etk_container_add(ETK_CONTAINER(frame), abouttext); + etk_box_pack_start(ETK_BOX(vbox), frame, ETK_FALSE, ETK_FALSE, 0); + + frame = etk_frame_new("Common shortcuts"); + helptext = etk_text_view_new(); + etk_widget_size_request_set(helptext, -1,100); + etk_object_properties_set(ETK_OBJECT(helptext), + "focusable", ETK_FALSE, NULL); + etk_textblock_text_set(ETK_TEXT_VIEW(helptext)->textblock, + "<b>control-t:</b> create a new tab\n" + "<b>control-w:</b> close active tab\n" + "<b>control-d:</b> add to favorites\n" + "<b>control-x:</b> toggle view\n" + "<b>control-q:</b> exit program\n" + "<b>control-s:</b> toggle slideshow\n", + ETK_TRUE); + etk_container_add(ETK_CONTAINER(frame), helptext); + etk_box_pack_start(ETK_BOX(vbox), frame, ETK_FALSE, ETK_FALSE, 0); + etk_dialog_pack_in_main_area(ETK_DIALOG(win), vbox, ETK_FALSE, ETK_FALSE, + 0, ETK_FALSE); + etk_dialog_button_add(ETK_DIALOG(win), "Close", ETK_RESPONSE_CLOSE); + etk_container_border_width_set(ETK_CONTAINER(win), 7); + etk_widget_show_all(win); + + etk_textblock_object_cursor_visible_set(ETK_TEXT_VIEW(abouttext)->textblock_object, + ETK_FALSE); + etk_textblock_object_cursor_visible_set(ETK_TEXT_VIEW(desctext)->textblock_object, + ETK_FALSE); + etk_textblock_object_cursor_visible_set(ETK_TEXT_VIEW(helptext)->textblock_object, + ETK_FALSE); + } =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_menus.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- exhibit_menus.h 13 Aug 2006 20:04:43 -0000 1.9 +++ exhibit_menus.h 13 Aug 2006 22:59:01 -0000 1.10 @@ -12,7 +12,7 @@ Etk_Widget *_ex_menu_item_new(Ex_Menu_Item_Type item_type, const char *label, int stock_id, Etk_Menu_Shell *menu_shell, Etk_Signal_Callback_Function callback, void *data); -void _ex_menu_build_run_menu(); +void _ex_menu_build_run_menu(Etk_Widget *submenu); void _ex_menu_new_window_cb(Etk_Object *obj, void *data); void _ex_menu_new_tab_cb(Etk_Object *obj, void *data); void _ex_menu_delete_tab_cb(Etk_Object *obj, void *data); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_options.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- exhibit_options.c 13 Aug 2006 20:04:43 -0000 1.12 +++ exhibit_options.c 13 Aug 2006 22:59:01 -0000 1.13 @@ -490,7 +490,7 @@ etk_menu_shell_remove(ETK_MENU_SHELL(e->submenu), ETK_MENU_ITEM(e->app2_menu)); etk_menu_shell_remove(ETK_MENU_SHELL(e->submenu), ETK_MENU_ITEM(e->app3_menu)); etk_menu_shell_remove(ETK_MENU_SHELL(e->submenu), ETK_MENU_ITEM(e->app4_menu)); - _ex_menu_build_run_menu(); + _ex_menu_build_run_menu(NULL); } static Etk_Widget * |
From: Enlightenment C. <no...@cv...> - 2006-08-13 22:59:32
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit Modified Files: TODO Log Message: - Implemented refresh - Added the about dialog - Some other small fixes =================================================================== RCS file: /cvs/e/e17/proto/exhibit/TODO,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- TODO 13 Aug 2006 20:04:42 -0000 1.13 +++ TODO 13 Aug 2006 22:59:01 -0000 1.14 @@ -5,16 +5,17 @@ o TODO: ------ +- Close tab +- Create window +- Close window + - menus - * refresh * release notes - * about o DONE: ------ + "open in" should be generated from options -+ rename + andy's comments feature + sorting + wheel changing / zooming @@ -24,8 +25,11 @@ + make slideshow display its status in the statusbar(s) + save window geometry between sessions + menus + + about + save image as + delete (needs message dialog) + + refresh + + rename + new window + options + dialog (common options) @@ -63,7 +67,6 @@ * BUGS: ======= -- When typing 's' in the comment field you start slideshow. - fix autocomplete (combobox?) - if we're looking at a LOT of images and change dir before they have finished loading, then the images will thumbnail and load in the current dir |
From: Enlightenment C. <no...@cv...> - 2006-08-14 16:26:05
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/etk/src/lib Modified Files: etk_tree.c etk_tree.h Log Message: just a small update with functions needed in exhibit =================================================================== RCS file: /cvs/e/e17/proto/etk/src/lib/etk_tree.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -3 -r1.72 -r1.73 --- etk_tree.c 13 Aug 2006 22:42:23 -0000 1.72 +++ etk_tree.c 14 Aug 2006 16:26:00 -0000 1.73 @@ -309,6 +309,7 @@ return tree->num_cols; } + /** * @brief Gets the "nth" column of the tree * @param tree a tree @@ -651,6 +652,46 @@ } /** + * @brief Gets the number of rows of the tree + * @param tree a tree + * @return Returns the number of rows of the tree + */ +int etk_tree_num_rows_get(Etk_Tree *tree) +{ + if (!tree) + return 0; + return tree->num_rows; +} + +/** + * @brief Gets the rownumber of the row + * @param tree a tree + * @param row a row + * @return Returns the rownumber of the row + */ +int etk_tree_row_num_get(Etk_Tree *tree, Etk_Tree_Row *row) +{ + Etk_Tree_Row *cur_row; + int n = 0; + + if (!tree || !row) + return 0; + + cur_row = etk_tree_first_row_get(ETK_TREE(tree)); + while (cur_row != NULL) + { + if (row == cur_row) return n; + n++; + cur_row = etk_tree_next_row_get(cur_row, ETK_FALSE, ETK_FALSE); + } + + return 0; +} + + + + +/** * @brief Sets the height of the rows of the tree * @param tree a tree * @param row_height the new height of the rows. If @a row_height < 8, the tree will use the theme default value @@ -770,6 +811,8 @@ if (!tree) return NULL; + tree->num_rows++; + va_start(args, tree); new_row = _etk_tree_row_new_valist(tree, &tree->root, args); va_end(args); @@ -875,6 +918,7 @@ while (tree->root.first_child) _etk_tree_row_free(tree->root.first_child); tree->last_selected = NULL; + tree->num_rows = 0; etk_widget_redraw_queue(ETK_WIDGET(tree->grid)); etk_signal_emit_by_name("scroll_size_changed", ETK_OBJECT(tree->grid), NULL); @@ -1583,6 +1627,7 @@ etk_widget_show(tree->grid); tree->num_cols = 0; + tree->num_rows = 0; tree->columns = NULL; tree->last_selected = NULL; tree->column_to_resize = NULL; =================================================================== RCS file: /cvs/e/e17/proto/etk/src/lib/etk_tree.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- etk_tree.h 29 Jul 2006 20:09:06 -0000 1.24 +++ etk_tree.h 14 Aug 2006 16:26:01 -0000 1.25 @@ -75,6 +75,7 @@ Etk_Widget *grid; int num_cols; + int num_rows; Etk_Tree_Col **columns; Etk_Bool headers_visible; @@ -180,6 +181,8 @@ void etk_tree_freeze(Etk_Tree *tree); void etk_tree_thaw(Etk_Tree *tree); +int etk_tree_num_rows_get(Etk_Tree *tree); +int etk_tree_row_num_get(Etk_Tree *tree, Etk_Tree_Row *row); void etk_tree_row_height_set(Etk_Tree *tree, int row_height); int etk_tree_row_height_get(Etk_Tree *tree); void etk_tree_multiple_select_set(Etk_Tree *tree, Etk_Bool multiple_select); |
From: Enlightenment C. <no...@cv...> - 2006-08-14 16:34:53
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_slideshow.c exhibit_slideshow.h Log Message: Now updating on statusbar as slideshow runs. Need latest etk for this. =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_slideshow.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- exhibit_slideshow.c 10 Aug 2006 17:05:48 -0000 1.4 +++ exhibit_slideshow.c 14 Aug 2006 16:34:52 -0000 1.5 @@ -1,3 +1,6 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #include "exhibit.h" void @@ -29,23 +32,14 @@ _ex_slideshow_next(void *data) { Exhibit *e; - Etk_Tree_Row *row, *first_row, *last_row, *count; - int i; + Etk_Tree_Row *row, *last_row; + int i = 0; + int n = 0; + char string[80]; e = data; row = etk_tree_selected_row_get(ETK_TREE(e->cur_tab->itree)); last_row = etk_tree_last_row_get(ETK_TREE(e->cur_tab->itree), ETK_FALSE, ETK_FALSE); - first_row = etk_tree_first_row_get(ETK_TREE(e->cur_tab->itree)); - - /* FIXME - * Need an etk function for this, this isnt even working properly. - * Would be nice to display slideshow image x of maximages in sbar. - */ - for (count = etk_tree_first_row_get(ETK_TREE(e->cur_tab->itree)), i = 0; - count && count != row; i++) - count = etk_tree_next_row_get(count, ETK_FALSE, ETK_FALSE); - - D(("Rownumber: %d\n", i)); if(!row || row == last_row) row = etk_tree_first_row_get(ETK_TREE(e->cur_tab->itree)); @@ -54,6 +48,11 @@ etk_tree_row_select(row); etk_tree_row_scroll_to(row, ETK_FALSE); - + + i = etk_tree_num_rows_get(ETK_TREE(e->cur_tab->itree)); + n = 1 + etk_tree_row_num_get(ETK_TREE(e->cur_tab->itree), row); + sprintf(string, "Slideshow picture %d of %d", n, i); + etk_statusbar_push(ETK_STATUSBAR(e->statusbar[3]), string, 0); + return 1; } =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_slideshow.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- exhibit_slideshow.h 2 Jan 2006 14:47:45 -0000 1.1 +++ exhibit_slideshow.h 14 Aug 2006 16:34:52 -0000 1.2 @@ -1,3 +1,6 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #ifndef _EX_SLIDESHOW_H #define _EX_SLIDESHOW_H |
From: Enlightenment C. <no...@cv...> - 2006-08-15 22:21:54
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit.h exhibit_image.c exhibit_main.c exhibit_menus.c exhibit_menus.h exhibit_slideshow.c exhibit_tab.c exhibit_tab.h Log Message: Some tab removal code, not working correct yet. =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- exhibit.h 13 Aug 2006 20:04:43 -0000 1.30 +++ exhibit.h 15 Aug 2006 22:21:47 -0000 1.31 @@ -154,8 +154,6 @@ Etk_Tree_Col *dcol; Etk_Tree_Col *icol; - Exhibit *e; - struct { Etk_Bool visible; Etk_Widget *vbox; =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_image.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- exhibit_image.c 15 Aug 2006 18:45:51 -0000 1.33 +++ exhibit_image.c 15 Aug 2006 22:21:47 -0000 1.34 @@ -770,7 +770,7 @@ } E_FREE(newpath); - E_FREE(oldpath); + E_FREE(oldpath); break; default: break; =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -3 -r1.66 -r1.67 --- exhibit_main.c 15 Aug 2006 18:45:51 -0000 1.66 +++ exhibit_main.c 15 Aug 2006 22:21:47 -0000 1.67 @@ -413,10 +413,7 @@ { D(("Number of tabs: %d\n", evas_list_count(e->tabs))); if(evas_list_count(e->tabs) > 1) - { - _ex_main_window_tab_remove(e->cur_tab); _ex_tab_delete(e->cur_tab); - } } else if(!strcmp(ev->key, "q")) { @@ -479,17 +476,12 @@ tab = evas_list_nth(e->tabs, etk_notebook_current_page_get(ETK_NOTEBOOK(object))); e->cur_tab = tab; + D(("Selecting tab %d\n", e->cur_tab->num)); _ex_tab_select(tab); etk_entry_text_set(ETK_ENTRY(e->entry[0]), e->cur_tab->cur_path); } void -_ex_main_window_tab_remove(Ex_Tab *tab) -{ - D(("_ex_main_window_tab_remove\n")); -} - -void _ex_main_window_tab_append(Exhibit *e, Ex_Tab *tab) { if(evas_list_count(e->tabs) == 1) @@ -685,7 +677,6 @@ submenu = etk_menu_new(); etk_menu_item_submenu_set(ETK_MENU_ITEM(menu_item), ETK_MENU(submenu)); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Window"), ETK_STOCK_WINDOW_NEW, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_new_window_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Tab"), ETK_STOCK_TAB_NEW, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_new_tab_cb), NULL); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Save image"), ETK_STOCK_DOCUMENT_SAVE, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_save_image_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Save image as"), ETK_STOCK_DOCUMENT_SAVE, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_save_image_as_cb), e); @@ -700,7 +691,6 @@ submenu = etk_menu_new(); etk_menu_item_submenu_set(ETK_MENU_ITEM(menu_item), ETK_MENU(submenu)); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Window"), ETK_STOCK_WINDOW_NEW, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_close_window_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Tab"), ETK_STOCK_TAB_NEW, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_delete_tab_cb), NULL); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Quit"), ETK_STOCK_DIALOG_CLOSE, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_quit_cb), e); @@ -767,7 +757,6 @@ menu_item = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Help"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu_bar), NULL, NULL); menu = etk_menu_new(); etk_menu_item_submenu_set(ETK_MENU_ITEM(menu_item), ETK_MENU(menu)); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Release notes"), ETK_STOCK_TEXT_X_GENERIC, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_release_notes_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("About"), ETK_STOCK_HELP_BROWSER, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_about_cb), e); } @@ -837,7 +826,7 @@ e->cur_tab = tab; e->tabs = evas_list_append(e->tabs, tab); _ex_tab_select(tab); - etk_paned_child2_set(ETK_PANED(tab->e->hpaned), tab->scrolled_view, ETK_TRUE); + etk_paned_child2_set(ETK_PANED(e->hpaned), tab->scrolled_view, ETK_TRUE); _ex_main_populate_files(e, file); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -3 -r1.29 -r1.30 --- exhibit_menus.c 15 Aug 2006 18:45:51 -0000 1.29 +++ exhibit_menus.c 15 Aug 2006 22:21:47 -0000 1.30 @@ -88,14 +88,6 @@ } void -_ex_menu_new_window_cb(Etk_Object *obj, void *data) -{ - EX_MENU_ITEM_GET_RETURN(obj); - - D(("new window\n")); -} - -void _ex_menu_new_tab_cb(Etk_Object *obj, void *data) { Ex_Tab *tab; @@ -119,7 +111,6 @@ EX_MENU_ITEM_GET_RETURN(obj); - _ex_main_window_tab_remove(e->cur_tab); _ex_tab_delete(e->cur_tab); } @@ -150,13 +141,6 @@ } void -_ex_menu_search_cb(Etk_Object *obj, void *data) -{ - EX_MENU_ITEM_GET_RETURN(obj); - D(("search\n")); -} - -void _ex_menu_rename_cb(Etk_Object *obj, void *data) { Exhibit *e = data; @@ -190,13 +174,6 @@ } void -_ex_menu_close_window_cb(Etk_Object *obj, void *data) -{ - EX_MENU_ITEM_GET_RETURN(obj); - etk_main_quit(); -} - -void _ex_menu_quit_cb(Etk_Object *obj, void *data) { Exhibit *e; @@ -505,13 +482,6 @@ etk_tree_clear(ETK_TREE(e->cur_tab->itree)); etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); _ex_main_populate_files(e, NULL); -} - -void -_ex_menu_release_notes_cb(Etk_Object *obj, void *data) -{ - EX_MENU_ITEM_GET_RETURN(obj); - D(("release notes\n")); } void =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_menus.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- exhibit_menus.h 13 Aug 2006 22:59:01 -0000 1.10 +++ exhibit_menus.h 15 Aug 2006 22:21:47 -0000 1.11 @@ -13,16 +13,13 @@ Etk_Widget *_ex_menu_item_new(Ex_Menu_Item_Type item_type, const char *label, int stock_id, Etk_Menu_Shell *menu_shell, Etk_Signal_Callback_Function callback, void *data); void _ex_menu_build_run_menu(Etk_Widget *submenu); -void _ex_menu_new_window_cb(Etk_Object *obj, void *data); void _ex_menu_new_tab_cb(Etk_Object *obj, void *data); void _ex_menu_delete_tab_cb(Etk_Object *obj, void *data); void _ex_menu_save_image_cb(Etk_Object *obj, void *data); void _ex_menu_save_image_as_cb(Etk_Object *obj, void *data); -void _ex_menu_search_cb(Etk_Object *obj, void *data); void _ex_menu_rename_cb(Etk_Object *obj, void *data); void _ex_menu_delete_cb(Etk_Object *obj, void *data); void _ex_menu_options_cb(Etk_Object *obj, void *data); -void _ex_menu_close_window_cb(Etk_Object *obj, void *data); void _ex_menu_quit_cb(Etk_Object *obj, void *data); void _ex_menu_run_in_cb(Etk_Object *obj, void *data); void _ex_menu_undo_cb(Etk_Object *obj, void *data); @@ -45,7 +42,6 @@ void _ex_menu_add_to_fav_cb(Etk_Object *obj, void *data); void _ex_menu_remove_from_fav_cb(Etk_Object *obj, void *data); void _ex_menu_go_to_fav_cb(Etk_Object *obj, void *data); -void _ex_menu_release_notes_cb(Etk_Object *obj, void *data); void _ex_menu_about_cb(Etk_Object *obj, void *data); #endif =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_slideshow.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- exhibit_slideshow.c 14 Aug 2006 16:34:52 -0000 1.5 +++ exhibit_slideshow.c 15 Aug 2006 22:21:47 -0000 1.6 @@ -54,5 +54,5 @@ sprintf(string, "Slideshow picture %d of %d", n, i); etk_statusbar_push(ETK_STATUSBAR(e->statusbar[3]), string, 0); - return 1; + return 1; } =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_tab.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- exhibit_tab.c 15 Aug 2006 18:45:51 -0000 1.24 +++ exhibit_tab.c 15 Aug 2006 22:21:47 -0000 1.25 @@ -23,7 +23,6 @@ tab->num = evas_list_count(e->tabs); tab->dirs = NULL; tab->images = NULL; - tab->e = e; if (e->options->default_view == EX_IMAGE_FIT_TO_WINDOW) { @@ -88,15 +87,30 @@ } void -_ex_tab_dir_set(Ex_Tab *tab, char *path) -{ - -} - -void _ex_tab_delete(Ex_Tab *tab) { - D (("Delete tab\n")); + if (!e->cur_tab) { + D(("No currently selected TAB!!\n")); + return; + } + + if (e->cur_tab->num == 0) + return; + + D(("Delete tab %d\n", e->cur_tab->num)); + etk_notebook_page_remove(ETK_NOTEBOOK(e->notebook), e->cur_tab->num); + + D(("Remove from list\n")); + evas_list_remove(e->tabs, e->cur_tab); + + D(("Free\n")); + E_FREE(e->cur_tab->dir); + E_FREE(e->cur_tab->set_img_path); + E_FREE(e->cur_tab->cur_file); + E_FREE(tab->comment.text); + evas_list_free(e->cur_tab->images); + evas_list_free(e->cur_tab->dirs); + E_FREE(e->cur_tab); } void @@ -107,23 +121,23 @@ D(("_ex_tab_select: changed dir to %s\n", tab->cur_path)); if(tab->comment.visible) - etk_notebook_page_child_set(ETK_NOTEBOOK(tab->e->notebook), tab->num, tab->comment.vbox); + etk_notebook_page_child_set(ETK_NOTEBOOK(e->notebook), tab->num, tab->comment.vbox); else if(tab->fit_window) - etk_notebook_page_child_set(ETK_NOTEBOOK(tab->e->notebook), tab->num, tab->alignment); + etk_notebook_page_child_set(ETK_NOTEBOOK(e->notebook), tab->num, tab->alignment); - etk_table_attach(ETK_TABLE(tab->e->table), tab->dtree, + etk_table_attach(ETK_TABLE(e->table), tab->dtree, 0, 3, 3, 3, 0, 0, ETK_TABLE_VEXPAND | ETK_TABLE_FILL); etk_widget_show(tab->dtree); - etk_paned_child2_set(ETK_PANED(tab->e->vpaned), tab->itree, ETK_TRUE); + etk_paned_child2_set(ETK_PANED(e->vpaned), tab->itree, ETK_TRUE); etk_widget_show(tab->itree); etk_widget_show(tab->image); etk_widget_show(tab->alignment); etk_widget_show(tab->scrolled_view); - etk_widget_show_all(tab->e->win); + etk_widget_show_all(e->win); } void =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_tab.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- exhibit_tab.h 2 Aug 2006 19:23:22 -0000 1.3 +++ exhibit_tab.h 15 Aug 2006 22:21:47 -0000 1.4 @@ -5,7 +5,6 @@ #define _EX_TAB_H Ex_Tab *_ex_tab_new(Exhibit *e, char *dir); -void _ex_tab_dir_set(Ex_Tab *tab, char *dir); void _ex_tab_delete(Ex_Tab *tab); void _ex_tab_select(Ex_Tab *tab); void _ex_tab_current_zoom_in(Exhibit *e); |
From: Enlightenment C. <no...@cv...> - 2006-08-18 10:36:45
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_main.c exhibit_menus.c exhibit_menus.h exhibit_tab.c exhibit_tab.h Log Message: - Fix from latest etk update. (make exhibit compile again) - Some debug printf's for tabcode =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -3 -r1.67 -r1.68 --- exhibit_main.c 15 Aug 2006 22:21:47 -0000 1.67 +++ exhibit_main.c 18 Aug 2006 10:36:41 -0000 1.68 @@ -411,9 +411,7 @@ } else if(!strcmp(ev->key, "w")) { - D(("Number of tabs: %d\n", evas_list_count(e->tabs))); - if(evas_list_count(e->tabs) > 1) - _ex_tab_delete(e->cur_tab); + _ex_tab_delete(); } else if(!strcmp(ev->key, "q")) { @@ -473,9 +471,13 @@ e = data; _ex_slideshow_stop(e); - tab = evas_list_nth(e->tabs, etk_notebook_current_page_get(ETK_NOTEBOOK(object))); + + tab = evas_list_nth(e->tabs, + etk_notebook_current_page_get(ETK_NOTEBOOK(object))); e->cur_tab = tab; + D(("Toggeled tab %p number %d\n", tab, e->cur_tab->num)); + D(("Selecting tab %d\n", e->cur_tab->num)); _ex_tab_select(tab); etk_entry_text_set(ETK_ENTRY(e->entry[0]), e->cur_tab->cur_path); @@ -521,6 +523,9 @@ e->cur_tab = tab; etk_notebook_page_append(ETK_NOTEBOOK(e->notebook), _ex_file_get(e->cur_tab->dir), e->cur_tab->scrolled_view); etk_notebook_current_page_set(ETK_NOTEBOOK(e->notebook), evas_list_count(e->tabs) - 1); + + tab->num = etk_notebook_current_page_get(ETK_NOTEBOOK(e->notebook)); + D(("Setting tab number %d\n", tab->num)); } static void =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- exhibit_menus.c 15 Aug 2006 22:21:47 -0000 1.30 +++ exhibit_menus.c 18 Aug 2006 10:36:41 -0000 1.31 @@ -42,7 +42,7 @@ Etk_Widget * _ex_menu_item_new(Ex_Menu_Item_Type item_type, const char *label, int stock_id, Etk_Menu_Shell *menu_shell, - Etk_Signal_Callback_Function callback, + Etk_Callback callback, void *data) { Etk_Widget *menu_item = NULL; @@ -111,7 +111,7 @@ EX_MENU_ITEM_GET_RETURN(obj); - _ex_tab_delete(e->cur_tab); + _ex_tab_delete(); } void =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_menus.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- exhibit_menus.h 15 Aug 2006 22:21:47 -0000 1.11 +++ exhibit_menus.h 18 Aug 2006 10:36:41 -0000 1.12 @@ -10,7 +10,7 @@ EX_MENU_ITEM_SEPERATOR } Ex_Menu_Item_Type; -Etk_Widget *_ex_menu_item_new(Ex_Menu_Item_Type item_type, const char *label, int stock_id, Etk_Menu_Shell *menu_shell, Etk_Signal_Callback_Function callback, void *data); +Etk_Widget *_ex_menu_item_new(Ex_Menu_Item_Type item_type, const char *label, int stock_id, Etk_Menu_Shell *menu_shell, Etk_Callback callback, void *data); void _ex_menu_build_run_menu(Etk_Widget *submenu); void _ex_menu_new_tab_cb(Etk_Object *obj, void *data); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_tab.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- exhibit_tab.c 15 Aug 2006 22:21:47 -0000 1.25 +++ exhibit_tab.c 18 Aug 2006 10:36:41 -0000 1.26 @@ -19,11 +19,18 @@ char *file; file = NULL; - tab = calloc(1, sizeof(Ex_Tab)); - tab->num = evas_list_count(e->tabs); + tab = calloc(1, sizeof(Ex_Tab)); + //tab->num = evas_list_count(e->tabs); tab->dirs = NULL; tab->images = NULL; + if (!dir) { + D(("NO DIR\n")); + exit(-1); + } + + D(("Creating new tab with %s\n", dir)); + if (e->options->default_view == EX_IMAGE_FIT_TO_WINDOW) { tab->fit_window = ETK_TRUE; @@ -87,7 +94,7 @@ } void -_ex_tab_delete(Ex_Tab *tab) +_ex_tab_delete() { if (!e->cur_tab) { D(("No currently selected TAB!!\n")); @@ -97,20 +104,24 @@ if (e->cur_tab->num == 0) return; + + D(("Number of tabs: %d\n", evas_list_count(e->tabs))); + + if(evas_list_count(e->tabs) < 1) + { + D(("Cannot remove the last tab\n")); + return; + } + + D(("Delete tab %d\n", e->cur_tab->num)); - etk_notebook_page_remove(ETK_NOTEBOOK(e->notebook), e->cur_tab->num); D(("Remove from list\n")); - evas_list_remove(e->tabs, e->cur_tab); +// e->tabs = evas_list_remove(e->tabs, e->cur_tab); D(("Free\n")); - E_FREE(e->cur_tab->dir); - E_FREE(e->cur_tab->set_img_path); - E_FREE(e->cur_tab->cur_file); - E_FREE(tab->comment.text); - evas_list_free(e->cur_tab->images); - evas_list_free(e->cur_tab->dirs); - E_FREE(e->cur_tab); + etk_notebook_page_remove(ETK_NOTEBOOK(e->notebook), e->cur_tab->num); + // E_FREE(e->cur_tab); } void @@ -119,11 +130,14 @@ chdir(tab->cur_path); D(("_ex_tab_select: changed dir to %s\n", tab->cur_path)); + D(("_ex_tab_select: selecting tab num %d\n", e->cur_tab->num)); if(tab->comment.visible) - etk_notebook_page_child_set(ETK_NOTEBOOK(e->notebook), tab->num, tab->comment.vbox); + etk_notebook_page_child_set(ETK_NOTEBOOK(e->notebook), tab->num, + tab->comment.vbox); else if(tab->fit_window) - etk_notebook_page_child_set(ETK_NOTEBOOK(e->notebook), tab->num, tab->alignment); + etk_notebook_page_child_set(ETK_NOTEBOOK(e->notebook), tab->num, + tab->alignment); etk_table_attach(ETK_TABLE(e->table), tab->dtree, 0, 3, 3, 3, =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_tab.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- exhibit_tab.h 15 Aug 2006 22:21:47 -0000 1.4 +++ exhibit_tab.h 18 Aug 2006 10:36:41 -0000 1.5 @@ -5,7 +5,7 @@ #define _EX_TAB_H Ex_Tab *_ex_tab_new(Exhibit *e, char *dir); -void _ex_tab_delete(Ex_Tab *tab); +void _ex_tab_delete(); void _ex_tab_select(Ex_Tab *tab); void _ex_tab_current_zoom_in(Exhibit *e); void _ex_tab_current_zoom_out(Exhibit *e); |
From: Enlightenment C. <no...@cv...> - 2006-08-18 10:39:02
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/estickies/src/bin Modified Files: stickies.c Log Message: make it compile from etk change =================================================================== RCS file: /cvs/e/e17/proto/estickies/src/bin/stickies.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- stickies.c 15 Aug 2006 18:10:38 -0000 1.9 +++ stickies.c 18 Aug 2006 10:39:01 -0000 1.10 @@ -218,7 +218,7 @@ } static Etk_Widget * -_etk_menu_stock_item_new(const char *label, Etk_Stock_Id stock_id, Etk_Menu_Shell *menu_shell, Etk_Signal_Callback_Function callback, void *data) +_etk_menu_stock_item_new(const char *label, Etk_Stock_Id stock_id, Etk_Menu_Shell *menu_shell, Etk_Callback callback, void *data) { Etk_Widget *menu_item; Etk_Widget *image; |
From: Enlightenment C. <no...@cv...> - 2006-09-01 20:23:53
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit.h exhibit_image.c exhibit_main.c exhibit_main.h exhibit_menus.c exhibit_options.c exhibit_tab.c Log Message: - Added monitoring for the dir/file -listing - Some minor cleanup =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -3 -r1.31 -r1.32 --- exhibit.h 15 Aug 2006 22:21:47 -0000 1.31 +++ exhibit.h 1 Sep 2006 20:23:50 -0000 1.32 @@ -70,6 +70,13 @@ EX_SORT_BY_RESOLUTION = -4 } Ex_Sort; +typedef enum _Ex_Tree_Update +{ + EX_TREE_UPDATE_FILES = -1, + EX_TREE_UPDATE_DIRS = -2, + EX_TREE_UPDATE_ALL = -3, +} Ex_Tree_Update; + struct _Ex_Options { char *app1; @@ -139,7 +146,8 @@ int num; - Etk_Bool fit_window; + Etk_Bool fit_window; + Ecore_File_Monitor *monitor; Evas_List *images; Evas_List *dirs; =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_image.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- exhibit_image.c 25 Aug 2006 12:00:13 -0000 1.36 +++ exhibit_image.c 1 Sep 2006 20:23:50 -0000 1.37 @@ -582,16 +582,6 @@ /* Dont fork for the tree polulating to work */ evas_object_image_save(im->image_object, file, NULL, NULL); - /* Refresh list if the file is saved in our dir */ - D(("Image path: %s <-> Cur path: %s\n", fd->e->cur_tab->set_img_path, - fd->e->cur_tab->cur_path)); - if (!strcmp(fd->e->cur_tab->set_img_path, fd->e->cur_tab->cur_path)) - { - etk_tree_clear(ETK_TREE(fd->e->cur_tab->itree)); - etk_tree_clear(ETK_TREE(fd->e->cur_tab->dtree)); - _ex_main_populate_files(fd->e, NULL); - } - etk_widget_hide(fd->win); } @@ -679,23 +669,13 @@ } _ex_main_image_unset(); - - /* Refresh the tree as we deleted the file first */ - etk_tree_clear(ETK_TREE(tab->itree)); - etk_tree_clear(ETK_TREE(tab->dtree)); - _ex_main_populate_files(e, NULL); - - D(("Ex_Tab pointer in _ex_image_delete_cb %p\n", tab)); etk_object_destroy(ETK_OBJECT(tab->dialog)); - - D(("Deleted for %s\n", string)); + D(("Deleted %s\n", string)); } static void _ex_image_delete_dialog_response(Etk_Object *obj, int response_id, void *data) { - Exhibit *e = data; - switch(response_id) { case ETK_RESPONSE_OK: @@ -715,9 +695,8 @@ Ex_Tab *tab = e->cur_tab; char string[PATH_MAX]; - sprintf(string, "Are you sure you want to delete this image? <br>%s%s<br> ", tab->set_img_path, tab->cur_file); - - D(("Ex_Tab pointer in _ex_image_delete %p\n", e->cur_tab)); + sprintf(string, "Are you sure you want to delete this image? <br>%s%s<br> ", + tab->set_img_path, tab->cur_file); tab->dialog = etk_message_dialog_new(ETK_MESSAGE_DIALOG_QUESTION, ETK_MESSAGE_DIALOG_OK_CANCEL, @@ -731,11 +710,6 @@ _("Exhibit - Confirm delete")); etk_widget_show_all(tab->dialog); - - /* TODO - * Center the dialog on top of the app. - etk_window_center_on_window(ETK_WINDOW(tab->dialog), ETK_WINDOW(e->win)); - */ } @@ -761,13 +735,8 @@ ret = rename(oldpath, newpath); if (ret == -1) _ex_main_dialog_show("Error renaming file!", ETK_MESSAGE_DIALOG_ERROR); - else - { - _ex_main_image_unset(); - etk_tree_clear(ETK_TREE(tab->itree)); - etk_tree_clear(ETK_TREE(tab->dtree)); - _ex_main_populate_files(e, NULL); - } + else + _ex_main_image_unset(); E_FREE(newpath); E_FREE(oldpath); @@ -1064,8 +1033,6 @@ char filename_s[PATH_MAX]; Ecore_X_Window *roots = NULL; - D(("Entered the foo\n")); - if (!ecore_x_init(NULL)) exit(0); @@ -1166,9 +1133,8 @@ { char e_bg_set[PATH_MAX*2]; - snprintf(e_bg_set, PATH_MAX, "enlightenment_remote -default-bg-set %s", edj_file); - - D(("FOO: %s\n", e_bg_set)); + snprintf(e_bg_set, PATH_MAX, "enlightenment_remote -default-bg-set %s", + edj_file); system(e_bg_set); } =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.69 retrieving revision 1.70 diff -u -3 -r1.69 -r1.70 --- exhibit_main.c 25 Aug 2006 12:00:13 -0000 1.69 +++ exhibit_main.c 1 Sep 2006 20:23:50 -0000 1.70 @@ -10,6 +10,7 @@ Exhibit *e; Evas_List *event_handlers; +static void _ex_main_monitor_dir(void *data, Ecore_File_Monitor *ecore_file_monitor, Ecore_File_Event event, const char *path); static int _ex_main_dtree_compare_cb(Etk_Tree *tree, Etk_Tree_Row *row1, Etk_Tree_Row *row2, Etk_Tree_Col *col, void *data); static void _ex_main_goto_dir_clicked_cb(Etk_Object *object, void *data); static void _ex_main_entry_dir_key_down_cb(Etk_Object *object, void *event, void *data); @@ -103,17 +104,11 @@ else { etk_image_set_from_file(ETK_IMAGE(e->cur_tab->image), image); - + if (e->cur_tab->fit_window) - { - _ex_tab_current_fit_to_window(e); - D(("Setting EX_IMAGE_FIT_TO_WINDOW loaded and used\n")); - } + _ex_tab_current_fit_to_window(e); else - { - _ex_tab_current_zoom_one_to_one(e); - D(("Setting EX_IMAGE_ONE_TO_ONE loaded and used\n")); - } + _ex_tab_current_zoom_one_to_one(e); } bytes = ecore_file_size(image); @@ -133,7 +128,6 @@ etk_range_value_set(vs, (double)h/2); /* Reset undo data every time we change image */ - D(("Resetting undo data on image %p\n", e->cur_tab->image)); data2 = etk_object_data_get(ETK_OBJECT(e->cur_tab->image), "undo"); if (data2) E_FREE(data2); @@ -158,24 +152,31 @@ } void -_ex_main_populate_files(Exhibit *e, const char *selected_file) +_ex_main_populate_files(const char *selected_file, Ex_Tree_Update update) { char back[PATH_MAX]; DIR *dir; struct dirent *dir_entry; - Etk_Tree_Row *row, *selected_row; - - selected_row = NULL; - snprintf(back, PATH_MAX, ".."); - etk_tree_append(ETK_TREE(e->cur_tab->dtree), e->cur_tab->dcol, - etk_theme_icon_theme_get(), "actions/go-up_16", back, NULL); + Etk_Tree_Row *row, *selected_row = NULL; chdir(e->cur_tab->dir); + + if (update == EX_TREE_UPDATE_ALL || update == EX_TREE_UPDATE_DIRS) + { + snprintf(back, PATH_MAX, ".."); + etk_tree_append(ETK_TREE(e->cur_tab->dtree), e->cur_tab->dcol, + etk_theme_icon_theme_get(), "actions/go-up_16", back, NULL); + } - D(("Changing to dir: %s\n", e->cur_tab->dir)); + if (e->cur_tab->monitor) + { + D(("Removing old monitoring\n")); + ecore_file_monitor_del(e->cur_tab->monitor); + e->cur_tab->monitor = NULL; + } if ((dir = opendir(".")) == NULL) - return ; + return; etk_tree_freeze(ETK_TREE(e->cur_tab->itree)); etk_tree_freeze(ETK_TREE(e->cur_tab->dtree)); @@ -201,17 +202,25 @@ continue; snprintf(image, PATH_MAX, "%s", dir_entry->d_name); - if(stat(image, &st) == -1) continue; - if(S_ISDIR(st.st_mode)) + + if (update == EX_TREE_UPDATE_ALL || update == EX_TREE_UPDATE_DIRS) { - etk_tree_append(ETK_TREE(e->cur_tab->dtree), e->cur_tab->dcol, - etk_theme_icon_theme_get(), - "places/folder_16", - dir_entry->d_name, NULL); - e->cur_tab->dirs = evas_list_append(e->cur_tab->dirs, dir_entry->d_name); - continue; + if(stat(image, &st) == -1) continue; + if(S_ISDIR(st.st_mode)) + { + etk_tree_append(ETK_TREE(e->cur_tab->dtree), e->cur_tab->dcol, + etk_theme_icon_theme_get(), + "places/folder_16", + dir_entry->d_name, NULL); + e->cur_tab->dirs = evas_list_append(e->cur_tab->dirs, dir_entry->d_name); + continue; + } } + /* If we don't want to do the rtree updating */ + if (update == EX_TREE_UPDATE_DIRS) + continue; + if(!_ex_file_is_viewable(dir_entry->d_name)) continue; @@ -252,20 +261,25 @@ } etk_tree_thaw(ETK_TREE(e->cur_tab->itree)); + etk_tree_thaw(ETK_TREE(e->cur_tab->dtree)); - D(("e->options->default_sort: %d\n", e->options->default_sort)); - - if (e->options->default_sort == EX_SORT_BY_DATE) - _ex_sort_date_cb(NULL, NULL); - else if (e->options->default_sort == EX_SORT_BY_SIZE) - _ex_sort_size_cb(NULL, NULL); - else if (e->options->default_sort == EX_SORT_BY_NAME) - _ex_sort_name_cb(NULL, NULL); - else if (e->options->default_sort == EX_SORT_BY_RESOLUTION) - _ex_sort_resol_cb(NULL, NULL); + if (update == EX_TREE_UPDATE_FILES) + { + if (e->options->default_sort == EX_SORT_BY_DATE) + _ex_sort_date_cb(NULL, NULL); + else if (e->options->default_sort == EX_SORT_BY_SIZE) + _ex_sort_size_cb(NULL, NULL); + else if (e->options->default_sort == EX_SORT_BY_NAME) + _ex_sort_name_cb(NULL, NULL); + else if (e->options->default_sort == EX_SORT_BY_RESOLUTION) + _ex_sort_resol_cb(NULL, NULL); + } - etk_tree_thaw(ETK_TREE(e->cur_tab->dtree)); - etk_tree_sort(ETK_TREE(e->cur_tab->dtree), _ex_main_dtree_compare_cb, ETK_TRUE, e->cur_tab->dcol, NULL); + if (update == EX_TREE_UPDATE_ALL || update == EX_TREE_UPDATE_DIRS) + { + etk_tree_sort(ETK_TREE(e->cur_tab->dtree), _ex_main_dtree_compare_cb, + ETK_TRUE, e->cur_tab->dcol, NULL); + } if(selected_row) { @@ -277,18 +291,65 @@ stepdown like ".." if we just call the refresh on the listing like after a delete */ e->cur_tab->dir = strdup("."); + + if (!e->cur_tab->monitor) + { + D(("Adding monitoring to path %s\n", e->cur_tab->cur_path)); + e->cur_tab->monitor = ecore_file_monitor_add(e->cur_tab->cur_path, + _ex_main_monitor_dir, NULL); + } closedir(dir); } static void -_ex_main_entry_dir_key_down_cb(Etk_Object *object, void *event, void *data) +_ex_main_monitor_dir(void *data, Ecore_File_Monitor *ecore_file_monitor, Ecore_File_Event event, const char *path) { - Etk_Event_Key_Down *ev; - Exhibit *e; + /* Only do changes if tree's are visible */ + if (ecore_file_monitor != e->cur_tab->monitor) + return; - e = data; - ev = event; + /* TODO: update non-visible tabs too */ + + switch (event) + { + case ECORE_FILE_EVENT_CREATED_DIRECTORY: + etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_DIRS); + break; + case ECORE_FILE_EVENT_DELETED_DIRECTORY: + etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_DIRS); + break; + case ECORE_FILE_EVENT_DELETED_SELF: + etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); + etk_tree_clear(ETK_TREE(e->cur_tab->itree)); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); + break; + case ECORE_FILE_EVENT_MODIFIED: + etk_tree_clear(ETK_TREE(e->cur_tab->itree)); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES); + break; + case ECORE_FILE_EVENT_DELETED_FILE: + etk_tree_clear(ETK_TREE(e->cur_tab->itree)); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES); + break; + case ECORE_FILE_EVENT_CREATED_FILE: + etk_tree_clear(ETK_TREE(e->cur_tab->itree)); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES); + break; + default: + D(("Unknown ecore file event occured\n")); + break; + } + + D(("Monitor event %d happened in %s\n", event, path)); +} + +static void +_ex_main_entry_dir_key_down_cb(Etk_Object *object, void *event, void *data) +{ + Etk_Event_Key_Down *ev = event; if(!strcmp(ev->key, "Tab")) { @@ -362,29 +423,22 @@ e->cur_tab->dir = strdup((char*)etk_entry_text_get(ETK_ENTRY(e->entry[0]))); etk_tree_clear(ETK_TREE(e->cur_tab->itree)); etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); - _ex_main_populate_files(e, NULL); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); } } static void _ex_main_goto_dir_clicked_cb(Etk_Object *object, void *data) { - Exhibit *e; - - e = data; - e->cur_tab->dir = strdup((char*)etk_entry_text_get(ETK_ENTRY(e->entry[0]))); etk_tree_clear(ETK_TREE(e->cur_tab->itree)); etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); - _ex_main_populate_files(e, NULL); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); } static Etk_Bool _ex_main_window_deleted_cb(void *data) { - Exhibit *e; - - e = data; etk_main_quit(); return 1; } @@ -392,11 +446,7 @@ static void _ex_main_window_key_down_cb(Etk_Object *object, void *event, void *data) { - Etk_Event_Key_Down *ev; - Exhibit *e; - - e = data; - ev = event; + Etk_Event_Key_Down *ev = event; if(ev->modifiers == ETK_MODIFIER_CTRL) { @@ -407,7 +457,7 @@ tab = _ex_tab_new(e, e->cur_tab->cur_path); _ex_main_window_tab_append(e, tab); - _ex_main_populate_files(e, NULL); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); } else if(!strcmp(ev->key, "w")) { @@ -568,7 +618,7 @@ e->cur_tab->dir = strdup(dir); etk_tree_clear(ETK_TREE(e->cur_tab->itree)); etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); - _ex_main_populate_files(e, ecore_file_get_file(file)); + _ex_main_populate_files(ecore_file_get_file(file), EX_TREE_UPDATE_ALL); if(ecore_file_exists(file) && !ecore_file_is_dir(file)) _ex_main_image_set(e, file); etk_notebook_page_tab_label_set(ETK_NOTEBOOK(e->notebook), e->cur_tab->num, _ex_file_get(e->cur_tab->cur_path)); @@ -833,7 +883,7 @@ _ex_tab_select(tab); etk_paned_child2_set(ETK_PANED(e->hpaned), tab->scrolled_view, ETK_TRUE); - _ex_main_populate_files(e, file); + _ex_main_populate_files(file, EX_TREE_UPDATE_ALL); e->hbox = etk_hbox_new(ETK_TRUE, 0); etk_box_append(ETK_BOX(e->vbox), e->hbox, ETK_BOX_END, ETK_BOX_NONE, 0); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- exhibit_main.h 10 Aug 2006 04:01:10 -0000 1.12 +++ exhibit_main.h 1 Sep 2006 20:23:50 -0000 1.13 @@ -5,7 +5,7 @@ #define _EX_MAIN_H void _ex_main_statusbar_zoom_update(Exhibit *e); -void _ex_main_populate_files(Exhibit *e, const char *selected_file); +void _ex_main_populate_files(const char *selected_file, Ex_Tree_Update update); int _ex_main_window_slideshow_next(void *data); void _ex_main_window_slideshow_toggle(Exhibit *e); void _ex_main_window_tab_append(Exhibit *e, Ex_Tab *tab); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -3 -r1.31 -r1.32 --- exhibit_menus.c 18 Aug 2006 10:36:41 -0000 1.31 +++ exhibit_menus.c 1 Sep 2006 20:23:50 -0000 1.32 @@ -96,7 +96,7 @@ tab = _ex_tab_new(e, e->cur_tab->cur_path); _ex_main_window_tab_append(e, tab); - _ex_main_populate_files(e, NULL); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); } void @@ -383,10 +383,6 @@ { EX_MENU_ITEM_GET_RETURN(obj); - etk_tree_clear(ETK_TREE(e->cur_tab->itree)); - etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); - _ex_main_populate_files(e, NULL); - if (!e->cur_tab->image_loaded) return; @@ -481,7 +477,7 @@ e->cur_tab->dir = strdup(e->options->fav_path); etk_tree_clear(ETK_TREE(e->cur_tab->itree)); etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); - _ex_main_populate_files(e, NULL); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); } void =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_options.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- exhibit_options.c 15 Aug 2006 18:45:51 -0000 1.14 +++ exhibit_options.c 1 Sep 2006 20:23:50 -0000 1.15 @@ -473,7 +473,7 @@ e->options->default_sort = e->options->default_sort_tmp; etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); etk_tree_clear(ETK_TREE(e->cur_tab->itree)); - _ex_main_populate_files(e, NULL); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); /* RUN IN */ APP_NEW(dialog->app1, e->options->app1); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_tab.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- exhibit_tab.c 25 Aug 2006 12:00:13 -0000 1.28 +++ exhibit_tab.c 1 Sep 2006 20:23:50 -0000 1.29 @@ -134,12 +134,15 @@ D(("_ex_tab_select: changed dir to %s\n", tab->cur_path)); D(("_ex_tab_select: selecting tab num %d\n", e->cur_tab->num)); - if(tab->comment.visible) - etk_notebook_page_child_set(ETK_NOTEBOOK(e->notebook), tab->num, - tab->comment.vbox); - else if(tab->fit_window) - etk_notebook_page_child_set(ETK_NOTEBOOK(e->notebook), tab->num, - tab->alignment); + if (!e->notebook) + { + if(tab->comment.visible) + etk_notebook_page_child_set(ETK_NOTEBOOK(e->notebook), tab->num, + tab->comment.vbox); + else if(tab->fit_window) + etk_notebook_page_child_set(ETK_NOTEBOOK(e->notebook), tab->num, + tab->alignment); + } etk_table_attach(ETK_TABLE(e->table), tab->dtree, 0, 3, 3, 3, @@ -429,7 +432,7 @@ e->cur_tab->dir = strdup(dcol_string); etk_tree_clear(ETK_TREE(e->cur_tab->itree)); etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); - _ex_main_populate_files(e, NULL); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); etk_notebook_page_tab_label_set(ETK_NOTEBOOK(e->notebook), etk_notebook_current_page_get(ETK_NOTEBOOK(e->notebook)), _ex_file_get(e->cur_tab->cur_path)); } @@ -466,6 +469,6 @@ e->cur_tab->dir = strdup((char*)etk_entry_text_get(ETK_ENTRY(e->entry[0]))); etk_tree_clear(ETK_TREE(e->cur_tab->itree)); etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); - _ex_main_populate_files(e, NULL); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); } } |
From: Enlightenment C. <no...@cv...> - 2006-09-01 20:24:22
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit Modified Files: TODO Log Message: - Added monitoring for the dir/file -listing - Some minor cleanup =================================================================== RCS file: /cvs/e/e17/proto/exhibit/TODO,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- TODO 13 Aug 2006 22:59:01 -0000 1.14 +++ TODO 1 Sep 2006 20:23:50 -0000 1.15 @@ -9,10 +9,6 @@ - Create window - Close window -- menus - * release notes - - o DONE: ------ + "open in" should be generated from options @@ -37,12 +33,12 @@ + comments visibile / hidden by default (with remembering last state) + provide tab for "open in" applications + key shotcuts - + x - fit / unfit to window - + s (slideshow) + + control-x - fit / unfit to window + + control-s (slideshow) + control-q (quit) ================= -* RELEASSE 0.2.0: +* RELEASE 0.2.0: ================= o TODO: |
From: Enlightenment C. <no...@cv...> - 2006-09-01 21:51:40
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit.h exhibit_main.c exhibit_options.c exhibit_thumb.c Log Message: - Much better way of updating the thumblist when new images is added to your current dir. - A new option to choose if you want to autofocus the new image added, may be cheesy if lots of images is added at once.. :-) =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -3 -r1.32 -r1.33 --- exhibit.h 1 Sep 2006 20:23:50 -0000 1.32 +++ exhibit.h 1 Sep 2006 21:51:38 -0000 1.33 @@ -16,6 +16,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <libgen.h> #include <dirent.h> #include <limits.h> #include <sys/types.h> @@ -100,6 +101,7 @@ int default_view; int default_sort; int default_sort_tmp; + int monitor_focus; int last_w; int last_h; @@ -118,6 +120,7 @@ Etk_Widget *comments_visible; Etk_Widget *rotate_autosave; Etk_Widget *default_sort; + Etk_Widget *monitor_focus; Etk_Combobox_Item *sort_date; Etk_Combobox_Item *sort_size; Etk_Combobox_Item *sort_name; =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -3 -r1.70 -r1.71 --- exhibit_main.c 1 Sep 2006 20:23:50 -0000 1.70 +++ exhibit_main.c 1 Sep 2006 21:51:38 -0000 1.71 @@ -10,6 +10,7 @@ Exhibit *e; Evas_List *event_handlers; +static void _ex_main_itree_add(const char *file, const char *selected_file); static void _ex_main_monitor_dir(void *data, Ecore_File_Monitor *ecore_file_monitor, Ecore_File_Event event, const char *path); static int _ex_main_dtree_compare_cb(Etk_Tree *tree, Etk_Tree_Row *row1, Etk_Tree_Row *row2, Etk_Tree_Col *col, void *data); static void _ex_main_goto_dir_clicked_cb(Etk_Object *object, void *data); @@ -157,7 +158,6 @@ char back[PATH_MAX]; DIR *dir; struct dirent *dir_entry; - Etk_Tree_Row *row, *selected_row = NULL; chdir(e->cur_tab->dir); @@ -195,7 +195,6 @@ char image[PATH_MAX]; char imagereal[PATH_MAX]; struct stat st; - Epsilon *ep; /* Do not include hidden files */ if (dir_entry->d_name[0] == '.') @@ -227,37 +226,7 @@ if(!realpath(image, imagereal)) snprintf(imagereal, PATH_MAX, "%s", image); - ep = epsilon_new(imagereal); - epsilon_thumb_size(ep, EPSILON_THUMB_NORMAL); - - if(epsilon_exists(ep) == EPSILON_OK) - { - char *thumb; - - thumb = (char*)epsilon_thumb_file_get(ep); - row = etk_tree_append(ETK_TREE(e->cur_tab->itree), e->cur_tab->icol, thumb, dir_entry->d_name, NULL); - if(selected_file) - if(!strcmp(selected_file, dir_entry->d_name)) - selected_row = row; - E_FREE(thumb); - } - else { - Ex_Thumb *thumb; - - thumb = calloc(1, sizeof(Ex_Thumb)); - thumb->ep = ep; - thumb->e = e; - thumb->name = strdup(dir_entry->d_name); - thumb_list = evas_list_append(thumb_list, thumb); - if(selected_file) - { - if(!strcmp(selected_file, dir_entry->d_name)) - thumb->selected = ETK_TRUE; - } - else - thumb->selected = ETK_FALSE; - if(pid == -1) _ex_thumb_generate(); - } + _ex_main_itree_add(imagereal, selected_file); } etk_tree_thaw(ETK_TREE(e->cur_tab->itree)); @@ -276,30 +245,75 @@ } if (update == EX_TREE_UPDATE_ALL || update == EX_TREE_UPDATE_DIRS) - { etk_tree_sort(ETK_TREE(e->cur_tab->dtree), _ex_main_dtree_compare_cb, ETK_TRUE, e->cur_tab->dcol, NULL); - } - if(selected_row) + if (!e->cur_tab->monitor) { - etk_tree_row_select(selected_row); - etk_tree_row_scroll_to(selected_row, ETK_TRUE); + D(("Adding monitoring to path %s\n", e->cur_tab->cur_path)); + e->cur_tab->monitor = ecore_file_monitor_add(e->cur_tab->cur_path, + _ex_main_monitor_dir, NULL); } /* Set the dir to the current dir at the end so we avoid stepdown like ".." if we just call the refresh on the listing like after a delete */ e->cur_tab->dir = strdup("."); + + closedir(dir); +} - if (!e->cur_tab->monitor) +static void +_ex_main_itree_add(const char *file, const char *selected_file) +{ + Epsilon *ep; + Etk_Tree_Row *row; + + if(!_ex_file_is_viewable(basename((char *) file))) + return; + + ep = epsilon_new(file); + epsilon_thumb_size(ep, EPSILON_THUMB_NORMAL); + + if(epsilon_exists(ep) == EPSILON_OK) { - D(("Adding monitoring to path %s\n", e->cur_tab->cur_path)); - e->cur_tab->monitor = ecore_file_monitor_add(e->cur_tab->cur_path, - _ex_main_monitor_dir, NULL); + char *thumb; + + thumb = (char*) epsilon_thumb_file_get(ep); + row = etk_tree_append(ETK_TREE(e->cur_tab->itree), e->cur_tab->icol, + thumb, basename((char *) file), NULL); + + if (selected_file && e->options->monitor_focus) + { + if(!strcmp(selected_file, file)) + { + etk_tree_row_select(row); + etk_tree_row_scroll_to(row, ETK_TRUE); + } + } + + E_FREE(thumb); } - - closedir(dir); + else + { + Ex_Thumb *thumb; + + thumb = calloc(1, sizeof(Ex_Thumb)); + thumb->ep = ep; + thumb->e = e; + thumb->name = strdup(basename((char *) file)); + thumb_list = evas_list_append(thumb_list, thumb); + if(selected_file && e->options->monitor_focus) + { + if(!strcmp(selected_file, file)) + thumb->selected = ETK_TRUE; + } + else + thumb->selected = ETK_FALSE; + + if(pid == -1) _ex_thumb_generate(); + } + } static void @@ -335,8 +349,7 @@ _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES); break; case ECORE_FILE_EVENT_CREATED_FILE: - etk_tree_clear(ETK_TREE(e->cur_tab->itree)); - _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES); + _ex_main_itree_add(path, path); break; default: D(("Unknown ecore file event occured\n")); @@ -942,9 +955,7 @@ fprintf(stderr, "WARNING: Exhibit could not set up its options files!\n" " You will not be able to save your preferences.\n"); event_handlers = evas_list_append(event_handlers, - ecore_event_handler_add(ECORE_EXE_EVENT_DEL, - _ex_thumb_exe_exit, - NULL)); + ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _ex_thumb_exe_exit, NULL)); epsilon_init(); if(argc > 1) =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_options.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- exhibit_options.c 1 Sep 2006 20:23:50 -0000 1.15 +++ exhibit_options.c 1 Sep 2006 21:51:38 -0000 1.16 @@ -106,6 +106,7 @@ CFG_OPTIONS_NEWI("lt", slide_interval, EET_T_DOUBLE); CFG_OPTIONS_NEWI("cv", comments_visible, EET_T_INT); CFG_OPTIONS_NEWI("ra", rotate_autosave, EET_T_INT); + CFG_OPTIONS_NEWI("mf", monitor_focus, EET_T_INT); CFG_OPTIONS_NEWI("dv", default_view, EET_T_INT); CFG_OPTIONS_NEWI("ds", default_sort, EET_T_INT); CFG_OPTIONS_NEWI("lw", last_w, EET_T_INT); @@ -206,6 +207,7 @@ e->options->last_w = EX_DEFAULT_WINDOW_WIDTH; e->options->last_h = EX_DEFAULT_WINDOW_HEIGHT; e->options->rotate_autosave = ETK_FALSE; + e->options->monitor_focus = ETK_FALSE; e->version = _ex_options_version_parse(VERSION); } @@ -475,6 +477,12 @@ etk_tree_clear(ETK_TREE(e->cur_tab->itree)); _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); + /* MONITOR FOCUS */ + if (IS_SELECTED(dialog->monitor_focus)) + e->options->monitor_focus = ETK_TRUE; + else + e->options->monitor_focus = ETK_FALSE; + /* RUN IN */ APP_NEW(dialog->app1, e->options->app1); APP_NEW(dialog->app1_cmd, e->options->app1_cmd); @@ -687,6 +695,17 @@ etk_signal_connect("active_item_changed", ETK_OBJECT(dialog->default_sort), ETK_CALLBACK(_ex_options_combobox_active_item_changed_cb), NULL); + frame = etk_frame_new("Filesystem monitoring"); + etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_NONE, 5); + hbox = etk_hbox_new(ETK_FALSE, 0); + etk_container_add(ETK_CONTAINER(frame), hbox); + + dialog->monitor_focus = etk_check_button_new_with_label("Autofocus new images added to your current dir"); + etk_box_append(ETK_BOX(hbox), dialog->monitor_focus, ETK_BOX_START, ETK_BOX_NONE, 0); + + if (e->options->monitor_focus) + etk_toggle_button_toggle(ETK_TOGGLE_BUTTON(dialog->monitor_focus)); + if (e->options->default_sort == EX_SORT_BY_DATE) etk_combobox_active_item_set(ETK_COMBOBOX(dialog->default_sort), dialog->sort_date); else if (e->options->default_sort == EX_SORT_BY_SIZE) =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_thumb.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- exhibit_thumb.c 15 Jan 2006 12:31:48 -0000 1.7 +++ exhibit_thumb.c 1 Sep 2006 21:51:38 -0000 1.8 @@ -7,8 +7,8 @@ int _ex_thumb_exe_exit(void *data, int type, void *event) { - Ecore_Exe_Event_Del *ev; - Ex_Thumb *thumb; + Ecore_Exe_Event_Del *ev; + Ex_Thumb *thumb; char *ext; ev = event; @@ -31,10 +31,10 @@ etk_tree_row_select(row); etk_tree_row_scroll_to(row, ETK_TRUE); } - free(thumb->image); - free(thumb->name); + E_FREE(thumb->image); + E_FREE(thumb->name); epsilon_free(thumb->ep); - free(thumb); + E_FREE(thumb); } pid = -1; |
From: Enlightenment C. <no...@cv...> - 2006-09-01 22:41:39
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_main.c exhibit_main.h exhibit_slideshow.c exhibit_slideshow.h Log Message: And some more cleanups ... =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -3 -r1.71 -r1.72 --- exhibit_main.c 1 Sep 2006 21:51:38 -0000 1.71 +++ exhibit_main.c 1 Sep 2006 22:41:37 -0000 1.72 @@ -469,7 +469,7 @@ tab = _ex_tab_new(e, e->cur_tab->cur_path); - _ex_main_window_tab_append(e, tab); + _ex_main_window_tab_append(tab); _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); } else if(!strcmp(ev->key, "w")) @@ -500,7 +500,7 @@ } else if(!strcmp(ev->key, "s")) { - _ex_main_window_slideshow_toggle(e); + _ex_main_window_slideshow_toggle(); } } } @@ -514,26 +514,24 @@ } void -_ex_main_window_slideshow_toggle(Exhibit *e) +_ex_main_window_slideshow_toggle() { if(e->slideshow.active) { - _ex_slideshow_stop(e); + _ex_slideshow_stop(); } else { - _ex_slideshow_start(e); + _ex_slideshow_start(); } } static void _ex_main_window_tab_toggled_cb(Etk_Object *object, void *data) { - Exhibit *e; Ex_Tab *tab; - e = data; - _ex_slideshow_stop(e); + _ex_slideshow_stop(); tab = evas_list_nth(e->tabs, etk_notebook_current_page_get(ETK_NOTEBOOK(object))); @@ -547,7 +545,7 @@ } void -_ex_main_window_tab_append(Exhibit *e, Ex_Tab *tab) +_ex_main_window_tab_append(Ex_Tab *tab) { if(evas_list_count(e->tabs) == 1) { =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- exhibit_main.h 1 Sep 2006 20:23:50 -0000 1.13 +++ exhibit_main.h 1 Sep 2006 22:41:37 -0000 1.14 @@ -7,8 +7,8 @@ void _ex_main_statusbar_zoom_update(Exhibit *e); void _ex_main_populate_files(const char *selected_file, Ex_Tree_Update update); int _ex_main_window_slideshow_next(void *data); -void _ex_main_window_slideshow_toggle(Exhibit *e); -void _ex_main_window_tab_append(Exhibit *e, Ex_Tab *tab); +void _ex_main_window_slideshow_toggle(); +void _ex_main_window_tab_append(Ex_Tab *tab); void _ex_main_window_tab_remove(Ex_Tab *tab); void _ex_main_dialog_show(char *text, Etk_Message_Dialog_Type type); void _ex_main_window_show(char *dir); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_slideshow.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- exhibit_slideshow.c 15 Aug 2006 22:21:47 -0000 1.6 +++ exhibit_slideshow.c 1 Sep 2006 22:41:37 -0000 1.7 @@ -4,7 +4,7 @@ #include "exhibit.h" void -_ex_slideshow_stop(Exhibit *e) +_ex_slideshow_stop() { if(e->slideshow.active) { @@ -15,7 +15,7 @@ } void -_ex_slideshow_start(Exhibit *e) +_ex_slideshow_start() { if (e->options->slide_interval) e->slideshow.interval = e->options->slide_interval; @@ -23,7 +23,8 @@ if(!e->slideshow.active) { etk_statusbar_push(ETK_STATUSBAR(e->statusbar[3]), "Slideshow running", 0); - e->slideshow.timer = ecore_timer_add(e->slideshow.interval, _ex_slideshow_next, e); + e->slideshow.timer = ecore_timer_add(e->slideshow.interval, + _ex_slideshow_next, NULL); e->slideshow.active = ETK_TRUE; } } @@ -31,13 +32,11 @@ int _ex_slideshow_next(void *data) { - Exhibit *e; Etk_Tree_Row *row, *last_row; int i = 0; int n = 0; char string[80]; - e = data; row = etk_tree_selected_row_get(ETK_TREE(e->cur_tab->itree)); last_row = etk_tree_last_row_get(ETK_TREE(e->cur_tab->itree), ETK_FALSE, ETK_FALSE); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_slideshow.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- exhibit_slideshow.h 14 Aug 2006 16:34:52 -0000 1.2 +++ exhibit_slideshow.h 1 Sep 2006 22:41:37 -0000 1.3 @@ -4,8 +4,8 @@ #ifndef _EX_SLIDESHOW_H #define _EX_SLIDESHOW_H -void _ex_slideshow_stop(Exhibit *e); -void _ex_slideshow_start(Exhibit *e); +void _ex_slideshow_stop(); +void _ex_slideshow_start(); int _ex_slideshow_next(void *data); #endif |
From: Enlightenment C. <no...@cv...> - 2006-09-02 01:43:25
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_comment_jpeg.c exhibit_file.c exhibit_file.h exhibit_image.c exhibit_main.c exhibit_menus.c exhibit_options.c exhibit_options.h exhibit_sort.c exhibit_sort.h exhibit_thumb.c exhibit_thumb.h Log Message: - Only handle the viewable files and dirs when monitoring. - Yet more code polishing... =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_comment_jpeg.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- exhibit_comment_jpeg.c 2 Aug 2006 17:31:03 -0000 1.5 +++ exhibit_comment_jpeg.c 2 Sep 2006 01:43:23 -0000 1.6 @@ -1,4 +1,11 @@ /* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ + +#include "exhibit.h" +#include "exhibit_comment_jpeg.h" + +/* * Updated by HandyAndE * * based on: @@ -9,10 +16,18 @@ * */ -#include <stdlib.h> -#include <sys/types.h> -#include <stdio.h> -#include <string.h> +static int _ex_comment_jpeg_read_1_byte (FILE *infile, int *c); +static int _ex_comment_jpeg_read_2_bytes (FILE *infile, unsigned int *c); +static void _ex_comment_jpeg_write_1_byte (FILE *outfile, int c); +static void _ex_comment_jpeg_write_2_bytes (FILE *outfile, unsigned int val); +static void _ex_comment_jpeg_write_marker(FILE *outfile, int marker); +static void _ex_comment_jpeg_copy_rest_of_file(FILE *infile, FILE *outfile); +static int _ex_comment_jpeg_next_marker (FILE *infile, int *c); +static int _ex_comment_jpeg_first_marker (FILE *infile, int *c); +static int _ex_comment_jpeg_skip_variable (FILE *infile); +static int _ex_comment_jpeg_copy_variable (FILE *infile, FILE *outfile); +static int _ex_comment_jpeg_read_process_COM (FILE *infile, unsigned int *len, char **com); +static int _ex_comment_jpeg_write_scan_header (FILE *infile, FILE *outfile, int *ret, int keep_COM); /* Read one byte, testing for EOF */ static int @@ -536,7 +551,7 @@ fclose(infile); fclose(outfile); rename((const char*) tmp_file, (const char*) file); - free(tmp_file); + E_FREE(tmp_file); return 1; } =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_file.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- exhibit_file.c 28 Jul 2006 16:04:47 -0000 1.9 +++ exhibit_file.c 2 Sep 2006 01:43:23 -0000 1.10 @@ -1,3 +1,6 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #include "exhibit.h" #include <Edje.h> =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_file.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- exhibit_file.h 28 Jul 2006 16:04:47 -0000 1.7 +++ exhibit_file.h 2 Sep 2006 01:43:23 -0000 1.8 @@ -1,3 +1,6 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #ifndef _EX_FILE_H #define _EX_FILE_H =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_image.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- exhibit_image.c 1 Sep 2006 20:23:50 -0000 1.37 +++ exhibit_image.c 2 Sep 2006 01:43:23 -0000 1.38 @@ -444,10 +444,10 @@ { } } - free(as); - free(rs); - free(gs); - free(bs); + E_FREE(as); + E_FREE(rs); + E_FREE(gs); + E_FREE(bs); evas_object_image_data_set(im->image_object, data); evas_object_image_data_update_add(im->image_object, 0, 0, w, h); @@ -1149,7 +1149,7 @@ snprintf(esetroot, strlen("Esetroot ") + strlen(esetroot_opt) + strlen(im->filename) + 2, "Esetroot %s %s", esetroot_opt, im->filename); system(esetroot); - free(esetroot); + E_FREE(esetroot); exit(0); } } =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -3 -r1.73 -r1.74 --- exhibit_main.c 1 Sep 2006 23:39:22 -0000 1.73 +++ exhibit_main.c 2 Sep 2006 01:43:23 -0000 1.74 @@ -269,8 +269,6 @@ Epsilon *ep; Etk_Tree_Row *row; - if(!_ex_file_is_viewable(basename((char *) file))) - return; ep = epsilon_new(file); epsilon_thumb_size(ep, EPSILON_THUMB_NORMAL); @@ -319,44 +317,52 @@ static void _ex_main_monitor_dir(void *data, Ecore_File_Monitor *ecore_file_monitor, Ecore_File_Event event, const char *path) { + struct stat st; + + /* TODO: update non-visible tabs too */ + /* Only do changes if tree's are visible */ if (ecore_file_monitor != e->cur_tab->monitor) return; - /* TODO: update non-visible tabs too */ - - switch (event) + stat(path, &st); + + if(_ex_file_is_viewable(basename((char *) path)) || + S_ISDIR(st.st_mode)) { - case ECORE_FILE_EVENT_CREATED_DIRECTORY: - etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); - _ex_main_populate_files(NULL, EX_TREE_UPDATE_DIRS); - break; - case ECORE_FILE_EVENT_DELETED_DIRECTORY: - etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); - _ex_main_populate_files(NULL, EX_TREE_UPDATE_DIRS); - break; - case ECORE_FILE_EVENT_DELETED_SELF: - etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); - etk_tree_clear(ETK_TREE(e->cur_tab->itree)); - _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); - break; - case ECORE_FILE_EVENT_MODIFIED: - etk_tree_clear(ETK_TREE(e->cur_tab->itree)); - _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES); - break; - case ECORE_FILE_EVENT_DELETED_FILE: - etk_tree_clear(ETK_TREE(e->cur_tab->itree)); - _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES); - break; - case ECORE_FILE_EVENT_CREATED_FILE: - _ex_main_itree_add(path, path); - break; - default: - D(("Unknown ecore file event occured\n")); - break; + switch (event) + { + case ECORE_FILE_EVENT_CREATED_DIRECTORY: + etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_DIRS); + break; + case ECORE_FILE_EVENT_DELETED_DIRECTORY: + etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_DIRS); + break; + case ECORE_FILE_EVENT_DELETED_SELF: + etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); + etk_tree_clear(ETK_TREE(e->cur_tab->itree)); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); + break; + case ECORE_FILE_EVENT_MODIFIED: + /* Careful with what to do here.. */ + break; + case ECORE_FILE_EVENT_DELETED_FILE: + /* TODO: remove the correct item from tree, don't refresh all */ + etk_tree_clear(ETK_TREE(e->cur_tab->itree)); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES); + break; + case ECORE_FILE_EVENT_CREATED_FILE: + _ex_main_itree_add(path, path); + break; + default: + D(("Unknown ecore file event occured\n")); + break; + } + + D(("Monitor event %d happened in %s\n", event, path)); } - - D(("Monitor event %d happened in %s\n", event, path)); } static void @@ -488,7 +494,8 @@ r = etk_tree_selected_row_get(ETK_TREE(e->cur_tab->itree)); if(!r) return; - etk_tree_row_fields_get(r, etk_tree_nth_col_get(ETK_TREE(e->cur_tab->itree), 0), NULL, &icol_string, etk_tree_nth_col_get(ETK_TREE(e->cur_tab->itree), 1),NULL); + etk_tree_row_fields_get(r, etk_tree_nth_col_get(ETK_TREE(e->cur_tab->itree), 0), + NULL, &icol_string, etk_tree_nth_col_get(ETK_TREE(e->cur_tab->itree), 1), NULL); _ex_favorites_add(e, icol_string); } else if(!strcmp(ev->key, "x")) @@ -563,16 +570,11 @@ static void _etk_main_drag_drop_cb(Etk_Object *object, void *event, void *data) { - Etk_Event_Selection_Request *ev; + Etk_Event_Selection_Request *ev = event; Etk_Selection_Data_Files *files; - Exhibit *e; - int i; - ev = event; - e = data; - - if(ev->content != ETK_SELECTION_CONTENT_FILES) + if (ev->content != ETK_SELECTION_CONTENT_FILES) return; files = ev->data; @@ -601,7 +603,8 @@ _ex_main_populate_files(ecore_file_get_file(file), EX_TREE_UPDATE_ALL); if (ecore_file_exists(file) && !ecore_file_is_dir(file)) _ex_main_image_set(e, file); - etk_notebook_page_tab_label_set(ETK_NOTEBOOK(e->notebook), e->cur_tab->num, _ex_file_get(e->cur_tab->cur_path)); + etk_notebook_page_tab_label_set(ETK_NOTEBOOK(e->notebook), e->cur_tab->num, + _ex_file_get(e->cur_tab->cur_path)); break; } } @@ -683,7 +686,6 @@ etk_container_add(ETK_CONTAINER(e->win), e->vbox); e->hpaned = etk_hpaned_new(); - //etk_container_add(ETK_CONTAINER(e->win), e->hpaned); etk_box_append(ETK_BOX(e->vbox), e->hpaned, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); e->vpaned = etk_vpaned_new(); @@ -860,14 +862,12 @@ e->notebook = etk_notebook_new(); etk_notebook_tabs_visible_set(ETK_NOTEBOOK(e->notebook), ETK_FALSE); etk_paned_child2_set(ETK_PANED(e->hpaned), e->notebook, ETK_TRUE); - etk_signal_connect("current_page_changed", ETK_OBJECT(e->notebook), ETK_CALLBACK(_ex_main_window_tab_toggled_cb), e); + etk_signal_connect("current_page_changed", ETK_OBJECT(e->notebook), + ETK_CALLBACK(_ex_main_window_tab_toggled_cb), NULL); e->hbox = etk_hbox_new(ETK_TRUE, 0); etk_box_append(ETK_BOX(e->vbox), e->hbox, ETK_BOX_END, ETK_BOX_NONE, 0); - e->sort = etk_label_new("Sort by date"); - /* size is different than statusbar, how do we make it look good? */ - //etk_box_append(ETK_BOX(e->hbox), e->sort, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); { Etk_Widget *menu; Etk_Widget *menu_item; =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- exhibit_menus.c 1 Sep 2006 23:39:22 -0000 1.33 +++ exhibit_menus.c 2 Sep 2006 01:43:23 -0000 1.34 @@ -167,22 +167,17 @@ void _ex_menu_options_cb(Etk_Object *obj, void *data) { - Exhibit *e = data; - EX_MENU_ITEM_GET_RETURN(obj); - _ex_options_window_show(e); + _ex_options_window_show(); } void _ex_menu_quit_cb(Etk_Object *obj, void *data) { - Exhibit *e; - EX_MENU_ITEM_GET_RETURN(obj); - e = (Exhibit *)data; if (e) - free(e); + E_FREE(e); etk_main_quit(); } @@ -433,12 +428,10 @@ void _ex_menu_add_to_fav_cb(Etk_Object *obj, void *data) { - Exhibit *e; Etk_Tree_Row *r; char *icol_string; EX_MENU_ITEM_GET_RETURN(obj); - e = data; r = etk_tree_selected_row_get(ETK_TREE(e->cur_tab->itree)); if(!r) return; @@ -450,12 +443,10 @@ void _ex_menu_remove_from_fav_cb(Etk_Object *obj, void *data) { - Exhibit *e; Etk_Tree_Row *r; char *icol_string; EX_MENU_ITEM_GET_RETURN(obj); - e = data; r = etk_tree_selected_row_get(ETK_TREE(e->cur_tab->itree)); if(!r) return; @@ -467,12 +458,9 @@ void _ex_menu_go_to_fav_cb(Etk_Object *obj, void *data) { - Exhibit *e; EX_MENU_ITEM_GET_RETURN(obj); - e = data; - - _ex_slideshow_stop(e); + _ex_slideshow_stop(); E_FREE(e->cur_tab->dir); e->cur_tab->dir = strdup(e->options->fav_path); etk_tree_clear(ETK_TREE(e->cur_tab->itree)); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_options.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- exhibit_options.c 1 Sep 2006 21:51:38 -0000 1.16 +++ exhibit_options.c 2 Sep 2006 01:43:23 -0000 1.17 @@ -812,7 +812,7 @@ } void -_ex_options_window_show(Exhibit *e) +_ex_options_window_show() { Etk_Widget *win; Etk_Widget *vbox; =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_options.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- exhibit_options.h 10 Aug 2006 04:01:10 -0000 1.4 +++ exhibit_options.h 2 Sep 2006 01:43:23 -0000 1.5 @@ -11,6 +11,6 @@ void _ex_options_free(Exhibit *e); int _ex_options_save(Exhibit *e); int _ex_options_load(Exhibit *e); -void _ex_options_window_show(Exhibit *e); +void _ex_options_window_show(); #endif =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_sort.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- exhibit_sort.c 11 Aug 2006 02:30:57 -0000 1.6 +++ exhibit_sort.c 2 Sep 2006 01:43:23 -0000 1.7 @@ -1,3 +1,6 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #include "exhibit.h" static Ecore_Evas *ee_buf; =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_sort.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- exhibit_sort.h 23 Dec 2005 01:19:34 -0000 1.2 +++ exhibit_sort.h 2 Sep 2006 01:43:23 -0000 1.3 @@ -1,3 +1,6 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #ifndef _EX_SORT_H #define _EX_SORT_H =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_thumb.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- exhibit_thumb.c 1 Sep 2006 21:51:38 -0000 1.8 +++ exhibit_thumb.c 2 Sep 2006 01:43:23 -0000 1.9 @@ -1,3 +1,6 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #include "exhibit.h" #include "exhibit_file.h" =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_thumb.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- exhibit_thumb.h 14 Dec 2005 11:33:30 -0000 1.1 +++ exhibit_thumb.h 2 Sep 2006 01:43:23 -0000 1.2 @@ -1,3 +1,6 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #ifndef _EX_THUMB_H #define _EX_THUMB_H |
From: Enlightenment C. <no...@cv...> - 2006-09-02 14:14:05
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_main.c Log Message: Having file as argument got broken. Here is a fix.. =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -3 -r1.75 -r1.76 --- exhibit_main.c 2 Sep 2006 12:33:08 -0000 1.75 +++ exhibit_main.c 2 Sep 2006 14:13:59 -0000 1.76 @@ -269,7 +269,6 @@ Epsilon *ep; Etk_Tree_Row *row; - ep = epsilon_new(file); epsilon_thumb_size(ep, EPSILON_THUMB_NORMAL); @@ -281,7 +280,7 @@ row = etk_tree_append(ETK_TREE(e->cur_tab->itree), e->cur_tab->icol, thumb, basename((char *) file), NULL); - if (selected_file && e->options->monitor_focus) + if (selected_file) { if(!strcmp(selected_file, file)) { @@ -301,7 +300,7 @@ thumb->e = e; thumb->name = strdup(basename((char *) file)); thumb_list = evas_list_append(thumb_list, thumb); - if(selected_file && e->options->monitor_focus) + if(selected_file) { if(!strcmp(selected_file, file)) thumb->selected = ETK_TRUE; @@ -354,7 +353,10 @@ _ex_main_populate_files(NULL, EX_TREE_UPDATE_FILES); break; case ECORE_FILE_EVENT_CREATED_FILE: - _ex_main_itree_add(path, path); + if (e->options->monitor_focus) + _ex_main_itree_add(path, path); + else + _ex_main_itree_add(NULL, path); break; default: D(("Unknown ecore file event occured\n")); @@ -627,7 +629,7 @@ _ex_main_window_show(char *dir) { Ex_Tab *tab; - const char *file; + char *file; char *homedir; const char **dnd_types; int dnd_types_num; @@ -838,6 +840,11 @@ 3, 3, 2, 2, 0, 0, ETK_TABLE_NONE); etk_signal_connect("clicked", ETK_OBJECT(e->entry[1]), ETK_CALLBACK(_ex_main_goto_dir_clicked_cb), e); + + if (ecore_file_download_protocol_available("http://")) + { + D(("Protocol HTTP is available\n")); + } /* create first tab but dont place it in notebook */ if(dir) @@ -851,7 +858,7 @@ dir2 = ecore_file_get_dir(dir); tab = _ex_tab_new(e, dir2); E_FREE(dir2); - file = ecore_file_get_file(dir); + file = strdup(dir); } else tab = _ex_tab_new(e, "."); @@ -905,10 +912,11 @@ etk_box_append(ETK_BOX(e->hbox), e->statusbar[3], ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); _ex_main_window_tab_append(tab); - _ex_main_populate_files(file, EX_TREE_UPDATE_ALL); + _ex_main_populate_files(file, EX_TREE_UPDATE_ALL); _ex_tab_select(tab); etk_widget_show_all(e->win); + E_FREE(file); } int |
From: Enlightenment C. <no...@cv...> - 2006-09-02 16:14:57
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_main.c Log Message: Ups! Switched the arguments, caused segv.. =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -3 -r1.77 -r1.78 --- exhibit_main.c 2 Sep 2006 14:33:35 -0000 1.77 +++ exhibit_main.c 2 Sep 2006 16:14:54 -0000 1.78 @@ -356,7 +356,7 @@ if (e->options->monitor_focus) _ex_main_itree_add(path, path); else - _ex_main_itree_add(NULL, path); + _ex_main_itree_add(path, NULL); break; default: D(("Unknown ecore file event occured\n")); |
From: Enlightenment C. <no...@cv...> - 2006-09-03 12:41:32
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit.h exhibit_file.c exhibit_file.h exhibit_main.c exhibit_options.c Log Message: Start of some direct image download code. (and a new option for where to put the files) =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -3 -r1.34 -r1.35 --- exhibit.h 1 Sep 2006 23:39:22 -0000 1.34 +++ exhibit.h 3 Sep 2006 12:41:30 -0000 1.35 @@ -90,6 +90,7 @@ char *app4_cmd; char *fav_path; + char *dl_path; double blur_thresh; double sharpen_thresh; @@ -121,6 +122,7 @@ Etk_Widget *rotate_autosave; Etk_Widget *default_sort; Etk_Widget *monitor_focus; + Etk_Widget *dl_path; Etk_Combobox_Item *sort_date; Etk_Combobox_Item *sort_size; Etk_Combobox_Item *sort_name; =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_file.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- exhibit_file.c 2 Sep 2006 01:43:23 -0000 1.10 +++ exhibit_file.c 3 Sep 2006 12:41:30 -0000 1.11 @@ -15,6 +15,21 @@ NULL }; +int +_ex_file_download_progress_cb(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow) +{ + D(("Download progress on %s\n", file)); + + return TRUE; +} + +void +_ex_file_download_complete_cb(void *data, const char *file, int status) +{ + D(("Download of file %s is done\n", file)); + +} + int _ex_file_is_viewable(char *file) { =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_file.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- exhibit_file.h 2 Sep 2006 01:43:23 -0000 1.8 +++ exhibit_file.h 3 Sep 2006 12:41:30 -0000 1.9 @@ -4,6 +4,8 @@ #ifndef _EX_FILE_H #define _EX_FILE_H +int _ex_file_download_progress_cb(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow); +void _ex_file_download_complete_cb(void *data, const char *file, int status); int _ex_file_is_viewable(char *file); int _ex_file_is_ebg(char *file); int _ex_file_is_jpg(char *file); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.78 retrieving revision 1.79 diff -u -3 -r1.78 -r1.79 --- exhibit_main.c 2 Sep 2006 16:14:54 -0000 1.78 +++ exhibit_main.c 3 Sep 2006 12:41:30 -0000 1.79 @@ -268,6 +268,12 @@ { Epsilon *ep; Etk_Tree_Row *row; + + if (!file) + { + D(("ERROR: file is NULL\n")); + return; + } ep = epsilon_new(file); epsilon_thumb_size(ep, EPSILON_THUMB_NORMAL); @@ -840,17 +846,12 @@ 0, 0, ETK_TABLE_NONE); etk_signal_connect("clicked", ETK_OBJECT(e->entry[1]), ETK_CALLBACK(_ex_main_goto_dir_clicked_cb), e); - if (ecore_file_download_protocol_available("http://")) - { - D(("Protocol HTTP is available\n")); - } - /* create first tab but dont place it in notebook */ - if(dir) + if (dir) { - if(ecore_file_is_dir(dir)) + if (ecore_file_is_dir(dir)) tab = _ex_tab_new(e, dir); - else if(ecore_file_exists(dir)) + else if (ecore_file_exists(dir)) { char *dir2; @@ -858,6 +859,20 @@ tab = _ex_tab_new(e, dir2); E_FREE(dir2); realpath(dir, file); + } + else if (ecore_file_download_protocol_available("http://")) + { + D(("Protocol HTTP is available\n")); + D(("Trying to download %s to %s\n", dir, e->options->dl_path)); + if (ecore_file_download(dir, e->options->dl_path, + _ex_file_download_complete_cb, + _ex_file_download_progress_cb, NULL)) + { + D(("Starting download\n")); + tab = _ex_tab_new(e, e->options->dl_path); + } + else + tab = _ex_tab_new(e, "."); } else tab = _ex_tab_new(e, "."); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_options.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- exhibit_options.c 2 Sep 2006 01:43:23 -0000 1.17 +++ exhibit_options.c 3 Sep 2006 12:41:30 -0000 1.18 @@ -36,12 +36,18 @@ static Eet_Data_Descriptor *_ex_config_options_edd = NULL; static Eet_Data_Descriptor *_ex_config_version_edd = NULL; -static void _ex_options_set(); +static Ex_Config_Version *_ex_options_version_parse(char *version); +static int _ex_options_version_compare(Ex_Config_Version *v1, Ex_Config_Version *v2); static void _ex_options_set_cancel_cb(Etk_Object *object, void *data); static void _ex_options_set_apply_cb(Etk_Object *object, void *data); static void _ex_options_set_ok_cb(Etk_Object *object, void *data); static Etk_Bool _ex_options_window_delete_cb(void *data); - +static void _ex_options_set(); +static Etk_Widget *_ex_options_page_1_create(); +static Etk_Widget *_ex_options_page_2_create(); +static void _ex_options_combobox_active_item_changed_cb(Etk_Object *object, void *data); +static Etk_Widget *_ex_options_page_3_create(); +static Etk_Widget *_ex_options_page_4_create(); int _ex_options_init() @@ -99,6 +105,7 @@ CFG_OPTIONS_NEWI("a2_cmd", app2_cmd, EET_T_STRING); CFG_OPTIONS_NEWI("a3_cmd", app3_cmd, EET_T_STRING); CFG_OPTIONS_NEWI("a4_cmd", app4_cmd, EET_T_STRING); + CFG_OPTIONS_NEWI("dlp", dl_path, EET_T_STRING); CFG_OPTIONS_NEWI("fp", fav_path, EET_T_STRING); CFG_OPTIONS_NEWI("bt", blur_thresh, EET_T_DOUBLE); CFG_OPTIONS_NEWI("st", sharpen_thresh, EET_T_DOUBLE); @@ -128,7 +135,7 @@ return 1; } -Ex_Config_Version * +static Ex_Config_Version * _ex_options_version_parse(char *version) { Ex_Config_Version *v; @@ -148,7 +155,7 @@ * return 0 if v1 == v2 * return -1 if v1 < v2 */ -int +static int _ex_options_version_compare(Ex_Config_Version *v1, Ex_Config_Version *v2) { if(v1->major > v2->major) @@ -197,6 +204,7 @@ e->options->app4 = NULL; e->options->app4_cmd = NULL; e->options->fav_path = NULL; + e->options->dl_path = strdup("/tmp"); e->options->blur_thresh = EX_DEFAULT_BLUR_THRESH; e->options->sharpen_thresh = EX_DEFAULT_SHARPEN_THRESH; e->options->brighten_thresh = EX_DEFAULT_BRIGHTEN_THRESH; @@ -223,6 +231,7 @@ E_FREE(e->options->app3_cmd); E_FREE(e->options->app4_cmd); E_FREE(e->options->fav_path); + E_FREE(e->options->dl_path); E_FREE(e->options); } @@ -252,7 +261,7 @@ if(!ret) fprintf(stderr, "Problem saving config/options!"); - D(("Saving configuation (%s)\n", e->options->fav_path)); + D(("Saving configuation (%s)\n", buf)); eet_close(ef); return ret; @@ -311,10 +320,7 @@ } e->options = eet_data_read(ef, _ex_config_options_edd, "config/options"); - - D(("Config: Loaded saved options (%s)\n", e->options->fav_path)); - - D(("Default view: %d\n", e->options->default_view)); + D(("Config: Loaded saved options (%s)\n", buf)); eet_close(ef); return 1; @@ -359,17 +365,14 @@ const char *string; double ss_int; - /* STANDARD VIEW */ if (IS_SELECTED(dialog->dv_btn_1)) { - D(("Zoom 1:1 is checked\n")); e->options->default_view = EX_IMAGE_ONE_TO_ONE; _ex_tab_current_zoom_one_to_one(e); } else if (IS_SELECTED(dialog->dv_btn_2)) { - D(("Fit to window is checked\n")); e->options->default_view = EX_IMAGE_FIT_TO_WINDOW; e->cur_tab->fit_window = ETK_TRUE; _ex_tab_current_fit_to_window(e); @@ -378,14 +381,12 @@ /* COMMENTS */ if (IS_SELECTED(dialog->comments_visible)) { - D(("Comments EX_DEFAULT_COMMENTS_VISIBLE\n")); e->options->comments_visible = EX_DEFAULT_COMMENTS_VISIBLE; _ex_comment_show(e); _ex_comment_load(e); } else { - D(("Comments EX_DEFAULT_COMMENTS_HIDDEN\n")); e->options->comments_visible = EX_DEFAULT_COMMENTS_HIDDEN; _ex_comment_hide(e); } @@ -400,9 +401,7 @@ string = etk_entry_text_get(ETK_ENTRY(dialog->blur_thresh)); if (string) { - D(("Setting blur thresh: %f\n", atof(string))); e->options->blur_thresh = atof(string); - if (e->options->blur_thresh <= 1) _ex_main_dialog_show("One, Zero or negative value for blur tresh " \ "is not recommended! ", ETK_MESSAGE_DIALOG_WARNING); @@ -417,9 +416,7 @@ string = etk_entry_text_get(ETK_ENTRY(dialog->sharpen_thresh)); if (string) { - D(("Setting sharpen thresh: %f\n", atof(string))); e->options->sharpen_thresh = atof(string); - if (e->options->sharpen_thresh <= 0) _ex_main_dialog_show("Zero or negative value for sharpen tresh " \ "is not recommended! ", ETK_MESSAGE_DIALOG_WARNING); @@ -434,9 +431,7 @@ string = etk_entry_text_get(ETK_ENTRY(dialog->brighten_thresh)); if (string) { - D(("Setting brighten thresh: %f\n", atof(string))); e->options->brighten_thresh = atof(string); - if (e->options->brighten_thresh <= 0) _ex_main_dialog_show("Zero or negative value for brighten tresh " \ "is not recommended! ", ETK_MESSAGE_DIALOG_WARNING); @@ -455,15 +450,11 @@ if (string) { ss_int = atof(string); - if (ss_int <= 0) _ex_main_dialog_show("Zero or negative value for slideshow interval " \ "is not possible, skipping! ", ETK_MESSAGE_DIALOG_WARNING); else - { - D(("Setting slide_interval: %f\n", ss_int)); - e->options->slide_interval = ss_int; - } + e->options->slide_interval = ss_int; } else { @@ -471,6 +462,19 @@ "saving the other options!", ETK_MESSAGE_DIALOG_WARNING); } + /* DOWNLOAD PATH */ + string = etk_entry_text_get(ETK_ENTRY(dialog->dl_path)); + if (string) + { + E_FREE(e->options->dl_path); + e->options->dl_path = strdup(string); + } + else + { + _ex_main_dialog_show("Missing value for image download path, but still " \ + "saving the other options!", ETK_MESSAGE_DIALOG_WARNING); + } + /* SORTING */ e->options->default_sort = e->options->default_sort_tmp; etk_tree_clear(ETK_TREE(e->cur_tab->dtree)); @@ -544,6 +548,17 @@ dialog->comments_visible = etk_check_button_new_with_label("Visible"); etk_box_append(ETK_BOX(vbox2), dialog->comments_visible, ETK_BOX_START, ETK_BOX_NONE, 0); + + frame = etk_frame_new("Image download"); + etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_NONE, 5); + hbox = etk_hbox_new(ETK_FALSE, 0); + etk_container_add(ETK_CONTAINER(frame), hbox); + + label = etk_label_new("Default storage path"); + etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 0); + + dialog->dl_path = etk_entry_new(); + etk_box_append(ETK_BOX(hbox), dialog->dl_path, ETK_BOX_START, ETK_BOX_NONE, 0); /* * Start toggling/setting the correct values from loaded options @@ -558,9 +573,10 @@ sprintf(string, "%.2f", e->options->slide_interval); - D(("Entry gets texts for slide_interval: %s\n", string)); etk_entry_text_set(ETK_ENTRY(dialog->slide_interval), string); + etk_entry_text_set(ETK_ENTRY(dialog->dl_path), e->options->dl_path); + return vbox; } @@ -613,17 +629,11 @@ etk_box_append(ETK_BOX(vbox2), dialog->rotate_autosave, ETK_BOX_START, ETK_BOX_NONE, 0); - sprintf(string, "%.2f", e->options->blur_thresh); - D(("Entry gets texts for blur tresh: %s\n", string)); etk_entry_text_set(ETK_ENTRY(dialog->blur_thresh), string); - sprintf(string, "%.2f", e->options->sharpen_thresh); - D(("Entry gets texts for sharpen tresh: %s\n", string)); etk_entry_text_set(ETK_ENTRY(dialog->sharpen_thresh), string); - sprintf(string, "%.2f", e->options->brighten_thresh); - D(("Entry gets texts for brighten tresh: %s\n", string)); etk_entry_text_set(ETK_ENTRY(dialog->brighten_thresh), string); if (e->options->rotate_autosave) @@ -648,9 +658,6 @@ e->options->default_sort_tmp = EX_SORT_BY_NAME; else if (item == dialog->sort_resolution) e->options->default_sort_tmp = EX_SORT_BY_RESOLUTION; - - D(("Selected item %p, e->options->default_sort_tmp %d\n", item, - e->options->default_sort_tmp)); } static Etk_Widget * |
From: Enlightenment C. <no...@cv...> - 2006-09-08 12:48:30
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_file.c exhibit_file.h exhibit_main.c exhibit_main.h Log Message: "exhibit http://..../image.jpg" now works with progressbar displaying the download status. =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_file.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- exhibit_file.c 6 Sep 2006 12:09:53 -0000 1.12 +++ exhibit_file.c 8 Sep 2006 12:48:25 -0000 1.13 @@ -4,6 +4,8 @@ #include "exhibit.h" #include <Edje.h> +static void _ex_file_download_dialog_response(Etk_Object *obj, int response_id, void *data); + char *viewables[] = { ".jpg", @@ -17,17 +19,70 @@ NULL }; +static Etk_Widget *dialog; +static Etk_Widget *progressbar; + + +static void +_ex_file_download_dialog_response(Etk_Object *obj, int response_id, void *data) +{ + switch(response_id) + { + case ETK_RESPONSE_CANCEL: + etk_object_destroy(ETK_OBJECT(obj)); + break; + default: + break; + } +} + +void +_ex_file_download_dialog(char *url) +{ + char string[PATH_MAX + 50]; + + sprintf(string, "Downloading %s", url); + + dialog = etk_message_dialog_new(ETK_MESSAGE_DIALOG_INFO, + ETK_MESSAGE_DIALOG_CANCEL, + string); + etk_signal_connect("response", ETK_OBJECT(dialog), + ETK_CALLBACK(_ex_file_download_dialog_response), NULL); + + etk_container_border_width_set(ETK_CONTAINER(dialog), 4); + etk_window_title_set(ETK_WINDOW(dialog), + _("Exhibit - Download progress")); + + progressbar = etk_progress_bar_new(); + etk_progress_bar_text_set(ETK_PROGRESS_BAR(progressbar), "0% done"); + etk_dialog_pack_in_main_area(ETK_DIALOG(dialog), progressbar, + ETK_TRUE, ETK_TRUE, 2, ETK_TRUE); + + etk_widget_show_all(dialog); +} + int _ex_file_download_progress_cb(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow) { - D(("Download progress on %s\n", file)); + double fraction; + char text[32]; + + if (dlnow == 0 || dltotal == 0) + return 0; - return TRUE; + fraction = (double) ((double) dlnow) / ((double) dltotal); + snprintf(text, sizeof(text), "%d%% done", (int) (fraction * 100.0)); + etk_progress_bar_text_set(ETK_PROGRESS_BAR(progressbar), text); + etk_progress_bar_fraction_set(ETK_PROGRESS_BAR(progressbar), fraction); + + return 0; } void _ex_file_download_complete_cb(void *data, const char *file, int status) { + etk_object_destroy(ETK_OBJECT(dialog)); + _ex_main_itree_add(file, file); D(("Download of file %s is done\n", file)); } =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_file.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- exhibit_file.h 3 Sep 2006 12:41:30 -0000 1.9 +++ exhibit_file.h 8 Sep 2006 12:48:25 -0000 1.10 @@ -4,6 +4,7 @@ #ifndef _EX_FILE_H #define _EX_FILE_H +void _ex_file_download_dialog(char *url); int _ex_file_download_progress_cb(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow); void _ex_file_download_complete_cb(void *data, const char *file, int status); int _ex_file_is_viewable(char *file); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -3 -r1.79 -r1.80 --- exhibit_main.c 3 Sep 2006 12:41:30 -0000 1.79 +++ exhibit_main.c 8 Sep 2006 12:48:25 -0000 1.80 @@ -9,7 +9,6 @@ Exhibit *e; Evas_List *event_handlers; -static void _ex_main_itree_add(const char *file, const char *selected_file); static void _ex_main_monitor_dir(void *data, Ecore_File_Monitor *ecore_file_monitor, Ecore_File_Event event, const char *path); static int _ex_main_dtree_compare_cb(Etk_Tree *tree, Etk_Tree_Row *row1, Etk_Tree_Row *row2, Etk_Tree_Col *col, void *data); static void _ex_main_goto_dir_clicked_cb(Etk_Object *object, void *data); @@ -263,7 +262,7 @@ closedir(dir); } -static void +void _ex_main_itree_add(const char *file, const char *selected_file) { Epsilon *ep; @@ -274,6 +273,9 @@ D(("ERROR: file is NULL\n")); return; } + + if (ecore_file_size(file) <= 0) + return; ep = epsilon_new(file); epsilon_thumb_size(ep, EPSILON_THUMB_NORMAL); @@ -572,7 +574,6 @@ etk_notebook_current_page_set(ETK_NOTEBOOK(e->notebook), evas_list_count(e->tabs) - 1); tab->num = etk_notebook_current_page_get(ETK_NOTEBOOK(e->notebook)); - D(("Setting tab number %d\n", tab->num)); } static void @@ -862,17 +863,40 @@ } else if (ecore_file_download_protocol_available("http://")) { - D(("Protocol HTTP is available\n")); - D(("Trying to download %s to %s\n", dir, e->options->dl_path)); - if (ecore_file_download(dir, e->options->dl_path, - _ex_file_download_complete_cb, - _ex_file_download_progress_cb, NULL)) + char *ptr; + char tmp_file[PATH_MAX]; + int i; + + if ((ptr = strrchr(dir, '/'))) ptr++; + D(("Trying to download %s to %s/%s\n", dir, + e->options->dl_path, ptr)); + + if (!_ex_file_is_viewable(ptr)) { - D(("Starting download\n")); - tab = _ex_tab_new(e, e->options->dl_path); + tab = _ex_tab_new(e, "."); } else - tab = _ex_tab_new(e, "."); + { + for (i = 0;;i++) + { + snprintf(tmp_file, PATH_MAX, "%s/ex_%d_%s", + e->options->dl_path, i, ptr); + + if (!ecore_file_exists(tmp_file)) + break; + } + + tab = _ex_tab_new(e, e->options->dl_path); + + if (ecore_file_download(dir, tmp_file, + _ex_file_download_complete_cb, + _ex_file_download_progress_cb, NULL)) + { + D(("Starting download\n")); + _ex_file_download_dialog(dir); + } + } + } else tab = _ex_tab_new(e, "."); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- exhibit_main.h 1 Sep 2006 22:41:37 -0000 1.14 +++ exhibit_main.h 8 Sep 2006 12:48:26 -0000 1.15 @@ -6,6 +6,7 @@ void _ex_main_statusbar_zoom_update(Exhibit *e); void _ex_main_populate_files(const char *selected_file, Ex_Tree_Update update); +void _ex_main_itree_add(const char *file, const char *selected_file); int _ex_main_window_slideshow_next(void *data); void _ex_main_window_slideshow_toggle(); void _ex_main_window_tab_append(Ex_Tab *tab); |
From: Enlightenment C. <no...@cv...> - 2006-09-08 16:54:32
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_file.c exhibit_file.h exhibit_main.c Log Message: Make cancel download work and added more info on the progressbar. =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_file.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- exhibit_file.c 8 Sep 2006 12:48:25 -0000 1.13 +++ exhibit_file.c 8 Sep 2006 16:54:30 -0000 1.14 @@ -29,6 +29,9 @@ switch(response_id) { case ETK_RESPONSE_CANCEL: + ecore_file_download_abort_all(); + ecore_file_unlink(data); + E_FREE(data); etk_object_destroy(ETK_OBJECT(obj)); break; default: @@ -37,9 +40,9 @@ } void -_ex_file_download_dialog(char *url) +_ex_file_download_dialog(char *url, char *file) { - char string[PATH_MAX + 50]; + char string[PATH_MAX + 16]; sprintf(string, "Downloading %s", url); @@ -47,7 +50,7 @@ ETK_MESSAGE_DIALOG_CANCEL, string); etk_signal_connect("response", ETK_OBJECT(dialog), - ETK_CALLBACK(_ex_file_download_dialog_response), NULL); + ETK_CALLBACK(_ex_file_download_dialog_response), file); etk_container_border_width_set(ETK_CONTAINER(dialog), 4); etk_window_title_set(ETK_WINDOW(dialog), @@ -65,15 +68,36 @@ _ex_file_download_progress_cb(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow) { double fraction; - char text[32]; + char text[42]; + static long int last; + static double t_last; + long int diff; + double t_diff; + double kbytes; + static double total_kbytes; if (dlnow == 0 || dltotal == 0) return 0; - fraction = (double) ((double) dlnow) / ((double) dltotal); - snprintf(text, sizeof(text), "%d%% done", (int) (fraction * 100.0)); - etk_progress_bar_text_set(ETK_PROGRESS_BAR(progressbar), text); - etk_progress_bar_fraction_set(ETK_PROGRESS_BAR(progressbar), fraction); + if (!total_kbytes) + total_kbytes = (double) ((((double)dltotal) / 1024)); + + if (last) + { + diff = dlnow - last; + t_diff = ecore_time_get() - t_last; + kbytes = (double) ((((double) diff) / 1024)); + fraction = (double) ((double) dlnow) / ((double) dltotal); + etk_progress_bar_fraction_set(ETK_PROGRESS_BAR(progressbar), fraction); + snprintf(text, sizeof(text), "%d%% done at %.0f kb/s (%.0f of %.0f kb)", + (int) (fraction * 100.0), + kbytes / t_diff, + kbytes, total_kbytes); + etk_progress_bar_text_set(ETK_PROGRESS_BAR(progressbar), text); + } + + t_last = ecore_time_get(); + last = dlnow; return 0; } @@ -81,8 +105,9 @@ void _ex_file_download_complete_cb(void *data, const char *file, int status) { - etk_object_destroy(ETK_OBJECT(dialog)); _ex_main_itree_add(file, file); + etk_object_destroy(ETK_OBJECT(dialog)); + E_FREE(data); D(("Download of file %s is done\n", file)); } =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_file.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- exhibit_file.h 8 Sep 2006 12:48:25 -0000 1.10 +++ exhibit_file.h 8 Sep 2006 16:54:30 -0000 1.11 @@ -4,7 +4,7 @@ #ifndef _EX_FILE_H #define _EX_FILE_H -void _ex_file_download_dialog(char *url); +void _ex_file_download_dialog(char *url, char *file); int _ex_file_download_progress_cb(void *data, const char *file, long int dltotal, long int dlnow, long int ultotal, long int ulnow); void _ex_file_download_complete_cb(void *data, const char *file, int status); int _ex_file_is_viewable(char *file); =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.80 retrieving revision 1.81 diff -u -3 -r1.80 -r1.81 --- exhibit_main.c 8 Sep 2006 12:48:25 -0000 1.80 +++ exhibit_main.c 8 Sep 2006 16:54:30 -0000 1.81 @@ -864,19 +864,17 @@ else if (ecore_file_download_protocol_available("http://")) { char *ptr; - char tmp_file[PATH_MAX]; + char *tmp_file; int i; if ((ptr = strrchr(dir, '/'))) ptr++; - D(("Trying to download %s to %s/%s\n", dir, - e->options->dl_path, ptr)); - if (!_ex_file_is_viewable(ptr)) { tab = _ex_tab_new(e, "."); } else { + tmp_file = malloc(PATH_MAX); for (i = 0;;i++) { snprintf(tmp_file, PATH_MAX, "%s/ex_%d_%s", @@ -890,10 +888,10 @@ if (ecore_file_download(dir, tmp_file, _ex_file_download_complete_cb, - _ex_file_download_progress_cb, NULL)) + _ex_file_download_progress_cb, tmp_file)) { - D(("Starting download\n")); - _ex_file_download_dialog(dir); + D(("Starting download to %s\n", tmp_file)); + _ex_file_download_dialog(dir, tmp_file); } } |
From: Enlightenment C. <no...@cv...> - 2006-09-13 21:36:13
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit/src/bin Modified Files: exhibit_main.c Log Message: segv-- and added argv/argc stuff. =================================================================== RCS file: /cvs/e/e17/proto/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -3 -r1.81 -r1.82 --- exhibit_main.c 8 Sep 2006 16:54:30 -0000 1.81 +++ exhibit_main.c 13 Sep 2006 21:36:09 -0000 1.82 @@ -868,6 +868,10 @@ int i; if ((ptr = strrchr(dir, '/'))) ptr++; + + if (!ptr) + ptr = dir; + if (!_ex_file_is_viewable(ptr)) { tab = _ex_tab_new(e, "."); @@ -957,6 +961,30 @@ int main(int argc, char *argv[]) { + int i; + + for (i = 1; i < argc; i++) + { + if (((!strcmp(argv[i], "-h")) || + (!strcmp(argv[i], "--help")))) + { + printf("Usage\n"); + printf(" %s <image>\n", PACKAGE); + printf(" %s <path>\n", PACKAGE); + printf(" %s <url>\n\n", PACKAGE); + printf(" -h, --help\t\t display this help and exit\n"); + printf(" -v, --version\t\t output version information and exit\n\n"); + exit(1); + } + else if (((!strcmp(argv[i], "-v")) || + (!strcmp(argv[i], "--version")))) + { + printf("%s version %s\n", PACKAGE, VERSION); + exit(1); + } + + } + if (!etk_init(&argc, &argv)) { fprintf(stderr, "Could not init etk. Exiting...\n"); |
From: Enlightenment C. <no...@cv...> - 2006-09-13 22:25:29
|
Enlightenment CVS committal Author : balony Project : e17 Module : proto Dir : e17/proto/exhibit Modified Files: TODO Log Message: todo++ bugs++ =================================================================== RCS file: /cvs/e/e17/proto/exhibit/TODO,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- TODO 1 Sep 2006 23:42:50 -0000 1.17 +++ TODO 13 Sep 2006 22:25:27 -0000 1.18 @@ -8,8 +8,11 @@ - Close tab - Create window - Close window -- menus - * release notes +- Rightclick menu on thumbs (rightclick without having to select, would be +nice if you want to delete an image without viewing it in fullsize and then +you wont have to wait for the loading if it for example is a big image). + +- Fix sorting menu (on statusbar) o DONE: ------ @@ -66,7 +69,8 @@ ======= * BUGS: ======= - +- when rotating images and saving it doesnt update in the thumb listing. +- when sorting on name right after adding a new image it doesnt sort correct. - fix autocomplete (combobox?) - if we're looking at a LOT of images and change dir before they have finished loading, then the images will thumbnail and load in the current dir |