Skip to content

Commit 313772e

Browse files
Rock-N-TrollRock-N-Troll
Rock-N-Troll
authored and
Rock-N-Troll
committed
if nautomintdenom is set, prioritize its use
if nautomintdenom is set, do not allow UI update of nPreferredDenom settings minting screen GUI checkbox save fix
1 parent e55a309 commit 313772e

File tree

4 files changed

+61
-14
lines changed

4 files changed

+61
-14
lines changed

src/init.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1757,9 +1757,10 @@ bool AppInitMain()
17571757

17581758

17591759
// Automint denom
1760-
if(nPreferredDenom == DEFAULT_AUTOMINT_DENOM) {
1760+
if(gArgs.IsArgSet("-nautomintdenom")){
17611761
nPreferredDenom = gArgs.GetArg("-nautomintdenom", DEFAULT_AUTOMINT_DENOM);
17621762
if(nPreferredDenom != 10 && nPreferredDenom != 100 && nPreferredDenom != 1000 && nPreferredDenom != 10000){
1763+
LogPrintf("Invalid -nautomintdenom value set: %d. Defaulting to : %d\n", nPreferredDenom, DEFAULT_AUTOMINT_DENOM);
17631764
nPreferredDenom = DEFAULT_AUTOMINT_DENOM;
17641765
}
17651766
}

src/qt/veil.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -649,12 +649,15 @@ int main(int argc, char *argv[])
649649
return EXIT_FAILURE;
650650
}
651651

652-
// Preferences check
653-
// If the UI settings have a different value than the server args then use the UI settings.
654-
QSettings* settings = getSettings();
655-
int tempPref = settings->value("nAutomintDenom").toInt();
656-
if(tempPref != nPreferredDenom && tempPref != 0){
657-
nPreferredDenom = tempPref;
652+
// Automint denom
653+
// If nautomintdenom is set, use it
654+
// Else use saved UI settings
655+
if(!gArgs.IsArgSet("-nautomintdenom")){
656+
QSettings* settings = getSettings();
657+
int tempPref = settings->value("nAutomintDenom").toInt();
658+
if(tempPref != nPreferredDenom && tempPref != 0){
659+
nPreferredDenom = tempPref;
660+
}
658661
}
659662

660663
// Now that the QApplication is setup and we have parsed our parameters, we can set the platform style

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

+25-6
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ SettingsMinting::SettingsMinting(QWidget *parent, WalletView *mainWindow, Wallet
5353
ui->btnSendMint->setEnabled(true);
5454
}
5555

56+
//retrieved saved settings if nautomintdenom is not in use
57+
QSettings* settings = getSettings();
58+
if (!gArgs.IsArgSet("-nautomintdenom") && settings->contains("nAutomintDenom")){
59+
int tempPref = settings->value("nAutomintDenom").toInt();
60+
if(tempPref != nPreferredDenom && tempPref != 0){
61+
nPreferredDenom = tempPref;
62+
}
63+
}
64+
5665
switch (nPreferredDenom){
5766
case 10:
5867
ui->radioButton10->setChecked(true);
@@ -81,14 +90,24 @@ SettingsMinting::SettingsMinting(QWidget *parent, WalletView *mainWindow, Wallet
8190
connect(ui->btnEsc,SIGNAL(clicked()),this, SLOT(close()));
8291
connect(ui->btnSendMint,SIGNAL(clicked()),this, SLOT(btnMint()));
8392
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)));
93+
if(gArgs.IsArgSet("-nautomintdenom")){
94+
ui->labelAutomintConfig->setVisible(true);
95+
ui->radioButton10->setEnabled(0);
96+
ui->radioButton100->setEnabled(0);
97+
ui->radioButton1000->setEnabled(0);
98+
ui->radioButton100000->setEnabled(0);
99+
ui->checkAutomintInstant->setEnabled(0);
100+
}
101+
else{
102+
ui->labelAutomintConfig->setVisible(false);
103+
connect(ui->radioButton10, SIGNAL(toggled(bool)), this, SLOT(onCheck10Clicked(bool)));
104+
connect(ui->radioButton100, SIGNAL(toggled(bool)), this, SLOT(onCheck100Clicked(bool)));
105+
connect(ui->radioButton1000, SIGNAL(toggled(bool)), this, SLOT(onCheck1000Clicked(bool)));
106+
connect(ui->radioButton100000, SIGNAL(toggled(bool)), this, SLOT(onCheck100000Clicked(bool)));
107+
connect(ui->checkAutomintInstant, SIGNAL(toggled(bool)), this, SLOT(onCheckFullMintClicked(bool)));
108+
}
88109
connect(ui->editAmount, SIGNAL(textChanged(const QString &)), this, SLOT(mintAmountChange(const QString &)));
89110

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

94113
/**

0 commit comments

Comments
 (0)