mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-08-16 08:34:12 +02:00
2021-01-17 Fred Gleason <fredg@paravelsystems.com>
* Restored enforcement of service authorized groups in rdairplay(1) and rdlogedit(1). Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
834ea996fd
commit
cd581d3c51
@ -20818,3 +20818,6 @@
|
|||||||
* Added support for cart notes in the 'RDCartDialog' dialog.
|
* Added support for cart notes in the 'RDCartDialog' dialog.
|
||||||
2021-01-17 Fred Gleason <fredg@paravelsystems.com>
|
2021-01-17 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Removed all global variables from rdairplay(1).
|
* Removed all global variables from rdairplay(1).
|
||||||
|
2021-01-17 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Restored enforcement of service authorized groups in rdairplay(1)
|
||||||
|
and rdlogedit(1).
|
||||||
|
@ -1408,10 +1408,6 @@ ze &souboru</translation>
|
|||||||
<source>Scheduler Code:</source>
|
<source>Scheduler Code:</source>
|
||||||
<translation type="unfinished">Kódy rozvrhovače:</translation>
|
<translation type="unfinished">Kódy rozvrhovače:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>And Scheduler Code:</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Matching Carts:</source>
|
<source>Matching Carts:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -1395,10 +1395,6 @@ senden</translation>
|
|||||||
<source>Scheduler Code:</source>
|
<source>Scheduler Code:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>And Scheduler Code:</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Matching Carts:</source>
|
<source>Matching Carts:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -1399,10 +1399,6 @@ Color</translation>
|
|||||||
<source>Scheduler Code:</source>
|
<source>Scheduler Code:</source>
|
||||||
<translation type="unfinished">Cód. Programac.:</translation>
|
<translation type="unfinished">Cód. Programac.:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>And Scheduler Code:</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Matching Carts:</source>
|
<source>Matching Carts:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -1217,10 +1217,6 @@ La Couleur</translation>
|
|||||||
<source>Scheduler Code:</source>
|
<source>Scheduler Code:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>And Scheduler Code:</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Matching Carts:</source>
|
<source>Matching Carts:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -1386,10 +1386,6 @@ farge</translation>
|
|||||||
<source>Scheduler Code:</source>
|
<source>Scheduler Code:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>And Scheduler Code:</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Matching Carts:</source>
|
<source>Matching Carts:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -1386,10 +1386,6 @@ farge</translation>
|
|||||||
<source>Scheduler Code:</source>
|
<source>Scheduler Code:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>And Scheduler Code:</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Matching Carts:</source>
|
<source>Matching Carts:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -1387,10 +1387,6 @@ Cor</translation>
|
|||||||
<source>Scheduler Code:</source>
|
<source>Scheduler Code:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>And Scheduler Code:</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Matching Carts:</source>
|
<source>Matching Carts:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -155,8 +155,7 @@ int RDButtonDialog::exec(RDPanelButton *button,bool hookmode,
|
|||||||
|
|
||||||
void RDButtonDialog::setCartData()
|
void RDButtonDialog::setCartData()
|
||||||
{
|
{
|
||||||
if(edit_cart_dialog->exec(&edit_cart,RDCart::All,&edit_svcname,1,
|
if(edit_cart_dialog->exec(&edit_cart,RDCart::All,edit_svcname,NULL)==0) {
|
||||||
edit_user_name,edit_user_password)==0) {
|
|
||||||
DisplayCart(edit_cart);
|
DisplayCart(edit_cart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,12 +97,7 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
|||||||
cart_cart_model->setPalette(palette());
|
cart_cart_model->setPalette(palette());
|
||||||
cart_cart_view->setModel(cart_cart_model);
|
cart_cart_view->setModel(cart_cart_model);
|
||||||
cart_cart_filter->setModel(cart_cart_model);
|
cart_cart_filter->setModel(cart_cart_model);
|
||||||
// connect(cart_cart_filter,SIGNAL(filterChanged(const QString &)),
|
|
||||||
// cart_cart_model,SLOT(setFilterSql(const QString &)));
|
|
||||||
connect(cart_cart_model,SIGNAL(modelReset()),this,SLOT(modelResetData()));
|
connect(cart_cart_model,SIGNAL(modelReset()),this,SLOT(modelResetData()));
|
||||||
|
|
||||||
// connect(cart_cart_model,SIGNAL(rowCountChanged(int)),
|
|
||||||
// cart_cart_filter,SLOT(setMatchCount(int)));
|
|
||||||
connect(cart_cart_view,SIGNAL(doubleClicked(const QModelIndex &)),
|
connect(cart_cart_view,SIGNAL(doubleClicked(const QModelIndex &)),
|
||||||
this,SLOT(cartDoubleClickedData(const QModelIndex &)));
|
this,SLOT(cartDoubleClickedData(const QModelIndex &)));
|
||||||
connect(cart_cart_view->selectionModel(),
|
connect(cart_cart_view->selectionModel(),
|
||||||
@ -189,18 +184,15 @@ QSize RDCartDialog::sizeHint() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int RDCartDialog::exec(int *cartnum,RDCart::Type type,QString *svcname,
|
int RDCartDialog::exec(int *cartnum,RDCart::Type type,const QString &svc,
|
||||||
int svc_quan,const QString &username,
|
bool *temp_allowed)
|
||||||
const QString &passwd,bool *temp_allowed)
|
|
||||||
{
|
{
|
||||||
|
printf("RDCartDialog service: %s\n",svc.toUtf8().constData());
|
||||||
LoadState();
|
LoadState();
|
||||||
cart_cart_filter->setShowCartType(type);
|
cart_cart_filter->setShowCartType(type);
|
||||||
|
cart_cart_filter->setService(svc);
|
||||||
cart_cartnum=cartnum;
|
cart_cartnum=cartnum;
|
||||||
cart_type=type;
|
cart_type=type;
|
||||||
cart_service=svcname;
|
|
||||||
cart_service_quan=svc_quan;
|
|
||||||
cart_user_name=username;
|
|
||||||
cart_user_password=passwd;
|
|
||||||
cart_temp_allowed=temp_allowed;
|
cart_temp_allowed=temp_allowed;
|
||||||
switch(cart_type) {
|
switch(cart_type) {
|
||||||
case RDCart::All:
|
case RDCart::All:
|
||||||
@ -398,7 +390,7 @@ void RDCartDialog::loadFileData()
|
|||||||
settings.setNormalizationLevel(-11);
|
settings.setNormalizationLevel(-11);
|
||||||
conv->setDestinationSettings(&settings);
|
conv->setDestinationSettings(&settings);
|
||||||
conv->setUseMetadata(true);
|
conv->setUseMetadata(true);
|
||||||
err=conv->runImport(cart_user_name,cart_user_password,&conv_err);
|
err=conv->runImport(rda->user()->name(),rda->user()->password(),&conv_err);
|
||||||
cart_busy_dialog->hide();
|
cart_busy_dialog->hide();
|
||||||
switch(conv_err) {
|
switch(conv_err) {
|
||||||
case RDAudioImport::ErrorOk:
|
case RDAudioImport::ErrorOk:
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QProgressDialog>
|
#include <QProgressDialog>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QStringList>
|
||||||
#include <QTableView>
|
#include <QTableView>
|
||||||
|
|
||||||
#include <rdbusydialog.h>
|
#include <rdbusydialog.h>
|
||||||
@ -48,9 +49,13 @@ class RDCartDialog : public RDDialog
|
|||||||
QSizePolicy sizePolicy() const;
|
QSizePolicy sizePolicy() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
int exec(int *cartnum,RDCart::Type type,QString *svcname,int svc_quan,
|
int exec(int *cartnum,RDCart::Type type,const QString &svc,
|
||||||
const QString &username,const QString &passwd,
|
bool *temp_allowed);
|
||||||
bool *temp_allowed=NULL);
|
// int exec(int *cartnum,RDCart::Type type,QString *svcname,int svc_quan,
|
||||||
|
// bool *temp_allowed);
|
||||||
|
// int exec(int *cartnum,RDCart::Type type,QString *svcname,int svc_quan,
|
||||||
|
// const QString &username,const QString &passwd,
|
||||||
|
// bool *temp_allowed=NULL);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void modelResetData();
|
void modelResetData();
|
||||||
@ -82,15 +87,12 @@ class RDCartDialog : public RDDialog
|
|||||||
QString *cart_filter;
|
QString *cart_filter;
|
||||||
bool local_filter;
|
bool local_filter;
|
||||||
RDCart::Type cart_type;
|
RDCart::Type cart_type;
|
||||||
QString *cart_service;
|
QStringList cart_services;
|
||||||
int cart_service_quan;
|
|
||||||
RDStation::FilterMode cart_filter_mode;
|
RDStation::FilterMode cart_filter_mode;
|
||||||
QProgressDialog *cart_progress_dialog;
|
QProgressDialog *cart_progress_dialog;
|
||||||
QString cart_import_path;
|
QString cart_import_path;
|
||||||
QString cart_import_file_filter;
|
QString cart_import_file_filter;
|
||||||
bool *cart_temp_allowed;
|
bool *cart_temp_allowed;
|
||||||
QString cart_user_name;
|
|
||||||
QString cart_user_password;
|
|
||||||
RDBusyDialog *cart_busy_dialog;
|
RDBusyDialog *cart_busy_dialog;
|
||||||
RDSimplePlayer *cart_player;
|
RDSimplePlayer *cart_player;
|
||||||
QString cart_caption;
|
QString cart_caption;
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
|
|
||||||
#include "rdapplication.h"
|
#include "rdapplication.h"
|
||||||
@ -33,6 +34,9 @@ RDCartFilter::RDCartFilter(bool show_drag_box,QWidget *parent)
|
|||||||
d_model=NULL;
|
d_model=NULL;
|
||||||
d_show_drag_box=show_drag_box;
|
d_show_drag_box=show_drag_box;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Filter Phrase
|
||||||
|
//
|
||||||
d_filter_edit=new QLineEdit(this);
|
d_filter_edit=new QLineEdit(this);
|
||||||
d_filter_label=new QLabel(d_filter_edit,tr("Filter:"),this);
|
d_filter_label=new QLabel(d_filter_edit,tr("Filter:"),this);
|
||||||
d_filter_label->setFont(labelFont());
|
d_filter_label->setFont(labelFont());
|
||||||
@ -85,16 +89,6 @@ RDCartFilter::RDCartFilter(bool show_drag_box,QWidget *parent)
|
|||||||
connect(d_codes_box,SIGNAL(activated(const QString &)),
|
connect(d_codes_box,SIGNAL(activated(const QString &)),
|
||||||
this,SLOT(groupChangedData(const QString &)));
|
this,SLOT(groupChangedData(const QString &)));
|
||||||
|
|
||||||
//
|
|
||||||
// Scheduler Codes2 Filter
|
|
||||||
//
|
|
||||||
d_codes2_box=new QComboBox(this);
|
|
||||||
d_codes2_label=new QLabel(d_codes2_box,tr("And Scheduler Code:"),this);
|
|
||||||
d_codes2_label->setFont(labelFont());
|
|
||||||
d_codes2_label->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
|
|
||||||
connect(d_codes2_box,SIGNAL(activated(const QString &)),
|
|
||||||
this,SLOT(groupChangedData(const QString &)));
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Results Counter
|
// Results Counter
|
||||||
//
|
//
|
||||||
@ -232,7 +226,7 @@ QString RDCartFilter::filterSql(const QStringList &and_fields) const
|
|||||||
sql+=RDCartFilter::typeFilter(d_showaudio_check->isChecked(),
|
sql+=RDCartFilter::typeFilter(d_showaudio_check->isChecked(),
|
||||||
d_showmacro_check->isChecked(),
|
d_showmacro_check->isChecked(),
|
||||||
d_show_cart_type);
|
d_show_cart_type);
|
||||||
// sql+=RDCartFilter::phraseFilter(d_filter_edit->text().trimmed(),true);
|
sql+=RDCartFilter::phraseFilter(d_filter_edit->text().trimmed(),true);
|
||||||
QStringList groups;
|
QStringList groups;
|
||||||
for(int i=0;i<d_group_box->count();i++) {
|
for(int i=0;i<d_group_box->count();i++) {
|
||||||
groups.push_back(d_group_box->text(i));
|
groups.push_back(d_group_box->text(i));
|
||||||
@ -369,6 +363,24 @@ void RDCartFilter::setUserIsAdmin(bool state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString RDCartFilter::service() const
|
||||||
|
{
|
||||||
|
return d_service;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RDCartFilter::setService(const QString &svc)
|
||||||
|
{
|
||||||
|
if(svc!=d_service) {
|
||||||
|
d_service=svc;
|
||||||
|
if(!d_service.isEmpty()) {
|
||||||
|
LoadServiceGroups();
|
||||||
|
}
|
||||||
|
emit filterChanged(filterSql());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
RDLibraryModel *RDCartFilter::model() const
|
RDLibraryModel *RDCartFilter::model() const
|
||||||
{
|
{
|
||||||
return d_model;
|
return d_model;
|
||||||
@ -409,35 +421,19 @@ void RDCartFilter::changeUser()
|
|||||||
QString sql;
|
QString sql;
|
||||||
RDSqlQuery *q;
|
RDSqlQuery *q;
|
||||||
|
|
||||||
d_group_box->clear();
|
if(d_service.isEmpty()) {
|
||||||
d_group_box->insertItem(tr("ALL"));
|
LoadUserGroups();
|
||||||
if(d_user_is_admin) {
|
|
||||||
sql=QString("select NAME from GROUPS order by NAME ");
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
sql=QString("select GROUP_NAME from USER_PERMS where ")+
|
|
||||||
"USER_NAME=\""+RDEscapeString(rda->user()->name())+"\" "+
|
|
||||||
"order by GROUP_NAME";
|
|
||||||
}
|
|
||||||
q=new RDSqlQuery(sql);
|
|
||||||
while(q->next()) {
|
|
||||||
d_group_box->insertItem(q->value(0).toString());
|
|
||||||
}
|
|
||||||
delete q;
|
|
||||||
|
|
||||||
d_codes_box->clear();
|
d_codes_box->clear();
|
||||||
d_codes_box->insertItem(tr("ALL"));
|
d_codes_box->insertItem(tr("ALL"));
|
||||||
d_codes2_box->clear();
|
|
||||||
d_codes2_box->insertItem(tr("ALL"));
|
|
||||||
sql=QString().sprintf("select CODE from SCHED_CODES");
|
sql=QString().sprintf("select CODE from SCHED_CODES");
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
while(q->next()) {
|
while(q->next()) {
|
||||||
d_codes_box->insertItem(q->value(0).toString());
|
d_codes_box->insertItem(q->value(0).toString());
|
||||||
d_codes2_box->insertItem(q->value(0).toString());
|
|
||||||
}
|
}
|
||||||
delete q;
|
delete q;
|
||||||
d_search_button->setDisabled(true);
|
d_search_button->setDisabled(true);
|
||||||
groupChangedData(d_group_box->currentText());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -523,8 +519,6 @@ void RDCartFilter::resizeEvent(QResizeEvent *e)
|
|||||||
d_group_box->setGeometry(70,40,100,20);
|
d_group_box->setGeometry(70,40,100,20);
|
||||||
d_codes_label->setGeometry(175,40,115,20);
|
d_codes_label->setGeometry(175,40,115,20);
|
||||||
d_codes_box->setGeometry(295,40,100,20);
|
d_codes_box->setGeometry(295,40,100,20);
|
||||||
d_codes2_label->setGeometry(410,40,130,20);
|
|
||||||
d_codes2_box->setGeometry(545,40,100,20);
|
|
||||||
d_matches_label->setGeometry(660,40,100,20);
|
d_matches_label->setGeometry(660,40,100,20);
|
||||||
d_matches_edit->setGeometry(765,40,55,20);
|
d_matches_edit->setGeometry(765,40,55,20);
|
||||||
d_showmatches_label->setGeometry(760,66,200,20);
|
d_showmatches_label->setGeometry(760,66,200,20);
|
||||||
@ -545,29 +539,29 @@ QString RDCartFilter::phraseFilter(const QString &phrase, bool incl_cuts)
|
|||||||
QString sql="";
|
QString sql="";
|
||||||
|
|
||||||
if(phrase.isEmpty()) {
|
if(phrase.isEmpty()) {
|
||||||
sql=" &&";
|
sql=" ";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sql+=QString(" (")+
|
QString search=RDEscapeString(phrase);
|
||||||
"(CART.TITLE like \"%%\")||"+
|
sql=sql+QString(" ((CART.TITLE like \"%")+search+"%\")||"+
|
||||||
"(CART.ARTIST like \"%%\")||"+
|
"(CART.ARTIST like \"%"+search+"%\")||"+
|
||||||
"(CART.CLIENT like \"%%\")||"+
|
"(CART.CLIENT like \"%"+search+"%\")||"+
|
||||||
"(CART.AGENCY like \"%%\")||"+
|
"(CART.AGENCY like \"%"+search+"%\")||"+
|
||||||
"(CART.ALBUM like \"%%\")||"+
|
"(CART.ALBUM like \"%"+search+"%\")||"+
|
||||||
"(CART.LABEL like \"%%\")||"+
|
"(CART.LABEL like \"%"+search+"%\")||"+
|
||||||
"(CART.NUMBER like \"%%\")||"+
|
"(CART.NUMBER like \"%"+search+"%\")||"+
|
||||||
"(CART.PUBLISHER like \"%%\")||"+
|
"(CART.PUBLISHER like \"%"+search+"%\")||"+
|
||||||
"(CART.COMPOSER like \"%%\")||"+
|
"(CART.COMPOSER like \"%"+search+"%\")||"+
|
||||||
"(CART.CONDUCTOR like \"%%\")||"+
|
"(CART.CONDUCTOR like \"%"+search+"%\")||"+
|
||||||
"(CART.SONG_ID like \"%%\")||"+
|
"(CART.SONG_ID like \"%"+search+"%\")||"+
|
||||||
"(CART.USER_DEFINED like \"%%\")";
|
"(CART.USER_DEFINED like \"%"+search+"%\")";
|
||||||
if(incl_cuts) {
|
if(incl_cuts) {
|
||||||
sql+=QString("||(CUTS.ISCI like \"%%\")")+
|
sql+=QString("||(CUTS.ISCI like \"%")+search+"%\")"+
|
||||||
"||(CUTS.ISRC like \"%%\")"+
|
"||(CUTS.ISRC like \"%"+search+"%\")"+
|
||||||
"||(CUTS.DESCRIPTION like \"%%\")"+
|
"||(CUTS.DESCRIPTION like \"%"+search+"%\")"+
|
||||||
"||(CUTS.OUTCUE like \"%%\")";
|
"||(CUTS.OUTCUE like \"%"+search+"%\")";
|
||||||
}
|
}
|
||||||
sql+=") &&";
|
sql+=") && ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return sql;
|
return sql;
|
||||||
@ -630,3 +624,48 @@ QString RDCartFilter::typeFilter(bool incl_audio,bool incl_macro,
|
|||||||
}
|
}
|
||||||
return sql;
|
return sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RDCartFilter::LoadUserGroups()
|
||||||
|
{
|
||||||
|
QString sql;
|
||||||
|
RDSqlQuery *q;
|
||||||
|
|
||||||
|
d_group_box->clear();
|
||||||
|
d_group_box->insertItem(tr("ALL"));
|
||||||
|
if(d_user_is_admin) {
|
||||||
|
sql=QString("select NAME from GROUPS order by NAME ");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sql=QString("select GROUP_NAME from USER_PERMS where ")+
|
||||||
|
"USER_NAME=\""+RDEscapeString(rda->user()->name())+"\" "+
|
||||||
|
"order by GROUP_NAME";
|
||||||
|
}
|
||||||
|
q=new RDSqlQuery(sql);
|
||||||
|
while(q->next()) {
|
||||||
|
d_group_box->insertItem(q->value(0).toString());
|
||||||
|
}
|
||||||
|
delete q;
|
||||||
|
|
||||||
|
groupChangedData(d_group_box->currentText());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RDCartFilter::LoadServiceGroups()
|
||||||
|
{
|
||||||
|
QString sql;
|
||||||
|
RDSqlQuery *q=NULL;
|
||||||
|
|
||||||
|
d_group_box->clear();
|
||||||
|
d_group_box->insertItem(0,tr("ALL"));
|
||||||
|
sql=QString("select ")+
|
||||||
|
"GROUP_NAME "+
|
||||||
|
"from AUDIO_PERMS where "+
|
||||||
|
"SERVICE_NAME=\""+RDEscapeString(d_service)+"\" "+
|
||||||
|
"order by GROUP_NAME";
|
||||||
|
q=new RDSqlQuery(sql);
|
||||||
|
while(q->next()) {
|
||||||
|
d_group_box->insertItem(d_group_box->count(),q->value(0).toString());
|
||||||
|
}
|
||||||
|
delete q;
|
||||||
|
}
|
||||||
|
@ -53,6 +53,8 @@ class RDCartFilter : public RDWidget
|
|||||||
void setLimitSearch(bool state);
|
void setLimitSearch(bool state);
|
||||||
bool userIsAdmin() const;
|
bool userIsAdmin() const;
|
||||||
void setUserIsAdmin(bool state);
|
void setUserIsAdmin(bool state);
|
||||||
|
QString service() const;
|
||||||
|
void setService(const QString &svc);
|
||||||
RDLibraryModel *model() const;
|
RDLibraryModel *model() const;
|
||||||
static QString phraseFilter(const QString &phrase,bool incl_cuts);
|
static QString phraseFilter(const QString &phrase,bool incl_cuts);
|
||||||
static QString groupFilter(const QString &group,const QStringList &groups);
|
static QString groupFilter(const QString &group,const QStringList &groups);
|
||||||
@ -83,6 +85,8 @@ class RDCartFilter : public RDWidget
|
|||||||
void resizeEvent(QResizeEvent *e);
|
void resizeEvent(QResizeEvent *e);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void LoadUserGroups();
|
||||||
|
void LoadServiceGroups();
|
||||||
RDLibraryModel *d_model;
|
RDLibraryModel *d_model;
|
||||||
QLineEdit *d_filter_edit;
|
QLineEdit *d_filter_edit;
|
||||||
QLabel *d_filter_label;
|
QLabel *d_filter_label;
|
||||||
@ -90,8 +94,6 @@ class RDCartFilter : public RDWidget
|
|||||||
QLabel *d_group_label;
|
QLabel *d_group_label;
|
||||||
QComboBox *d_codes_box;
|
QComboBox *d_codes_box;
|
||||||
QLabel *d_codes_label;
|
QLabel *d_codes_label;
|
||||||
QComboBox *d_codes2_box;
|
|
||||||
QLabel *d_codes2_label;
|
|
||||||
QLineEdit *d_matches_edit;
|
QLineEdit *d_matches_edit;
|
||||||
QLabel *d_matches_label;
|
QLabel *d_matches_label;
|
||||||
QPushButton *d_search_button;
|
QPushButton *d_search_button;
|
||||||
@ -110,6 +112,7 @@ class RDCartFilter : public RDWidget
|
|||||||
RDCart::Type d_show_cart_type;
|
RDCart::Type d_show_cart_type;
|
||||||
QString d_default_group;
|
QString d_default_group;
|
||||||
bool d_user_is_admin;
|
bool d_user_is_admin;
|
||||||
|
QString d_service;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -428,8 +428,7 @@ void RDCartSlot::loadData()
|
|||||||
case RDSlotOptions::CartDeckMode:
|
case RDSlotOptions::CartDeckMode:
|
||||||
cartnum=slot_logline->cartNumber();
|
cartnum=slot_logline->cartNumber();
|
||||||
if(cartnum==0) {
|
if(cartnum==0) {
|
||||||
if(slot_cart_dialog->exec(&cartnum,RDCart::All,&svcname,0,
|
if(slot_cart_dialog->exec(&cartnum,RDCart::All,QString(),
|
||||||
slot_user->name(),slot_user->password(),
|
|
||||||
&slot_temp_cart)==0) {
|
&slot_temp_cart)==0) {
|
||||||
load(cartnum);
|
load(cartnum);
|
||||||
}
|
}
|
||||||
|
@ -445,6 +445,7 @@ void RDLibraryModel::setShowNotes(int state)
|
|||||||
|
|
||||||
void RDLibraryModel::setFilterSql(const QString &sql)
|
void RDLibraryModel::setFilterSql(const QString &sql)
|
||||||
{
|
{
|
||||||
|
// printf("FILTER SQL: %s\n",sql.toUtf8().constData());
|
||||||
updateModel(sql);
|
updateModel(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,8 +138,7 @@ QSizePolicy AutofillCarts::sizePolicy() const
|
|||||||
void AutofillCarts::addData()
|
void AutofillCarts::addData()
|
||||||
{
|
{
|
||||||
int cart=0;
|
int cart=0;
|
||||||
if(admin_cart_dialog->exec(&cart,RDCart::Audio,NULL,0,
|
if(admin_cart_dialog->exec(&cart,RDCart::Audio,QString(),NULL)<0) {
|
||||||
rda->user()->name(),rda->user()->password())<0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RDCart *rdcart=new RDCart(cart);
|
RDCart *rdcart=new RDCart(cart);
|
||||||
|
@ -355,8 +355,7 @@ void EditCartSlots::cartSelectData()
|
|||||||
{
|
{
|
||||||
int cartnum=edit_cart_edit->text().toInt();
|
int cartnum=edit_cart_edit->text().toInt();
|
||||||
|
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::All,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::All,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
edit_cart_edit->setText(QString().sprintf("%06d",cartnum));
|
edit_cart_edit->setText(QString().sprintf("%06d",cartnum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -528,7 +528,7 @@ void EditDecks::playSettingsChangedData(int id,int card,int port)
|
|||||||
void EditDecks::eventCartSelectedData(int n)
|
void EditDecks::eventCartSelectedData(int n)
|
||||||
{
|
{
|
||||||
int cartnum=edit_event_edits[n]->text().toInt();
|
int cartnum=edit_event_edits[n]->text().toInt();
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,"","")==0) {
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
if(cartnum==0) {
|
if(cartnum==0) {
|
||||||
edit_event_edits[n]->setText("");
|
edit_event_edits[n]->setText("");
|
||||||
}
|
}
|
||||||
|
@ -538,8 +538,7 @@ void EditDropbox::pathChangedData(QString text)
|
|||||||
void EditDropbox::selectCartData()
|
void EditDropbox::selectCartData()
|
||||||
{
|
{
|
||||||
int cartnum=box_to_cart_edit->text().toInt();
|
int cartnum=box_to_cart_edit->text().toInt();
|
||||||
admin_cart_dialog->exec(&cartnum,RDCart::Audio,NULL,0,
|
admin_cart_dialog->exec(&cartnum,RDCart::Audio,QString(),NULL);
|
||||||
rda->user()->name(),rda->user()->password());
|
|
||||||
if(cartnum>0) {
|
if(cartnum>0) {
|
||||||
box_to_cart_edit->setText(QString().sprintf("%06d",cartnum));
|
box_to_cart_edit->setText(QString().sprintf("%06d",cartnum));
|
||||||
}
|
}
|
||||||
|
@ -201,8 +201,7 @@ QSizePolicy EditGpi::sizePolicy() const
|
|||||||
void EditGpi::selectOnData()
|
void EditGpi::selectOnData()
|
||||||
{
|
{
|
||||||
int oncart=edit_onmacro_edit->text().toInt();
|
int oncart=edit_onmacro_edit->text().toInt();
|
||||||
if(admin_cart_dialog->exec(&oncart,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&oncart,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
if(oncart>0) {
|
if(oncart>0) {
|
||||||
RDCart *rdcart=new RDCart(oncart);
|
RDCart *rdcart=new RDCart(oncart);
|
||||||
edit_onmacro_edit->setText(QString().sprintf("%06d",oncart));
|
edit_onmacro_edit->setText(QString().sprintf("%06d",oncart));
|
||||||
@ -227,8 +226,7 @@ void EditGpi::clearOnData()
|
|||||||
void EditGpi::selectOffData()
|
void EditGpi::selectOffData()
|
||||||
{
|
{
|
||||||
int offcart=edit_offmacro_edit->text().toInt();
|
int offcart=edit_offmacro_edit->text().toInt();
|
||||||
if(admin_cart_dialog->exec(&offcart,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&offcart,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
if(offcart>0) {
|
if(offcart>0) {
|
||||||
RDCart *rdcart=new RDCart(offcart);
|
RDCart *rdcart=new RDCart(offcart);
|
||||||
edit_offmacro_edit->setText(QString().sprintf("%06d",offcart));
|
edit_offmacro_edit->setText(QString().sprintf("%06d",offcart));
|
||||||
|
@ -1109,8 +1109,7 @@ void EditMatrix::sasResourcesButtonData()
|
|||||||
void EditMatrix::startCartData()
|
void EditMatrix::startCartData()
|
||||||
{
|
{
|
||||||
int cartnum=edit_start_cart_edit->text().toUInt();
|
int cartnum=edit_start_cart_edit->text().toUInt();
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
if(cartnum>0) {
|
if(cartnum>0) {
|
||||||
edit_start_cart_edit->setText(QString().sprintf("%06u",cartnum));
|
edit_start_cart_edit->setText(QString().sprintf("%06u",cartnum));
|
||||||
}
|
}
|
||||||
@ -1124,8 +1123,7 @@ void EditMatrix::startCartData()
|
|||||||
void EditMatrix::stopCartData()
|
void EditMatrix::stopCartData()
|
||||||
{
|
{
|
||||||
int cartnum=edit_stop_cart_edit->text().toUInt();
|
int cartnum=edit_stop_cart_edit->text().toUInt();
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
if(cartnum>0) {
|
if(cartnum>0) {
|
||||||
edit_stop_cart_edit->setText(QString().sprintf("%06u",cartnum));
|
edit_stop_cart_edit->setText(QString().sprintf("%06u",cartnum));
|
||||||
}
|
}
|
||||||
@ -1139,8 +1137,7 @@ void EditMatrix::stopCartData()
|
|||||||
void EditMatrix::startCart2Data()
|
void EditMatrix::startCart2Data()
|
||||||
{
|
{
|
||||||
int cartnum=edit_start_cart2_edit->text().toUInt();
|
int cartnum=edit_start_cart2_edit->text().toUInt();
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
if(cartnum>0) {
|
if(cartnum>0) {
|
||||||
edit_start_cart2_edit->setText(QString().sprintf("%06u",cartnum));
|
edit_start_cart2_edit->setText(QString().sprintf("%06u",cartnum));
|
||||||
}
|
}
|
||||||
@ -1154,8 +1151,7 @@ void EditMatrix::startCart2Data()
|
|||||||
void EditMatrix::stopCart2Data()
|
void EditMatrix::stopCart2Data()
|
||||||
{
|
{
|
||||||
int cartnum=edit_stop_cart2_edit->text().toUInt();
|
int cartnum=edit_stop_cart2_edit->text().toUInt();
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
if(cartnum>0) {
|
if(cartnum>0) {
|
||||||
edit_stop_cart2_edit->setText(QString().sprintf("%06u",cartnum));
|
edit_stop_cart2_edit->setText(QString().sprintf("%06u",cartnum));
|
||||||
}
|
}
|
||||||
|
@ -403,8 +403,7 @@ void EditRDLogedit::selectStartData()
|
|||||||
{
|
{
|
||||||
int cartnum=lib_startcart_edit->text().toInt();
|
int cartnum=lib_startcart_edit->text().toInt();
|
||||||
|
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
lib_startcart_edit->setText(QString().sprintf("%d",cartnum));
|
lib_startcart_edit->setText(QString().sprintf("%d",cartnum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -413,8 +412,7 @@ void EditRDLogedit::selectStartData()
|
|||||||
void EditRDLogedit::selectEndData()
|
void EditRDLogedit::selectEndData()
|
||||||
{
|
{
|
||||||
int cartnum=lib_endcart_edit->text().toInt();
|
int cartnum=lib_endcart_edit->text().toInt();
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
lib_endcart_edit->setText(QString().sprintf("%d",cartnum));
|
lib_endcart_edit->setText(QString().sprintf("%d",cartnum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -423,8 +421,7 @@ void EditRDLogedit::selectEndData()
|
|||||||
void EditRDLogedit::selectRecordStartData()
|
void EditRDLogedit::selectRecordStartData()
|
||||||
{
|
{
|
||||||
int cartnum=lib_recstartcart_edit->text().toInt();
|
int cartnum=lib_recstartcart_edit->text().toInt();
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
lib_recstartcart_edit->setText(QString().sprintf("%d",cartnum));
|
lib_recstartcart_edit->setText(QString().sprintf("%d",cartnum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -433,8 +430,7 @@ void EditRDLogedit::selectRecordStartData()
|
|||||||
void EditRDLogedit::selectRecordEndData()
|
void EditRDLogedit::selectRecordEndData()
|
||||||
{
|
{
|
||||||
int cartnum=lib_recendcart_edit->text().toInt();
|
int cartnum=lib_recendcart_edit->text().toInt();
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
lib_recendcart_edit->setText(QString().sprintf("%d",cartnum));
|
lib_recendcart_edit->setText(QString().sprintf("%d",cartnum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -606,8 +606,7 @@ void EditStation::selectClicked()
|
|||||||
{
|
{
|
||||||
int cartnum=station_startup_cart_edit->text().toInt();
|
int cartnum=station_startup_cart_edit->text().toInt();
|
||||||
|
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
station_startup_cart_edit->setText(QString().sprintf("%06d",cartnum));
|
station_startup_cart_edit->setText(QString().sprintf("%06d",cartnum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -628,8 +627,7 @@ void EditStation::heartbeatClickedData()
|
|||||||
{
|
{
|
||||||
int cartnum=station_hbcart_edit->text().toInt();
|
int cartnum=station_hbcart_edit->text().toInt();
|
||||||
|
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
station_hbcart_edit->setText(QString().sprintf("%06d",cartnum));
|
station_hbcart_edit->setText(QString().sprintf("%06d",cartnum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -889,8 +887,7 @@ void EditStation::startCartClickedData()
|
|||||||
{
|
{
|
||||||
int cartnum=station_start_cart_edit->text().toUInt();
|
int cartnum=station_start_cart_edit->text().toUInt();
|
||||||
|
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
station_start_cart_edit->setText(QString().sprintf("%06d",cartnum));
|
station_start_cart_edit->setText(QString().sprintf("%06d",cartnum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -900,8 +897,7 @@ void EditStation::stopCartClickedData()
|
|||||||
{
|
{
|
||||||
int cartnum=station_stop_cart_edit->text().toUInt();
|
int cartnum=station_stop_cart_edit->text().toUInt();
|
||||||
|
|
||||||
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
if(admin_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
station_stop_cart_edit->setText(QString().sprintf("%06d",cartnum));
|
station_stop_cart_edit->setText(QString().sprintf("%06d",cartnum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -328,7 +328,7 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
|||||||
// Cart Picker
|
// Cart Picker
|
||||||
//
|
//
|
||||||
air_cart_dialog=new RDCartDialog(&air_add_filter,&air_add_group,
|
air_cart_dialog=new RDCartDialog(&air_add_filter,&air_add_group,
|
||||||
&air_add_schedcode,"RDAirPlay",false,this);
|
&air_add_schedcode,"RDAirPlay",false,this);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Wall Clock
|
// Wall Clock
|
||||||
@ -2226,8 +2226,8 @@ void MainWidget::SetActionMode(StartButton::Mode mode)
|
|||||||
if(air_panel!=NULL) {
|
if(air_panel!=NULL) {
|
||||||
air_panel->setActionMode(RDAirPlayConf::Normal);
|
air_panel->setActionMode(RDAirPlayConf::Normal);
|
||||||
}
|
}
|
||||||
if(air_cart_dialog->exec(&air_add_cart,RDCart::All,0,0,
|
if(air_cart_dialog->
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
exec(&air_add_cart,RDCart::All,air_log[0]->serviceName(),NULL)==0) {
|
||||||
SetActionMode(StartButton::AddTo);
|
SetActionMode(StartButton::AddTo);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -294,8 +294,7 @@ void EditCartEvent::selectCartData()
|
|||||||
if(edit_cart!=NULL) {
|
if(edit_cart!=NULL) {
|
||||||
cartnum=edit_cart->number();
|
cartnum=edit_cart->number();
|
||||||
}
|
}
|
||||||
switch(catch_cart_dialog->exec(&cartnum,RDCart::Macro,NULL,0,
|
switch(catch_cart_dialog->exec(&cartnum,RDCart::Macro,QString(),NULL)) {
|
||||||
rda->user()->name(),rda->user()->password())) {
|
|
||||||
case 0:
|
case 0:
|
||||||
if(edit_cart!=NULL) {
|
if(edit_cart!=NULL) {
|
||||||
delete edit_cart;
|
delete edit_cart;
|
||||||
|
@ -147,8 +147,7 @@ void EditLogLine::selectCartData()
|
|||||||
if(!ok) {
|
if(!ok) {
|
||||||
cartnum=-1;
|
cartnum=-1;
|
||||||
}
|
}
|
||||||
if(edit_cart_dialog->exec(&cartnum,RDCart::All,&edit_service,1,
|
if(edit_cart_dialog->exec(&cartnum,RDCart::All,edit_service,NULL)==0) {
|
||||||
rda->user()->name(),rda->user()->password())==0) {
|
|
||||||
FillCart(cartnum);
|
FillCart(cartnum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user