diff options
author | Loetkolben <sirloetkolben@gmail.com> | 2014-07-27 15:50:03 +0200 |
---|---|---|
committer | Jan Dalheimer <jan@dalheimer.de> | 2014-07-30 21:40:18 +0200 |
commit | c0254d9a75a1f0f784a3e9b6874475b2c2a3ab8f (patch) | |
tree | 113e3561122c70b51e97b530c8055bdf91533cb8 /gui/pages/global/MultiMCPage.cpp | |
parent | e5b393318fb2a143c9520928dd45c697af68f498 (diff) | |
download | MultiMC-c0254d9a75a1f0f784a3e9b6874475b2c2a3ab8f.tar MultiMC-c0254d9a75a1f0f784a3e9b6874475b2c2a3ab8f.tar.gz MultiMC-c0254d9a75a1f0f784a3e9b6874475b2c2a3ab8f.tar.lz MultiMC-c0254d9a75a1f0f784a3e9b6874475b2c2a3ab8f.tar.xz MultiMC-c0254d9a75a1f0f784a3e9b6874475b2c2a3ab8f.zip |
Show a warning if the instance path contains a '!'
The checks and warnings happen the time MMC loads (via QLOG_INFO), the time the GUI starts (via a dialog) and when the user changes the instance path via the settings window.
Diffstat (limited to 'gui/pages/global/MultiMCPage.cpp')
-rw-r--r-- | gui/pages/global/MultiMCPage.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/gui/pages/global/MultiMCPage.cpp b/gui/pages/global/MultiMCPage.cpp index 2d6eb7d5..73a5ff20 100644 --- a/gui/pages/global/MultiMCPage.cpp +++ b/gui/pages/global/MultiMCPage.cpp @@ -112,16 +112,37 @@ void MultiMCPage::on_ftbBrowseBtn_clicked() void MultiMCPage::on_instDirBrowseBtn_clicked() { - QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Instance Directory"), - ui->instDirTextBox->text()); - QString cooked_dir = NormalizePath(raw_dir); + QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Instance Directory"), + ui->instDirTextBox->text()); + QString cooked_dir = NormalizePath(raw_dir); // do not allow current dir - it's dirty. Do not allow dirs that don't exist if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) { - ui->instDirTextBox->setText(cooked_dir); + if (checkProblemticPathJava(QDir(cooked_dir))) + { + QMessageBox warning; + warning.setText(tr("You're trying to specify an instance folder which\'s path " + "contains at least one \'!\'. " + "Java is known to cause problems if that is the case, your " + "instances (probably) won't start!")); + warning.setInformativeText( + tr("Do you really want to use this path? " + "Selecting \"No\" will close this and not alter your instance path.")); + warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No); + int result = warning.exec(); + if (result == QMessageBox::Yes) + { + ui->instDirTextBox->setText(cooked_dir); + } + } + else + { + ui->instDirTextBox->setText(cooked_dir); + } } } + void MultiMCPage::on_iconsDirBrowseBtn_clicked() { QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Icons Directory"), |