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))
|
||||
}
|
||||
|
||||
@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
|
||||
void cancel() {
|
||||
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.files.FileSharedEvent
|
||||
import com.muwire.core.trust.RemoteTrustList
|
||||
|
||||
import java.awt.BorderLayout
|
||||
import java.awt.CardLayout
|
||||
import java.awt.FlowLayout
|
||||
|
@ -456,9 +455,18 @@ class MainFrameView {
|
|||
// searches table
|
||||
def searchesTable = builder.getVariable("searches-table")
|
||||
JPopupMenu searchTableMenu = new JPopupMenu()
|
||||
|
||||
JMenuItem copySearchToClipboard = new JMenuItem("Copy search to clipboard")
|
||||
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(trustSearcher)
|
||||
searchTableMenu.add(distrustSearcher)
|
||||
|
||||
searchesTable.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
|
|
Loading…
Reference in New Issue