Revision: 2283 http://geany.svn.sourceforge.net/geany/?rev=2283&view=rev Author: ntrel Date: 2008-02-25 09:27:54 -0800 (Mon, 25 Feb 2008)
Log Message: ----------- Don't beep when using Replace All in Session unless all open files have no replacements (fixes #1893796).
Modified Paths: -------------- trunk/ChangeLog trunk/src/document.c trunk/src/search.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-02-25 17:02:23 UTC (rev 2282) +++ trunk/ChangeLog 2008-02-25 17:27:54 UTC (rev 2283) @@ -3,6 +3,9 @@ * src/notebook.c: When closing a tab when using left-to-right tabs, focus the next document, not the previous. + * src/search.c, src/document.c: + Don't beep when using Replace All in Session unless all open files + have no replacements (fixes #1893796).
2008-02-24 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2008-02-25 17:02:23 UTC (rev 2282) +++ trunk/src/document.c 2008-02-25 17:27:54 UTC (rev 2283) @@ -1852,10 +1852,6 @@ count = document_replace_range( idx, find_text, replace_text, flags, 0, len, TRUE, NULL);
- if (count == 0) - { - utils_beep(); - } show_replace_summary(idx, count, find_text, replace_text, escaped_chars); return (count > 0); }
Modified: trunk/src/search.c =================================================================== --- trunk/src/search.c 2008-02-25 17:02:23 UTC (rev 2282) +++ trunk/src/search.c 2008-02-25 17:27:54 UTC (rev 2283) @@ -962,8 +962,11 @@ } case GEANY_RESPONSE_REPLACE_IN_FILE: { - document_replace_all(idx, find, replace, search_flags_re, search_replace_escape_re); - if (close_window) gtk_widget_hide(widgets.replace_dialog); + if (! document_replace_all(idx, find, replace, search_flags_re, + search_replace_escape_re)) + { + utils_beep(); + } break; } case GEANY_RESPONSE_REPLACE_IN_SESSION: @@ -980,21 +983,30 @@ if (document_replace_all(ix, find, replace, search_flags_re, search_replace_escape_re)) count++; } + if (count == 0) + utils_beep(); + ui_set_statusbar(FALSE, _("Replaced text in %u files."), count); // show which docs had replacements: gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_STATUS);
ui_save_buttons_toggle(doc_list[idx].changed); // update save all - if (close_window) gtk_widget_hide(widgets.replace_dialog); break; } case GEANY_RESPONSE_REPLACE_IN_SEL: { document_replace_sel(idx, find, replace, search_flags_re, search_replace_escape_re); - if (close_window) gtk_widget_hide(widgets.replace_dialog); break; } } + switch (response) + { + case GEANY_RESPONSE_REPLACE_IN_SEL: + case GEANY_RESPONSE_REPLACE_IN_FILE: + case GEANY_RESPONSE_REPLACE_IN_SESSION: + if (close_window) + gtk_widget_hide(widgets.replace_dialog); + } g_free(find); g_free(replace); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.