859 |
859 |
860 roomsList->setRowCount(list.size() / 8); |
860 roomsList->setRowCount(list.size() / 8); |
861 for(int i = 0, r = 0; i < list.size(); i += 8, r++) |
861 for(int i = 0, r = 0; i < list.size(); i += 8, r++) |
862 { |
862 { |
863 QTableWidgetItem * item; |
863 QTableWidgetItem * item; |
864 item = new QTableWidgetItem(list[i + 1]); // room name |
864 item = new QTableWidgetItem(list[i + 1].left(30)); // room name |
865 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
865 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
866 |
866 |
867 // pick appropriate room icon and tooltip (game in progress yes/no; later maybe locked rooms etc.) |
867 // pick appropriate room icon and tooltip (game in progress yes/no; later maybe locked rooms etc.) |
868 if(list[i].compare("True")) |
868 if(list[i].compare("True")) |
869 { |
869 { |
888 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
888 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
889 item->setTextAlignment(Qt::AlignCenter); |
889 item->setTextAlignment(Qt::AlignCenter); |
890 item->setToolTip(tr("There are %1 teams participating in this room.", "", list[i + 3].toInt()).arg(list[i + 3])); |
890 item->setToolTip(tr("There are %1 teams participating in this room.", "", list[i + 3].toInt()).arg(list[i + 3])); |
891 roomsList->setItem(r, 2, item); |
891 roomsList->setItem(r, 2, item); |
892 |
892 |
893 item = new QTableWidgetItem(list[i + 4]); // name of host |
893 item = new QTableWidgetItem(list[i + 4].left(15)); // name of host |
894 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
894 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
895 item->setToolTip(tr("%1 is the host. He may adjust settings and start the game.").arg(list[i + 4])); |
895 item->setToolTip(tr("%1 is the host. He may adjust settings and start the game.").arg(list[i + 4])); |
896 roomsList->setItem(r, 3, item); |
896 roomsList->setItem(r, 3, item); |
897 |
897 |
898 if(list[i + 5].compare("+rnd+")) |
898 if(list[i + 5].compare("+rnd+")) |
902 |
902 |
903 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
903 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
904 item->setToolTip(tr("Games may be played on precreated or randomized maps.")); |
904 item->setToolTip(tr("Games may be played on precreated or randomized maps.")); |
905 roomsList->setItem(r, 4, item); |
905 roomsList->setItem(r, 4, item); |
906 |
906 |
907 item = new QTableWidgetItem(list[i + 6]); // selected game scheme |
907 item = new QTableWidgetItem(list[i + 6].left(20)); // selected game scheme |
908 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
908 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
909 item->setToolTip(tr("The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.")); |
909 item->setToolTip(tr("The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.")); |
910 roomsList->setItem(r, 5, item); |
910 roomsList->setItem(r, 5, item); |
911 |
911 |
912 item = new QTableWidgetItem(list[i + 7]); // selected weapon scheme |
912 item = new QTableWidgetItem(list[i + 7].left(20)); // selected weapon scheme |
913 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
913 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); |
914 item->setToolTip(tr("The Weapon Scheme defines available weapons and their ammunition count.")); |
914 item->setToolTip(tr("The Weapon Scheme defines available weapons and their ammunition count.")); |
915 roomsList->setItem(r, 6, item); |
915 roomsList->setItem(r, 6, item); |
916 |
916 |
917 } |
917 } |