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">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::NoSelection</enum>
|
||||||
|
</property>
|
||||||
<property name="sortingEnabled">
|
<property name="sortingEnabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
@ -242,6 +242,11 @@ void MasternodeList::updateMyNodeList(bool fForce)
|
|||||||
if(nSecondsTillUpdate > 0 && !fForce) return;
|
if(nSecondsTillUpdate > 0 && !fForce) return;
|
||||||
nTimeMyListUpdated = GetTime();
|
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);
|
ui->tableWidgetMyMasternodes->setSortingEnabled(false);
|
||||||
for (const auto& mne : masternodeConfig.getEntries()) {
|
for (const auto& mne : masternodeConfig.getEntries()) {
|
||||||
int32_t nOutputIndex = 0;
|
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));
|
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);
|
ui->tableWidgetMyMasternodes->setSortingEnabled(true);
|
||||||
|
|
||||||
// reset "timer"
|
// reset "timer"
|
||||||
|
Loading…
Reference in New Issue
Block a user