2021-09-21 Fred Gleason <fredg@paravelsystems.com>

* Fixed a regression in rdlibrary(1) that failed to update the
	length of macro carts after editing.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-09-21 11:55:42 -04:00
parent acd80bcd65
commit bf1d015cb4
6 changed files with 40 additions and 12 deletions

View File

@@ -736,13 +736,12 @@ void EditCart::lengthChangedData(unsigned len)
void EditCart::okData()
{
// RDSystem *system;
QString sql;
RDSqlQuery *q;
if(rdcart_cart_numbers.size()==1) { // Single Edit
if(rdcart_controls.title_edit->text().isEmpty()) {
QMessageBox::warning(this,tr("Missing Title"),
QMessageBox::warning(this,"RDLibrary - "+tr("Missing Title"),
tr("You must provide at least a Cart Title!"));
return;
}
@@ -752,7 +751,7 @@ void EditCart::okData()
QString::asprintf("(`NUMBER`!=%u)",rdcart_cart->number());
q=new RDSqlQuery(sql);
if(q->first()) {
QMessageBox::warning(this,tr("Duplicate Title"),
QMessageBox::warning(this,"RDLibrary - "+tr("Duplicate Title"),
tr("The cart title must be unique!"));
delete q;
return;
@@ -761,7 +760,7 @@ void EditCart::okData()
}
if(rdcart_controls.enforce_length_box->isChecked()) {
if(!ValidateLengths()) {
switch(QMessageBox::warning(this,tr("Length Mismatch"),
switch(QMessageBox::warning(this,"RDLibrary - "+tr("Length Mismatch"),
tr("One or more cut lengths exceed the timescaling\nlimits of the system! Do you still want to save?"),QMessageBox::Yes,QMessageBox::No)) {
case QMessageBox::No:
case QMessageBox::NoButton:

View File

@@ -18,8 +18,6 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <qstring.h>
#include "cdripper.h"
#include "edit_macro.h"
#include "globals.h"
@@ -300,8 +298,10 @@ void MacroCart::doubleClickedData(const QModelIndex &index)
void MacroCart::UpdateLength()
{
if(rdcart_events->length()!=rdcart_length) {
rdcart_length=rdcart_events->length();
emit lengthChanged(rdcart_length);
unsigned len=rdcart_macro_model->totalLength();
if(len!=rdcart_length) {
rdcart_length=len;
emit lengthChanged(len);
}
}

View File

@@ -21,8 +21,8 @@
#ifndef MACRO_CART_H
#define MACRO_CART_H
#include <qcombobox.h>
#include <qpushbutton.h>
#include <QComboBox>
#include <QPushButton>
#include <rdmacro_event.h>
#include <rdmacrocartmodel.h>