mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-10 00:43:59 +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()
|
void MainWindow::on_actionOpenRecent_triggered()
|
||||||
{
|
{
|
||||||
if(!getAnswerAboutUnsavedChanges())
|
|
||||||
return;
|
|
||||||
|
|
||||||
QSettings s(Ui::teamName, Ui::appName);
|
QSettings s(Ui::teamName, Ui::appName);
|
||||||
QStringList recentFiles = s.value(recentlyOpenedFilesSetting).toStringList();
|
QStringList recentFiles = s.value(recentlyOpenedFilesSetting).toStringList();
|
||||||
|
|
||||||
@ -483,8 +480,10 @@ void MainWindow::on_actionOpenRecent_triggered()
|
|||||||
RecentFileDialog d(this, recentFiles);
|
RecentFileDialog d(this, recentFiles);
|
||||||
|
|
||||||
auto onSelect = [this, &d](QListWidgetItem *item) {
|
auto onSelect = [this, &d](QListWidgetItem *item) {
|
||||||
|
if(getAnswerAboutUnsavedChanges()) {
|
||||||
QString filename = item->text();
|
QString filename = item->text();
|
||||||
openMap(filename);
|
openMap(filename);
|
||||||
|
}
|
||||||
d.close();
|
d.close();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user