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 * ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs