Browse Source

Fix for settings/connection info

pull/112/head
fekt 2 years ago
parent
commit
dc5f3c3a11
  1. 7
      src/connection.cpp
  2. 8
      src/mainwindow.cpp
  3. 2
      src/rescandialog.ui
  4. 2
      src/settings.ui

7
src/connection.cpp

@ -726,6 +726,13 @@ std::shared_ptr<ConnectionConfig> ConnectionLoader::autoDetectHushConf() {
if (hushconf->port.isEmpty()) hushconf->port = "18031";
file.close();
// Save to Qsettings
Settings::getInstance()->saveSettings(
hushconf->host,
hushconf->port,
hushconf->rpcuser,
hushconf->rpcpassword);
// In addition to the HUSH3/HUSH3.conf file, also double check the params.
return std::shared_ptr<ConnectionConfig>(hushconf);

8
src/mainwindow.cpp

@ -520,10 +520,10 @@ void MainWindow::setupSettingsModal() {
auto hushConfLocation = Settings::getInstance()->getHushdConfLocation();
if (!hushConfLocation.isEmpty()) {
settings.confMsg->setText("Settings are being read from \n" + hushConfLocation);
settings.hostname->setEnabled(false);
settings.port->setEnabled(false);
settings.rpcuser->setEnabled(false);
settings.rpcpassword->setEnabled(false);
settings.hostname->setReadOnly(true);
settings.port->setReadOnly(true);
settings.rpcuser->setReadOnly(true);
settings.rpcpassword->setReadOnly(true);
} else {
settings.confMsg->setText("No local HUSH3.conf found. Please configure connection manually.");
settings.hostname->setEnabled(true);

2
src/rescandialog.ui

@ -44,7 +44,7 @@
<item row="2" column="0" colspan="3">
<widget class="QLineEdit" name="rescanBlockheight"/>
</item>
<item row="0" column="0">
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label">
<property name="text">
<string>Enter block height to rescan from:</string>

2
src/settings.ui

@ -26,7 +26,7 @@
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">

Loading…
Cancel
Save