mirror of https://github.com/zlatinb/muwire
fix contact subscriptions table which broke after recent redesign
parent
3c932608af
commit
9db10e23fc
|
@ -339,7 +339,7 @@ class MainFrameController {
|
|||
}
|
||||
|
||||
private RemoteTrustList getSelectedTrustList() {
|
||||
int row = view.getSelectedTrustTablesRow("subscription-table")
|
||||
int row = view.getSelectedContactSubscriptionTableRow()
|
||||
if (row < 0)
|
||||
return null
|
||||
model.subscriptions[row]
|
||||
|
|
|
@ -82,6 +82,7 @@ class MainFrameView {
|
|||
def lastUploadsSortEvent
|
||||
def lastSharedSortEvent
|
||||
def lastContactsSortEvent
|
||||
def lastContactsSubscriptionSortEvent
|
||||
def expansionListener = new TreeExpansions()
|
||||
def lastFeedsSortEvent
|
||||
def lastFeedItemsSortEvent
|
||||
|
@ -1109,12 +1110,12 @@ class MainFrameView {
|
|||
// subscription table
|
||||
def subscriptionTable = builder.getVariable("subscription-table")
|
||||
subscriptionTable.setDefaultRenderer(Integer.class, centerRenderer)
|
||||
subscriptionTable.rowSorter.addRowSorterListener({ evt -> trustTablesSortEvents["subscription-table"] = evt })
|
||||
subscriptionTable.rowSorter.addRowSorterListener({ evt -> lastContactsSubscriptionSortEvent = evt })
|
||||
subscriptionTable.rowSorter.setSortsOnUpdates(true)
|
||||
selectionModel = subscriptionTable.getSelectionModel()
|
||||
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
|
||||
selectionModel.addListSelectionListener({
|
||||
int selectedRow = getSelectedTrustTablesRow("subscription-table")
|
||||
int selectedRow = getSelectedContactSubscriptionTableRow()
|
||||
if (selectedRow < 0) {
|
||||
model.reviewButtonEnabled = false
|
||||
model.updateButtonEnabled = false
|
||||
|
@ -1766,6 +1767,17 @@ class MainFrameView {
|
|||
selectedRow
|
||||
}
|
||||
|
||||
int getSelectedContactSubscriptionTableRow() {
|
||||
def table = builder.getVariable("subscription-table")
|
||||
int selectedRow = table.getSelectedRow()
|
||||
if (selectedRow < 0)
|
||||
return -1
|
||||
if (lastContactsSubscriptionSortEvent != null)
|
||||
selectedRow = table.rowSorter.convertRowIndexToModel(selectedRow)
|
||||
selectedRow
|
||||
}
|
||||
|
||||
|
||||
public void refreshSharedFiles() {
|
||||
def tree = builder.getVariable("shared-files-tree")
|
||||
TreePath[] selectedPaths = tree.getSelectionPaths()
|
||||
|
|
Loading…
Reference in New Issue