1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-21 14:04:10 +01:00

(gui) reconnect is enabled if state=offline and node is funder

This commit is contained in:
dpad85 2017-02-23 18:33:30 +01:00
parent ed70d0299c
commit 4e2bf2b047
3 changed files with 10 additions and 3 deletions

View file

@ -27,7 +27,7 @@
HBox.hgrow="ALWAYS" focusTraversable="false" />
<HBox GridPane.columnIndex="4" GridPane.halignment="RIGHT" alignment="CENTER_RIGHT" HBox.hgrow="NEVER" spacing="5.0">
<children>
<Button fx:id="reconnect" mnemonicParsing="false" styleClass="" text="Reconnect"/>
<Button fx:id="reconnect" mnemonicParsing="false" styleClass="" text="Reconnect" disable="true"/>
<Button fx:id="close" mnemonicParsing="false" styleClass="close-channel" text="Close"/>
</children>
</HBox>

View file

@ -71,7 +71,14 @@ class GUIUpdater(primaryStage: Stage, mainController: MainController, setup: Set
case ChannelChangedState(channel, _, _, previousState, currentState, currentData) if m.contains(channel) =>
val channelPane = m(channel)
Platform.runLater(new Runnable() {
override def run = channelPane.state.setText(currentState.toString)
override def run = {
if (channelPane.channelParams.isFunder && OFFLINE.equals(currentState)) {
channelPane.reconnect.setDisable(false)
} else {
channelPane.reconnect.setDisable(true)
}
channelPane.state.setText(currentState.toString)
}
})
case ChannelSignatureReceived(channel, commitments) =>

View file

@ -12,7 +12,7 @@ import grizzled.slf4j.Logging
/**
* Created by DPA on 23/09/2016.
*/
class ChannelPaneController(theirNodeIdValue: String, channelParams: LocalParams) extends Logging {
class ChannelPaneController(theirNodeIdValue: String, val channelParams: LocalParams) extends Logging {
@FXML var channelId: TextField = _
@FXML var balanceBar: ProgressBar = _