mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Added a confirmation dialog when deleting activities on the calendar (#4691)
This commit is contained in:
committed by
GitHub
parent
cd780b2247
commit
cdcd47e4c1
@@ -88,12 +88,15 @@ PlanningCalendarWindow::PlanningCalendarWindow(Context *context)
|
||||
context->tab->setNoSwitch(false);
|
||||
});
|
||||
connect(calendar, &Calendar::delActivity, [=](CalendarEntry activity) {
|
||||
context->tab->setNoSwitch(true);
|
||||
context->athlete->rideCache->removeRide(activity.reference);
|
||||
context->tab->setNoSwitch(false);
|
||||
QMessageBox::StandardButton res = QMessageBox::question(this, tr("Delete Activity"), tr("Are you sure you want to delete %1?").arg(activity.reference));
|
||||
if (res == QMessageBox::Yes) {
|
||||
context->tab->setNoSwitch(true);
|
||||
context->athlete->rideCache->removeRide(activity.reference);
|
||||
context->tab->setNoSwitch(false);
|
||||
|
||||
// Context::rideDeleted is not always emitted, therefore forcing the update
|
||||
updateActivities();
|
||||
// Context::rideDeleted is not always emitted, therefore forcing the update
|
||||
updateActivities();
|
||||
}
|
||||
});
|
||||
connect(calendar, &Calendar::moveActivity, [=](CalendarEntry activity, const QDate &srcDay, const QDate &destDay) {
|
||||
Q_UNUSED(srcDay)
|
||||
|
||||
Reference in New Issue
Block a user