From: John Ellis Date: Mon, 13 Jun 2005 21:39:13 +0000 (+0000) Subject: Mon Jun 13 17:31:46 2005 John Ellis X-Git-Tag: v1.0.0~1743 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=db847541f4accf694cb745f32d6c360ae740c119 Mon Jun 13 17:31:46 2005 John Ellis * editors.[ch]: Add "%w" macro to disable full screen deactivation when running an editor command. * img-view.c, layout_image.c, pan-view.c: Honor %w editor flag to prevent exit of full screen. * image-load.c (image_load_begin): Fix to not treat short reads as end of file condition. * README, doc/10_5_editor_commands.html: Document %w macro for editor commands. * po/it.po: Update Italian translation, submitted by Kostantino . --- diff --git a/ChangeLog b/ChangeLog index 8ca45b93..e17ac6da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Mon Jun 13 17:31:46 2005 John Ellis + + * editors.[ch]: Add "%w" macro to disable full screen deactivation when + running an editor command. + * img-view.c, layout_image.c, pan-view.c: Honor %w editor flag to + prevent exit of full screen. + * image-load.c (image_load_begin): Fix to not treat short reads as + end of file condition. + * README, doc/10_5_editor_commands.html: Document %w macro for editor + commands. + * po/it.po: Update Italian translation, + submitted by Kostantino . + Sun Jun 12 19:25:26 2005 John Ellis * format_canon.[ch]: Reimplement canon raw parser to use convenience diff --git a/README b/README index f3d81595..aa8a9ab7 100644 --- a/README +++ b/README @@ -351,10 +351,15 @@ homepage: http://gqview.sourceforge.net Use of the following to display output window for the command: %v Display result of command in output window, must occur as first two - characters in the command. + characters in the command, or immediately after the "%w" macro. %V Like v above, but when used with %p, only displays output window for multiple files. The output of a single file is suppressed. + Additional macros: + + %w Prevent full screen from deactivating when command is executed, + must occur as the first two characters. + ======== Additional comments: Advanced options: diff --git a/TODO b/TODO index 45953a9c..4b83eaf5 100644 --- a/TODO +++ b/TODO @@ -91,7 +91,7 @@ d> fix window size hints not to use USER_SIZE as we do not use gtk_window_resize ------------- - > update translations: it( ) ( ) ( ) +d> update translations: it(x) ( ) ( ) > document recent additions/changes: > Added 'Fast jpeg thumbnailing'. diff --git a/doc/10_5_editor_commands.html b/doc/10_5_editor_commands.html index 4844f95a..32d4df5f 100644 --- a/doc/10_5_editor_commands.html +++ b/doc/10_5_editor_commands.html @@ -5,7 +5,7 @@ Editor Options - GQview User Manual - +
@@ -86,8 +86,9 @@ filenames onto the end of the command (the result will be the same as

%v

-

Display the result of the command in an output window, must - occur as the first two characters.

+

Display the result of the command in an output window. Must + occur as the first two characters, or immediately after the “%w” + macro.

@@ -100,6 +101,15 @@ filenames onto the end of the command (the result will be the same as file is suppressed.

+ + +

%w

+ + +

Prevent full screen from deactivating when command is + executed. Must occur as the first two characters.

+ + @@ -152,4 +162,4 @@ settings, discarding any customizations made by the user.


- + \ No newline at end of file diff --git a/po/it.po b/po/it.po index 610b2feb..e1f24b3a 100644 --- a/po/it.po +++ b/po/it.po @@ -1,21 +1,21 @@ -# translation of gqview-1.5.9_it.po to Italiano +# translation of gqview-2.1.0_it.po to Italiano # This file is distributed under the same license as the PACKAGE package. -# Costantino , 2005. # Un ringraziamento per i preziosi suggerimenti a Marco Colombo +# Kostantino , 2005. # Copyright (C) Christopher R. Gabriel , 2000 - 2001. -# Costantino , 2005. +# Kostantino , 2005. msgid "" msgstr "" -"Project-Id-Version: gqview-1.5.9_it\n" +"Project-Id-Version: gqview-2.1.0_it\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2005-03-05 16:24-0500\n" -"PO-Revision-Date: 2005-02-26 16:44+0100\n" -"Last-Translator: Costantino \n" -"Language-Team: Italiano \n" +"PO-Revision-Date: 2005-03-11 17:26+0100\n" +"Last-Translator: Kostantino \n" +"Language-Team: Italiano \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.3.1\n" +"X-Generator: KBabel 1.9.1\n" #: src/bar_info.c:30 msgid "Favorite" @@ -1234,9 +1234,8 @@ msgid "_Search..." msgstr "C_erca..." #: src/layout_util.c:768 -#, fuzzy msgid "Pan _view" -msgstr "Vista avanzata" +msgstr "_Vista panoramica" #: src/layout_util.c:769 msgid "_Print..." @@ -1615,19 +1614,17 @@ msgid "Rotate _180" msgstr "Ruota di _180 gradi" #: src/pan-view.c:3109 -#, fuzzy, c-format +#, c-format msgid "%d images, %s" -msgstr "%d immagini" +msgstr "%d immagini, %s" #: src/pan-view.c:3180 src/pan-view.c:3233 -#, fuzzy msgid "Sorting images..." -msgstr "Sto ordinando..." +msgstr "Sto ordinando le immagini..." #: src/pan-view.c:3552 src/pan-view.c:3879 -#, fuzzy msgid "Date:" -msgstr "Data" +msgstr "Data:" #: src/pan-view.c:3562 src/preferences.c:849 src/print.c:3201 src/print.c:3408 msgid "Size:" @@ -1635,21 +1632,19 @@ msgstr "Dimensione:" #: src/pan-view.c:3617 msgid "path found" -msgstr "" +msgstr "il percorso è stato trovato" #: src/pan-view.c:3617 -#, fuzzy msgid "filename found" -msgstr "Il file non è stato trovato" +msgstr "Il file è stato trovato" #: src/pan-view.c:3665 -#, fuzzy msgid "partial match" -msgstr "parziale" +msgstr "corrispondenza parziale" #: src/pan-view.c:3876 src/pan-view.c:3909 msgid "no match" -msgstr "" +msgstr "nessuna corrispondenza" #: src/pan-view.c:4179 src/search.c:2140 msgid "Folder not found" @@ -1657,88 +1652,79 @@ msgstr "La cartella non è stata trovata" #: src/pan-view.c:4180 msgid "The entered path is not a folder" -msgstr "" +msgstr "Il percorso immesso non corrisponde ad una cartella" #: src/pan-view.c:4285 -#, fuzzy msgid "Timeline" -msgstr "Bilineare" +msgstr "Linea tempo" #: src/pan-view.c:4286 -#, fuzzy msgid "Calendar" -msgstr "Pu_lisci" +msgstr "Calendario" #: src/pan-view.c:4288 -#, fuzzy msgid "Folders (flower)" -msgstr "Cartelle" +msgstr "Cartelle (fiore)" #: src/pan-view.c:4289 msgid "Grid" -msgstr "" +msgstr "Griglia" #: src/pan-view.c:4298 -#, fuzzy msgid "Dots" -msgstr "punti" +msgstr "Punti" #: src/pan-view.c:4299 -#, fuzzy msgid "No Images" -msgstr "Immagine" +msgstr "Nessuna immagine" #: src/pan-view.c:4300 -#, fuzzy msgid "Small Thumbnails" -msgstr "Miniature" +msgstr "Miniature Piccole" #: src/pan-view.c:4301 -#, fuzzy msgid "Normal Thumbnails" -msgstr "Miniature" +msgstr "Miniature Normali" #: src/pan-view.c:4302 -#, fuzzy msgid "Large Thumbnails" -msgstr "Miniature" +msgstr "Miniature Grandi" #: src/pan-view.c:4303 msgid "1:10 (10%)" -msgstr "" +msgstr "1:10 (10%)" #: src/pan-view.c:4304 msgid "1:4 (25%)" -msgstr "" +msgstr "1:4 (25%)" #: src/pan-view.c:4305 msgid "1:3 (33%)" -msgstr "" +msgstr "1:3 (33%)" #: src/pan-view.c:4306 msgid "1:2 (50%)" -msgstr "" +msgstr "1:2 (50%)" #: src/pan-view.c:4307 msgid "1:1 (100%)" -msgstr "" +msgstr "1:1 (100%)" #: src/pan-view.c:4358 -#, fuzzy msgid "Find:" -msgstr "File:" +msgstr "Trova:" #: src/pan-view.c:4409 msgid "Find" -msgstr "" +msgstr "Trova" #: src/pan-view.c:4470 msgid "Pan View Performance" -msgstr "" +msgstr "Esecuzione Vista Panoramica" #: src/pan-view.c:4477 msgid "Pan view performance may be poor." -msgstr "" +msgstr "L'esecuzione in vista panoramica può essere scadente." #: src/pan-view.c:4478 msgid "" @@ -1746,6 +1732,9 @@ msgid "" "can be enabled. Note that both options must be enabled to notice a change in " "performance." msgstr "" +"Le opzioni seguenti possono essere abilitate per migliorare l'esecuzione delle miniature in modalità vista panoramica. " +"Nota che, per rilevare una modifica nella resa, entrambe le opzioni " +"devono essere abilitate." #: src/pan-view.c:4486 src/preferences.c:852 msgid "Cache thumbnails" @@ -1757,7 +1746,7 @@ msgstr "Usa la cache condivisa delle miniature" #: src/pan-view.c:4494 msgid "Do not show this dialog again" -msgstr "" +msgstr "Non mostrare ancora questo" #: src/preferences.c:390 msgid "Nearest (worst, but fastest)" @@ -1853,7 +1842,7 @@ msgstr "Utilizza le miniature di Xvpic se esistono (sola lettura)" #: src/preferences.c:872 msgid "Faster jpeg thumbnailing (may reduce quality)" -msgstr "" +msgstr "Miniaturizzazione JPEG veloce (potrebbe ridurre la qualità)" #: src/preferences.c:875 msgid "Slide show" @@ -2549,8 +2538,7 @@ msgstr "Rango" #: src/thumb.c:379 msgid "Thumbnail image in cache failed to load, trying to recreate.\n" -msgstr "" -"Non sono riuscito a caricare le miniature dalla cache: provo a ricrearle.\n" +msgstr "Non sono riuscito a caricare le miniature dalla cache: provo a ricrearle.\n" #: src/ui_bookmark.c:148 #, c-format @@ -3154,3 +3142,4 @@ msgid "" msgstr "" "Il nome del file non è valido:\n" "%s" + diff --git a/src/editors.c b/src/editors.c index d7eaa6c7..4a21156e 100644 --- a/src/editors.c +++ b/src/editors.c @@ -464,10 +464,16 @@ static gint editor_line_break(const gchar *template, gchar **front, const gchar * * Only one of the macros %f or %p may be used in a given commmand. * - * %v must be the first two characters in a command, causes a window to display + * %v must be the first two characters[1] in a command, causes a window to display * showing the output of the command(s). * %V same as %v except in the case of %p only displays a window for multiple files, * operating on a single file is suppresses the output dialog. + * + * %w must be first two characters in a command, presence will disable full screen + * from exiting upon invocation. + * + * + * [1] Note: %v,%V may also be preceded by "%w". */ static void editor_command_run(const gchar *template, const gchar *text, GList *list) { @@ -478,6 +484,9 @@ static void editor_command_run(const gchar *template, const gchar *text, GList * for_each = (strstr(template, "%p") != NULL); + /* no window state change flag, skip */ + if (strncmp(template, "%w", 2) == 0) template += 2; + if (strncmp(template, "%v", 2) == 0) { template += 2; @@ -582,3 +591,14 @@ void start_editor_from_file(gint n, const gchar *path) start_editor_from_path_list(n, list); g_list_free(list); } + +gint editor_window_flag_set(gint n) +{ + if (n < 0 || n >= GQVIEW_EDITOR_SLOTS || + !editor_command[n] || + strlen(editor_command[n]) == 0) return TRUE; + + return (strncmp(editor_command[n], "%w", 2) == 0); +} + + diff --git a/src/editors.h b/src/editors.h index 26fd8745..b03aec79 100644 --- a/src/editors.h +++ b/src/editors.h @@ -18,6 +18,8 @@ void editor_reset_defaults(void); void start_editor_from_file(gint n, const gchar *path); void start_editor_from_path_list(gint n, GList *list); +gint editor_window_flag_set(gint n); + #endif diff --git a/src/image-load.c b/src/image-load.c index 86d098db..f0d1386b 100644 --- a/src/image-load.c +++ b/src/image-load.c @@ -217,7 +217,7 @@ static gint image_loader_begin(ImageLoader *il) b = read(il->load_fd, &buf, sizeof(buf)); - if (b > 1 && + if (b > 0 && format_raw_img_exif_offsets_fd(il->load_fd, il->path, buf, b, &offset, NULL)) { if (debug) printf("Raw file %s contains embedded image\n", il->path); @@ -231,66 +231,47 @@ static gint image_loader_begin(ImageLoader *il) return FALSE; } - if (gdk_pixbuf_loader_write(il->loader, buf, b, NULL)) + if (!gdk_pixbuf_loader_write(il->loader, buf, b, NULL)) { - il->bytes_read += b + offset; + image_loader_stop(il); + return FALSE; + } - if (b < sizeof(buf)) - { - /* end of file already */ + il->bytes_read += b + offset; + /* read until size is known */ + while (il->loader && !gdk_pixbuf_loader_get_pixbuf(il->loader) && b > 0) + { + b = read(il->load_fd, &buf, sizeof(buf)); + if (b < 0 || (b > 0 && !gdk_pixbuf_loader_write(il->loader, buf, b, NULL))) + { image_loader_stop(il); - - if (!il->pixbuf) return FALSE; - - image_loader_done_delay(il); - return TRUE; + return FALSE; } - else - { - /* larger file */ - - /* read until size is known */ - while(il->loader && !gdk_pixbuf_loader_get_pixbuf(il->loader) && b > 0) - { - b = read(il->load_fd, &buf, sizeof(buf)); - if (b < 0 || (b > 0 && !gdk_pixbuf_loader_write(il->loader, buf, b, NULL))) - { - image_loader_stop(il); - return FALSE; - } - il->bytes_read += b; - } - if (!il->pixbuf) image_loader_sync_pixbuf(il); - - if (il->bytes_read == il->bytes_total || b < sizeof(buf)) - { - /* done, handle (broken) loaders that do not have pixbuf till close */ - image_loader_stop(il); + il->bytes_read += b; + } + if (!il->pixbuf) image_loader_sync_pixbuf(il); - if (!il->pixbuf) return FALSE; + if (il->bytes_read == il->bytes_total || b < 1) + { + /* done, handle (broken) loaders that do not have pixbuf till close */ + image_loader_stop(il); - image_loader_done_delay(il); - return TRUE; - } + if (!il->pixbuf) return FALSE; - if (!il->pixbuf) - { - image_loader_stop(il); - return FALSE; - } - - /* finally, progressive loading :) */ - il->idle_id = g_idle_add_full(il->idle_priority, image_loader_idle_cb, il, NULL); - return TRUE; - } + image_loader_done_delay(il); + return TRUE; } - else + + if (!il->pixbuf) { image_loader_stop(il); return FALSE; } + /* finally, progressive loading :) */ + il->idle_id = g_idle_add_full(il->idle_priority, image_loader_idle_cb, il, NULL); + return TRUE; } diff --git a/src/img-view.c b/src/img-view.c index b0f305a8..2da0f536 100644 --- a/src/img-view.c +++ b/src/img-view.c @@ -528,7 +528,11 @@ static gint view_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpoi } if (n != -1) { - view_fullscreen_toggle(vw, TRUE); + if (!editor_window_flag_set(n)) + { + view_fullscreen_toggle(vw, TRUE); + } + imd = view_window_active_image(vw); start_editor_from_file(n, image_get_path(imd)); } } @@ -1023,14 +1027,20 @@ static void view_new_window_cb(GtkWidget *widget, gpointer data) static void view_edit_cb(GtkWidget *widget, gpointer data) { ViewWindow *vw; + ImageWindow *imd; gint n; vw = submenu_item_get_data(widget); n = GPOINTER_TO_INT(data); if (!vw) return; - view_fullscreen_toggle(vw, TRUE); - start_editor_from_file(n, image_get_path(vw->imd)); + if (!editor_window_flag_set(n)) + { + view_fullscreen_toggle(vw, TRUE); + } + + imd = view_window_active_image(vw); + start_editor_from_file(n, image_get_path(imd)); } static void view_alter_cb(GtkWidget *widget, gpointer data) diff --git a/src/layout_image.c b/src/layout_image.c index 385d7163..0db14caf 100644 --- a/src/layout_image.c +++ b/src/layout_image.c @@ -282,7 +282,10 @@ static gint layout_image_full_screen_key_press_cb(GtkWidget *widget, GdkEventKey } if (n != -1) { - layout_image_full_screen_stop(lw); + if (!editor_window_flag_set(n)) + { + layout_image_full_screen_stop(lw); + } start_editor_from_file(n, layout_image_get_path(lw)); } } @@ -568,8 +571,10 @@ static void li_pop_menu_edit_cb(GtkWidget *widget, gpointer data) lw = submenu_item_get_data(widget); n = GPOINTER_TO_INT(data); - layout_image_full_screen_stop(lw); - + if (!editor_window_flag_set(n)) + { + layout_image_full_screen_stop(lw); + } start_editor_from_file(n, layout_image_get_path(lw)); } diff --git a/src/pan-view.c b/src/pan-view.c index d8257421..8aebb79f 100644 --- a/src/pan-view.c +++ b/src/pan-view.c @@ -3523,7 +3523,10 @@ static gint pan_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpoin } if (n != -1 && path) { - pan_fullscreen_toggle(pw, TRUE); + if (!editor_window_flag_set(n)) + { + pan_fullscreen_toggle(pw, TRUE); + } start_editor_from_file(n, path); stop_signal = TRUE; } @@ -4656,7 +4659,10 @@ static void pan_edit_cb(GtkWidget *widget, gpointer data) path = pan_menu_click_path(pw); if (path) { - pan_fullscreen_toggle(pw, TRUE); + if (!editor_window_flag_set(n)) + { + pan_fullscreen_toggle(pw, TRUE); + } start_editor_from_file(n, path); } }