summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2013-12-30 14:45:59 +0100
committerJan Dalheimer <jan@dalheimer.de>2013-12-30 14:45:59 +0100
commit5d0868a056e3de295deaa94717b4023d07772c54 (patch)
treec546862b4f0c2aa16c68c9c1d4d1d99932712b4f /gui
parentc01678a3fa328e2f7b8f33bfe54733820802f7b7 (diff)
downloadMultiMC-5d0868a056e3de295deaa94717b4023d07772c54.tar
MultiMC-5d0868a056e3de295deaa94717b4023d07772c54.tar.gz
MultiMC-5d0868a056e3de295deaa94717b4023d07772c54.tar.lz
MultiMC-5d0868a056e3de295deaa94717b4023d07772c54.tar.xz
MultiMC-5d0868a056e3de295deaa94717b4023d07772c54.zip
Notify the user of any errors
Diffstat (limited to 'gui')
-rw-r--r--gui/dialogs/OneSixModEditDialog.cpp5
-rw-r--r--gui/dialogs/SettingsDialog.cpp11
2 files changed, 14 insertions, 2 deletions
diff --git a/gui/dialogs/OneSixModEditDialog.cpp b/gui/dialogs/OneSixModEditDialog.cpp
index e575c868..3982f17d 100644
--- a/gui/dialogs/OneSixModEditDialog.cpp
+++ b/gui/dialogs/OneSixModEditDialog.cpp
@@ -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"));
+ }
}
}
diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp
index 2797fe4e..0d97a5a5 100644
--- a/gui/dialogs/SettingsDialog.cpp
+++ b/gui/dialogs/SettingsDialog.cpp
@@ -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)