search through comments

This commit is contained in:
Zlatin Balevsky
2019-10-16 14:06:11 +01:00
parent 1227cf9263
commit d0299f80c6
5 changed files with 72 additions and 1 deletions

View File

@@ -8,6 +8,8 @@ import net.i2p.data.Base64
import javax.annotation.Nonnull
import com.muwire.core.Core
import com.muwire.core.files.UICommentEvent
import com.muwire.core.util.DataUtil
@ArtifactProviderFor(GriffonController)
@@ -17,6 +19,8 @@ class AddCommentController {
@MVCMember @Nonnull
AddCommentView view
Core core
@ControllerAction
void save() {
String comment = view.textarea.getText()
@@ -25,7 +29,9 @@ class AddCommentController {
else
comment = Base64.encode(DataUtil.encodei18nString(comment))
model.selectedFiles.each {
def event = new UICommentEvent(sharedFile : it, oldComment : it.getComment())
it.setComment(comment)
core.eventBus.publish(event)
}
mvcGroup.parentGroup.view.refreshSharedFiles()
cancel()

View File

@@ -288,6 +288,7 @@ class MainFrameController {
Map<String, Object> params = new HashMap<>()
params['selectedFiles'] = selectedFiles
params['core'] = core
mvcGroup.createMVCGroup("add-comment", "Add Comment", params)
}