mirror of https://github.com/zlatinb/muwire
show a message instead of search bar while disconnected
parent
d18a618575
commit
c51e3874da
|
@ -120,6 +120,11 @@ class MainFrameModel {
|
|||
runInsideUIAsync {
|
||||
connections = core.connectionManager.getConnections().size()
|
||||
|
||||
if (connections > 0) {
|
||||
def topPanel = builder.getVariable("top-panel")
|
||||
topPanel.getLayout().show(topPanel, "top-search-panel")
|
||||
}
|
||||
|
||||
connectionList.add(e.endpoint.destination)
|
||||
JTable table = builder.getVariable("connections-table")
|
||||
table.model.fireTableDataChanged()
|
||||
|
@ -129,6 +134,12 @@ class MainFrameModel {
|
|||
void onDisconnectionEvent(DisconnectionEvent e) {
|
||||
runInsideUIAsync {
|
||||
connections = core.connectionManager.getConnections().size()
|
||||
|
||||
if (connections == 0) {
|
||||
def topPanel = builder.getVariable("top-panel")
|
||||
topPanel.getLayout().show(topPanel, "top-connect-panel")
|
||||
}
|
||||
|
||||
connectionList.remove(e.destination)
|
||||
JTable table = builder.getVariable("connections-table")
|
||||
table.model.fireTableDataChanged()
|
||||
|
|
|
@ -52,6 +52,13 @@ class MainFrameView {
|
|||
button(text: "Uploads", actionPerformed : showUploadsWindow)
|
||||
button(text: "Monitor", actionPerformed : showMonitorWindow)
|
||||
}
|
||||
panel(id: "top-panel", constraints: BorderLayout.CENTER) {
|
||||
cardLayout()
|
||||
panel(constraints : "top-connect-panel") {
|
||||
label(text : "MuWire is connecting, please wait. You will be able to search soon.")
|
||||
}
|
||||
panel(constraints : "top-search-panel") {
|
||||
borderLayout()
|
||||
panel(constraints: BorderLayout.CENTER) {
|
||||
borderLayout()
|
||||
label(" Enter search here:", constraints: BorderLayout.WEST) // TODO: fix this
|
||||
|
@ -62,6 +69,8 @@ class MainFrameView {
|
|||
button(text: "Search", searchAction)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
panel (id: "cards-panel", constraints : BorderLayout.CENTER) {
|
||||
cardLayout()
|
||||
panel (constraints : "search window") {
|
||||
|
|
Loading…
Reference in New Issue