diff --git a/yfk b/yfk index 2954336..240a7d1 100755 --- a/yfk +++ b/yfk @@ -1481,6 +1481,7 @@ while ($status == 9) { my $nr; # nr of imported QSOs my $err; # nr of errors during import my $war; # nr of warnings during import + my @newcalls; attron($wmain, COLOR_PAIR(4)); addstr($whead, 0,0, "YFKlog v$yfkver - ADIF import mode - Active Logbook: ". @@ -1543,7 +1544,7 @@ while ($status == 9) { last; } else { # we want to import $adifiles[$adifile] - ($nr, $err, $war) = &adifimport($adifiles[$adifile],$whelp); + ($nr, $err, $war, @newcalls) = &adifimport($adifiles[$adifile],$whelp); } attron($wmain, COLOR_PAIR(4)); # selectlist changed attributes @@ -1553,18 +1554,22 @@ while ($status == 9) { if ($nr > 0) { # OK, QSOs imported $adifiles[$adifile] =~ /([^\/]+)$/; my $basename = $1; - addstr($wmain, 8,20, "QSOs processed: $nr. Successful: ".($nr-$err)); - addstr($wmain, 11,6, "Errors: $err. See detailed information in ". + addstr($wmain, 4,20, "QSOs processed: $nr. Successful: ".($nr-$err)); + addstr($wmain, 5,6, "Errors: $err. See detailed information in ". "/tmp/$mycall-import-from-$basename.err") if $err; - addstr($wmain, 12,5, "Warnings: $war. See detailed information in ". + addstr($wmain, 6,5, "Warnings: $war. See detailed information in ". "/tmp/$mycall-import-from-$basename.err") if $war; + + addstr($wmain, 8,30, " New Calls: "); + &selectlist(\$wmain, 9, 25, $row-13, 20, \@newcalls); + attron($wmain, COLOR_PAIR(4)); } else { # No QSOs imported, huh? addstr($wmain, 7,10, "No QSOs imported. Possibly this file doesn't meet the ADIF"); addstr($wmain, 8,10, "specifications. Make sure there the header is terminated"); addstr($wmain, 9,10, "with . If you think the file is OK, contact author."); } - refresh($wmain); + refresh($wmain); &waitkey(); diff --git a/yfksubs.pl b/yfksubs.pl index 25999bd..91c317b 100644 --- a/yfksubs.pl +++ b/yfksubs.pl @@ -3607,6 +3607,7 @@ my $war=0; # number of warnings (unk. fields) my $ch; # process adif-file $ch by $ch.. my $header=1; # while header=1, we are still before my $parsecount=1; +my @newcalls; # find all new calls from imported ADIF $filename =~ /([^\/]+)$/; my $basename = $1; @@ -3615,6 +3616,14 @@ open(ERROR, ">>/tmp/$mycall-import-from-$basename.err"); print ERROR "-"x80; +# remember all worked calls from the log, so after the import we can +# show a list of new unique calls that were imported +my $q = $dbh->prepare("SELECT distinct `call` FROM log_$mycall;"); +$q->execute(); +while (my @r = $q->fetchrow_array()) { + $wkdcalls{$r[0]} = 1; +} + addstr($win,0,0, "Parsing ADIF-File, that might take a while..."." "x80); refresh($win); @@ -4203,6 +4212,13 @@ for my $i (0 .. $#qso) { # iterate through Array of Hashes ('$call',$qso[$i]{'name'},$qso[$i]{'qth'});"); } } + + # check if this is a new call in the current log + unless (defined($wkdcalls{$qso[$i]{'call'}})) { + my $c = $qso[$i]{'call'}; + $c =~ s/'//g; + push @newcalls, $c; + } } @@ -4211,7 +4227,7 @@ close ERROR; addstr($win,0,0,"Done. Import complete. "); refresh($win); -return($nr, $err, $war); +return($nr, $err, $war, @newcalls); } # end of adifimport