From e02ccbb7838ece6b4b8662401006e80d9d6108e6 Mon Sep 17 00:00:00 2001 From: SAHIL Date: Tue, 24 Oct 2023 16:56:22 +0530 Subject: [PATCH 1/2] Network ID UI --- cmd/gtk/assets/ui/widget_node.ui | 46 ++++++++++++++++++++++++++------ cmd/gtk/widget_node.go | 3 +++ node/node.go | 4 +++ 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/cmd/gtk/assets/ui/widget_node.ui b/cmd/gtk/assets/ui/widget_node.ui index 6c25fb646..c0e84a0af 100644 --- a/cmd/gtk/assets/ui/widget_node.ui +++ b/cmd/gtk/assets/ui/widget_node.ui @@ -104,7 +104,7 @@ 0 - 2 + 3 @@ -118,7 +118,7 @@ 1 - 2 + 3 @@ -133,7 +133,7 @@ 0 - 3 + 4 @@ -147,7 +147,7 @@ 1 - 3 + 4 @@ -162,7 +162,7 @@ 0 - 4 + 5 @@ -176,7 +176,7 @@ 1 - 4 + 5 @@ -191,7 +191,7 @@ 0 - 5 + 6 @@ -204,7 +204,7 @@ 1 - 5 + 6 @@ -237,6 +237,36 @@ 1 + + + True + False + start + start + True + True + Network ID: + + + 0 + 2 + + + + + True + False + start + start + True + True + True + + + 1 + 2 + + diff --git a/cmd/gtk/widget_node.go b/cmd/gtk/widget_node.go index f13a9889d..e47ef1d61 100644 --- a/cmd/gtk/widget_node.go +++ b/cmd/gtk/widget_node.go @@ -22,6 +22,7 @@ type widgetNode struct { genesisTime time.Time // TODO: move this logic to the state model *nodeModel + labelNetworkID *gtk.Label labelLastBlockTime *gtk.Label labelLastBlockHeight *gtk.Label labelBlocksLeft *gtk.Label @@ -42,6 +43,7 @@ func buildWidgetNode(model *nodeModel) (*widgetNode, error) { box := getBoxObj(builder, "id_box_node") labelLocation := getLabelObj(builder, "id_label_working_directory") labelNetwork := getLabelObj(builder, "id_label_network") + labelNetworkID := getLabelObj(builder, "id_label_network_id") cwd, err := os.Getwd() if err != nil { @@ -49,6 +51,7 @@ func buildWidgetNode(model *nodeModel) (*widgetNode, error) { } labelLocation.SetText(cwd) labelNetwork.SetText(model.node.State().Genesis().ChainType().String()) + labelNetworkID.SetText(model.node.Network().SelfID().String()) w := &widgetNode{ Box: box, diff --git a/node/node.go b/node/node.go index ee26f8e1f..70ac54b6c 100644 --- a/node/node.go +++ b/node/node.go @@ -170,3 +170,7 @@ func (n *Node) State() state.Facade { func (n *Node) GRPC() *grpc.Server { return n.grpc } + +func (n *Node) Network() network.Network { + return n.network +} From 8a30357ef0a498b1cfd200bdf96e2538fee12d77 Mon Sep 17 00:00:00 2001 From: SAHIL Date: Tue, 24 Oct 2023 19:00:43 +0530 Subject: [PATCH 2/2] lint fix --- cmd/gtk/widget_node.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/gtk/widget_node.go b/cmd/gtk/widget_node.go index e47ef1d61..4625f8108 100644 --- a/cmd/gtk/widget_node.go +++ b/cmd/gtk/widget_node.go @@ -22,7 +22,6 @@ type widgetNode struct { genesisTime time.Time // TODO: move this logic to the state model *nodeModel - labelNetworkID *gtk.Label labelLastBlockTime *gtk.Label labelLastBlockHeight *gtk.Label labelBlocksLeft *gtk.Label