mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-18 16:41:18 +02:00
2021-01-20 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in rdlibrary(1) that broke display of the 'Group' control in the 'Edit Cart' dialog with a user with no editing privileges. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -20840,3 +20840,7 @@
|
|||||||
2021-01-20 Fred Gleason <fredg@paravelsystems.com>
|
2021-01-20 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Modified 'RDCartFilter' to use 'RDGroupListModel' for the
|
* Modified 'RDCartFilter' to use 'RDGroupListModel' for the
|
||||||
'Group' dropdown.
|
'Group' dropdown.
|
||||||
|
2021-01-20 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Fixed a regression in rdlibrary(1) that broke display of the
|
||||||
|
'Group' control in the 'Edit Cart' dialog with a user with
|
||||||
|
no editing privileges.
|
||||||
|
@@ -110,6 +110,8 @@ EditCart::EditCart(const QList<unsigned> &cartnums,QString *path,bool new_cart,
|
|||||||
else {
|
else {
|
||||||
rdcart_group_box->setGeometry(135,38,110,21);
|
rdcart_group_box->setGeometry(135,38,110,21);
|
||||||
}
|
}
|
||||||
|
rdcart_group_model=new RDGroupListModel(false,false,this);
|
||||||
|
rdcart_group_box->setModel(rdcart_group_model);
|
||||||
rdcart_group_edit=new QLineEdit(this);
|
rdcart_group_edit=new QLineEdit(this);
|
||||||
rdcart_group_edit->setGeometry(280,11,140,21);
|
rdcart_group_edit->setGeometry(280,11,140,21);
|
||||||
rdcart_group_edit->setReadOnly(true);
|
rdcart_group_edit->setReadOnly(true);
|
||||||
@@ -574,19 +576,12 @@ EditCart::EditCart(const QList<unsigned> &cartnums,QString *path,bool new_cart,
|
|||||||
//
|
//
|
||||||
// Populate Fields
|
// Populate Fields
|
||||||
//
|
//
|
||||||
|
rdcart_group_model->changeUser();
|
||||||
if(cartnums.size()==1) { //single edit
|
if(cartnums.size()==1) { //single edit
|
||||||
rdcart_number_edit->
|
rdcart_number_edit->
|
||||||
setText(QString().sprintf("%06d",rdcart_cart->number()));
|
setText(QString().sprintf("%06d",rdcart_cart->number()));
|
||||||
if(rdcart_group_box->count() == 0)
|
rdcart_group_box->setCurrentText(rdcart_cart->groupName());
|
||||||
{
|
rdcart_group_edit->setText(rdcart_group_box->currentText());
|
||||||
PopulateGroupList();
|
|
||||||
for(int i=0;i<rdcart_group_box->count();i++) {
|
|
||||||
if(rdcart_group_box->text(i)==rdcart_cart->groupName()) {
|
|
||||||
rdcart_group_box->setCurrentItem(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rdcart_group_edit->setText(rdcart_cart->groupName());
|
|
||||||
}
|
|
||||||
switch(rdcart_cart->type()) {
|
switch(rdcart_cart->type()) {
|
||||||
case RDCart::Audio:
|
case RDCart::Audio:
|
||||||
rdcart_type_edit->setText(tr("AUDIO"));
|
rdcart_type_edit->setText(tr("AUDIO"));
|
||||||
@@ -655,7 +650,7 @@ EditCart::EditCart(const QList<unsigned> &cartnums,QString *path,bool new_cart,
|
|||||||
else {//multi edit
|
else {//multi edit
|
||||||
if(rdcart_group_box->count() == 0) {
|
if(rdcart_group_box->count() == 0) {
|
||||||
rdcart_group_box->insertItem("");
|
rdcart_group_box->insertItem("");
|
||||||
PopulateGroupList();
|
// PopulateGroupList();
|
||||||
rdcart_group_box->setCurrentItem(0);
|
rdcart_group_box->setCurrentItem(0);
|
||||||
}
|
}
|
||||||
rdcart_usage_box->setCurrentItem(0);
|
rdcart_usage_box->setCurrentItem(0);
|
||||||
@@ -984,26 +979,6 @@ bool EditCart::ValidateLengths()
|
|||||||
{
|
{
|
||||||
return rdcart_cart->validateLengths(QTime().
|
return rdcart_cart->validateLengths(QTime().
|
||||||
msecsTo(rdcart_controls.forced_length_edit->time()));
|
msecsTo(rdcart_controls.forced_length_edit->time()));
|
||||||
/*
|
|
||||||
int maxlen=(int)(RD_TIMESCALE_MAX*
|
|
||||||
(double)QTime().msecsTo(rdcart_controls.forced_length_edit->
|
|
||||||
time()));
|
|
||||||
int minlen=(int)(RD_TIMESCALE_MIN*
|
|
||||||
(double)QTime().msecsTo(rdcart_controls.forced_length_edit->
|
|
||||||
time()));
|
|
||||||
QString sql=QString().sprintf("select LENGTH from CUTS where CART_NUMBER=%u",
|
|
||||||
rdcart_cart->number());
|
|
||||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
|
||||||
while(q->next()) {
|
|
||||||
if((q->value(0).toInt()>maxlen)||(q->value(0).toInt()<minlen)) {
|
|
||||||
delete q;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete q;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1013,25 +988,11 @@ void EditCart::schedCodesData()
|
|||||||
EditSchedulerCodes *dialog=new EditSchedulerCodes(&sched_codes,NULL,this);
|
EditSchedulerCodes *dialog=new EditSchedulerCodes(&sched_codes,NULL,this);
|
||||||
dialog->exec();
|
dialog->exec();
|
||||||
delete dialog;
|
delete dialog;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
EditSchedulerCodes *dialog=
|
EditSchedulerCodes *dialog=
|
||||||
new EditSchedulerCodes(&add_codes,&remove_codes,this);
|
new EditSchedulerCodes(&add_codes,&remove_codes,this);
|
||||||
dialog->exec();
|
dialog->exec();
|
||||||
delete dialog;
|
delete dialog;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void EditCart::PopulateGroupList()
|
|
||||||
{
|
|
||||||
QString sql=QString("select GROUP_NAME from USER_PERMS where ")+
|
|
||||||
"USER_NAME=\""+RDEscapeString(rda->user()->name())+"\" "+
|
|
||||||
"order by GROUP_NAME";
|
|
||||||
|
|
||||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
|
||||||
while(q->next()) {
|
|
||||||
rdcart_group_box->insertItem(q->value(0).toString());
|
|
||||||
}
|
}
|
||||||
delete q;
|
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
#include <rddialog.h>
|
#include <rddialog.h>
|
||||||
|
#include <rdgrouplistmodel.h>
|
||||||
|
|
||||||
#include "audio_cart.h"
|
#include "audio_cart.h"
|
||||||
#include "audio_controls.h"
|
#include "audio_controls.h"
|
||||||
@@ -55,13 +56,13 @@ class EditCart : public RDDialog
|
|||||||
void closeEvent(QCloseEvent *e);
|
void closeEvent(QCloseEvent *e);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void PopulateGroupList();
|
|
||||||
QList<unsigned> rdcart_cart_numbers;
|
QList<unsigned> rdcart_cart_numbers;
|
||||||
bool ValidateLengths();
|
bool ValidateLengths();
|
||||||
RDCart *rdcart_cart;
|
RDCart *rdcart_cart;
|
||||||
QLineEdit *rdcart_type_edit;
|
QLineEdit *rdcart_type_edit;
|
||||||
QLineEdit *rdcart_number_edit;
|
QLineEdit *rdcart_number_edit;
|
||||||
QComboBox *rdcart_group_box;
|
QComboBox *rdcart_group_box;
|
||||||
|
RDGroupListModel *rdcart_group_model;
|
||||||
QLineEdit *rdcart_group_edit;
|
QLineEdit *rdcart_group_edit;
|
||||||
AudioControls rdcart_controls;
|
AudioControls rdcart_controls;
|
||||||
QComboBox *rdcart_cut_sched_box;
|
QComboBox *rdcart_cut_sched_box;
|
||||||
|
Reference in New Issue
Block a user