Add confirmation dialog for world deletion
This commit is contained in:
parent
c3480d6fe4
commit
498dc8fc03
@ -19,6 +19,7 @@
|
|||||||
#include "dialogs/ModEditDialogCommon.h"
|
#include "dialogs/ModEditDialogCommon.h"
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
WorldListPage::WorldListPage(BaseInstance *inst, std::shared_ptr<WorldList> worlds, QString id,
|
WorldListPage::WorldListPage(BaseInstance *inst, std::shared_ptr<WorldList> worlds, QString id,
|
||||||
QString iconName, QString displayName, QString helpPage,
|
QString iconName, QString displayName, QString helpPage,
|
||||||
@ -85,6 +86,17 @@ void WorldListPage::on_rmWorldBtn_clicked()
|
|||||||
|
|
||||||
if (!lastfirst(list, first, last))
|
if (!lastfirst(list, first, last))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
auto result = QMessageBox::question(this,
|
||||||
|
tr("Are you sure?"),
|
||||||
|
tr("This will remove the selected world permenantly.\n"
|
||||||
|
"The world will be gone forever (A LONG TIME).\n"
|
||||||
|
"\n"
|
||||||
|
"Do you want to continue?"),
|
||||||
|
tr("I understand, continue."), tr("Cancel"), QString(), 1, 1
|
||||||
|
);
|
||||||
|
if(result != 0)
|
||||||
|
return;
|
||||||
m_worlds->stopWatching();
|
m_worlds->stopWatching();
|
||||||
m_worlds->deleteWorlds(first, last);
|
m_worlds->deleteWorlds(first, last);
|
||||||
m_worlds->startWatching();
|
m_worlds->startWatching();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user