mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
cockatrice: ask to save modified decks on close; fix #759
This commit is contained in:
parent
06e5327595
commit
399d4bf516
5 changed files with 26 additions and 6 deletions
|
|
@ -15,6 +15,7 @@
|
|||
#include "settingscache.h"
|
||||
#include <QDebug>
|
||||
#include <QPainter>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "pb/room_commands.pb.h"
|
||||
#include "pb/room_event.pb.h"
|
||||
|
|
@ -130,6 +131,23 @@ void TabSupervisor::retranslateUi()
|
|||
}
|
||||
}
|
||||
|
||||
bool TabSupervisor::closeRequest()
|
||||
{
|
||||
if (getGameCount()) {
|
||||
if (QMessageBox::question(this, tr("Are you sure?"), tr("There are still open games. Are you sure you want to quit?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach(TabDeckEditor *tab, deckEditorTabs)
|
||||
{
|
||||
if(!tab->confirmClose())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
AbstractClient *TabSupervisor::getClient() const
|
||||
{
|
||||
return localClients.isEmpty() ? client : localClients.first();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue