mirror of https://github.com/zlatinb/muwire
Add trust/distrust action from monitor window. Thanks Aegon
parent
80e165b505
commit
69b4f0b547
|
@ -165,6 +165,24 @@ class MainFrameController {
|
||||||
core.eventBus.publish( new TrustEvent(persona : result.sender, level : TrustLevel.DISTRUSTED))
|
core.eventBus.publish( new TrustEvent(persona : result.sender, level : TrustLevel.DISTRUSTED))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ControllerAction
|
||||||
|
void trustPersonaFromSearch() {
|
||||||
|
int selected = builder.getVariable("searches-table").getSelectedRow()
|
||||||
|
if (selected < 0)
|
||||||
|
return
|
||||||
|
Persona p = model.searches[selected].originator
|
||||||
|
core.eventBus.publish( new TrustEvent(persona : p, level : TrustLevel.TRUSTED) )
|
||||||
|
}
|
||||||
|
|
||||||
|
@ControllerAction
|
||||||
|
void distrustPersonaFromSearch() {
|
||||||
|
int selected = builder.getVariable("searches-table").getSelectedRow()
|
||||||
|
if (selected < 0)
|
||||||
|
return
|
||||||
|
Persona p = model.searches[selected].originator
|
||||||
|
core.eventBus.publish( new TrustEvent(persona : p, level : TrustLevel.DISTRUSTED) )
|
||||||
|
}
|
||||||
|
|
||||||
@ControllerAction
|
@ControllerAction
|
||||||
void cancel() {
|
void cancel() {
|
||||||
def downloader = model.downloads[selectedDownload()].downloader
|
def downloader = model.downloads[selectedDownload()].downloader
|
||||||
|
|
|
@ -26,7 +26,6 @@ import com.muwire.core.MuWireSettings
|
||||||
import com.muwire.core.download.Downloader
|
import com.muwire.core.download.Downloader
|
||||||
import com.muwire.core.files.FileSharedEvent
|
import com.muwire.core.files.FileSharedEvent
|
||||||
import com.muwire.core.trust.RemoteTrustList
|
import com.muwire.core.trust.RemoteTrustList
|
||||||
|
|
||||||
import java.awt.BorderLayout
|
import java.awt.BorderLayout
|
||||||
import java.awt.CardLayout
|
import java.awt.CardLayout
|
||||||
import java.awt.FlowLayout
|
import java.awt.FlowLayout
|
||||||
|
@ -456,9 +455,18 @@ class MainFrameView {
|
||||||
// searches table
|
// searches table
|
||||||
def searchesTable = builder.getVariable("searches-table")
|
def searchesTable = builder.getVariable("searches-table")
|
||||||
JPopupMenu searchTableMenu = new JPopupMenu()
|
JPopupMenu searchTableMenu = new JPopupMenu()
|
||||||
|
|
||||||
JMenuItem copySearchToClipboard = new JMenuItem("Copy search to clipboard")
|
JMenuItem copySearchToClipboard = new JMenuItem("Copy search to clipboard")
|
||||||
copySearchToClipboard.addActionListener({mvcGroup.view.copySearchToClipboard(searchesTable)})
|
copySearchToClipboard.addActionListener({mvcGroup.view.copySearchToClipboard(searchesTable)})
|
||||||
|
JMenuItem trustSearcher = new JMenuItem("Trust searcher")
|
||||||
|
trustSearcher.addActionListener({mvcGroup.controller.trustPersonaFromSearch()})
|
||||||
|
JMenuItem distrustSearcher = new JMenuItem("Distrust searcher")
|
||||||
|
distrustSearcher.addActionListener({mvcGroup.controller.distrustPersonaFromSearch()})
|
||||||
|
|
||||||
searchTableMenu.add(copySearchToClipboard)
|
searchTableMenu.add(copySearchToClipboard)
|
||||||
|
searchTableMenu.add(trustSearcher)
|
||||||
|
searchTableMenu.add(distrustSearcher)
|
||||||
|
|
||||||
searchesTable.addMouseListener(new MouseAdapter() {
|
searchesTable.addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mouseReleased(MouseEvent e) {
|
public void mouseReleased(MouseEvent e) {
|
||||||
|
|
Loading…
Reference in New Issue