show all watched directories
This commit is contained in:
@@ -81,4 +81,9 @@ mvcGroups {
|
||||
view = 'com.muwire.gui.UpdateView'
|
||||
controller = 'com.muwire.gui.UpdateController'
|
||||
}
|
||||
'advanced-sharing' {
|
||||
model = 'com.muwire.gui.AdvancedSharingModel'
|
||||
view = 'com.muwire.gui.AdvancedSharingView'
|
||||
controller = 'com.muwire.gui.AdvancedSharingController'
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,17 @@
|
||||
package com.muwire.gui
|
||||
|
||||
import griffon.core.artifact.GriffonController
|
||||
import griffon.core.controller.ControllerAction
|
||||
import griffon.inject.MVCMember
|
||||
import griffon.metadata.ArtifactProviderFor
|
||||
import javax.annotation.Nonnull
|
||||
|
||||
import com.muwire.core.Core
|
||||
|
||||
@ArtifactProviderFor(GriffonController)
|
||||
class AdvancedSharingController {
|
||||
@MVCMember @Nonnull
|
||||
AdvancedSharingModel model
|
||||
@MVCMember @Nonnull
|
||||
AdvancedSharingView view
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.muwire.gui
|
||||
|
||||
import com.muwire.core.Core
|
||||
|
||||
import griffon.core.artifact.GriffonModel
|
||||
import griffon.transform.Observable
|
||||
import griffon.metadata.ArtifactProviderFor
|
||||
|
||||
@ArtifactProviderFor(GriffonModel)
|
||||
class AdvancedSharingModel {
|
||||
def watchedDirectories = []
|
||||
|
||||
Core core
|
||||
|
||||
void mvcGroupInit(Map<String,String> args) {
|
||||
watchedDirectories.addAll(core.muOptions.watchedDirectories)
|
||||
// view.watchedDirsTable.model.fireTableDataChanged()
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,79 @@
|
||||
package com.muwire.gui
|
||||
|
||||
import griffon.core.artifact.GriffonView
|
||||
import griffon.inject.MVCMember
|
||||
import griffon.metadata.ArtifactProviderFor
|
||||
|
||||
import javax.swing.JDialog
|
||||
import javax.swing.JTabbedPane
|
||||
import javax.swing.SwingConstants
|
||||
|
||||
import java.awt.BorderLayout
|
||||
import java.awt.event.WindowAdapter
|
||||
import java.awt.event.WindowEvent
|
||||
|
||||
import javax.annotation.Nonnull
|
||||
|
||||
@ArtifactProviderFor(GriffonView)
|
||||
class AdvancedSharingView {
|
||||
@MVCMember @Nonnull
|
||||
FactoryBuilderSupport builder
|
||||
@MVCMember @Nonnull
|
||||
AdvancedSharingModel model
|
||||
|
||||
def mainFrame
|
||||
def dialog
|
||||
def watchedDirsPanel
|
||||
def negativeTreePanel
|
||||
|
||||
def watchedDirsTable
|
||||
|
||||
void initUI() {
|
||||
mainFrame = application.windowManager.findWindow("main-frame")
|
||||
dialog = new JDialog(mainFrame,"Advanced Sharing",true)
|
||||
dialog.setResizable(true)
|
||||
|
||||
watchedDirsPanel = builder.panel {
|
||||
borderLayout()
|
||||
panel (constraints : BorderLayout.NORTH) {
|
||||
label(text : "Directories watched for file changes")
|
||||
}
|
||||
scrollPane( constraints : BorderLayout.CENTER ) {
|
||||
watchedDirsTable = table(autoCreateRowSorter : true) {
|
||||
tableModel(list : model.watchedDirectories) {
|
||||
closureColumn(header : "Directory", type : String, read : {it})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
negativeTreePanel = builder.panel {
|
||||
borderLayout()
|
||||
panel(constraints : BorderLayout.NORTH) {
|
||||
label(text : "Files which are explicitly not shared")
|
||||
}
|
||||
scrollPane( constraints : BorderLayout.CENTER ) {
|
||||
// add tree here
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void mvcGroupInit(Map<String,String> args) {
|
||||
def tabbedPane = new JTabbedPane()
|
||||
tabbedPane.addTab("Watched Directories", watchedDirsPanel)
|
||||
tabbedPane.addTab("Negative Tree", negativeTreePanel)
|
||||
|
||||
dialog.with {
|
||||
getContentPane().add(tabbedPane)
|
||||
pack()
|
||||
setLocationRelativeTo(mainFrame)
|
||||
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE)
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosed(WindowEvent e) {
|
||||
mvcGroup.destroy()
|
||||
}
|
||||
})
|
||||
show()
|
||||
}
|
||||
}
|
||||
}
|
@@ -90,11 +90,6 @@ class MainFrameView {
|
||||
}
|
||||
menu (text : "Options") {
|
||||
menuItem("Configuration", actionPerformed : {mvcGroup.createMVCGroup("Options")})
|
||||
menuItem("Content Control", actionPerformed : {
|
||||
def env = [:]
|
||||
env["core"] = model.core
|
||||
mvcGroup.createMVCGroup("content-panel", env)
|
||||
})
|
||||
}
|
||||
menu (text : "Status") {
|
||||
menuItem("MuWire", actionPerformed : {mvcGroup.createMVCGroup("mu-wire-status")})
|
||||
@@ -102,6 +97,18 @@ class MainFrameView {
|
||||
menuItem("I2P", enabled : bind {model.routerPresent}, actionPerformed: {mvcGroup.createMVCGroup("i-2-p-status")})
|
||||
menuItem("System", actionPerformed : {mvcGroup.createMVCGroup("system-status")})
|
||||
}
|
||||
menu (text : "Tools") {
|
||||
menuItem("Content Control", actionPerformed : {
|
||||
def env = [:]
|
||||
env["core"] = model.core
|
||||
mvcGroup.createMVCGroup("content-panel", env)
|
||||
})
|
||||
menuItem("Advanced Sharing", actionPerformed : {
|
||||
def env = [:]
|
||||
env["core"] = model.core
|
||||
mvcGroup.createMVCGroup("advanced-sharing",env)
|
||||
})
|
||||
}
|
||||
}
|
||||
borderLayout()
|
||||
panel (border: etchedBorder(), constraints : BorderLayout.NORTH) {
|
||||
|
Reference in New Issue
Block a user