Compare commits

..

11 Commits

Author SHA1 Message Date
Zlatin Balevsky
5fa2f2753c Release 0.6.4 2019-11-13 20:06:53 +00:00
Zlatin Balevsky
cacdd2a7a9 add browse and chat buttons to trusted panel 2019-11-13 19:40:28 +00:00
Zlatin Balevsky
d56f7c6184 add right-click menu to trusted table 2019-11-13 19:33:34 +00:00
Zlatin Balevsky
f7f4513109 better help and welcome message 2019-11-13 17:50:50 +00:00
Zlatin Balevsky
dd15d893ba Call for help for Web UI 2019-11-13 17:26:14 +00:00
Zlatin Balevsky
bf5ab9c82e ) 2019-11-13 14:10:26 +00:00
Zlatin Balevsky
edd5a29b10 make private chat room ids unique across servers 2019-11-13 14:09:09 +00:00
Zlatin Balevsky
38eb89f2f7 prepend server name to room id in order to make ids unique across server connections 2019-11-13 13:44:22 +00:00
Zlatin Balevsky
73f1d64428 indentation of text field 2019-11-13 12:24:21 +00:00
Zlatin Balevsky
bc1cae2d75 enable sharing of directories from button 2019-11-13 12:03:23 +00:00
Zlatin Balevsky
a0ab07a7c0 show browse status for local results correctly 2019-11-13 11:58:55 +00:00
13 changed files with 91 additions and 17 deletions

View File

