From 37f30116e78c177d49afcbdb528ac0dd1a2cfff2 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Tue, 23 Jun 2015 21:59:03 -0400 Subject: [PATCH] Updated the program version tag, added ability to delete entries in the sequence in the playback window. --- config.h | 2 +- frameplaybackwindow.cpp | 26 ++++++++++++++++++++++++++ frameplaybackwindow.h | 1 + frameplaybackwindow.ui | 7 +++++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/config.h b/config.h index 37592ec..35cc4d5 100644 --- a/config.h +++ b/config.h @@ -1,7 +1,7 @@ #ifndef CONFIG #define CONFIG -#define VERSION 113 +#define VERSION 114 #endif // CONFIG diff --git a/frameplaybackwindow.cpp b/frameplaybackwindow.cpp index 42406e7..f0c7ad4 100644 --- a/frameplaybackwindow.cpp +++ b/frameplaybackwindow.cpp @@ -50,6 +50,7 @@ FramePlaybackWindow::FramePlaybackWindow(QVector *frames, SerialWorker connect(ui->btnStepForward, SIGNAL(clicked(bool)), this, SLOT(btnFwdOneClick())); connect(ui->btnSelectAll, SIGNAL(clicked(bool)), this, SLOT(btnSelectAllClick())); connect(ui->btnSelectNone, SIGNAL(clicked(bool)), this, SLOT(btnSelectNoneClick())); + connect(ui->btnDelete, SIGNAL(clicked(bool)), this, SLOT(btnDeleteCurrSeq())); connect(ui->spinPlaySpeed, SIGNAL(valueChanged(int)), this, SLOT(changePlaybackSpeed(int))); //connect(ui->cbLoop, SIGNAL(clicked(bool)), this, SLOT(changeLooping(bool))); connect(ui->comboCANBus, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSendingBus(int))); @@ -159,6 +160,31 @@ void FramePlaybackWindow::fillIDHash(SequenceItem &item) } } +void FramePlaybackWindow::btnDeleteCurrSeq() +{ + if (currentSeqNum == -1) return; + + if (playbackActive) + { + playbackActive = false; + playbackTimer->stop(); + } + + seqItems.removeAt(currentSeqNum); + ui->tblSequence->removeRow(currentSeqNum); + if (seqItems.count() > 0) + { + currentSeqNum = 0; + currentSeqItem = &seqItems[currentSeqNum]; + } + else + { + currentSeqNum = -1; + currentSeqItem = NULL; + } + updateFrameLabel(); +} + void FramePlaybackWindow::btnLoadFile() { QString filename; diff --git a/frameplaybackwindow.h b/frameplaybackwindow.h index 3f2d970..7960faa 100644 --- a/frameplaybackwindow.h +++ b/frameplaybackwindow.h @@ -37,6 +37,7 @@ private slots: void btnStopClick(); void btnPlayClick(); void btnFwdOneClick(); + void btnDeleteCurrSeq(); void changePlaybackSpeed(int newSpeed); void changeLooping(bool check); void changeSendingBus(int newIdx); diff --git a/frameplaybackwindow.ui b/frameplaybackwindow.ui index d08a5ee..cff92d6 100644 --- a/frameplaybackwindow.ui +++ b/frameplaybackwindow.ui @@ -287,6 +287,13 @@ + + + + Delete Selected + + +