Notify the user of any errors
This commit is contained in:
@ -140,7 +140,10 @@ void OneSixModEditDialog::on_customEditorBtn_clicked()
|
||||
{
|
||||
if (m_inst->versionIsCustom())
|
||||
{
|
||||
MMC->openJsonEditor(m_inst->instanceRoot() + "/custom.json");
|
||||
if (!MMC->openJsonEditor(m_inst->instanceRoot() + "/custom.json"))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"), tr("Unable to open custom.json, check the settings"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,12 +142,21 @@ void SettingsDialog::on_jsonEditorBrowseBtn_clicked()
|
||||
: ui->jsonEditorTextBox->text());
|
||||
QString cooked_file = NormalizePath(raw_file);
|
||||
|
||||
if (cooked_file.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// it has to exist and be an executable
|
||||
if (!cooked_file.isEmpty() && QFileInfo(cooked_file).exists() &&
|
||||
if (QFileInfo(cooked_file).exists() &&
|
||||
QFileInfo(cooked_file).isExecutable())
|
||||
{
|
||||
ui->jsonEditorTextBox->setText(cooked_file);
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::warning(this, tr("Invalid"), tr("The file choosen does not seem to be an executable"));
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::on_maximizedCheckBox_clicked(bool checked)
|
||||
|
Reference in New Issue
Block a user