| 26 | #include <QTimer> |
| 27 | |
| 28 | OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) : |
| 29 | QDialog(parent), |
| 30 | ui(new Ui::OptionsDialog), |
| 31 | model(0), |
| 32 | mapper(0) |
| 33 | { |
| 34 | ui->setupUi(this); |
| 35 | |
| 36 | /* Main elements init */ |
| 37 | ui->databaseCache->setMinimum(nMinDbCache); |
| 38 | ui->databaseCache->setMaximum(nMaxDbCache); |
| 39 | static const uint64_t GiB = 1024 * 1024 * 1024; |
| 40 | static const uint64_t nMinDiskSpace = MIN_DISK_SPACE_FOR_BLOCK_FILES / GiB + |
| 41 | (MIN_DISK_SPACE_FOR_BLOCK_FILES % GiB) ? 1 : 0; |
| 42 | ui->pruneSize->setMinimum(nMinDiskSpace); |
| 43 | ui->threadsScriptVerif->setMinimum(-GetNumCores()); |
| 44 | ui->threadsScriptVerif->setMaximum(MAX_SCRIPTCHECK_THREADS); |
| 45 | ui->pruneWarning->setVisible(false); |
| 46 | ui->pruneWarning->setStyleSheet("QLabel { color: red; }"); |
| 47 | |
| 48 | ui->pruneSize->setEnabled(false); |
| 49 | connect(ui->prune, SIGNAL(toggled(bool)), ui->pruneSize, SLOT(setEnabled(bool))); |
| 50 | |
| 51 | /* Network elements init */ |
| 52 | #ifndef USE_UPNP |
| 53 | ui->mapPortUpnp->setEnabled(false); |
| 54 | #endif |
| 55 | |
| 56 | ui->proxyIp->setEnabled(false); |
| 57 | ui->proxyPort->setEnabled(false); |
| 58 | ui->proxyPort->setValidator(new QIntValidator(1, 65535, this)); |
| 59 | |
| 60 | ui->proxyIpTor->setEnabled(false); |
| 61 | ui->proxyPortTor->setEnabled(false); |
| 62 | ui->proxyPortTor->setValidator(new QIntValidator(1, 65535, this)); |
| 63 | |
| 64 | connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyIp, SLOT(setEnabled(bool))); |
| 65 | connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyPort, SLOT(setEnabled(bool))); |
| 66 | connect(ui->connectSocks, SIGNAL(toggled(bool)), this, SLOT(updateProxyValidationState())); |
| 67 | |
| 68 | connect(ui->connectSocksTor, SIGNAL(toggled(bool)), ui->proxyIpTor, SLOT(setEnabled(bool))); |
| 69 | connect(ui->connectSocksTor, SIGNAL(toggled(bool)), ui->proxyPortTor, SLOT(setEnabled(bool))); |
| 70 | connect(ui->connectSocksTor, SIGNAL(toggled(bool)), this, SLOT(updateProxyValidationState())); |
| 71 | |
| 72 | /* Window elements init */ |
| 73 | #ifdef Q_OS_MAC |
| 74 | /* remove Window tab on Mac */ |
| 75 | ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWindow)); |
| 76 | #endif |
| 77 | |
| 78 | /* remove Wallet tab in case of -disablewallet */ |
| 79 | if (!enableWallet) { |
| 80 | ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWallet)); |
| 81 | } |
| 82 | |
| 83 | /* Display elements init */ |
| 84 | QDir translations(":translations"); |
| 85 |
nothing calls this directly
no test coverage detected