display an error dialog when we fail to parse a log file

due to EOF or a bad header parsing.  Fixes #331620 based
on the test-case.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13292 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins
2006-02-18 16:45:50 +00:00
parent d6b618a92d
commit 46b1c64d77
2 changed files with 11 additions and 1 deletions

View File

@@ -3,6 +3,11 @@
* intl-scm/xgettext.scm: remove the absolute path from filenames
* intl-scm/Makefile.am: pass the absolute path to xgettext.scm
* src/import-export/log-replay/gnc-log-replay.c:
display an error dialog when we fail to parse a log file
due to EOF or a bad header parsing. Fixes #331620 based
on the test-case.
2006-02-17 David Hampton <hampton@employees.org>
* src/register/register-gnome/gnucash-sheet.c:

View File

@@ -44,7 +44,7 @@
#include "gnc-book.h"
#include "gnc-ui-util.h"
#include "gnc-gconf-utils.h"
#include "gnc-gui-query.h"
#define GCONF_SECTION "dialogs/log_replay"
@@ -534,6 +534,8 @@ void gnc_file_log_replay (void)
if((read_retval = fgets(read_buf,sizeof(read_buf),log_file)) == NULL)
{
DEBUG("Read error or EOF");
gnc_info_dialog(NULL, "%s",
_("The log file you selected was empty."));
}
else
{
@@ -541,6 +543,9 @@ void gnc_file_log_replay (void)
{
PERR("File header not recognised:\n%s",read_buf);
PERR("Expected:\n%s",expected_header);
gnc_error_dialog(NULL, "%s",
_("The log file you selected cannot be read. "
"The file header was not recognized."));
}
else
{