don't forget the current selected table when switching tabs

This commit is contained in:
Peinthor Rene
2012-01-30 16:54:17 +01:00
parent 226f2f83b2
commit 93905d82bf

View File

@@ -543,6 +543,7 @@ void mainForm::populateTable( const QString & tablename)
void mainForm::resetBrowser()
{
recAtTop = 0;
QString sCurrentTable = comboBrowseTable->currentText();
comboBrowseTable->clear();
QStringList tab = db.getTableNames();
if (tab.isEmpty()){
@@ -551,7 +552,9 @@ void mainForm::resetBrowser()
comboBrowseTable->addItems(tab);
}
setRecordsetLabel();
comboBrowseTable->setCurrentIndex(0);
int pos = comboBrowseTable->findText(sCurrentTable);
pos = pos == -1 ? 0 : pos;
comboBrowseTable->setCurrentIndex(pos);
populateTable(comboBrowseTable->currentText());
}