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:
parent
5e898b9aa8
commit
2ed83e53b7
@ -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();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user