mastercoin-wallet 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +76 -0
- data/LICENSE.txt +61 -0
- data/Makefile +11 -0
- data/README.rdoc +39 -0
- data/Rakefile +36 -0
- data/VERSION +1 -0
- data/bin/mastercoin-wallet +16 -0
- data/lib/.DS_Store +0 -0
- data/lib/mastercoin-wallet/config.rb +92 -0
- data/lib/mastercoin-wallet/gui/first_run_window.rb +92 -0
- data/lib/mastercoin-wallet/gui/first_run_window.ui +186 -0
- data/lib/mastercoin-wallet/gui/images.rb +681 -0
- data/lib/mastercoin-wallet/gui/main_window.rb +96 -0
- data/lib/mastercoin-wallet/gui/simple_send_window.rb +196 -0
- data/lib/mastercoin-wallet/gui/simple_send_window.ui +125 -0
- data/lib/mastercoin-wallet/gui/ui_first_run.rb +161 -0
- data/lib/mastercoin-wallet/gui/ui_simple_send.rb +123 -0
- data/lib/mastercoin-wallet/models/address.rb +16 -0
- data/lib/mastercoin-wallet/models/transaction.rb +17 -0
- data/lib/mastercoin-wallet/network.rb +34 -0
- data/lib/mastercoin-wallet.rb +47 -0
- data/mastercoin-wallet.gemspec +86 -0
- data/resources/images.qrc +6 -0
- data/resources/logo.svg +96 -0
- data/test/helper.rb +18 -0
- data/test/test_mastercoin-wallet.rb +7 -0
- metadata +191 -0
@@ -0,0 +1,96 @@
|
|
1
|
+
module MastercoinWallet
|
2
|
+
class MainWindow < Qt::Dialog
|
3
|
+
slots 'new_simple_send()'
|
4
|
+
|
5
|
+
def initialize()
|
6
|
+
super
|
7
|
+
setWindowTitle(tr("Mastercoin wallet - v0.0.1"))
|
8
|
+
|
9
|
+
@rows = []
|
10
|
+
|
11
|
+
createBalanceOverview()
|
12
|
+
|
13
|
+
@recentTransactions = Qt::TreeWidget.new
|
14
|
+
@recentTransactions.setColumnCount(2)
|
15
|
+
@recentTransactions.setHeaderLabels(["Address", "Amount", "Date"])
|
16
|
+
|
17
|
+
@recentTransactions.setColumnWidth(0,300)
|
18
|
+
@recentTransactions.setColumnWidth(1,50)
|
19
|
+
|
20
|
+
overview = Qt::VBoxLayout.new
|
21
|
+
@btc_balance_label = Qt::Label.new(tr("#{MastercoinWallet.config.btc_balance} BTC"))
|
22
|
+
overview.addWidget(Qt::Label.new(tr("<h3>Mastercoin wallet</h3>")),0,0)
|
23
|
+
overview.addWidget(Qt::Label.new(tr(MastercoinWallet.config.address)),1,0)
|
24
|
+
overview.addWidget(@btc_balance_label,1,1)
|
25
|
+
|
26
|
+
simple_send = Qt::PushButton.new
|
27
|
+
simple_send.setText("New simple send")
|
28
|
+
connect(simple_send, SIGNAL('clicked()'), self, SLOT('new_simple_send()'))
|
29
|
+
|
30
|
+
self.layout = Qt::GridLayout.new do |m|
|
31
|
+
m.addWidget(@gridGroupBox, 0, 0)
|
32
|
+
m.addLayout(overview, 0, 1)
|
33
|
+
m.addWidget(@recentTransactions, 1,0,1, 2)
|
34
|
+
m.addWidget(simple_send, 2,1)
|
35
|
+
end
|
36
|
+
|
37
|
+
MastercoinWallet.network.add_observer(self, :update)
|
38
|
+
MastercoinWallet.network.sync!
|
39
|
+
end
|
40
|
+
|
41
|
+
def new_simple_send
|
42
|
+
dialog = MastercoinWallet::SimpleSendWindow.new
|
43
|
+
dialog.exec
|
44
|
+
end
|
45
|
+
|
46
|
+
def update(status = true)
|
47
|
+
puts "update"
|
48
|
+
load_transactions
|
49
|
+
update_balance
|
50
|
+
end
|
51
|
+
|
52
|
+
def load_transactions
|
53
|
+
if MastercoinWallet.config.has_key?(:received_transactions)
|
54
|
+
MastercoinWallet.config.received_transactions.each do |x|
|
55
|
+
row = Qt::TreeWidgetItem.new
|
56
|
+
row.setText(0, x["address"])
|
57
|
+
row.setText(1, x["amount"])
|
58
|
+
row.setText(2, x["tx_date"])
|
59
|
+
@rows << row
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
if MastercoinWallet.config.has_key?(:sent_transactions)
|
64
|
+
MastercoinWallet.config.sent_transactions.each do |x|
|
65
|
+
row = Qt::TreeWidgetItem.new
|
66
|
+
row.setText(0, x["receiving_address"])
|
67
|
+
row.setText(1, x["amount"])
|
68
|
+
row.setText(2, x["tx_date"])
|
69
|
+
@rows << row
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
@recentTransactions.insertTopLevelItems(0, @rows)
|
74
|
+
end
|
75
|
+
|
76
|
+
def update_balance
|
77
|
+
@balance_label.setText("#{MastercoinWallet.config.balance} MSC")
|
78
|
+
@test_balance_label.setText("Test #{MastercoinWallet.config.test_balance} MSC")
|
79
|
+
@btc_balance_label.setText(tr("#{MastercoinWallet.config.btc_balance} BTC"))
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
def createBalanceOverview()
|
84
|
+
@gridGroupBox = Qt::GroupBox.new(tr("Balances"))
|
85
|
+
layout = Qt::GridLayout.new
|
86
|
+
@balance_label = Qt::Label.new(tr("Retrieving balance"))
|
87
|
+
@test_balance_label = Qt::Label.new(tr("Retrieving test balance"))
|
88
|
+
layout.addWidget(@balance_label,1,0)
|
89
|
+
layout.addWidget(@test_balance_label,2,0)
|
90
|
+
|
91
|
+
layout.setColumnStretch(1, 10)
|
92
|
+
layout.setColumnStretch(2, 20)
|
93
|
+
@gridGroupBox.layout = layout
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,196 @@
|
|
1
|
+
module MastercoinWallet
|
2
|
+
class SimpleSendWindow < Qt::Dialog
|
3
|
+
include Bitcoin::Builder
|
4
|
+
|
5
|
+
slots 'on_amount_input_textChanged(const QString&)',
|
6
|
+
'on_address_input_textChanged(const QString&)',
|
7
|
+
'on_password_input_textChanged(const QString&)',
|
8
|
+
'send_payment()'
|
9
|
+
|
10
|
+
# TODO: TRY TO REDEEM MULTISIGS
|
11
|
+
def initialize(parent=nil)
|
12
|
+
super(parent)
|
13
|
+
|
14
|
+
@ui = Ui_SimpleSend.new
|
15
|
+
@ui.setupUi(self)
|
16
|
+
|
17
|
+
@amount_input = findChild(Qt::LineEdit, "amount_input")
|
18
|
+
@address_input = findChild(Qt::LineEdit, "address_input")
|
19
|
+
|
20
|
+
@submit = findChild(Qt::PushButton, "submit_button")
|
21
|
+
|
22
|
+
@amount_input.setText("1.337")
|
23
|
+
@address_input.setText("1J2svn2GxYx9LPrpCLFikmzn9kkrXBrk8B")
|
24
|
+
|
25
|
+
|
26
|
+
@amount_input.validator = Qt::DoubleValidator.new(0.00000001, 10000,8, @amount_input)
|
27
|
+
|
28
|
+
|
29
|
+
@currency_select = findChild(Qt::ComboBox, "currency_box")
|
30
|
+
# Dont allow real coins for now
|
31
|
+
# @currency_select.addItem(tr("Mastercoin"))
|
32
|
+
@currency_select.addItem(tr("Test Mastercoin"))
|
33
|
+
|
34
|
+
connect(@submit, SIGNAL('clicked()'), self, SLOT('send_payment()'))
|
35
|
+
end
|
36
|
+
|
37
|
+
def on_amount_input_textChanged(amount)
|
38
|
+
@amount = amount
|
39
|
+
check_valid
|
40
|
+
end
|
41
|
+
|
42
|
+
def on_address_input_textChanged(address)
|
43
|
+
@address = address
|
44
|
+
check_valid
|
45
|
+
end
|
46
|
+
|
47
|
+
def on_password_input_textChanged(password)
|
48
|
+
@password = password
|
49
|
+
check_valid
|
50
|
+
end
|
51
|
+
|
52
|
+
def send_payment
|
53
|
+
data_key = Mastercoin::SimpleSend.new(currency_id: 2, amount: @amount.to_f * 1e8).encode_to_compressed_public_key
|
54
|
+
|
55
|
+
fee = BigDecimal.new("0.0001")
|
56
|
+
tx_amount = BigDecimal.new("0.00006")
|
57
|
+
mastercoin_tx = (4 * tx_amount)
|
58
|
+
|
59
|
+
result = MastercoinWallet.config.spendable_outputs.find{|x| BigDecimal.new(x[:value]) > (fee + mastercoin_tx)}
|
60
|
+
|
61
|
+
if result.is_a?(Array)
|
62
|
+
output = result[0]
|
63
|
+
else
|
64
|
+
output = result
|
65
|
+
end
|
66
|
+
|
67
|
+
unless output
|
68
|
+
Qt::MessageBox.critical(self, tr("Could not send transaction"),
|
69
|
+
tr("It appears there are no spendable outputs for this address that are big enough to transmit this transaction. Please consolidate some coins and send them to your Mastercoin address."))
|
70
|
+
return
|
71
|
+
end
|
72
|
+
|
73
|
+
change_amount = BigDecimal.new(output["value"]) - fee - mastercoin_tx
|
74
|
+
|
75
|
+
tx = MastercoinWallet.config.bitcoin_transactions.find{|x| x["hash"] == output["prev_out"]["hash"]}
|
76
|
+
if tx.is_a?(Array)
|
77
|
+
tx = tx[0]
|
78
|
+
end
|
79
|
+
|
80
|
+
begin
|
81
|
+
priv_key = MastercoinWallet.config.get_encrypted_key(:private_key, @password)
|
82
|
+
rescue ArgumentError
|
83
|
+
Qt::MessageBox.information(self, tr("Could not send payment."),
|
84
|
+
tr("Could not send payment, wrong password."))
|
85
|
+
return
|
86
|
+
end
|
87
|
+
begin
|
88
|
+
key = Bitcoin::Key.from_base58(priv_key)
|
89
|
+
rescue ArgumentError
|
90
|
+
begin
|
91
|
+
key = Bitcoin::Key.new(priv_key)
|
92
|
+
rescue ArgumentError, OpenSSL::BNError
|
93
|
+
Qt::MessageBox.information(self, tr("Could not send payment."),
|
94
|
+
tr("Could not send payment, wrong password."))
|
95
|
+
return
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
tx = build_tx do |t|
|
100
|
+
t.input do |i|
|
101
|
+
i.prev_out Bitcoin::Protocol::Tx.from_hash(tx)
|
102
|
+
i.prev_out_index output["prev_out"]["n"]
|
103
|
+
i.signature_key key
|
104
|
+
end
|
105
|
+
|
106
|
+
# Change address
|
107
|
+
t.output do |o|
|
108
|
+
o.value change_amount * 1e8
|
109
|
+
|
110
|
+
o.script do |s|
|
111
|
+
s.type :address
|
112
|
+
s.recipient MastercoinWallet.config.address
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
# Receiving address
|
117
|
+
t.output do |o|
|
118
|
+
o.value tx_amount * 1e8
|
119
|
+
|
120
|
+
o.script do |s|
|
121
|
+
s.type :address
|
122
|
+
s.recipient @address
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
# Exodus address
|
127
|
+
t.output do |o|
|
128
|
+
o.value tx_amount * 1e8
|
129
|
+
|
130
|
+
o.script do |s|
|
131
|
+
s.type :address
|
132
|
+
s.recipient Mastercoin::EXODUS_ADDRESS
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
# Data address
|
137
|
+
t.output do |o|
|
138
|
+
o.value (tx_amount) * 2 * 1e8
|
139
|
+
|
140
|
+
o.script do |s|
|
141
|
+
s.type :multisig
|
142
|
+
s.recipient 1, key.pub_uncompressed, data_key
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
tx = Bitcoin::Protocol::Tx.new( tx.to_payload )
|
148
|
+
|
149
|
+
MastercoinWallet.log.debug("TX Made: #{tx.to_hash}")
|
150
|
+
|
151
|
+
transaction_hash = tx.to_payload.unpack("H*").first
|
152
|
+
|
153
|
+
MastercoinWallet.log.debug("If you want to send it by Bitcoind use this")
|
154
|
+
MastercoinWallet.log.debug(transaction_hash)
|
155
|
+
|
156
|
+
remote_transaction = Transaction.new(tx.to_hash["hash"], tx.to_json)
|
157
|
+
response = remote_transaction.create!
|
158
|
+
if response.parsed_response.keys.include?("error")
|
159
|
+
Qt::MessageBox.critical(self, tr("Could not relay transaction"),
|
160
|
+
tr("The remote server could not transmit your transaction at this moment."))
|
161
|
+
return
|
162
|
+
else
|
163
|
+
Qt::MessageBox.information(self, tr("Transaction send"),
|
164
|
+
tr("Your transaction has been offered to the relay server, it should show up within 10 minutes."))
|
165
|
+
end
|
166
|
+
close()
|
167
|
+
end
|
168
|
+
|
169
|
+
def check_valid
|
170
|
+
unless Bitcoin::valid_address?(@address)
|
171
|
+
invalid!
|
172
|
+
return
|
173
|
+
end
|
174
|
+
|
175
|
+
if @amount.nil?
|
176
|
+
invalid!
|
177
|
+
return
|
178
|
+
end
|
179
|
+
|
180
|
+
if @password.nil? || (@password && @password.length < 7)
|
181
|
+
invalid!
|
182
|
+
return
|
183
|
+
end
|
184
|
+
|
185
|
+
valid!
|
186
|
+
end
|
187
|
+
|
188
|
+
def invalid!
|
189
|
+
@submit.enabled = false
|
190
|
+
end
|
191
|
+
|
192
|
+
def valid!
|
193
|
+
@submit.enabled = true
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<ui version="4.0">
|
3
|
+
<class>SimpleSend</class>
|
4
|
+
<widget class="QDialog" name="SimpleSend">
|
5
|
+
<property name="geometry">
|
6
|
+
<rect>
|
7
|
+
<x>0</x>
|
8
|
+
<y>0</y>
|
9
|
+
<width>534</width>
|
10
|
+
<height>238</height>
|
11
|
+
</rect>
|
12
|
+
</property>
|
13
|
+
<property name="windowTitle">
|
14
|
+
<string>New Simple Send</string>
|
15
|
+
</property>
|
16
|
+
<widget class="QWidget" name="verticalLayoutWidget">
|
17
|
+
<property name="geometry">
|
18
|
+
<rect>
|
19
|
+
<x>9</x>
|
20
|
+
<y>39</y>
|
21
|
+
<width>518</width>
|
22
|
+
<height>121</height>
|
23
|
+
</rect>
|
24
|
+
</property>
|
25
|
+
<layout class="QVBoxLayout" name="verticalLayout">
|
26
|
+
<item>
|
27
|
+
<layout class="QGridLayout" name="gridLayout">
|
28
|
+
<item row="1" column="1">
|
29
|
+
<widget class="QLineEdit" name="amount_input">
|
30
|
+
<property name="placeholderText">
|
31
|
+
<string/>
|
32
|
+
</property>
|
33
|
+
</widget>
|
34
|
+
</item>
|
35
|
+
<item row="0" column="0">
|
36
|
+
<widget class="QLabel" name="label_2">
|
37
|
+
<property name="text">
|
38
|
+
<string>Masteroin address</string>
|
39
|
+
</property>
|
40
|
+
</widget>
|
41
|
+
</item>
|
42
|
+
<item row="1" column="0">
|
43
|
+
<widget class="QLabel" name="label_3">
|
44
|
+
<property name="text">
|
45
|
+
<string>Amount</string>
|
46
|
+
</property>
|
47
|
+
</widget>
|
48
|
+
</item>
|
49
|
+
<item row="2" column="0">
|
50
|
+
<widget class="QLabel" name="label_4">
|
51
|
+
<property name="text">
|
52
|
+
<string>Currency</string>
|
53
|
+
</property>
|
54
|
+
</widget>
|
55
|
+
</item>
|
56
|
+
<item row="0" column="1">
|
57
|
+
<widget class="QLineEdit" name="address_input">
|
58
|
+
<property name="minimumSize">
|
59
|
+
<size>
|
60
|
+
<width>300</width>
|
61
|
+
<height>0</height>
|
62
|
+
</size>
|
63
|
+
</property>
|
64
|
+
<property name="placeholderText">
|
65
|
+
<string/>
|
66
|
+
</property>
|
67
|
+
</widget>
|
68
|
+
</item>
|
69
|
+
<item row="2" column="1">
|
70
|
+
<widget class="QComboBox" name="currency_box"/>
|
71
|
+
</item>
|
72
|
+
<item row="3" column="1">
|
73
|
+
<widget class="QLineEdit" name="password_input">
|
74
|
+
<property name="echoMode">
|
75
|
+
<enum>QLineEdit::Password</enum>
|
76
|
+
</property>
|
77
|
+
</widget>
|
78
|
+
</item>
|
79
|
+
<item row="3" column="0">
|
80
|
+
<widget class="QLabel" name="label_5">
|
81
|
+
<property name="text">
|
82
|
+
<string>Password</string>
|
83
|
+
</property>
|
84
|
+
</widget>
|
85
|
+
</item>
|
86
|
+
</layout>
|
87
|
+
</item>
|
88
|
+
</layout>
|
89
|
+
</widget>
|
90
|
+
<widget class="QLabel" name="label">
|
91
|
+
<property name="geometry">
|
92
|
+
<rect>
|
93
|
+
<x>20</x>
|
94
|
+
<y>10</y>
|
95
|
+
<width>151</width>
|
96
|
+
<height>16</height>
|
97
|
+
</rect>
|
98
|
+
</property>
|
99
|
+
<property name="text">
|
100
|
+
<string><h3>New Simple Send</h3></string>
|
101
|
+
</property>
|
102
|
+
</widget>
|
103
|
+
<widget class="QPushButton" name="submit_button">
|
104
|
+
<property name="enabled">
|
105
|
+
<bool>false</bool>
|
106
|
+
</property>
|
107
|
+
<property name="geometry">
|
108
|
+
<rect>
|
109
|
+
<x>410</x>
|
110
|
+
<y>170</y>
|
111
|
+
<width>114</width>
|
112
|
+
<height>32</height>
|
113
|
+
</rect>
|
114
|
+
</property>
|
115
|
+
<property name="text">
|
116
|
+
<string>Send</string>
|
117
|
+
</property>
|
118
|
+
<property name="autoDefault">
|
119
|
+
<bool>false</bool>
|
120
|
+
</property>
|
121
|
+
</widget>
|
122
|
+
</widget>
|
123
|
+
<resources/>
|
124
|
+
<connections/>
|
125
|
+
</ui>
|
@@ -0,0 +1,161 @@
|
|
1
|
+
=begin
|
2
|
+
** Form generated from reading ui file 'first_run_window.ui'
|
3
|
+
**
|
4
|
+
** Created: Wed Sep 25 15:48:58 2013
|
5
|
+
** by: Qt User Interface Compiler version 4.8.4
|
6
|
+
**
|
7
|
+
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
8
|
+
=end
|
9
|
+
|
10
|
+
class Ui_FirstRunWindow
|
11
|
+
attr_reader :verticalLayoutWidget
|
12
|
+
attr_reader :verticalLayout
|
13
|
+
attr_reader :label
|
14
|
+
attr_reader :horizontalSpacer
|
15
|
+
attr_reader :label_3
|
16
|
+
attr_reader :horizontalLayout_2
|
17
|
+
attr_reader :label_4
|
18
|
+
attr_reader :password_input
|
19
|
+
attr_reader :horizontalLayout_3
|
20
|
+
attr_reader :label_5
|
21
|
+
attr_reader :repeat_password_input
|
22
|
+
attr_reader :fault
|
23
|
+
attr_reader :horizontalSpacer_2
|
24
|
+
attr_reader :horizontalLayout
|
25
|
+
attr_reader :label_2
|
26
|
+
attr_reader :private_key_input
|
27
|
+
attr_reader :address
|
28
|
+
attr_reader :submit_button
|
29
|
+
|
30
|
+
def setupUi(firstRunWindow)
|
31
|
+
if firstRunWindow.objectName.nil?
|
32
|
+
firstRunWindow.objectName = "firstRunWindow"
|
33
|
+
end
|
34
|
+
firstRunWindow.resize(540, 288)
|
35
|
+
@verticalLayoutWidget = Qt::Widget.new(firstRunWindow)
|
36
|
+
@verticalLayoutWidget.objectName = "verticalLayoutWidget"
|
37
|
+
@verticalLayoutWidget.geometry = Qt::Rect.new(0, 0, 520, 258)
|
38
|
+
@verticalLayout = Qt::VBoxLayout.new(@verticalLayoutWidget)
|
39
|
+
@verticalLayout.spacing = 5
|
40
|
+
@verticalLayout.objectName = "verticalLayout"
|
41
|
+
@verticalLayout.setContentsMargins(20, 0, 0, 0)
|
42
|
+
@label = Qt::Label.new(@verticalLayoutWidget)
|
43
|
+
@label.objectName = "label"
|
44
|
+
|
45
|
+
@verticalLayout.addWidget(@label)
|
46
|
+
|
47
|
+
@horizontalSpacer = Qt::SpacerItem.new(40, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
|
48
|
+
|
49
|
+
@verticalLayout.addItem(@horizontalSpacer)
|
50
|
+
|
51
|
+
@label_3 = Qt::Label.new(@verticalLayoutWidget)
|
52
|
+
@label_3.objectName = "label_3"
|
53
|
+
@label_3.textFormat = Qt::AutoText
|
54
|
+
@label_3.scaledContents = false
|
55
|
+
@label_3.wordWrap = true
|
56
|
+
|
57
|
+
@verticalLayout.addWidget(@label_3)
|
58
|
+
|
59
|
+
@horizontalLayout_2 = Qt::HBoxLayout.new()
|
60
|
+
@horizontalLayout_2.objectName = "horizontalLayout_2"
|
61
|
+
@label_4 = Qt::Label.new(@verticalLayoutWidget)
|
62
|
+
@label_4.objectName = "label_4"
|
63
|
+
@label_4.minimumSize = Qt::Size.new(200, 0)
|
64
|
+
|
65
|
+
@horizontalLayout_2.addWidget(@label_4)
|
66
|
+
|
67
|
+
@password_input = Qt::LineEdit.new(@verticalLayoutWidget)
|
68
|
+
@password_input.objectName = "password_input"
|
69
|
+
@password_input.echoMode = Qt::LineEdit::Password
|
70
|
+
|
71
|
+
@horizontalLayout_2.addWidget(@password_input)
|
72
|
+
|
73
|
+
|
74
|
+
@verticalLayout.addLayout(@horizontalLayout_2)
|
75
|
+
|
76
|
+
@horizontalLayout_3 = Qt::HBoxLayout.new()
|
77
|
+
@horizontalLayout_3.objectName = "horizontalLayout_3"
|
78
|
+
@label_5 = Qt::Label.new(@verticalLayoutWidget)
|
79
|
+
@label_5.objectName = "label_5"
|
80
|
+
@label_5.minimumSize = Qt::Size.new(200, 0)
|
81
|
+
|
82
|
+
@horizontalLayout_3.addWidget(@label_5)
|
83
|
+
|
84
|
+
@repeat_password_input = Qt::LineEdit.new(@verticalLayoutWidget)
|
85
|
+
@repeat_password_input.objectName = "repeat_password_input"
|
86
|
+
@repeat_password_input.echoMode = Qt::LineEdit::Password
|
87
|
+
|
88
|
+
@horizontalLayout_3.addWidget(@repeat_password_input)
|
89
|
+
|
90
|
+
|
91
|
+
@verticalLayout.addLayout(@horizontalLayout_3)
|
92
|
+
|
93
|
+
@fault = Qt::Label.new(@verticalLayoutWidget)
|
94
|
+
@fault.objectName = "fault"
|
95
|
+
|
96
|
+
@verticalLayout.addWidget(@fault)
|
97
|
+
|
98
|
+
@horizontalSpacer_2 = Qt::SpacerItem.new(40, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
|
99
|
+
|
100
|
+
@verticalLayout.addItem(@horizontalSpacer_2)
|
101
|
+
|
102
|
+
@horizontalLayout = Qt::HBoxLayout.new()
|
103
|
+
@horizontalLayout.objectName = "horizontalLayout"
|
104
|
+
@label_2 = Qt::Label.new(@verticalLayoutWidget)
|
105
|
+
@label_2.objectName = "label_2"
|
106
|
+
@label_2.minimumSize = Qt::Size.new(200, 0)
|
107
|
+
|
108
|
+
@horizontalLayout.addWidget(@label_2)
|
109
|
+
|
110
|
+
@private_key_input = Qt::LineEdit.new(@verticalLayoutWidget)
|
111
|
+
@private_key_input.objectName = "private_key_input"
|
112
|
+
|
113
|
+
@horizontalLayout.addWidget(@private_key_input)
|
114
|
+
|
115
|
+
|
116
|
+
@verticalLayout.addLayout(@horizontalLayout)
|
117
|
+
|
118
|
+
@address = Qt::Label.new(@verticalLayoutWidget)
|
119
|
+
@address.objectName = "address"
|
120
|
+
|
121
|
+
@verticalLayout.addWidget(@address)
|
122
|
+
|
123
|
+
@submit_button = Qt::PushButton.new(firstRunWindow)
|
124
|
+
@submit_button.objectName = "submit_button"
|
125
|
+
@submit_button.enabled = false
|
126
|
+
@submit_button.geometry = Qt::Rect.new(410, 250, 114, 32)
|
127
|
+
|
128
|
+
retranslateUi(firstRunWindow)
|
129
|
+
|
130
|
+
Qt::MetaObject.connectSlotsByName(firstRunWindow)
|
131
|
+
end # setupUi
|
132
|
+
|
133
|
+
def setup_ui(firstRunWindow)
|
134
|
+
setupUi(firstRunWindow)
|
135
|
+
end
|
136
|
+
|
137
|
+
def retranslateUi(firstRunWindow)
|
138
|
+
firstRunWindow.windowTitle = Qt::Application.translate("firstRunWindow", "First run ", nil, Qt::Application::UnicodeUTF8)
|
139
|
+
@label.text = Qt::Application.translate("firstRunWindow", "<h3>Mastercoin setup</h3>", nil, Qt::Application::UnicodeUTF8)
|
140
|
+
@label_3.text = Qt::Application.translate("firstRunWindow", "To setup this wallet you need to enter the private key for\n" \
|
141
|
+
"your Mastercoin address. We will use this key to generate\n" \
|
142
|
+
"and broadcast valid Mastercoin transactions.", nil, Qt::Application::UnicodeUTF8)
|
143
|
+
@label_4.text = Qt::Application.translate("firstRunWindow", "Encryption password", nil, Qt::Application::UnicodeUTF8)
|
144
|
+
@label_5.text = Qt::Application.translate("firstRunWindow", "Repeat password", nil, Qt::Application::UnicodeUTF8)
|
145
|
+
@fault.text = ''
|
146
|
+
@label_2.text = Qt::Application.translate("firstRunWindow", "Mastercoin address private key", nil, Qt::Application::UnicodeUTF8)
|
147
|
+
@address.text = ''
|
148
|
+
@submit_button.text = Qt::Application.translate("firstRunWindow", "Done", nil, Qt::Application::UnicodeUTF8)
|
149
|
+
end # retranslateUi
|
150
|
+
|
151
|
+
def retranslate_ui(firstRunWindow)
|
152
|
+
retranslateUi(firstRunWindow)
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
|
157
|
+
module Ui
|
158
|
+
class FirstRunWindow < Ui_FirstRunWindow
|
159
|
+
end
|
160
|
+
end # module Ui
|
161
|
+
|
@@ -0,0 +1,123 @@
|
|
1
|
+
=begin
|
2
|
+
** Form generated from reading ui file 'simple_send_window.ui'
|
3
|
+
**
|
4
|
+
** Created: Sun Sep 29 16:35:18 2013
|
5
|
+
** by: Qt User Interface Compiler version 4.8.4
|
6
|
+
**
|
7
|
+
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
8
|
+
=end
|
9
|
+
|
10
|
+
class Ui_SimpleSend
|
11
|
+
attr_reader :verticalLayoutWidget
|
12
|
+
attr_reader :verticalLayout
|
13
|
+
attr_reader :gridLayout
|
14
|
+
attr_reader :amount_input
|
15
|
+
attr_reader :label_2
|
16
|
+
attr_reader :label_3
|
17
|
+
attr_reader :label_4
|
18
|
+
attr_reader :address_input
|
19
|
+
attr_reader :currency_box
|
20
|
+
attr_reader :password_input
|
21
|
+
attr_reader :label_5
|
22
|
+
attr_reader :label
|
23
|
+
attr_reader :submit_button
|
24
|
+
|
25
|
+
def setupUi(simpleSend)
|
26
|
+
if simpleSend.objectName.nil?
|
27
|
+
simpleSend.objectName = "simpleSend"
|
28
|
+
end
|
29
|
+
simpleSend.resize(534, 238)
|
30
|
+
@verticalLayoutWidget = Qt::Widget.new(simpleSend)
|
31
|
+
@verticalLayoutWidget.objectName = "verticalLayoutWidget"
|
32
|
+
@verticalLayoutWidget.geometry = Qt::Rect.new(9, 39, 518, 121)
|
33
|
+
@verticalLayout = Qt::VBoxLayout.new(@verticalLayoutWidget)
|
34
|
+
@verticalLayout.objectName = "verticalLayout"
|
35
|
+
@verticalLayout.setContentsMargins(0, 0, 0, 0)
|
36
|
+
@gridLayout = Qt::GridLayout.new()
|
37
|
+
@gridLayout.objectName = "gridLayout"
|
38
|
+
@amount_input = Qt::LineEdit.new(@verticalLayoutWidget)
|
39
|
+
@amount_input.objectName = "amount_input"
|
40
|
+
|
41
|
+
@gridLayout.addWidget(@amount_input, 1, 1, 1, 1)
|
42
|
+
|
43
|
+
@label_2 = Qt::Label.new(@verticalLayoutWidget)
|
44
|
+
@label_2.objectName = "label_2"
|
45
|
+
|
46
|
+
@gridLayout.addWidget(@label_2, 0, 0, 1, 1)
|
47
|
+
|
48
|
+
@label_3 = Qt::Label.new(@verticalLayoutWidget)
|
49
|
+
@label_3.objectName = "label_3"
|
50
|
+
|
51
|
+
@gridLayout.addWidget(@label_3, 1, 0, 1, 1)
|
52
|
+
|
53
|
+
@label_4 = Qt::Label.new(@verticalLayoutWidget)
|
54
|
+
@label_4.objectName = "label_4"
|
55
|
+
|
56
|
+
@gridLayout.addWidget(@label_4, 2, 0, 1, 1)
|
57
|
+
|
58
|
+
@address_input = Qt::LineEdit.new(@verticalLayoutWidget)
|
59
|
+
@address_input.objectName = "address_input"
|
60
|
+
@address_input.minimumSize = Qt::Size.new(300, 0)
|
61
|
+
|
62
|
+
@gridLayout.addWidget(@address_input, 0, 1, 1, 1)
|
63
|
+
|
64
|
+
@currency_box = Qt::ComboBox.new(@verticalLayoutWidget)
|
65
|
+
@currency_box.objectName = "currency_box"
|
66
|
+
|
67
|
+
@gridLayout.addWidget(@currency_box, 2, 1, 1, 1)
|
68
|
+
|
69
|
+
@password_input = Qt::LineEdit.new(@verticalLayoutWidget)
|
70
|
+
@password_input.objectName = "password_input"
|
71
|
+
@password_input.echoMode = Qt::LineEdit::Password
|
72
|
+
|
73
|
+
@gridLayout.addWidget(@password_input, 3, 1, 1, 1)
|
74
|
+
|
75
|
+
@label_5 = Qt::Label.new(@verticalLayoutWidget)
|
76
|
+
@label_5.objectName = "label_5"
|
77
|
+
|
78
|
+
@gridLayout.addWidget(@label_5, 3, 0, 1, 1)
|
79
|
+
|
80
|
+
|
81
|
+
@verticalLayout.addLayout(@gridLayout)
|
82
|
+
|
83
|
+
@label = Qt::Label.new(simpleSend)
|
84
|
+
@label.objectName = "label"
|
85
|
+
@label.geometry = Qt::Rect.new(20, 10, 151, 16)
|
86
|
+
@submit_button = Qt::PushButton.new(simpleSend)
|
87
|
+
@submit_button.objectName = "submit_button"
|
88
|
+
@submit_button.enabled = false
|
89
|
+
@submit_button.geometry = Qt::Rect.new(410, 170, 114, 32)
|
90
|
+
@submit_button.autoDefault = false
|
91
|
+
|
92
|
+
retranslateUi(simpleSend)
|
93
|
+
|
94
|
+
Qt::MetaObject.connectSlotsByName(simpleSend)
|
95
|
+
end # setupUi
|
96
|
+
|
97
|
+
def setup_ui(simpleSend)
|
98
|
+
setupUi(simpleSend)
|
99
|
+
end
|
100
|
+
|
101
|
+
def retranslateUi(simpleSend)
|
102
|
+
simpleSend.windowTitle = Qt::Application.translate("SimpleSend", "New Simple Send", nil, Qt::Application::UnicodeUTF8)
|
103
|
+
@amount_input.placeholderText = ''
|
104
|
+
@label_2.text = Qt::Application.translate("SimpleSend", "Masteroin address", nil, Qt::Application::UnicodeUTF8)
|
105
|
+
@label_3.text = Qt::Application.translate("SimpleSend", "Amount", nil, Qt::Application::UnicodeUTF8)
|
106
|
+
@label_4.text = Qt::Application.translate("SimpleSend", "Currency", nil, Qt::Application::UnicodeUTF8)
|
107
|
+
@address_input.placeholderText = ''
|
108
|
+
@label_5.text = Qt::Application.translate("SimpleSend", "Password", nil, Qt::Application::UnicodeUTF8)
|
109
|
+
@label.text = Qt::Application.translate("SimpleSend", "<h3>New Simple Send</h3>", nil, Qt::Application::UnicodeUTF8)
|
110
|
+
@submit_button.text = Qt::Application.translate("SimpleSend", "Send", nil, Qt::Application::UnicodeUTF8)
|
111
|
+
end # retranslateUi
|
112
|
+
|
113
|
+
def retranslate_ui(simpleSend)
|
114
|
+
retranslateUi(simpleSend)
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
module Ui
|
120
|
+
class SimpleSend < Ui_SimpleSend
|
121
|
+
end
|
122
|
+
end # module Ui
|
123
|
+
|