Fix issues with selections on Masternode tab (#2170)
Preserve selection on "My Masternodes" sub-tab, disable selections on "All Masternodes" sub-tab.
This commit is contained in:
parent
2474d9cb8c
commit
7b9919d182
@ -228,6 +228,9 @@
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
@ -242,6 +242,11 @@ void MasternodeList::updateMyNodeList(bool fForce)
|
||||
if(nSecondsTillUpdate > 0 && !fForce) return;
|
||||
nTimeMyListUpdated = GetTime();
|
||||
|
||||
// Find selected row
|
||||
QItemSelectionModel* selectionModel = ui->tableWidgetMyMasternodes->selectionModel();
|
||||
QModelIndexList selected = selectionModel->selectedRows();
|
||||
int nSelectedRow = selected.count() ? selected.at(0).row() : 0;
|
||||
|
||||
ui->tableWidgetMyMasternodes->setSortingEnabled(false);
|
||||
for (const auto& mne : masternodeConfig.getEntries()) {
|
||||
int32_t nOutputIndex = 0;
|
||||
@ -251,7 +256,7 @@ void MasternodeList::updateMyNodeList(bool fForce)
|
||||
|
||||
updateMyMasternodeInfo(QString::fromStdString(mne.getAlias()), QString::fromStdString(mne.getIp()), COutPoint(uint256S(mne.getTxHash()), nOutputIndex));
|
||||
}
|
||||
ui->tableWidgetMyMasternodes->selectRow(0);
|
||||
ui->tableWidgetMyMasternodes->selectRow(nSelectedRow);
|
||||
ui->tableWidgetMyMasternodes->setSortingEnabled(true);
|
||||
|
||||
// reset "timer"
|
||||
|
Loading…
Reference in New Issue
Block a user