Skip to content

Commit

Permalink
feat(gtk): adding IsPrune to node widget (#1470)
Browse files Browse the repository at this point in the history
Co-authored-by: Javad Rajabzadeh <[email protected]>
  • Loading branch information
kehiy and Ja7ad authored Aug 14, 2024
1 parent 8021824 commit 83261e1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
35 changes: 31 additions & 4 deletions cmd/gtk/assets/ui/widget_node.ui
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkBox" id="id_box_node">
Expand Down Expand Up @@ -48,7 +48,7 @@
<property name="label-xalign">0.019999999552965164</property>
<property name="shadow-type">in</property>
<child>
<!-- n-columns=2 n-rows=10 -->
<!-- n-columns=2 n-rows=12 -->
<object class="GtkGrid">
<property name="width-request">400</property>
<property name="visible">True</property>
Expand Down Expand Up @@ -191,7 +191,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">10</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
Expand All @@ -204,7 +204,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">10</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -386,6 +386,33 @@
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label" translatable="yes">✂️ Is Prune:</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="id_label_is_prune">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">10</property>
</packing>
</child>
</object>
</child>
<child type="label">
Expand Down
2 changes: 2 additions & 0 deletions cmd/gtk/widget_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func buildWidgetNode(model *nodeModel) (*widgetNode, error) {
labelNetwork := getLabelObj(builder, "id_label_network")
labelNetworkID := getLabelObj(builder, "id_label_network_id")
labelMoniker := getLabelObj(builder, "id_label_moniker")
labelIsPrune := getLabelObj(builder, "id_label_is_prune")

cwd, err := os.Getwd()
if err != nil {
Expand All @@ -57,6 +58,7 @@ func buildWidgetNode(model *nodeModel) (*widgetNode, error) {
labelNetwork.SetText(model.node.State().Genesis().ChainType().String())
labelNetworkID.SetText(model.node.Network().SelfID().String())
labelMoniker.SetText(model.node.Sync().Moniker())
labelIsPrune.SetText(strconv.FormatBool(model.node.State().IsPruned()))

w := &widgetNode{
Box: box,
Expand Down

0 comments on commit 83261e1

Please sign in to comment.