From c358e3546f21d2dc456a328c4f8e3c51040ce59d Mon Sep 17 00:00:00 2001 From: titan Date: Mon, 14 May 2007 17:05:29 +0000 Subject: [PATCH] Clean it up for translators. SVN revision: 29995 --- src/bin/ephoto_edit_view.c | 54 ++++++++++++++++++++++++++++++++---- src/bin/ephoto_exif.c | 2 +- src/bin/ephoto_gui.c | 16 +++++------ src/bin/ephoto_imaging.c | 4 +-- src/bin/ephoto_list_view.c | 11 +++++--- src/bin/ephoto_main.c | 26 +++++++++-------- src/bin/ephoto_single_view.c | 4 +-- 7 files changed, 83 insertions(+), 34 deletions(-) diff --git a/src/bin/ephoto_edit_view.c b/src/bin/ephoto_edit_view.c index 271e74d..cac3e76 100644 --- a/src/bin/ephoto_edit_view.c +++ b/src/bin/ephoto_edit_view.c @@ -5,6 +5,9 @@ static void add_standard_edit_tools(Ewl_Widget *c); static void add_advanced_edit_tools(Ewl_Widget *c); static void previous_image(Ewl_Widget *w, void *event, void *data); static void next_image(Ewl_Widget *w, void *event, void *data); +static void zoom_in(Ewl_Widget *w, void *event, void *data); +static void zoom_out(Ewl_Widget *w, void *event, void *data); +//static void zoom_full(Ewl_Widget *w, void *event, void *data); static void flip_image_horizontal(Ewl_Widget *w, void *event, void *data); static void flip_image_vertical(Ewl_Widget *w, void *event, void *data); static void rotate_image_left(Ewl_Widget *w, void *event, void *data); @@ -30,7 +33,7 @@ Ewl_Widget *add_edit_view(Ewl_Widget *c) ewl_object_maximum_w_set(EWL_OBJECT(standard), 172); ewl_object_minimum_w_set(EWL_OBJECT(standard), 172); ewl_object_fill_policy_set(EWL_OBJECT(standard), EWL_FLAG_FILL_VFILL); - ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(nb), standard, "Standard Tools"); + ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(nb), standard, _("Standard Tools")); add_standard_edit_tools(standard); @@ -38,7 +41,7 @@ Ewl_Widget *add_edit_view(Ewl_Widget *c) ewl_object_maximum_w_set(EWL_OBJECT(advanced), 172); ewl_object_minimum_w_set(EWL_OBJECT(advanced), 172); ewl_object_fill_policy_set(EWL_OBJECT(advanced), EWL_FLAG_FILL_VFILL); - ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(nb), advanced, "Advanced Tools"); + ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(nb), advanced, _("Advanced Tools")); add_advanced_edit_tools(advanced); @@ -60,11 +63,11 @@ Ewl_Widget *add_edit_view(Ewl_Widget *c) button = add_button(bhbox, NULL, PACKAGE_DATA_DIR "/images/media-seek-backward.png", previous_image, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 25, 25); - ewl_attach_tooltip_text_set(button, "Previous Image"); + ewl_attach_tooltip_text_set(button, _("Previous Image")); button = add_button(bhbox, NULL, PACKAGE_DATA_DIR "/images/media-seek-forward.png", next_image, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 25, 25); - ewl_attach_tooltip_text_set(button, "Next Image"); + ewl_attach_tooltip_text_set(button, _("Next Image")); return hbox; } @@ -83,6 +86,21 @@ static void add_standard_edit_tools(Ewl_Widget *c) { Ewl_Widget *button; + button = add_button(c, "Zoom In", PACKAGE_DATA_DIR "/images/search.png", zoom_in, NULL); + ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); + ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_LEFT); + ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_HFILL); + + button = add_button(c, "Zoom Out", PACKAGE_DATA_DIR "/images/search.png", zoom_out, NULL); + ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); + ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_LEFT); + ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_HFILL); + + //button = add_button(c, "Zoom 1:1", PACKAGE_DATA_DIR "/images/search.png", zoom_full, NULL); + ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); + ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_LEFT); + ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_HFILL); + button = add_button(c, "Rotate Left", PACKAGE_DATA_DIR "/images/undo.png", rotate_image_left, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_LEFT); @@ -142,7 +160,6 @@ static void previous_image(Ewl_Widget *w, void *event, void *data) return; } - /*Go to the next image*/ static void next_image(Ewl_Widget *w, void *event, void *data) { @@ -161,6 +178,33 @@ static void next_image(Ewl_Widget *w, void *event, void *data) return; } +/*Zoom in on the image*/ +static void zoom_in(Ewl_Widget *w, void *event, void *data) +{ + int ow, oh; + + ewl_object_current_size_get(EWL_OBJECT(em->eimage), &ow, &oh); + + ewl_image_size_set(EWL_IMAGE(em->eimage), ow*2, oh*2); + ewl_widget_configure(em->eimage->parent); + + return; +} + +/*Zoom out the image*/ +static void zoom_out(Ewl_Widget *w, void *event, void *data) +{ + int ow, oh; + + ewl_object_current_size_get(EWL_OBJECT(em->eimage), &ow, &oh); + + ewl_image_size_set(EWL_IMAGE(em->eimage), ow/2, oh/2); + ewl_widget_configure(em->eimage->parent); + + return; +} + + /*Flip the image 180 degrees horizontally*/ static void flip_image_horizontal(Ewl_Widget *w, void *event, void *data) { diff --git a/src/bin/ephoto_exif.c b/src/bin/ephoto_exif.c index 48defb9..8fd31c8 100644 --- a/src/bin/ephoto_exif.c +++ b/src/bin/ephoto_exif.c @@ -99,7 +99,7 @@ static void add_exif_to_container(Ewl_Widget *w, void *event, void *data) if(ecore_hash_count(exif_info) == 0) { - ecore_list_append(values, strdup("No Exif Data Exists")); + ecore_list_append(values, strdup(_("No Exif Data Exists"))); } else { diff --git a/src/bin/ephoto_gui.c b/src/bin/ephoto_gui.c index bf38db1..d420b14 100644 --- a/src/bin/ephoto_gui.c +++ b/src/bin/ephoto_gui.c @@ -37,7 +37,7 @@ Ewl_Widget *add_entry(Ewl_Widget *c, const char *txt, void *cb, void *data) Ewl_Widget *entry; entry = ewl_entry_new(); - if(txt) ewl_text_text_set(EWL_TEXT(entry), txt); + if(txt) ewl_text_text_set(EWL_TEXT(entry), _(txt)); if(c) ewl_container_child_append(EWL_CONTAINER(c), entry); if(cb) ewl_callback_append(entry, EWL_CALLBACK_VALUE_CHANGED, cb, data); ewl_widget_show(entry); @@ -52,7 +52,7 @@ Ewl_Widget *add_icon(Ewl_Widget *c, const char *lbl, const char *img, int thumbn icon = ewl_icon_new(); if(!thumbnail) ewl_icon_thumbnailing_set(EWL_ICON(icon), FALSE); - if (lbl) ewl_icon_label_set(EWL_ICON(icon), lbl); + if (lbl) ewl_icon_label_set(EWL_ICON(icon), _(lbl)); if (img) ewl_icon_image_set(EWL_ICON(icon), img, NULL); if (c) ewl_container_child_append(EWL_CONTAINER(c), icon); if (cb) ewl_callback_append(icon, EWL_CALLBACK_CLICKED, cb, data); @@ -103,7 +103,7 @@ Ewl_Widget *add_label(Ewl_Widget *c, const char *lbl) Ewl_Widget *label; label = ewl_label_new(); - if(lbl) ewl_label_text_set(EWL_LABEL(label), lbl); + if(lbl) ewl_label_text_set(EWL_LABEL(label), _(lbl)); ewl_object_alignment_set(EWL_OBJECT(label), EWL_FLAG_ALIGN_CENTER); ewl_object_fill_policy_set(EWL_OBJECT(label), EWL_FLAG_FILL_SHRINK); if(c) ewl_container_child_append(EWL_CONTAINER(c), label); @@ -131,7 +131,7 @@ Ewl_Widget *add_menu(Ewl_Widget *c, const char *lbl) Ewl_Widget *menu; menu = ewl_menu_new(); - if(lbl) ewl_button_label_set(EWL_BUTTON(menu), lbl); + if(lbl) ewl_button_label_set(EWL_BUTTON(menu), _(lbl)); ewl_object_fill_policy_set(EWL_OBJECT(menu), EWL_FLAG_FILL_NONE); if(c) ewl_container_child_append(EWL_CONTAINER(c), menu); ewl_widget_show(menu); @@ -146,7 +146,7 @@ Ewl_Widget *add_menu_item(Ewl_Widget *c, const char *lbl, const char *img, void mi = ewl_menu_item_new(); if(img) ewl_button_image_set(EWL_BUTTON(mi), img, NULL); - if(lbl) ewl_button_label_set(EWL_BUTTON(mi), lbl); + if(lbl) ewl_button_label_set(EWL_BUTTON(mi), _(lbl)); ewl_object_alignment_set(EWL_OBJECT(mi), EWL_FLAG_ALIGN_CENTER); ewl_object_fill_policy_set(EWL_OBJECT(mi), EWL_FLAG_FILL_ALL); if(c) ewl_container_child_append(EWL_CONTAINER(c), mi); @@ -174,7 +174,7 @@ Ewl_Widget *add_text(Ewl_Widget *c, const char *txt) Ewl_Widget *text; text = ewl_text_new(); - if(txt) ewl_text_text_set(EWL_TEXT(text), txt); + if(txt) ewl_text_text_set(EWL_TEXT(text), _(txt)); ewl_object_alignment_set(EWL_OBJECT(text), EWL_FLAG_ALIGN_CENTER); ewl_object_fill_policy_set(EWL_OBJECT(text), EWL_FLAG_FILL_SHRINK); if(c) ewl_container_child_append(EWL_CONTAINER(c), text); @@ -191,8 +191,8 @@ Ewl_Widget *add_window(const char *name, int width, int height, void *cb, void * win = ewl_window_new(); if(name) { - ewl_window_title_set(EWL_WINDOW(win), name); - ewl_window_name_set(EWL_WINDOW(win), name); + ewl_window_title_set(EWL_WINDOW(win), _(name)); + ewl_window_name_set(EWL_WINDOW(win), _(name)); } if(width && height) ewl_object_size_request(EWL_OBJECT(win), width, height); if(cb) ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, cb, data); diff --git a/src/bin/ephoto_imaging.c b/src/bin/ephoto_imaging.c index 484be6f..8b1dd65 100644 --- a/src/bin/ephoto_imaging.c +++ b/src/bin/ephoto_imaging.c @@ -305,8 +305,8 @@ static void save_image(Ewl_Widget *w, void *event, void *data) pid_t pid; file = ewl_text_text_get(EWL_TEXT(data)); - snprintf(flags, PATH_MAX, "quality=%f compress=%f", ewl_range_value_get(EWL_RANGE(qseek)), - ewl_range_value_get(EWL_RANGE(cseek))); + snprintf(flags, PATH_MAX, "quality=%i compress=%i", (int)ewl_range_value_get(EWL_RANGE(qseek)), + (int)ewl_range_value_get(EWL_RANGE(cseek))); if(!file) return; diff --git a/src/bin/ephoto_list_view.c b/src/bin/ephoto_list_view.c index d5b39dc..8f07d6d 100644 --- a/src/bin/ephoto_list_view.c +++ b/src/bin/ephoto_list_view.c @@ -73,7 +73,7 @@ Ewl_Widget *add_ltree(Ewl_Widget *c) ewl_tree2_column_count_set(EWL_TREE2(tree), 1); ewl_mvc_model_set(EWL_MVC(tree), model); ewl_mvc_view_set(EWL_MVC(tree), view); - ewl_mvc_selection_mode_set(EWL_MVC(tree), EWL_SELECTION_MODE_SINGLE); + ewl_mvc_selection_mode_set(EWL_MVC(tree), EWL_SELECTION_MODE_NONE); ewl_object_fill_policy_set(EWL_OBJECT(tree), EWL_FLAG_FILL_ALL); ewl_container_child_append(EWL_CONTAINER(c), tree); ewl_widget_show(tree); @@ -93,10 +93,13 @@ static Ewl_Widget *list_view_new(void *data, unsigned int row, unsigned int colu image = data; image_pixels_int_get(image, &width, &height); size = ecore_file_size(image); - snprintf(info, PATH_MAX, "Name: %s\nPixels: %s\nSize: %s\n", + snprintf(info, PATH_MAX, "%s: %s\n%s: %s\n%s: %s\n", + _("Name"), basename((char *)image), - image_pixels_string_get(image), - file_size_get(size)); + _("Pixels"), + image_pixels_string_get(image), + _("Size"), + file_size_get(size)); hbox = add_box(NULL, EWL_ORIENTATION_HORIZONTAL, 10); ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_HFILL); diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c index f12f00b..c2579e7 100644 --- a/src/bin/ephoto_main.c +++ b/src/bin/ephoto_main.c @@ -201,12 +201,12 @@ void create_main_gui(void) em->atree = add_atree(em->browser); ewl_object_maximum_w_set(EWL_OBJECT(em->atree), 200); ewl_widget_name_set(em->atree, "Albums"); - ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(em->browser), em->atree, "Albums"); + ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(em->browser), em->atree, _("Albums")); em->dtree = add_dtree(em->browser); ewl_object_maximum_w_set(EWL_OBJECT(em->dtree), 200); ewl_widget_name_set(em->dtree, "File System"); - ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(em->browser), em->dtree, "File System"); + ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(em->browser), em->dtree, _("File System")); em->view_box = ewl_notebook_new(); ewl_notebook_tabbar_visible_set(EWL_NOTEBOOK(em->view_box), 0); @@ -229,19 +229,19 @@ void create_main_gui(void) button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/normal_view.png", show_normal_view, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); - ewl_attach_tooltip_text_set(button, "Normal View"); + ewl_attach_tooltip_text_set(button, _("Normal View")); ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK); ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_CENTER); button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/list_view.png", show_list_view, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); - ewl_attach_tooltip_text_set(button, "List View"); + ewl_attach_tooltip_text_set(button, _("List View")); ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK); ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_CENTER); button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/image.png", show_single_view, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); - ewl_attach_tooltip_text_set(button, "Single View"); + ewl_attach_tooltip_text_set(button, _("Single View")); ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK); ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_CENTER); @@ -251,23 +251,23 @@ void create_main_gui(void) button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/get_exif.png", NULL, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); - ewl_attach_tooltip_text_set(button, "You do not have libexif 0.6.13"); + ewl_attach_tooltip_text_set(button, _("You do not have libexif 0.6.13")); ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_LEFT); ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_HFILL); #ifdef BUILD_EXIF_SUPPORT ewl_callback_append(button, EWL_CALLBACK_CLICKED, display_exif_dialog, NULL); - ewl_attach_tooltip_text_set(button, "View Exif Data"); + ewl_attach_tooltip_text_set(button, _("View Exif Data")); #endif button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/stock_fullscreen.png", window_fullscreen, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); - ewl_attach_tooltip_text_set(button, "Toggle Fullscreen"); + ewl_attach_tooltip_text_set(button, _("Toggle Fullscreen")); ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK); ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_CENTER); button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/x-office-presentation.png", start_slideshow, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); - ewl_attach_tooltip_text_set(button, "Start a Slideshow"); + ewl_attach_tooltip_text_set(button, _("Start a Slideshow")); ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK); ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_CENTER); @@ -277,13 +277,13 @@ void create_main_gui(void) button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/edit_view.png", show_edit_view, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 30, 30); - ewl_attach_tooltip_text_set(button, "Move to edit view"); + ewl_attach_tooltip_text_set(button, _("Move to edit view")); ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK); ewl_object_alignment_set(EWL_OBJECT(button), EWL_FLAG_ALIGN_CENTER); em->db = ephoto_db_init(); - em->current_album = strdup("Complete Library"); + em->current_album = strdup(_("Complete Library")); em->current_directory = strdup(getenv("HOME")); populate_albums(NULL, NULL, NULL); @@ -335,9 +335,9 @@ static void populate_albums(Ewl_Widget *w, void *event, void *data) ewl_object_alignment_set(EWL_OBJECT(thumb), EWL_FLAG_ALIGN_CENTER); ewl_widget_name_set(thumb, imagef); } - ecore_dlist_next(em->images); } + ewl_widget_reparent(em->fbox); ecore_dlist_goto_first(em->images); if(ecore_dlist_current(em->images)) { @@ -398,6 +398,7 @@ static void populate_directories(Ewl_Widget *w, void *event, void *data) } ecore_dlist_next(em->images); } + ewl_widget_reparent(em->fbox); ecore_dlist_goto_first(em->images); if(ecore_dlist_current(em->images)) { @@ -459,6 +460,7 @@ static Ewl_Widget *add_dtree(Ewl_Widget *c) ewl_tree2_column_count_set(EWL_TREE2(tree), 1); ewl_mvc_model_set(EWL_MVC(tree), model); ewl_mvc_view_set(EWL_MVC(tree), view); + ewl_mvc_selection_mode_set(EWL_MVC(tree), EWL_SELECTION_MODE_NONE); ewl_object_fill_policy_set(EWL_OBJECT(tree), EWL_FLAG_FILL_ALL); ewl_container_child_append(EWL_CONTAINER(c), tree); ewl_widget_show(tree); diff --git a/src/bin/ephoto_single_view.c b/src/bin/ephoto_single_view.c index e598390..b981e56 100644 --- a/src/bin/ephoto_single_view.c +++ b/src/bin/ephoto_single_view.c @@ -28,11 +28,11 @@ Ewl_Widget *add_single_view(Ewl_Widget *c) button = add_button(hbox, NULL, PACKAGE_DATA_DIR "/images/media-seek-backward.png", previous_image, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 25, 25); - ewl_attach_tooltip_text_set(button, "Previous Image"); + ewl_attach_tooltip_text_set(button, _("Previous Image")); button = add_button(hbox, NULL, PACKAGE_DATA_DIR "/images/media-seek-forward.png", next_image, NULL); ewl_button_image_size_set(EWL_BUTTON(button), 25, 25); - ewl_attach_tooltip_text_set(button, "Next Image"); + ewl_attach_tooltip_text_set(button, _("Next Image")); return em->single_vbox; }