2007-06-17 [wwp] 2.9.2cvs68

* src/ldif.c
	* src/importldif.c
		LDIF import: better error handling, minor code
		and UI cleanup, and renamed the Save button
		to Close, as imported stuff is already saved
		when the Save button is shown.
This commit is contained in:
Tristan Chabredier 2007-06-17 20:54:04 +00:00
parent 2dd9662818
commit e19aaf0148
5 changed files with 30 additions and 12 deletions

View file

@ -1,3 +1,12 @@
2007-06-17 [wwp] 2.9.2cvs68
* src/ldif.c
* src/importldif.c
LDIF import: better error handling, minor code
and UI cleanup, and renamed the Save button
to Close, as imported stuff is already saved
when the Save button is shown.
2007-06-17 [colin] 2.9.2cvs67
* src/prefs_summaries.c

View file

@ -2643,3 +2643,4 @@
( cvs diff -u -r 1.1.2.42 -r 1.1.2.43 src/prefs_summaries.c; cvs diff -u -r 1.150.2.96 -r 1.150.2.97 src/procmsg.c; ) > 2.9.2cvs65.patchset
( cvs diff -u -r 1.17.2.34 -r 1.17.2.35 src/alertpanel.c; ) > 2.9.2cvs66.patchset
( cvs diff -u -r 1.1.2.43 -r 1.1.2.44 src/prefs_summaries.c; cvs diff -u -r 1.150.2.97 -r 1.150.2.98 src/procmsg.c; ) > 2.9.2cvs67.patchset
( cvs diff -u -r 1.12.2.12 -r 1.12.2.13 src/ldif.c; cvs diff -u -r 1.14.2.13 -r 1.14.2.14 src/importldif.c; ) > 2.9.2cvs68.patchset

View file

@ -11,7 +11,7 @@ MINOR_VERSION=9
MICRO_VERSION=2
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=67
EXTRA_VERSION=68
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -447,14 +447,14 @@ static gboolean imp_ldif_file_move() {
gtk_entry_set_text( GTK_ENTRY(impldif_dlg.entryFile), sFile );
gtk_entry_set_text( GTK_ENTRY(impldif_dlg.entryName), sName );
if( *sFile == '\0'|| strlen( sFile ) < 1 ) {
if( *sFile == '\0' ) {
sMsg = _( "Please select a file." );
gtk_widget_grab_focus(impldif_dlg.entryFile);
errFlag = TRUE;
}
if( *sName == '\0'|| strlen( sName ) < 1 ) {
if( ! errFlag ) sMsg = _( "Address book name must be supplied." );
if( ! errFlag && *sName == '\0' ) {
sMsg = _( "Address book name must be supplied." );
gtk_widget_grab_focus(impldif_dlg.entryName);
errFlag = TRUE;
}
@ -469,7 +469,7 @@ static gboolean imp_ldif_file_move() {
retVal = TRUE;
}
else {
sMsg = _( "Error reading LDIF fields." );
sMsg = imp_ldif_err2string( _lutErrorsLDIF_, _ldifFile_->retVal );
}
}
imp_ldif_status_show( sMsg );
@ -536,6 +536,7 @@ static void imp_ldif_next( GtkWidget *widget ) {
}
else {
gtk_widget_set_sensitive( impldif_dlg.btnPrev, FALSE );
_ldifFile_->dirtyFlag = TRUE;
}
}
else if( pageNum == PAGE_ATTRIBUTES ) {
@ -544,7 +545,7 @@ static void imp_ldif_next( GtkWidget *widget ) {
gtk_notebook_set_current_page(
GTK_NOTEBOOK(impldif_dlg.notebook), PAGE_FINISH );
gtk_button_set_label(GTK_BUTTON(impldif_dlg.btnCancel),
GTK_STOCK_SAVE);
GTK_STOCK_CLOSE);
imp_ldif_finish_show();
}
}
@ -808,12 +809,6 @@ static void imp_ldif_page_fields( gint pageNum, gchar *pageLbl ) {
/* Next row */
++top;
label = gtk_label_new( _( "???" ) );
/*
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1),
GTK_FILL, 0, 0, 0);
*/
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
/*
* Use an event box to attach some help in the form of a tooltip.

View file

@ -257,6 +257,8 @@ static gchar *ldif_get_line( LdifFile *ldifFile ) {
while( i < LDIFBUFSIZE-1 ) {
ch = fgetc( ldifFile->file );
if (ferror( ldifFile->file ))
ldifFile->retVal = MGU_ERROR_READ;
if( ch == '\0' || ch == EOF ) {
if( i == 0 ) return NULL;
break;
@ -841,6 +843,11 @@ static void ldif_read_tag_list( LdifFile *ldifFile ) {
posEnd = ftell( ldifFile->file );
fseek( ldifFile->file, 0L, SEEK_SET );
if (posEnd == 0) {
ldifFile->retVal = MGU_EOF;
return;
}
/* Process file */
while( ! flagEOF ) {
gchar *line = ldif_get_line( ldifFile );
@ -889,6 +896,12 @@ static void ldif_read_tag_list( LdifFile *ldifFile ) {
{
flagMail = TRUE;
}
} else {
g_strstrip(line);
if (*line != '\0') {
debug_print("ldif: bad format: '%s'\n", line);
ldifFile->retVal = MGU_BAD_FORMAT;
}
}
}
}