Changeset View
Changeset View
Standalone View
Standalone View
src/qt/intro.cpp
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | try { | ||||
/* Parent directory does not exist or is not accessible */ | /* Parent directory does not exist or is not accessible */ | ||||
replyStatus = ST_ERROR; | replyStatus = ST_ERROR; | ||||
replyMessage = tr("Cannot create data directory here."); | replyMessage = tr("Cannot create data directory here."); | ||||
} | } | ||||
Q_EMIT reply(replyStatus, replyMessage, freeBytesAvailable); | Q_EMIT reply(replyStatus, replyMessage, freeBytesAvailable); | ||||
} | } | ||||
Intro::Intro(QWidget *parent) | Intro::Intro(QWidget *parent) | ||||
: QDialog(parent), ui(new Ui::Intro), thread(0), signalled(false) { | : QDialog(parent), ui(new Ui::Intro), thread(nullptr), signalled(false) { | ||||
ui->setupUi(this); | ui->setupUi(this); | ||||
ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(tr(PACKAGE_NAME))); | ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(tr(PACKAGE_NAME))); | ||||
ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME))); | ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME))); | ||||
ui->lblExplanation1->setText(ui->lblExplanation1->text() | ui->lblExplanation1->setText(ui->lblExplanation1->text() | ||||
.arg(tr(PACKAGE_NAME)) | .arg(tr(PACKAGE_NAME)) | ||||
.arg(BLOCK_CHAIN_SIZE) | .arg(BLOCK_CHAIN_SIZE) | ||||
.arg(2009) | .arg(2009) | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | if (!fs::exists(GUIUtil::qstringToBoostPath(dataDir)) || | ||||
GUIUtil::qstringToBoostPath(dataDir))) { | GUIUtil::qstringToBoostPath(dataDir))) { | ||||
// If a new data directory has been created, make wallets | // If a new data directory has been created, make wallets | ||||
// subdirectory too | // subdirectory too | ||||
TryCreateDirectories(GUIUtil::qstringToBoostPath(dataDir) / | TryCreateDirectories(GUIUtil::qstringToBoostPath(dataDir) / | ||||
"wallets"); | "wallets"); | ||||
} | } | ||||
break; | break; | ||||
} catch (const fs::filesystem_error &) { | } catch (const fs::filesystem_error &) { | ||||
QMessageBox::critical(0, tr(PACKAGE_NAME), | QMessageBox::critical(nullptr, tr(PACKAGE_NAME), | ||||
tr("Error: Specified data directory " | tr("Error: Specified data directory " | ||||
"\"%1\" cannot be created.") | "\"%1\" cannot be created.") | ||||
.arg(dataDir)); | .arg(dataDir)); | ||||
/* fall through, back to choosing screen */ | /* fall through, back to choosing screen */ | ||||
} | } | ||||
} | } | ||||
settings.setValue("strDataDir", dataDir); | settings.setValue("strDataDir", dataDir); | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
void Intro::on_dataDirectory_textChanged(const QString &dataDirStr) { | void Intro::on_dataDirectory_textChanged(const QString &dataDirStr) { | ||||
/* Disable OK button until check result comes in */ | /* Disable OK button until check result comes in */ | ||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); | ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); | ||||
checkPath(dataDirStr); | checkPath(dataDirStr); | ||||
} | } | ||||
void Intro::on_ellipsisButton_clicked() { | void Intro::on_ellipsisButton_clicked() { | ||||
QString dir = QDir::toNativeSeparators(QFileDialog::getExistingDirectory( | QString dir = QDir::toNativeSeparators(QFileDialog::getExistingDirectory( | ||||
0, "Choose data directory", ui->dataDirectory->text())); | nullptr, "Choose data directory", ui->dataDirectory->text())); | ||||
if (!dir.isEmpty()) { | if (!dir.isEmpty()) { | ||||
ui->dataDirectory->setText(dir); | ui->dataDirectory->setText(dir); | ||||
} | } | ||||
} | } | ||||
void Intro::on_dataDirDefault_clicked() { | void Intro::on_dataDirDefault_clicked() { | ||||
setDataDirectory(getDefaultDataDirectory()); | setDataDirectory(getDefaultDataDirectory()); | ||||
} | } | ||||
Show All 38 Lines |