@@ -35,6 +35,10 @@ Look inside `cli-lanterna/build/distributions`. Untar/unzip one of the `shadow`
The CLI is under active development and doesn't have all the features of the GUI.
### Web UI
If you are a Grails/Scala/JRuby/Kotlin developer and are interested in building a Web UI for MuWire, please get in touch. The MuWire core is written in Groovy and should be easy to integrate with any JVM-based language.
### GPG Fingerprint
```

View File

@@ -32,7 +32,7 @@ import com.muwire.core.UILoadedEvent
import com.muwire.core.files.AllFilesLoadedEvent
class CliLanterna {
private static final String MW_VERSION = "0.6.3"
private static final String MW_VERSION = "0.6.4"
private static volatile Core core

View File

@@ -436,7 +436,7 @@ public class Core {
}
}
Core core = new Core(props, home, "0.6.3")
Core core = new Core(props, home, "0.6.4")
core.startServices()
// ... at the end, sleep or execute script

View File

@@ -52,7 +52,7 @@ class ChatServer {
running.set(true)
connections.put(me.destination, LocalChatLink.INSTANCE)
joinRoom(me, CONSOLE)
processHelp(me.destination)
echo("/SAY Welcome to my chat server! Type /HELP for list of available commands.",me.destination)
}
private void sendPings() {
@@ -106,7 +106,7 @@ class ChatServer {
connections.put(endpoint.destination, connection)
joinRoom(client, CONSOLE)
connection.start()
processHelp(connection.endpoint.destination)
echo("/SAY Welcome to my chat server! Type /HELP for help on available commands",connection.endpoint.destination)
}
void onChatDisconnectionEvent(ChatDisconnectionEvent e) {
@@ -263,7 +263,15 @@ class ChatServer {
}
private void processHelp(Destination d) {
String help = "/SAY Available commands: /JOIN /LEAVE /SAY /LIST /INFO /HELP"
String help = """/SAY
Available commands: /JOIN /LEAVE /SAY /LIST /INFO /HELP
/JOIN <room name> - joins a room, or creates one if it does not exist. You must type this in the console
/LEAVE - leaves a room. You must type this in the room you want to leave
/SAY - optional, says something in the room you're in
/LIST - lists the existing rooms on this server. You must type this in the console
/INFO - shows information about this server. You must type this in the console
/HELP - prints this help message
"""
echo(help, d)
}

View File

@@ -84,6 +84,7 @@ class ResultsSender {
infohash : it.getInfoHash(),
pieceSize : pieceSize,
uuid : uuid,
browse : settings.browseFiles,
sources : suggested,
comment : comment,
certificates : certificates,

View File

@@ -1,5 +1,5 @@
group = com.muwire
version = 0.6.3
version = 0.6.4
i2pVersion = 0.9.43
groovyVersion = 2.4.15
slf4jVersion = 1.7.25

View File

@@ -72,7 +72,7 @@ class ChatRoomController {
params['host'] = model.host
params['roomTabName'] = newRoom
mvcGroup.parentGroup.createMVCGroup("chat-room", newRoom, params)
mvcGroup.parentGroup.createMVCGroup("chat-room", model.host.getHumanReadableName()+"-"+newRoom, params)
}
}
if (command.action == ChatAction.LEAVE && !model.console) {
@@ -101,7 +101,8 @@ class ChatRoomController {
Persona p = view.getSelectedPersona()
if (p == null)
return
if (p != model.core.me && !mvcGroup.parentGroup.childrenGroups.containsKey(p.getHumanReadableName()+"-private-chat")) {
String groupId = model.host.getHumanReadableName() + "-" + p.getHumanReadableName() +"-private-chat"
if (p != model.core.me && !mvcGroup.parentGroup.childrenGroups.containsKey(groupId)) {
def params = [:]
params['core'] = model.core
params['tabName'] = model.tabName
@@ -110,7 +111,7 @@ class ChatRoomController {
params['host'] = model.host
params['roomTabName'] = p.getHumanReadableName()
mvcGroup.parentGroup.createMVCGroup("chat-room", p.getHumanReadableName()+"-private-chat", params)
mvcGroup.parentGroup.createMVCGroup("chat-room", groupId, params)
}
}

View File

@@ -234,8 +234,11 @@ class MainFrameController {
int row = view.getSelectedTrustTablesRow(tableName)
if (row < 0)
return
String reason = null
if (level != TrustLevel.NEUTRAL)
reason = JOptionPane.showInputDialog("Enter reason (optional)")
builder.getVariable(tableName).model.fireTableDataChanged()
core.eventBus.publish(new TrustEvent(persona : list[row].persona, level : level))
core.eventBus.publish(new TrustEvent(persona : list[row].persona, level : level, reason : reason))
}
@ControllerAction
@@ -322,6 +325,31 @@ class MainFrameController {
return null
model.subscriptions[row]
}
@ControllerAction
void browseFromTrusted() {
int row = view.getSelectedTrustTablesRow("trusted-table")
if (row < 0)
return
Persona p = model.trusted[row].persona
String groupId = p.getHumanReadableName() + "-browse"
def params = [:]
params['host'] = p
params['core'] = model.core
mvcGroup.createMVCGroup("browse",groupId,params)
}
@ControllerAction
void chatFromTrusted() {
int row = view.getSelectedTrustTablesRow("trusted-table")
if (row < 0)
return
Persona p = model.trusted[row].persona
startChat(p)
view.showChatWindow.call()
}
void unshareSelectedFile() {
def sf = view.selectedSharedFiles()

View File

@@ -99,7 +99,7 @@ class SearchTabController {
if (sender == null)
return
String groupId = sender.getHumanReadableName()
String groupId = sender.getHumanReadableName() + "-browse"
Map<String,Object> params = new HashMap<>()
params['host'] = sender
params['core'] = core

View File

@@ -97,7 +97,7 @@ class ChatServerModel {
}
if (chatCommand.action == ChatAction.SAY &&
room == core.me.toBase64()) {
String groupId = e.sender.getHumanReadableName() + "-private-chat"
String groupId = host.getHumanReadableName()+"-"+e.sender.getHumanReadableName() + "-private-chat"
if (!mvcGroup.childrenGroups.containsKey(groupId)) {
def params = [:]
params['core'] = core
@@ -110,7 +110,8 @@ class ChatServerModel {
mvcGroup.createMVCGroup("chat-room",groupId, params)
}
room = groupId
}
} else
room = host.getHumanReadableName()+"-"+room
mvcGroup.childrenGroups[room]?.controller?.handleChatMessage(e)
}

View File

@@ -80,6 +80,7 @@ class ChatRoomView {
}
panel(constraints : BorderLayout.SOUTH) {
borderLayout()
label(text : "Say something here: ", constraints : BorderLayout.WEST)
sayField = textField(actionPerformed : {controller.say()}, constraints : BorderLayout.CENTER)
button(text : "Say", constraints : BorderLayout.EAST, sayAction)
}

View File

@@ -69,7 +69,7 @@ class ChatServerView {
params['roomTabName'] = 'Console'
params['console'] = true
params['host'] = model.host
mvcGroup.createMVCGroup("chat-room",ChatServer.CONSOLE, params)
mvcGroup.createMVCGroup("chat-room",model.host.getHumanReadableName()+"-"+ChatServer.CONSOLE, params)
}
def closeTab = {

View File

@@ -306,7 +306,7 @@ class MainFrameView {
radioButton(text : "Table", selected : false, buttonGroup : sharedViewType, actionPerformed : showSharedFilesTable)
}
panel {
button(text : "Share files", actionPerformed : shareFiles)
button(text : "Share", actionPerformed : shareFiles)
button(text : "Add Comment", enabled : bind {model.addCommentButtonEnabled}, addCommentAction)
button(text : "Certify", enabled : bind {model.addCommentButtonEnabled}, issueCertificateAction)
}
@@ -434,6 +434,8 @@ class MainFrameView {
button(text : "Subscribe", enabled : bind {model.subscribeButtonEnabled}, constraints : gbc(gridx: 0, gridy : 0), subscribeAction)
button(text : "Mark Neutral", enabled : bind {model.markNeutralFromTrustedButtonEnabled}, constraints : gbc(gridx: 1, gridy: 0), markNeutralFromTrustedAction)
button(text : "Mark Distrusted", enabled : bind {model.markDistrustedButtonEnabled}, constraints : gbc(gridx: 2, gridy:0), markDistrustedAction)
button(text : "Browse", constraints:gbc(gridx:3, gridy:0), browseFromTrustedAction)
button(text : "Chat", constraints : gbc(gridx:4, gridy:0), chatFromTrustedAction)
}
}
panel (border : etchedBorder()){
@@ -777,6 +779,34 @@ class MainFrameView {
model.markNeutralFromTrustedButtonEnabled = true
}
})
JPopupMenu trustMenu = new JPopupMenu()
JMenuItem subscribeItem = new JMenuItem("Subscribe")
subscribeItem.addActionListener({mvcGroup.controller.subscribe()})
trustMenu.add(subscribeItem)
JMenuItem markNeutralItem = new JMenuItem("Mark Neutral")
markNeutralItem.addActionListener({mvcGroup.controller.markNeutralFromTrusted()})
trustMenu.add(markNeutralItem)
JMenuItem markDistrustedItem = new JMenuItem("Mark Distrusted")
markDistrustedItem.addActionListener({mvcGroup.controller.markDistrusted()})
trustMenu.add(markDistrustedItem)
JMenuItem browseItem = new JMenuItem("Browse")
browseItem.addActionListener({mvcGroup.controller.browseFromTrusted()})
trustMenu.add(browseItem)
JMenuItem chatItem = new JMenuItem("Chat")
chatItem.addActionListener({mvcGroup.controller.chatFromTrusted()})
trustMenu.add(chatItem)
trustedTable.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
if (e.isPopupTrigger() || e.button == MouseEvent.BUTTON3)
showPopupMenu(trustMenu, e)
}
public void mouseReleased(MouseEvent e) {
if (e.isPopupTrigger() || e.button == MouseEvent.BUTTON3)
showPopupMenu(trustMenu, e)
}
})
// distrusted table
def distrustedTable = builder.getVariable("distrusted-table")
@@ -1069,8 +1099,8 @@ class MainFrameView {
def shareFiles = {
def chooser = new JFileChooser()
chooser.setFileHidingEnabled(!model.core.muOptions.shareHiddenFiles)
chooser.setDialogTitle("Select file to share")
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY)
chooser.setDialogTitle("Select files or directories to share")
chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES)
chooser.setMultiSelectionEnabled(true)
int rv = chooser.showOpenDialog(null)
if (rv == JFileChooser.APPROVE_OPTION) {