From a394dab92712a7a588805df69cd89710071f3a51 Mon Sep 17 00:00:00 2001 From: Louie S Date: Mon, 18 Mar 2024 15:05:06 -0400 Subject: Add question dialog before backend call in cleanHidden --- src/assignmentList.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/assignmentList.cpp b/src/assignmentList.cpp index 8d041e4..c1e40f5 100644 --- a/src/assignmentList.cpp +++ b/src/assignmentList.cpp @@ -135,8 +135,16 @@ void AssignmentList::reload() { } void AssignmentList::cleanHidden() { + QMessageBox::StandardButton are_you_sure; BackendDB database; - database.cleanHidden(); + + // create 'are you sure?' dialog before going forward + are_you_sure = QMessageBox::question(this, "Are You Sure?", + "Are you sure? All removed groups and entries will be permanently deleted from the database.", + QMessageBox::Yes|QMessageBox::No); + + if(are_you_sure == QMessageBox::Yes) + database.cleanHidden(); } void AssignmentList::aboutDialog() { -- cgit