diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-12-26 17:48:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-26 17:48:43 +0100 |
commit | 6ea1234a3bb9787a77680ff528f21bdf1e40989c (patch) | |
tree | 1385918c5819df035dd5bd7b8f6bab7fc534c396 /launcher/ui/pages/instance/WorldListPage.cpp | |
parent | dd3848d7b161e415c34c3c1c393985b644a88f1c (diff) | |
parent | 434f639b0c9af355703d6c64cfe5bbe9a28d0b9b (diff) | |
download | PrismLauncher-6ea1234a3bb9787a77680ff528f21bdf1e40989c.tar.gz PrismLauncher-6ea1234a3bb9787a77680ff528f21bdf1e40989c.tar.bz2 PrismLauncher-6ea1234a3bb9787a77680ff528f21bdf1e40989c.zip |
Merge pull request #618 from TheKodeToad/safer-destructive-actions
Fixes https://github.com/PolyMC/PolyMC/issues/948
Diffstat (limited to 'launcher/ui/pages/instance/WorldListPage.cpp')
-rw-r--r-- | launcher/ui/pages/instance/WorldListPage.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/launcher/ui/pages/instance/WorldListPage.cpp b/launcher/ui/pages/instance/WorldListPage.cpp index 93458ce4..0020c461 100644 --- a/launcher/ui/pages/instance/WorldListPage.cpp +++ b/launcher/ui/pages/instance/WorldListPage.cpp @@ -1,8 +1,9 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * PolyMC - Minecraft Launcher + * Prism Launcher - Minecraft Launcher * Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org> * Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net> + * Copyright (C) 2022 TheKodeToad <TheKodeToad@proton.me> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +36,7 @@ */ #include "WorldListPage.h" +#include "ui/dialogs/CustomMessageBox.h" #include "ui_WorldListPage.h" #include "minecraft/WorldList.h" @@ -192,12 +194,14 @@ void WorldListPage::on_actionRemove_triggered() if(!proxiedIndex.isValid()) 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?")); + auto result = CustomMessageBox::selectable(this, tr("Confirm Deletion"), + tr("You are about to delete \"%1\".\n" + "The world may be gone forever (A LONG TIME).\n\n" + "Are you sure?") + .arg(m_worlds->allWorlds().at(proxiedIndex.row()).name()), + QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) + ->exec(); + if(result != QMessageBox::Yes) { return; |