diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index 8bd016a1..c9970f7b 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -932,6 +932,7 @@ void gameLobbyDialogImpl::updatePlayer(unsigned playerId, QString newPlayerName) myNickListModel->item(it1, 0)->setIcon(QIcon(":/cflags/cflags/undefined.png")); } else { myNickListModel->item(it1, 0)->setIcon(QIcon(QString(":/cflags/cflags/%1.png").arg(countryString))); + myNickListModel->item(it1, 0)->setToolTip(getFullCountryString(countryString.toUpper())); } unsigned gameIdOfPlayer = mySession->getGameIdOfPlayer(playerId); @@ -995,6 +996,7 @@ void gameLobbyDialogImpl::playerJoinedLobby(unsigned playerId, QString /*playerN item->setIcon(QIcon(":/cflags/cflags/undefined.png")); } else { item->setIcon(QIcon(QString(":/cflags/cflags/%1.png").arg(countryString))); + item->setToolTip(getFullCountryString(countryString.toUpper())); } unsigned gameIdOfPlayer = mySession->getGameIdOfPlayer(playerId); @@ -1666,3 +1668,254 @@ void gameLobbyDialogImpl::showConnectedPlayersContextMenu(QPoint p) } } } + +QString gameLobbyDialogImpl::getFullCountryString(QString cs) +{ + QString fullString(""); + if(cs == "") fullString = ""; + else if(cs == "AF") fullString = tr("Afghanistan"); + else if(cs == "AX") fullString = tr("ALand Islands"); + else if(cs == "AL") fullString = tr("Albania"); + else if(cs == "DZ") fullString = tr("Algeria"); + else if(cs == "AS") fullString = tr("American Samoa"); + else if(cs == "AD") fullString = tr("Andorra"); + else if(cs == "AO") fullString = tr("Angola"); + else if(cs == "AI") fullString = tr("Anguilla"); + else if(cs == "AQ") fullString = tr("Antarctica"); + else if(cs == "AG") fullString = tr("Antigua And Barbuda"); + else if(cs == "AR") fullString = tr("Argentina"); + else if(cs == "AM") fullString = tr("Armenia"); + else if(cs == "AW") fullString = tr("Aruba"); + else if(cs == "AU") fullString = tr("Australia"); + else if(cs == "AT") fullString = tr("Austria"); + else if(cs == "AZ") fullString = tr("Azerbaijan"); + else if(cs == "BS") fullString = tr("Bahamas"); + else if(cs == "BH") fullString = tr("Bahrain"); + else if(cs == "BD") fullString = tr("Bangladesh"); + else if(cs == "BB") fullString = tr("Barbados"); + else if(cs == "BY") fullString = tr("Belarus"); + else if(cs == "BE") fullString = tr("Belgium"); + else if(cs == "BZ") fullString = tr("Belize"); + else if(cs == "BJ") fullString = tr("Benin"); + else if(cs == "BM") fullString = tr("Bermuda"); + else if(cs == "BT") fullString = tr("Bhutan"); + else if(cs == "BO") fullString = tr("Bolivia"); + else if(cs == "BA") fullString = tr("Bosnia And Herzegovina"); + else if(cs == "BW") fullString = tr("Botswana"); + else if(cs == "BV") fullString = tr("Bouvet Island"); + else if(cs == "BR") fullString = tr("Brazil"); + else if(cs == "IO") fullString = tr("British Indian Ocean Territory"); + else if(cs == "BN") fullString = tr("Brunei Darussalam"); + else if(cs == "BG") fullString = tr("Bulgaria"); + else if(cs == "BF") fullString = tr("Burkina Faso"); + else if(cs == "BI") fullString = tr("Burundi"); + else if(cs == "KH") fullString = tr("Cambodia"); + else if(cs == "CM") fullString = tr("Cameroon"); + else if(cs == "CA") fullString = tr("Canada"); + else if(cs == "CV") fullString = tr("Cape Verde"); + else if(cs == "KY") fullString = tr("Cayman Islands"); + else if(cs == "CF") fullString = tr("Central African Republic"); + else if(cs == "TD") fullString = tr("Chad"); + else if(cs == "CL") fullString = tr("Chile"); + else if(cs == "CN") fullString = tr("China"); + else if(cs == "CX") fullString = tr("Christmas Island"); + else if(cs == "CC") fullString = tr("Cocos (Keeling) Islands"); + else if(cs == "CO") fullString = tr("Colombia"); + else if(cs == "KM") fullString = tr("Comoros"); + else if(cs == "CG") fullString = tr("Congo"); + else if(cs == "CD") fullString = tr("Congo, The Democratic Republic Of The"); + else if(cs == "CK") fullString = tr("Cook Islands"); + else if(cs == "CR") fullString = tr("Costa Rica"); + else if(cs == "CI") fullString = tr("Cote D'Ivoire"); + else if(cs == "HR") fullString = tr("Croatia"); + else if(cs == "CU") fullString = tr("Cuba"); + else if(cs == "CY") fullString = tr("Cyprus"); + else if(cs == "CZ") fullString = tr("Czech Republic"); + else if(cs == "DK") fullString = tr("Denmark"); + else if(cs == "DJ") fullString = tr("Djibouti"); + else if(cs == "DM") fullString = tr("Dominica"); + else if(cs == "DO") fullString = tr("Dominican Republic"); + else if(cs == "EC") fullString = tr("Ecuador"); + else if(cs == "EG") fullString = tr("Egypt"); + else if(cs == "SV") fullString = tr("El Salvador"); + else if(cs == "GQ") fullString = tr("Equatorial Guinea"); + else if(cs == "ER") fullString = tr("Eritrea"); + else if(cs == "EE") fullString = tr("Estonia"); + else if(cs == "ET") fullString = tr("Ethiopia"); + else if(cs == "FK") fullString = tr("Falkland Islands (Malvinas)"); + else if(cs == "FO") fullString = tr("Faroe Islands"); + else if(cs == "FJ") fullString = tr("Fiji"); + else if(cs == "FI") fullString = tr("Finland"); + else if(cs == "FR") fullString = tr("France"); + else if(cs == "GF") fullString = tr("French Guiana"); + else if(cs == "PF") fullString = tr("French Polynesia"); + else if(cs == "TF") fullString = tr("French Southern Territories"); + else if(cs == "GA") fullString = tr("Gabon"); + else if(cs == "GM") fullString = tr("Gambia"); + else if(cs == "GE") fullString = tr("Georgia"); + else if(cs == "DE") fullString = tr("Germany"); + else if(cs == "GH") fullString = tr("Ghana"); + else if(cs == "GI") fullString = tr("Gibraltar"); + else if(cs == "GR") fullString = tr("Greece"); + else if(cs == "GL") fullString = tr("Greenland"); + else if(cs == "GD") fullString = tr("Grenada"); + else if(cs == "GP") fullString = tr("Guadeloupe"); + else if(cs == "GU") fullString = tr("Guam"); + else if(cs == "GT") fullString = tr("Guatemala"); + else if(cs == "GG") fullString = tr("Guernsey"); + else if(cs == "GN") fullString = tr("Guinea"); + else if(cs == "GW") fullString = tr("Guinea-Bissau"); + else if(cs == "GY") fullString = tr("Guyana"); + else if(cs == "HT") fullString = tr("Haiti"); + else if(cs == "HM") fullString = tr("Heard Island And Mcdonald Islands"); + else if(cs == "VA") fullString = tr("Holy See (Vatican City State)"); + else if(cs == "HN") fullString = tr("Honduras"); + else if(cs == "HK") fullString = tr("Hong Kong"); + else if(cs == "HU") fullString = tr("Hungary"); + else if(cs == "IS") fullString = tr("Iceland"); + else if(cs == "IN") fullString = tr("India"); + else if(cs == "ID") fullString = tr("Indonesia"); + else if(cs == "IR") fullString = tr("Iran, Islamic Republic Of"); + else if(cs == "IQ") fullString = tr("Iraq"); + else if(cs == "IE") fullString = tr("Ireland"); + else if(cs == "IM") fullString = tr("Isle Of Man"); + else if(cs == "IL") fullString = tr("Israel"); + else if(cs == "IT") fullString = tr("Italy"); + else if(cs == "JM") fullString = tr("Jamaica"); + else if(cs == "JP") fullString = tr("Japan"); + else if(cs == "JE") fullString = tr("Jersey"); + else if(cs == "JO") fullString = tr("Jordan"); + else if(cs == "KZ") fullString = tr("Kazakhstan"); + else if(cs == "KE") fullString = tr("Kenya"); + else if(cs == "KI") fullString = tr("Kiribati"); + else if(cs == "KP") fullString = tr("Korea, Democratic People'S Republic Of"); + else if(cs == "KR") fullString = tr("Korea, Republic Of"); + else if(cs == "KW") fullString = tr("Kuwait"); + else if(cs == "KG") fullString = tr("Kyrgyzstan"); + else if(cs == "LA") fullString = tr("Lao People'S Democratic Republic"); + else if(cs == "LV") fullString = tr("Latvia"); + else if(cs == "LB") fullString = tr("Lebanon"); + else if(cs == "LS") fullString = tr("Lesotho"); + else if(cs == "LR") fullString = tr("Liberia"); + else if(cs == "LY") fullString = tr("Libyan Arab Jamahiriya"); + else if(cs == "LI") fullString = tr("Liechtenstein"); + else if(cs == "LT") fullString = tr("Lithuania"); + else if(cs == "LU") fullString = tr("Luxembourg"); + else if(cs == "MO") fullString = tr("Macao"); + else if(cs == "MK") fullString = tr("Macedonia, The Former Yugoslav Republic Of"); + else if(cs == "MG") fullString = tr("Madagascar"); + else if(cs == "MW") fullString = tr("Malawi"); + else if(cs == "MY") fullString = tr("Malaysia"); + else if(cs == "MV") fullString = tr("Maldives"); + else if(cs == "ML") fullString = tr("Mali"); + else if(cs == "MT") fullString = tr("Malta"); + else if(cs == "MH") fullString = tr("Marshall Islands"); + else if(cs == "MQ") fullString = tr("Martinique"); + else if(cs == "MR") fullString = tr("Mauritania"); + else if(cs == "MU") fullString = tr("Mauritius"); + else if(cs == "YT") fullString = tr("Mayotte"); + else if(cs == "MX") fullString = tr("Mexico"); + else if(cs == "FM") fullString = tr("Micronesia, Federated States Of"); + else if(cs == "MD") fullString = tr("Moldova, Republic Of"); + else if(cs == "MC") fullString = tr("Monaco"); + else if(cs == "MN") fullString = tr("Mongolia"); + else if(cs == "MS") fullString = tr("Montserrat"); + else if(cs == "MA") fullString = tr("Morocco"); + else if(cs == "MZ") fullString = tr("Mozambique"); + else if(cs == "MM") fullString = tr("Myanmar"); + else if(cs == "NA") fullString = tr("Namibia"); + else if(cs == "NR") fullString = tr("Nauru"); + else if(cs == "NP") fullString = tr("Nepal"); + else if(cs == "NL") fullString = tr("Netherlands"); + else if(cs == "AN") fullString = tr("Netherlands Antilles"); + else if(cs == "NC") fullString = tr("New Caledonia"); + else if(cs == "NZ") fullString = tr("New Zealand"); + else if(cs == "NI") fullString = tr("Nicaragua"); + else if(cs == "NE") fullString = tr("Niger"); + else if(cs == "NG") fullString = tr("Nigeria"); + else if(cs == "NU") fullString = tr("Niue"); + else if(cs == "NF") fullString = tr("Norfolk Island"); + else if(cs == "MP") fullString = tr("Northern Mariana Islands"); + else if(cs == "NO") fullString = tr("Norway"); + else if(cs == "OM") fullString = tr("Oman"); + else if(cs == "PK") fullString = tr("Pakistan"); + else if(cs == "PW") fullString = tr("Palau"); + else if(cs == "PS") fullString = tr("Palestinian Territory, Occupied"); + else if(cs == "PA") fullString = tr("Panama"); + else if(cs == "PG") fullString = tr("Papua New Guinea"); + else if(cs == "PY") fullString = tr("Paraguay"); + else if(cs == "PE") fullString = tr("Peru"); + else if(cs == "PH") fullString = tr("Philippines"); + else if(cs == "PN") fullString = tr("Pitcairn"); + else if(cs == "PL") fullString = tr("Poland"); + else if(cs == "PT") fullString = tr("Portugal"); + else if(cs == "PR") fullString = tr("Puerto Rico"); + else if(cs == "QA") fullString = tr("Qatar"); + else if(cs == "RE") fullString = tr("Reunion"); + else if(cs == "RO") fullString = tr("Romania"); + else if(cs == "RU") fullString = tr("Russian Federation"); + else if(cs == "RW") fullString = tr("Rwanda"); + else if(cs == "SH") fullString = tr("Saint Helena"); + else if(cs == "KN") fullString = tr("Saint Kitts And Nevis"); + else if(cs == "LC") fullString = tr("Saint Lucia"); + else if(cs == "PM") fullString = tr("Saint Pierre And Miquelon"); + else if(cs == "VC") fullString = tr("Saint Vincent And The Grenadines"); + else if(cs == "WS") fullString = tr("Samoa"); + else if(cs == "SM") fullString = tr("San Marino"); + else if(cs == "ST") fullString = tr("Sao Tome And Principe"); + else if(cs == "SA") fullString = tr("Saudi Arabia"); + else if(cs == "SN") fullString = tr("Senegal"); + else if(cs == "CS") fullString = tr("Serbia And Montenegro"); + else if(cs == "SC") fullString = tr("Seychelles"); + else if(cs == "SL") fullString = tr("Sierra Leone"); + else if(cs == "SG") fullString = tr("Singapore"); + else if(cs == "SK") fullString = tr("Slovakia"); + else if(cs == "SI") fullString = tr("Slovenia"); + else if(cs == "SB") fullString = tr("Solomon Islands"); + else if(cs == "SO") fullString = tr("Somalia"); + else if(cs == "ZA") fullString = tr("South Africa"); + else if(cs == "GS") fullString = tr("South Georgia And The South Sandwich Islands"); + else if(cs == "ES") fullString = tr("Spain"); + else if(cs == "LK") fullString = tr("Sri Lanka"); + else if(cs == "SD") fullString = tr("Sudan"); + else if(cs == "SR") fullString = tr("Suriname"); + else if(cs == "SJ") fullString = tr("Svalbard And Jan Mayen"); + else if(cs == "SZ") fullString = tr("Swaziland"); + else if(cs == "SE") fullString = tr("Sweden"); + else if(cs == "CH") fullString = tr("Switzerland"); + else if(cs == "SY") fullString = tr("Syrian Arab Republic"); + else if(cs == "TW") fullString = tr("Taiwan, Province Of China"); + else if(cs == "TJ") fullString = tr("Tajikistan"); + else if(cs == "TZ") fullString = tr("Tanzania, United Republic Of"); + else if(cs == "TH") fullString = tr("Thailand"); + else if(cs == "TL") fullString = tr("Timor-Leste"); + else if(cs == "TG") fullString = tr("Togo"); + else if(cs == "TK") fullString = tr("Tokelau"); + else if(cs == "TO") fullString = tr("Tonga"); + else if(cs == "TT") fullString = tr("Trinidad And Tobago"); + else if(cs == "TN") fullString = tr("Tunisia"); + else if(cs == "TR") fullString = tr("Turkey"); + else if(cs == "TM") fullString = tr("Turkmenistan"); + else if(cs == "TC") fullString = tr("Turks And Caicos Islands"); + else if(cs == "TV") fullString = tr("Tuvalu"); + else if(cs == "UG") fullString = tr("Uganda"); + else if(cs == "UA") fullString = tr("Ukraine"); + else if(cs == "AE") fullString = tr("United Arab Emirates"); + else if(cs == "GB") fullString = tr("United Kingdom"); + else if(cs == "US") fullString = tr("United States"); + else if(cs == "UM") fullString = tr("United States Minor Outlying Islands"); + else if(cs == "UY") fullString = tr("Uruguay"); + else if(cs == "UZ") fullString = tr("Uzbekistan"); + else if(cs == "VU") fullString = tr("Vanuatu"); + else if(cs == "VE") fullString = tr("Venezuela"); + else if(cs == "VN") fullString = tr("Viet Nam"); + else if(cs == "VG") fullString = tr("Virgin Islands, British"); + else if(cs == "VI") fullString = tr("Virgin Islands, U.S."); + else if(cs == "WF") fullString = tr("Wallis And Futuna"); + else if(cs == "EH") fullString = tr("Western Sahara"); + else if(cs == "YE") fullString = tr("Yemen"); + else if(cs == "ZM") fullString = tr("Zambia"); + else if(cs == "ZW") fullString = tr("Zimbabwe"); + + return fullString; +} diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h index 627894ba..040b3ea8 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h @@ -131,6 +131,7 @@ public slots: void showAutoStartTimer(); void updateAutoStartTimer(); void openPlayerStats(); + QString getFullCountryString(QString); private: