Enlightenment CVS committal Author : codewarrior Project : e17 Module : apps/exhibit
Dir : e17/apps/exhibit/src/bin Modified Files: exhibit.h exhibit_file.c exhibit_image.c exhibit_main.c exhibit_main.h exhibit_menus.c exhibit_menus.h exhibit_options.c exhibit_thumb.c Log Message: patch by Brian 'morlenxus' Miculcy <[EMAIL PROTECTED]>: - 'options' menu entry moved from 'file' to 'edit' menu - 'set as wallpaper' menu entry moved from 'edit' to file' menu - new menu entry 'fullscreen' added to view menu - new option for showing all filetypes - new option for showing hidden files and directories - use "%s" when running command - new commandline argument 's'/'--slideshow', starts the slideshow on application start - fixed segfault on menu 'quit' - toggle fullscreen on double click at image - fit to window/zoom one to one is automatically switching on middle mouse click at image - show e17 background edje thumbnails again - clear image view on directory change =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit.h,v retrieving revision 1.41 retrieving revision 1.42 diff -u -3 -r1.41 -r1.42 --- exhibit.h 3 May 2007 10:30:41 -0000 1.41 +++ exhibit.h 1 Jun 2007 10:19:06 -0000 1.42 @@ -103,6 +103,8 @@ int default_view; int default_sort; int default_sort_tmp; + int show_all_filetypes; + int list_hidden; int monitor_focus; int last_w; @@ -122,6 +124,8 @@ Etk_Widget *comments_visible; Etk_Widget *rotate_autosave; Etk_Widget *default_sort; + Etk_Widget *show_all_filetypes; + Etk_Widget *list_hidden; Etk_Widget *monitor_focus; Etk_Widget *dl_path; Etk_Combobox_Item *sort_date; =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_file.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- exhibit_file.c 10 Mar 2007 04:30:29 -0000 1.16 +++ exhibit_file.c 1 Jun 2007 10:19:06 -0000 1.17 @@ -151,7 +151,7 @@ for (l = groups; l; l = l->next) { - if (!strcmp(l->data, "desktop/background")) + if (!strcmp(l->data, "e/desktop/background")) { val = 1; break; =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_image.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -3 -r1.48 -r1.49 --- exhibit_image.c 3 May 2007 16:21:53 -0000 1.48 +++ exhibit_image.c 1 Jun 2007 10:19:06 -0000 1.49 @@ -73,16 +73,23 @@ if(ev->button == 1) { - e->mouse.down = 1; - e->mouse.x = ev->canvas.x; - e->mouse.y = ev->canvas.y; + if (ev->flags != ETK_MOUSE_DOUBLE_CLICK) + { + e->mouse.down = 1; + e->mouse.x = ev->canvas.x; + e->mouse.y = ev->canvas.y; - etk_toplevel_pointer_push(ETK_TOPLEVEL(e->win), ETK_POINTER_MOVE); + etk_toplevel_pointer_push(ETK_TOPLEVEL(e->win), ETK_POINTER_MOVE); + } + else + _ex_main_window_fullscreen_toggle(e); } else if(ev->button == 2) { - /* TODO Make this function configurable in options */ - _ex_tab_current_fit_to_window(e); + if (e->cur_tab->fit_window) + _ex_tab_current_zoom_one_to_one(e); + else + _ex_tab_current_fit_to_window(e); } else if(ev->button == 3) { =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_main.c,v retrieving revision 1.102 retrieving revision 1.103 diff -u -3 -r1.102 -r1.103 --- exhibit_main.c 4 May 2007 09:45:48 -0000 1.102 +++ exhibit_main.c 1 Jun 2007 10:19:06 -0000 1.103 @@ -147,7 +147,7 @@ { /* can we do this without the size request? it doesnt look good */ etk_widget_size_request_set(ETK_WIDGET(e->cur_tab->image), 800, 600); - etk_image_set_from_edje(ETK_IMAGE(e->cur_tab->image), image, "desktop/background"); + etk_image_set_from_edje(ETK_IMAGE(e->cur_tab->image), image, "e/desktop/background"); } else { @@ -208,6 +208,7 @@ DIR *dir; struct dirent *dir_entry; + _ex_main_image_unset(); chdir(e->cur_tab->dir); if (update == EX_TREE_UPDATE_ALL || update == EX_TREE_UPDATE_DIRS) @@ -245,8 +246,12 @@ char imagereal[PATH_MAX]; struct stat st; - /* Do not include hidden files */ - if (dir_entry->d_name[0] == '.') + /* Do not include current dir/above dir */ + if ((!strcmp (dir_entry->d_name, ".")) || (!strcmp (dir_entry->d_name, ".."))) + continue; + + /* Show hidden files and directories? */ + if ((!e->options->list_hidden) && (dir_entry->d_name[0] == '.')) continue; snprintf(image, PATH_MAX, "%s", dir_entry->d_name); @@ -269,7 +274,7 @@ if (update == EX_TREE_UPDATE_DIRS) continue; - if(!_ex_file_is_viewable(dir_entry->d_name)) + if ((!e->options->show_all_filetypes) && (!_ex_file_is_viewable(dir_entry->d_name))) continue; if(!realpath(image, imagereal)) @@ -744,7 +749,7 @@ void -_ex_main_window_show(char *dir, int fullscreen) +_ex_main_window_show(char *dir, int fullscreen, int slideshow) { Ex_Tab *tab; Etk_Widget *entry_hbox, *toolbar; @@ -837,12 +842,11 @@ _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); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Set as wallpaper"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_set_wallpaper_cb), e); _ex_menu_item_new(EX_MENU_ITEM_SEPARATOR, 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_SEPARATOR, NULL, ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), NULL, NULL); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Options"), ETK_STOCK_PREFERENCES_SYSTEM, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_options_cb), e); - _ex_menu_item_new(EX_MENU_ITEM_SEPARATOR, NULL, ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), NULL, NULL); menu_item = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Close"), ETK_STOCK_LIST_REMOVE, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_run_in_cb), e); submenu = etk_menu_new(); @@ -883,8 +887,8 @@ _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Sharpen"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_sharpen_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Brighten"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(submenu), ETK_CALLBACK(_ex_menu_brighten_cb), e); _ex_menu_item_new(EX_MENU_ITEM_SEPARATOR, NULL, ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), NULL, NULL); - _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Set as wallpaper"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_set_wallpaper_cb), e); - + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Options"), ETK_STOCK_PREFERENCES_SYSTEM, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_options_cb), e); + /* Create the "View" menu item */ menu_item = _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("View"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(e->menu_bar), NULL, NULL); menu = etk_menu_new(); @@ -910,6 +914,7 @@ _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Zoom out"), EX_IMAGE_ZOOM_OUT, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_zoom_out_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Zoom 1:1"), EX_IMAGE_ONE_TO_ONE, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_zoom_one_to_one_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Fit to window"), EX_IMAGE_FIT_TO_WINDOW, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_fit_to_window_cb), e); + _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Fullscreen"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_window_fullscreen_toggle_cb), e); _ex_menu_item_new(EX_MENU_ITEM_SEPARATOR, NULL, ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), NULL, NULL); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Toggle slideshow"), ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_toggle_slideshow_cb), e); _ex_menu_item_new(EX_MENU_ITEM_NORMAL, _("Refresh"), ETK_STOCK_VIEW_REFRESH, ETK_MENU_SHELL(menu), ETK_CALLBACK(_ex_menu_refresh_cb), e); @@ -1083,24 +1088,27 @@ if(fullscreen) _ex_main_window_fullscreen_toggle(e); + if (slideshow) + _ex_main_window_slideshow_toggle(); } int main(int argc, char *argv[]) { int i; - int fullscreen = 0; + int fullscreen = 0, slideshow = 0; 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(" -f, --fullscreen\t\t start Exhibit in fullscreen mode\n"); + printf("Usage:\n"); + printf(" %s <image> <options>\n", PACKAGE); + printf(" %s <path> <options>\n", PACKAGE); + printf(" %s <url> <options>\n\n", PACKAGE); + printf(" -f, --fullscreen\t start Exhibit in fullscreen mode\n"); + printf(" -s, --slideshow\t start Exhibit in slideshow mode\n"); 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); @@ -1114,6 +1122,9 @@ else if (((!strcmp(argv[i], "-f")) || (!strcmp(argv[i], "--fullscreen")))) fullscreen = 1; + else if (((!strcmp(argv[i], "-s")) || + (!strcmp(argv[i], "--slideshow")))) + slideshow = 1; } if (!etk_init(&argc, &argv)) @@ -1131,9 +1142,9 @@ epsilon_init(); if(argc > 1) - _ex_main_window_show(argv[1], fullscreen); + _ex_main_window_show(argv[1], fullscreen, slideshow); else - _ex_main_window_show(NULL, fullscreen); + _ex_main_window_show(NULL, fullscreen, slideshow); etk_main(); if(e) =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_main.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- exhibit_main.h 17 Jan 2007 01:30:09 -0000 1.18 +++ exhibit_main.h 1 Jun 2007 10:19:06 -0000 1.19 @@ -13,7 +13,7 @@ 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, int fullscreen); +void _ex_main_window_show(char *dir, int fullscreen, int slideshow); void _ex_main_image_unset(); void _ex_main_image_set(Exhibit *e, char *image); void _ex_main_button_fit_to_window_cb(Etk_Object *obj, void *data); =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_menus.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- exhibit_menus.c 4 May 2007 09:45:48 -0000 1.45 +++ exhibit_menus.c 1 Jun 2007 10:19:06 -0000 1.46 @@ -185,12 +185,12 @@ void _ex_menu_quit_cb(Etk_Object *obj, void *data) { + Exhibit *e = data; EX_MENU_ITEM_GET_RETURN(obj); if (e) { _ex_options_save(e); - E_FREE(e); } etk_main_quit(); @@ -375,6 +375,16 @@ _ex_menu_fit_to_window_cb(Etk_Object *obj, void *data) { _ex_tab_current_fit_to_window(data); +} + +void +_ex_menu_window_fullscreen_toggle_cb(Etk_Object *obj, void *data) +{ + Exhibit *e; + EX_MENU_ITEM_GET_RETURN(obj); + + e = data; + _ex_main_window_fullscreen_toggle(e); } void =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_menus.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- exhibit_menus.h 3 May 2007 16:21:53 -0000 1.14 +++ exhibit_menus.h 1 Jun 2007 10:19:06 -0000 1.15 @@ -38,6 +38,7 @@ void _ex_menu_zoom_out_cb(Etk_Object *obj, void *data); void _ex_menu_zoom_one_to_one_cb(Etk_Object *obj, void *data); void _ex_menu_fit_to_window_cb(Etk_Object *obj, void *data); +void _ex_menu_window_fullscreen_toggle_cb(Etk_Object *obj, void *data); void _ex_menu_toggle_slideshow_cb(Etk_Object *obj, void *data); void _ex_menu_refresh_cb(Etk_Object *obj, void *data); void _ex_menu_comments_cb(Etk_Object *obj, void *data); =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_options.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- exhibit_options.c 25 Mar 2007 18:38:03 -0000 1.23 +++ exhibit_options.c 1 Jun 2007 10:19:06 -0000 1.24 @@ -116,6 +116,8 @@ 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("saft", show_all_filetypes, EET_T_INT); + CFG_OPTIONS_NEWI("lh", list_hidden, EET_T_INT); CFG_OPTIONS_NEWI("lw", last_w, EET_T_INT); CFG_OPTIONS_NEWI("lh", last_h, EET_T_INT); @@ -196,11 +198,11 @@ /* TODO: free values before allocating if e->options != NULL */ e->options->app1 = strdup("The Gimp"); - e->options->app1_cmd = strdup("gimp %s"); + e->options->app1_cmd = strdup("gimp \"%s\""); e->options->app2 = strdup("Xv"); - e->options->app2_cmd = strdup("xv %s"); + e->options->app2_cmd = strdup("xv \"%s\""); e->options->app3 = strdup("Xpaint"); - e->options->app3_cmd = strdup("xpaint %s"); + e->options->app3_cmd = strdup("xpaint \"%s\""); e->options->app4 = NULL; e->options->app4_cmd = NULL; e->options->fav_path = NULL; @@ -212,10 +214,12 @@ e->options->comments_visible = EX_DEFAULT_COMMENTS_HIDDEN; e->options->default_view = EX_IMAGE_ONE_TO_ONE; e->options->default_sort = EX_SORT_BY_NAME; + e->options->show_all_filetypes = ETK_FALSE; + e->options->list_hidden = ETK_FALSE; 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->options->monitor_focus = ETK_FALSE; e->version = _ex_options_version_parse(VERSION); } @@ -479,7 +483,6 @@ 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(NULL, EX_TREE_UPDATE_ALL); /* MONITOR FOCUS */ if (IS_SELECTED(dialog->monitor_focus)) @@ -487,6 +490,18 @@ else e->options->monitor_focus = ETK_FALSE; + /* SHOW ALL FILETYPESS */ + if (IS_SELECTED(dialog->show_all_filetypes)) + e->options->show_all_filetypes = ETK_TRUE; + else + e->options->show_all_filetypes = ETK_FALSE; + + /* LIST HIDDEN FILES AND DIRECTORIES*/ + if (IS_SELECTED(dialog->list_hidden)) + e->options->list_hidden = ETK_TRUE; + else + e->options->list_hidden = ETK_FALSE; + /* RUN IN */ APP_NEW(dialog->app1, e->options->app1); APP_NEW(dialog->app1_cmd, e->options->app1_cmd); @@ -497,12 +512,13 @@ APP_NEW(dialog->app4, e->options->app4); APP_NEW(dialog->app4_cmd, e->options->app4_cmd); - /* Rebuild the possible new menu */ + /* REGENERATE EVERYTHING */ 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(NULL); + _ex_main_populate_files(NULL, EX_TREE_UPDATE_ALL); } static Etk_Widget * @@ -658,6 +674,7 @@ _ex_options_page_3_create() { Etk_Widget *vbox, *hbox; + Etk_Widget *vbox2; Etk_Widget *frame, *label; Etk_Widget *image; Ex_Options_Dialog *dialog = e->opt_dialog; @@ -696,16 +713,24 @@ 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"); + frame = etk_frame_new("Directory listing"); 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); + vbox2 = etk_vbox_new(ETK_FALSE, 0); + etk_container_add(ETK_CONTAINER(frame), vbox2); 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); + etk_box_append(ETK_BOX(vbox2), dialog->monitor_focus, ETK_BOX_START, ETK_BOX_NONE, 0); + dialog->show_all_filetypes = etk_check_button_new_with_label("Show all kind of filetypes"); + etk_box_append(ETK_BOX(vbox2), dialog->show_all_filetypes, ETK_BOX_START, ETK_BOX_NONE, 0); + dialog->list_hidden = etk_check_button_new_with_label("List hidden files and directories"); + etk_box_append(ETK_BOX(vbox2), dialog->list_hidden, 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->show_all_filetypes) + etk_toggle_button_toggle(ETK_TOGGLE_BUTTON(dialog->show_all_filetypes)); + if (e->options->list_hidden) + etk_toggle_button_toggle(ETK_TOGGLE_BUTTON(dialog->list_hidden)); if (e->options->default_sort == EX_SORT_BY_DATE) etk_combobox_active_item_set(ETK_COMBOBOX(dialog->default_sort), dialog->sort_date); =================================================================== RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_thumb.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- exhibit_thumb.c 3 May 2007 13:06:17 -0000 1.14 +++ exhibit_thumb.c 1 Jun 2007 10:19:06 -0000 1.15 @@ -79,7 +79,7 @@ thumb = thumb_list->data; if(_ex_file_is_ebg(thumb->name)) - epsilon_key_set(thumb->ep, "desktop/background"); + epsilon_key_set(thumb->ep, "e/desktop/background"); if(epsilon_generate(thumb->ep)) { thumb->image = (char*)epsilon_thumb_file_get(thumb->ep); ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs