From e45f5b36a51a074506cf64422001c3f390fbd2ef Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 17 Feb 2015 18:42:00 +0000 Subject: [PATCH] Make some obvious abbreviations in DXXCC country names To keep the decoded text lines to a minimum length suitable for screen display some obvious abbreviations have been applied. Also as the lines may now extend to the right with a horizontal scroll bar appearing when necessary the country names are not truncated any more. Users still have the option to provide their own tailored cty.dat file if they wish. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4970 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- displaytext.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/displaytext.cpp b/displaytext.cpp index 601d45097..bf141ac0a 100644 --- a/displaytext.cpp +++ b/displaytext.cpp @@ -84,8 +84,25 @@ void DisplayText::_appendDXCCWorkedB4(DecodedText& t1, QString& bg, } charsAvail -= 1; - if (countryName.length()>charsAvail) - countryName = countryName.left(1)+"."+countryName.right(charsAvail-2); //abreviate the first word to the first letter, show remaining right most chars + // do some obvious abbreviations + countryName.replace ("Islands", "Is."); + countryName.replace ("Island", "Is."); + countryName.replace ("North ", "N. "); + countryName.replace ("Northern ", "N. "); + countryName.replace ("South ", "S. "); + countryName.replace ("East ", "E. "); + countryName.replace ("Eastern ", "E. "); + countryName.replace ("West ", "W. "); + countryName.replace ("Western ", "W. "); + countryName.replace ("Central ", "C. "); + countryName.replace (" and ", " & "); + countryName.replace ("Republic", "Rep."); + countryName.replace ("United States", "U.S.A."); + countryName.replace ("Fed. Rep. of ", ""); + countryName.replace ("French ", "Fr."); + countryName.replace ("Asiatic", "AS"); + countryName.replace ("European", "EU"); + countryName.replace ("African", "AF"); t1 += countryName; } }