Skip to content

Commit 4075e18

Browse files
Rock-N-TrollRock-N-Troll
Rock-N-Troll
authored and
Rock-N-Troll
committed
if nautomintdenom is set, do not allow UI update of nPreferredDenom
1 parent 9cf9e29 commit 4075e18

File tree

2 files changed

+46
-12
lines changed

2 files changed

+46
-12
lines changed

src/qt/veil/forms/settingsminting.ui

+25-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,31 @@ font-size:14px;</string>
293293
</property>
294294
<property name="text">
295295
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Every 5 minutes the wallet will try to
296-
&lt;br&gt;mint new zerocoins of the seleted denom&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
296+
&lt;br&gt;mint new zerocoins of the selected denom&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
297+
</property>
298+
<property name="alignment">
299+
<set>Qt::AlignCenter</set>
300+
</property>
301+
<property name="wordWrap">
302+
<bool>false</bool>
303+
</property>
304+
</widget>
305+
</item>
306+
<item>
307+
<widget class="QLabel" name="labelAutomintConfig">
308+
<property name="minimumSize">
309+
<size>
310+
<width>100</width>
311+
<height>0</height>
312+
</size>
313+
</property>
314+
<property name="styleSheet">
315+
<string notr="true">color:#ff7575;
316+
font-size:14px;font-weight:bold;</string>
317+
</property>
318+
<property name="text">
319+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Automint control setting has been given to
320+
&lt;br&gt;your Veil configuration file&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
297321
</property>
298322
<property name="alignment">
299323
<set>Qt::AlignCenter</set>

src/qt/veil/settings/settingsminting.cpp

+21-11
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,24 @@ SettingsMinting::SettingsMinting(QWidget *parent, WalletView *mainWindow, Wallet
8181
connect(ui->btnEsc,SIGNAL(clicked()),this, SLOT(close()));
8282
connect(ui->btnSendMint,SIGNAL(clicked()),this, SLOT(btnMint()));
8383
connect(ui->editAmount, SIGNAL(returnPressed()), this, SLOT(btnMint()));
84-
connect(ui->radioButton10, SIGNAL(toggled(bool)), this, SLOT(onCheck10Clicked(bool)));
85-
connect(ui->radioButton100, SIGNAL(toggled(bool)), this, SLOT(onCheck100Clicked(bool)));
86-
connect(ui->radioButton1000, SIGNAL(toggled(bool)), this, SLOT(onCheck1000Clicked(bool)));
87-
connect(ui->radioButton100000, SIGNAL(toggled(bool)), this, SLOT(onCheck100000Clicked(bool)));
84+
if(gArgs.IsArgSet("-nautomintdenom")){
85+
ui->labelAutomintConfig->setVisible(true);
86+
ui->radioButton10->setEnabled(0);
87+
ui->radioButton100->setEnabled(0);
88+
ui->radioButton1000->setEnabled(0);
89+
ui->radioButton100000->setEnabled(0);
90+
ui->checkAutomintInstant->setEnabled(0);
91+
}
92+
else{
93+
ui->labelAutomintConfig->setVisible(false);
94+
connect(ui->radioButton10, SIGNAL(toggled(bool)), this, SLOT(onCheck10Clicked(bool)));
95+
connect(ui->radioButton100, SIGNAL(toggled(bool)), this, SLOT(onCheck100Clicked(bool)));
96+
connect(ui->radioButton1000, SIGNAL(toggled(bool)), this, SLOT(onCheck1000Clicked(bool)));
97+
connect(ui->radioButton100000, SIGNAL(toggled(bool)), this, SLOT(onCheck100000Clicked(bool)));
98+
connect(ui->checkAutomintInstant, SIGNAL(toggled(bool)), this, SLOT(onCheckFullMintClicked(bool)));
99+
}
88100
connect(ui->editAmount, SIGNAL(textChanged(const QString &)), this, SLOT(mintAmountChange(const QString &)));
89101

90-
connect(ui->checkAutomintInstant, SIGNAL(toggled(bool)), this, SLOT(onCheckFullMintClicked(bool)));
91-
92102
}
93103

94104
/**
@@ -177,35 +187,35 @@ void SettingsMinting::mintzerocoins()
177187
}
178188

179189
void SettingsMinting::onCheck10Clicked(bool res) {
180-
if(res && nPreferredDenom != 10){
190+
if(res && !gArgs.IsArgSet("-nautomintdenom") && nPreferredDenom != 10){
181191
nPreferredDenom = 10;
182192
saveSettings(nPreferredDenom);
183193
}
184194
}
185195

186196
void SettingsMinting::onCheck100Clicked(bool res){
187-
if(res && nPreferredDenom != 100){
197+
if(res && !gArgs.IsArgSet("-nautomintdenom") && nPreferredDenom != 100){
188198
nPreferredDenom = 100;
189199
saveSettings(nPreferredDenom);
190200
}
191201
}
192202

193203
void SettingsMinting::onCheck1000Clicked(bool res){
194-
if(res && nPreferredDenom != 1000){
204+
if(res && !gArgs.IsArgSet("-nautomintdenom") && nPreferredDenom != 1000){
195205
nPreferredDenom = 1000;
196206
saveSettings(nPreferredDenom);
197207
}
198208
}
199209

200210
void SettingsMinting::onCheck100000Clicked(bool res){
201-
if(res && nPreferredDenom != 10000){
211+
if(res && !gArgs.IsArgSet("-nautomintdenom") && nPreferredDenom != 10000){
202212
nPreferredDenom = 10000;
203213
saveSettings(nPreferredDenom);
204214
}
205215
}
206216

207217
void SettingsMinting::onCheckFullMintClicked(bool res){
208-
if(res && nPreferredDenom != -1){
218+
if(res && !gArgs.IsArgSet("-nautomintdenom") && nPreferredDenom != -1){
209219
nPreferredDenom = -1;
210220
saveSettings(nPreferredDenom);
211221
}

0 commit comments

Comments
 (0)