1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00

Prompt about unsaved changes when trying to load a map instead of prompting when opening the dialogue.

This commit is contained in:
Joakim Thorén 2024-11-18 23:09:08 +01:00
parent 5e898b9aa8
commit 2ed83e53b7

View File

@ -448,9 +448,6 @@ void MainWindow::on_actionOpen_triggered()
void MainWindow::on_actionOpenRecent_triggered()
{
if(!getAnswerAboutUnsavedChanges())
return;
QSettings s(Ui::teamName, Ui::appName);
QStringList recentFiles = s.value(recentlyOpenedFilesSetting).toStringList();
@ -483,8 +480,10 @@ void MainWindow::on_actionOpenRecent_triggered()
RecentFileDialog d(this, recentFiles);
auto onSelect = [this, &d](QListWidgetItem *item) {
QString filename = item->text();
openMap(filename);
if(getAnswerAboutUnsavedChanges()) {
QString filename = item->text();
openMap(filename);
}
d.close();
};