MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / confirmDeleteSession

Method confirmDeleteSession

app/src/Sessions/DatabaseManager.cpp:641–664  ·  view source on GitHub ↗

* @brief Asks the user to confirm before deleting a session. */

Source from the content-addressed store, hash-verified

639 * @brief Asks the user to confirm before deleting a session.
640 */
641void Sessions::DatabaseManager::confirmDeleteSession(int sessionId)
642{
643 if (m_locked) {
644 Misc::Utilities::showMessageBox(
645 tr("Session file locked"),
646 tr("Unlock the session file before deleting recorded sessions."),
647 QMessageBox::Information);
648 return;
649 }
650
651 const auto meta = sessionMetadata(sessionId);
652 const auto title = meta.value("started_at").toString();
653
654 const int choice = Misc::Utilities::showMessageBox(
655 tr("Delete session from %1?").arg(title),
656 tr("All readings and raw data for this session are permanently removed."),
657 QMessageBox::Warning,
658 tr("Delete Session"),
659 QMessageBox::Yes | QMessageBox::Cancel,
660 QMessageBox::Cancel);
661
662 if (choice == QMessageBox::Yes)
663 deleteSession(sessionId);
664}
665
666/**
667 * @brief Hands the selected session off to the SQLite player for replay.

Callers 1

deleteSessionMethod · 0.80

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected