@ -350,6 +350,40 @@ void MainWindow::setupSettingsModal() {
settings . lblTor - > setToolTip ( tooltip ) ;
}
//Use Consolidation
bool isUsingConsolidation = false ;
if ( rpc - > getConnection ( ) ! = nullptr ) {
isUsingConsolidation = ! rpc - > getConnection ( ) - > config - > consolidation . isEmpty ( ) = = true ;
}
settings . chkConso - > setChecked ( isUsingConsolidation ) ;
if ( rpc - > getEZcashD ( ) = = nullptr ) {
settings . chkConso - > setEnabled ( false ) ;
}
//Use Deletetx
bool isUsingDeletetx = false ;
if ( rpc - > getConnection ( ) ! = nullptr ) {
isUsingDeletetx = ! rpc - > getConnection ( ) - > config - > deletetx . isEmpty ( ) = = true ;
}
settings . chkDeletetx - > setChecked ( isUsingDeletetx ) ;
if ( rpc - > getEZcashD ( ) = = nullptr ) {
settings . chkDeletetx - > setEnabled ( false ) ;
}
//Use Zindex
bool isUsingZindex = false ;
if ( rpc - > getConnection ( ) ! = nullptr ) {
isUsingZindex = ! rpc - > getConnection ( ) - > config - > zindex . isEmpty ( ) = = true ;
}
settings . chkzindex - > setChecked ( isUsingZindex ) ;
if ( rpc - > getEZcashD ( ) = = nullptr ) {
settings . chkzindex - > setEnabled ( false ) ;
}
// Connection Settings
QIntValidator validator ( 0 , 65535 ) ;
settings . port - > setValidator ( & validator ) ;
@ -361,16 +395,15 @@ void MainWindow::setupSettingsModal() {
settings . hostname - > setEnabled ( false ) ;
settings . port - > setEnabled ( false ) ;
settings . rpcuser - > setEnabled ( false ) ;
settings . rpcpassword - > setEnabled ( false ) ;
settings . rpcpassword - > setEnabled ( false ) ;
} else {
settings . confMsg - > setText ( " No local HUSH3.conf found. Please configure connection manually. " ) ;
settings . hostname - > setEnabled ( true ) ;
settings . port - > setEnabled ( true ) ;
settings . rpcuser - > setEnabled ( true ) ;
settings . rpcpassword - > setEnabled ( true ) ;
settings . rpcpassword - > setEnabled ( true ) ;
}
// Load current values into the dialog
// Load current values into the dialog
auto conf = Settings : : getInstance ( ) - > getSettings ( ) ;
settings . hostname - > setText ( conf . host ) ;
@ -466,8 +499,52 @@ void MainWindow::setupSettingsModal() {
showRestartInfo = true ;
}
if ( ! rpc - > getConnection ( ) - > config - > consolidation . isEmpty ( ) = = false ) {
if ( settings . chkConso - > isChecked ( ) ) {
Settings : : addToZcashConf ( zcashConfLocation , " consolidation=1 " ) ;
showRestartInfo = true ;
}
}
if ( ! rpc - > getConnection ( ) - > config - > consolidation . isEmpty ( ) ) {
if ( settings . chkConso - > isChecked ( ) = = false ) {
Settings : : removeFromZcashConf ( zcashConfLocation , " consolidation " ) ;
showRestartInfo = true ;
}
}
if ( ! rpc - > getConnection ( ) - > config - > deletetx . isEmpty ( ) = = false ) {
if ( settings . chkDeletetx - > isChecked ( ) ) {
Settings : : addToZcashConf ( zcashConfLocation , " deletetx=1 " ) ;
showRestartInfo = true ;
}
}
if ( ! rpc - > getConnection ( ) - > config - > deletetx . isEmpty ( ) ) {
if ( settings . chkDeletetx - > isChecked ( ) = = false ) {
Settings : : removeFromZcashConf ( zcashConfLocation , " deletetx " ) ;
showRestartInfo = true ;
}
}
if ( ! rpc - > getConnection ( ) - > config - > zindex . isEmpty ( ) = = false ) {
if ( settings . chkzindex - > isChecked ( ) ) {
Settings : : addToZcashConf ( zcashConfLocation , " zindex=1 " ) ;
Settings : : addToZcashConf ( zcashConfLocation , " reindex=1 " ) ;
showRestartInfo = true ;
}
}
if ( ! rpc - > getConnection ( ) - > config - > zindex . isEmpty ( ) ) {
if ( settings . chkzindex - > isChecked ( ) = = false ) {
Settings : : removeFromZcashConf ( zcashConfLocation , " zindex " ) ;
Settings : : addToZcashConf ( zcashConfLocation , " reindex=1 " ) ;
showRestartInfo = true ;
}
}
if ( showRestartInfo ) {
auto desc = tr ( " SilentDragon needs to restart to rescan/reindex. SilentDragon will now close, please restart SilentDragon to continue " ) ;
auto desc = tr ( " SilentDragon needs to restart to rescan,reindex,consolidation or deletet x. SilentDragon will now close, please restart SilentDragon to continue " ) ;
QMessageBox : : information ( this , tr ( " Restart SilentDragon " ) , desc , QMessageBox : : Ok ) ;
QTimer : : singleShot ( 1 , [ = ] ( ) { this - > close ( ) ; } ) ;