Frontend:
* Avoid losing current selection if the rooms list is updated (annoyed me for so long ...)
--- a/QTfrontend/pages.cpp Tue Sep 14 13:45:19 2010 +0200
+++ b/QTfrontend/pages.cpp Tue Sep 14 17:42:51 2010 +0200
@@ -1176,6 +1176,11 @@
{
listFromServer = list;
+ QString selection = "";
+
+ if(QTableWidgetItem *item = roomsList->item(roomsList->currentRow(), 0))
+ selection = item->text();
+
roomsList->clear();
roomsList->setColumnCount(7);
roomsList->setHorizontalHeaderLabels(
@@ -1303,6 +1308,8 @@
item->setToolTip(tr("The Weapon Scheme defines available weapons and their ammunition count."));
roomsList->setItem(r, 6, item);
+ if(!list[i + 1].compare(selection) && !selection.isEmpty())
+ roomsList->selectionModel()->setCurrentIndex(roomsList->model()->index(r,0), QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
}
roomsList->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
roomsList->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents);