Merge pull request #539 from GriffinRichards/recent-fail
Stop misleading error when recent project doesn't exist
This commit is contained in:
commit
0148580bd2
2 changed files with 11 additions and 4 deletions
|
@ -13,6 +13,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
|
||||||
### Changed
|
### Changed
|
||||||
- The Palette Editor now remembers the Bit Depth setting.
|
- The Palette Editor now remembers the Bit Depth setting.
|
||||||
- The min/max levels on the Wild Pokémon tab will now adjust automatically if they invalidate each other.
|
- The min/max levels on the Wild Pokémon tab will now adjust automatically if they invalidate each other.
|
||||||
|
- If the recent project directory doesn't exist Porymap will open an empty project instead of failing with a misleading error message.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fix text boxes in the Palette Editor calculating color incorrectly.
|
- Fix text boxes in the Palette Editor calculating color incorrectly.
|
||||||
|
|
|
@ -484,12 +484,18 @@ bool MainWindow::openRecentProject() {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QString default_dir = porymapConfig.getRecentProject();
|
QString default_dir = porymapConfig.getRecentProject();
|
||||||
if (!default_dir.isNull() && default_dir.length() > 0) {
|
if (default_dir.isNull() || default_dir.length() <= 0)
|
||||||
logInfo(QString("Opening recent project: '%1'").arg(default_dir));
|
return false;
|
||||||
return openProject(default_dir);
|
|
||||||
|
if (!QDir(default_dir).exists()) {
|
||||||
|
QString message = QString("Recent project directory '%1' doesn't exist.").arg(QDir::toNativeSeparators(default_dir));
|
||||||
|
logWarn(message);
|
||||||
|
this->statusBar()->showMessage(message);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
logInfo(QString("Opening recent project: '%1'").arg(default_dir));
|
||||||
|
return openProject(default_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MainWindow::openProject(QString dir) {
|
bool MainWindow::openProject(QString dir) {
|
||||||
|
|
Loading…
Reference in a new issue