From ffff8a90414c38c88d5e93542dab3c26a1e661dd Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 17 Dec 2023 22:27:16 +0900 Subject: Ask for confirmation before deleting a stream from the list Signed-off-by: Michele Calgaro --- src/kstreamripper.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/kstreamripper.cpp b/src/kstreamripper.cpp index 0eb9dae..15e827e 100644 --- a/src/kstreamripper.cpp +++ b/src/kstreamripper.cpp @@ -170,7 +170,7 @@ void KStreamRipper::addStreamButtonClicked() { StreamPropertiesDlg *dlg = new StreamPropertiesDlg(this); connect( dlg, TQT_SIGNAL( finished( StreamPropertiesDlg* )), this, TQT_SLOT( addStreamFinished( StreamPropertiesDlg* )) ); - dlg->setCaption("Add Stream..."); + dlg->setCaption("Add Stream..."); dlg->show(); } @@ -179,7 +179,7 @@ void KStreamRipper::editStreamButtonClicked() ProcessListViewItem *ProcItem = (ProcessListViewItem*)m_streamsListView->currentItem(); StreamPropertiesDlg *dlg = new StreamPropertiesDlg(this); connect( dlg, TQT_SIGNAL( finished( StreamPropertiesDlg* )), this, TQT_SLOT( editStreamFinished( StreamPropertiesDlg* )) ); - dlg->setCaption("Edit Stream"); + dlg->setCaption("Edit Stream"); dlg->d_nameEdit->setText(ProcItem->text(0)); dlg->d_urlEdit->setText(ProcItem->getProcessController()->getUrl()); dlg->d_descEdit->setText(ProcItem->getProcessController()->getDescription()); @@ -189,9 +189,17 @@ void KStreamRipper::editStreamButtonClicked() void KStreamRipper::deleteStreamButtonClicked() { - ProcessListViewItem * ProcItem = (ProcessListViewItem*)m_streamsListView->currentItem(); - stopRipButtonClicked(); - delete ProcItem; + ProcessListViewItem *procItem = (ProcessListViewItem*)m_streamsListView->currentItem(); + if (procItem) + { + int res = KMessageBox::questionYesNo(this, i18n("Delete the stream '%1'?").arg(procItem->text(0)), + i18n("Delete stream")); + if (res == KMessageBox::Yes) + { + stopRipButtonClicked(); + delete procItem; + } + } } void KStreamRipper::tuneInButtonClicked() -- cgit v1.2.1