Skip to content

Commit

Permalink
fix(GUI): make transaction hash selactable (#1196)
Browse files Browse the repository at this point in the history
  • Loading branch information
b00f authored Apr 4, 2024
1 parent 883c33d commit 620348d
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 118 deletions.
33 changes: 15 additions & 18 deletions cmd/gtk/assets/ui/dialog_transaction_bond.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.40.0 -->
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkDialog" id="id_dialog_transaction_bond">
Expand Down Expand Up @@ -220,7 +220,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Memo:</property>
<property name="label" translatable="yes">Amount:</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -229,13 +229,13 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="id_entry_memo">
<object class="GtkEntry" id="id_entry_amount">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="width-chars">32</property>
<property name="caps-lock-warning">False</property>
<property name="input-purpose">number</property>
<signal name="changed" handler="on_amount_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -244,9 +244,11 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="id_hint_amount">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="use-markup">True</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -258,8 +260,6 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Amount:</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -268,14 +268,11 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="id_entry_amount">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="width-chars">32</property>
<property name="caps-lock-warning">False</property>
<property name="input-purpose">number</property>
<signal name="changed" handler="on_amount_changed" swapped="no"/>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Memo (Up to 64 characters, Optional):</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -284,11 +281,11 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="id_hint_amount">
<object class="GtkEntry" id="id_entry_memo">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="use-markup">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="caps-lock-warning">False</property>
</object>
<packing>
<property name="expand">False</property>
Expand Down
35 changes: 16 additions & 19 deletions cmd/gtk/assets/ui/dialog_transaction_transfer.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.40.0 -->
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkDialog" id="id_dialog_transaction_transfer">
Expand Down Expand Up @@ -142,7 +142,6 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="width-chars">32</property>
<property name="caps-lock-warning">False</property>
<signal name="changed" handler="on_receiver_changed" swapped="no"/>
</object>
Expand Down Expand Up @@ -180,7 +179,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Memo:</property>
<property name="label" translatable="yes">Amount:</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -189,12 +188,13 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="id_entry_memo">
<object class="GtkEntry" id="id_entry_amount">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="width-chars">32</property>
<property name="caps-lock-warning">False</property>
<property name="input-purpose">number</property>
<signal name="changed" handler="on_amount_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -203,9 +203,11 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="id_hint_amount">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="use-markup">True</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -217,8 +219,6 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Amount:</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -227,14 +227,11 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="id_entry_amount">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="width-chars">32</property>
<property name="caps-lock-warning">False</property>
<property name="input-purpose">number</property>
<signal name="changed" handler="on_amount_changed" swapped="no"/>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Memo (Up to 64 characters, Optional):</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -243,11 +240,11 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="id_hint_amount">
<object class="GtkEntry" id="id_entry_memo">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="use-markup">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="caps-lock-warning">False</property>
</object>
<packing>
<property name="expand">False</property>
Expand Down
18 changes: 2 additions & 16 deletions cmd/gtk/assets/ui/dialog_transaction_unbond.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.40.0 -->
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkDialog" id="id_dialog_transaction_unbond">
Expand Down Expand Up @@ -136,7 +136,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Memo:</property>
<property name="label" translatable="yes">Memo (Up to 64 characters, Optional):</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -149,28 +149,14 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="width-chars">32</property>
<property name="caps-lock-warning">False</property>
<property name="input-purpose">number</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">6</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
Expand Down
62 changes: 15 additions & 47 deletions cmd/gtk/assets/ui/dialog_transaction_withdraw.ui
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkRecentChooserDialog">
<property name="can-focus">False</property>
<property name="type-hint">dialog</property>
<property name="limit">20</property>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can-focus">False</property>
<property name="layout-style">end</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkDialog" id="id_dialog_transaction_withdraw">
<property name="width-request">600</property>
<property name="can-focus">False</property>
Expand Down Expand Up @@ -203,7 +174,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Memo:</property>
<property name="label" translatable="yes">Stake:</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -212,13 +183,13 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="id_entry_memo">
<object class="GtkEntry" id="id_entry_stake">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="width-chars">32</property>
<property name="caps-lock-warning">False</property>
<property name="input-purpose">number</property>
<signal name="changed" handler="on_stake_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -227,9 +198,11 @@
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkLabel" id="id_hint_stake">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="use-markup">True</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -241,8 +214,6 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Stake:</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -251,14 +222,11 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="id_entry_stake">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="width-chars">32</property>
<property name="caps-lock-warning">False</property>
<property name="input-purpose">number</property>
<signal name="changed" handler="on_stake_changed" swapped="no"/>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Memo (Up to 64 characters, Optional):</property>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -267,11 +235,11 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="id_hint_stake">
<object class="GtkEntry" id="id_entry_memo">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="use-markup">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="caps-lock-warning">False</property>
</object>
<packing>
<property name="expand">False</property>
Expand Down
10 changes: 5 additions & 5 deletions cmd/gtk/dialog_transaction_bond.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ func broadcastTransactionBond(wlt *wallet.Wallet) {
}
msg := fmt.Sprintf(`
You are going to sign and broadcast this transaction:
<tt>
From: %s
To: %s
Amount: %s
Memo: %s
Fee: %s
THIS ACTION IS NOT REVERSIBLE. Do you want to continue?`,
sender, receiver, amt, trx.Memo(), trx.Fee())
Memo: %s
</tt>
<b>THIS ACTION IS NOT REVERSIBLE. Do you want to continue?</b>`,
sender, receiver, amt, trx.Fee(), trx.Memo())

signAndBroadcastTransaction(dlg, msg, wlt, trx)

Expand Down
10 changes: 5 additions & 5 deletions cmd/gtk/dialog_transaction_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ func broadcastTransactionTransfer(wlt *wallet.Wallet) {
}
msg := fmt.Sprintf(`
You are going to sign and broadcast this transaction:
<tt>
From: %s
To: %s
Amount: %s
Memo: %s
Fee: %s
THIS ACTION IS NOT REVERSIBLE. Do you want to continue?`,
sender, receiver, amt, trx.Memo(), trx.Fee())
Memo: %s
</tt>
<b>THIS ACTION IS NOT REVERSIBLE. Do you want to continue?</b>`,
sender, receiver, amt, trx.Fee(), trx.Memo())

signAndBroadcastTransaction(dlg, msg, wlt, trx)

Expand Down
Loading

0 comments on commit 620348d

Please sign in to comment.