Modified rdadmin(1) Edit Service dialog to display built-in traffic and music import template values.

Added "Copy To Custom" buttons to rdadmin(1) Edit Service dialog.
This commit is contained in:
Patrick Linstruth 2020-04-07 15:10:53 -07:00
parent d0c232eef1
commit 90a20c66ef
13 changed files with 174 additions and 9 deletions

View File

@ -19749,3 +19749,7 @@
* Fixed a regression in rdairplay(1) that caused two events to be * Fixed a regression in rdairplay(1) that caused two events to be
started by a single spacebar tap if a SoundPanel event had been started by a single spacebar tap if a SoundPanel event had been
played previously. played previously.
2020-04-07 Patrick Linstruth <patrick@deltecent.com>
* Modified rdadmin(1) Edit Service dialog to display built-in
traffic and music import template values.
* Added "Copy To Custom" buttons to rdadmin(1) Edit Service dialog.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 117 KiB

View File

@ -524,9 +524,12 @@
from one of these systems, all that is necessary is to select the from one of these systems, all that is necessary is to select the
appropriate system in the appropriate system in the
<computeroutput>Import Template</computeroutput> dropdown. If the <computeroutput>Import Template</computeroutput> dropdown. If the
target scheduler system is not on this list, a custom parser can target scheduler system is not on this list, or if your system
requires custom settings, a custom parser can
be defined by selecting <computeroutput>[custom]</computeroutput> be defined by selecting <computeroutput>[custom]</computeroutput>
from the dropdown. from the dropdown.
The <computeroutput>Copy To Custom</computeroutput> button will
copy the selected import template values to the custom parser.
</para> </para>
<para> <para>
Log schedule files for Rivendell are assumed to be in so-called Log schedule files for Rivendell are assumed to be in so-called

View File

@ -311,8 +311,25 @@ void RDSvc::setPreimportCommand(ImportSource src,const QString &path) const
int RDSvc::importOffset(ImportSource src,ImportField field) const int RDSvc::importOffset(ImportSource src,ImportField field) const
{ {
QString fieldname=SourceString(src)+FieldString(field)+"OFFSET"; QString parser_table;
return RDGetSqlValue("SERVICES","NAME",svc_name,fieldname).toInt(); QString parser_name;
QString src_str="";
//
// Set Import Source
//
if(importTemplate(src).isEmpty()) {
src_str=SourceString(src);
parser_table="SERVICES";
parser_name=svc_name;
}
else {
src_str="";
parser_table="IMPORT_TEMPLATES";
parser_name=importTemplate(src);
}
QString fieldname=src_str+FieldString(field)+"OFFSET";
return RDGetSqlValue(parser_table,"NAME",parser_name,fieldname).toInt();
} }
@ -326,8 +343,25 @@ void RDSvc::setImportOffset(ImportSource src,ImportField field,int offset)
int RDSvc::importLength(ImportSource src,ImportField field) const int RDSvc::importLength(ImportSource src,ImportField field) const
{ {
QString fieldname=SourceString(src)+FieldString(field)+"LENGTH"; QString parser_table;
return RDGetSqlValue("SERVICES","NAME",svc_name,fieldname).toInt(); QString parser_name;
QString src_str="";
//
// Set Import Source
//
if(importTemplate(src).isEmpty()) {
src_str=SourceString(src);
parser_table="SERVICES";
parser_name=svc_name;
}
else {
src_str="";
parser_table="IMPORT_TEMPLATES";
parser_name=importTemplate(src);
}
QString fieldname=src_str+FieldString(field)+"LENGTH";
return RDGetSqlValue(parser_table,"NAME",parser_name,fieldname).toInt();
} }

View File

@ -320,6 +320,15 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
button->setText(tr("Test \n&Traffic")); button->setText(tr("Test \n&Traffic"));
connect(button,SIGNAL(clicked()),this,SLOT(trafficData())); connect(button,SIGNAL(clicked()),this,SLOT(trafficData()));
//
// Traffic Copy Button
//
svc_tfc_copy_button=new QPushButton(this);
svc_tfc_copy_button->setGeometry(360,389,60,40);
svc_tfc_copy_button->setFont(buttonFont());
svc_tfc_copy_button->setText(tr("Copy To\nCustom"));
connect(svc_tfc_copy_button,SIGNAL(clicked()),this,SLOT(trafficCopyData()));
// //
// Music Import Section // Music Import Section
// //
@ -417,6 +426,15 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
button->setText(tr("Test \n&Music")); button->setText(tr("Test \n&Music"));
connect(button,SIGNAL(clicked()),this,SLOT(musicData())); connect(button,SIGNAL(clicked()),this,SLOT(musicData()));
//
// Music Copy Button
//
svc_mus_copy_button=new QPushButton(this);
svc_mus_copy_button->setGeometry(795,410,60,40);
svc_mus_copy_button->setFont(buttonFont());
svc_mus_copy_button->setText(tr("Copy To\nCustom"));
connect(svc_mus_copy_button,SIGNAL(clicked()),this,SLOT(musicCopyData()));
// //
// Ok Button // Ok Button
// //
@ -515,10 +533,8 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
setText(svc_svc->breakString()); setText(svc_svc->breakString());
svc_mus_track_edit-> svc_mus_track_edit->
setText(svc_svc->trackString(RDSvc::Music)); setText(svc_svc->trackString(RDSvc::Music));
svc_tfc_fields->setFields(svc_svc,RDSvc::Traffic);
tfcTemplateActivatedData(svc_tfc_import_template_box->currentItem()); tfcTemplateActivatedData(svc_tfc_import_template_box->currentItem());
musTemplateActivatedData(svc_mus_import_template_box->currentItem()); musTemplateActivatedData(svc_mus_import_template_box->currentItem());
svc_mus_fields->setFields(svc_svc,RDSvc::Music);
import_changed=false; import_changed=false;
} }
@ -564,12 +580,30 @@ void EditSvc::trafficData()
} }
void EditSvc::trafficCopyData()
{
svc_svc->setImportTemplate(RDSvc::Traffic,"");
svc_tfc_import_template_box->setCurrentItem(0);
svc_tfc_fields->setEnabled(1);
svc_tfc_copy_button->setEnabled(0);
}
void EditSvc::musicData() void EditSvc::musicData()
{ {
TestDataImport(RDSvc::Music); TestDataImport(RDSvc::Music);
} }
void EditSvc::musicCopyData()
{
svc_svc->setImportTemplate(RDSvc::Music,"");
svc_mus_import_template_box->setCurrentItem(0);
svc_mus_fields->setEnabled(1);
svc_mus_copy_button->setEnabled(0);
}
void EditSvc::textChangedData(const QString &) void EditSvc::textChangedData(const QString &)
{ {
import_changed=true; import_changed=true;
@ -578,15 +612,66 @@ void EditSvc::textChangedData(const QString &)
void EditSvc::tfcTemplateActivatedData(int index) void EditSvc::tfcTemplateActivatedData(int index)
{ {
//
// Save stored template
//
QString t;
t=svc_svc->importTemplate(RDSvc::Traffic);
//
// Temporarily set selected template
//
if(svc_tfc_import_template_box->currentItem()==0) {
svc_svc->setImportTemplate(RDSvc::Traffic,"");
}
else {
svc_svc->setImportTemplate(RDSvc::Traffic,
svc_tfc_import_template_box->currentText());
}
svc_tfc_fields->setFields(svc_svc,RDSvc::Traffic);
svc_tfc_fields->setEnabled(index==0); svc_tfc_fields->setEnabled(index==0);
svc_tfc_copy_button->setEnabled(index!=0);
import_changed=true; import_changed=true;
//
// Restore saved template
//
svc_svc->setImportTemplate(RDSvc::Traffic,t);
} }
void EditSvc::musTemplateActivatedData(int index) void EditSvc::musTemplateActivatedData(int index)
{ {
//
// Save stored template
//
QString t;
t=svc_svc->importTemplate(RDSvc::Music);
//
// Temporarily set selected template
//
if(svc_mus_import_template_box->currentItem()==0) {
svc_svc->setImportTemplate(RDSvc::Music,"");
}
else {
svc_svc->setImportTemplate(RDSvc::Music,
svc_mus_import_template_box->currentText());
}
svc_mus_fields->setFields(svc_svc,RDSvc::Music);
svc_mus_fields->setEnabled(index==0); svc_mus_fields->setEnabled(index==0);
svc_mus_copy_button->setEnabled(index!=0);
import_changed=true; import_changed=true;
//
// Restore saved template
//
svc_svc->setImportTemplate(RDSvc::Music,t);
} }
@ -653,6 +738,7 @@ void EditSvc::Save()
setPreimportCommand(RDSvc::Traffic,svc_tfc_preimport_cmd_edit->text()); setPreimportCommand(RDSvc::Traffic,svc_tfc_preimport_cmd_edit->text());
if(svc_tfc_import_template_box->currentItem()==0) { if(svc_tfc_import_template_box->currentItem()==0) {
svc_svc->setImportTemplate(RDSvc::Traffic,""); svc_svc->setImportTemplate(RDSvc::Traffic,"");
svc_tfc_fields->readFields(svc_svc,RDSvc::Traffic);
} }
else { else {
svc_svc->setImportTemplate(RDSvc::Traffic, svc_svc->setImportTemplate(RDSvc::Traffic,
@ -660,11 +746,11 @@ void EditSvc::Save()
} }
svc_svc->setLabelCart(RDSvc::Traffic,svc_tfc_label_cart_edit->text()); svc_svc->setLabelCart(RDSvc::Traffic,svc_tfc_label_cart_edit->text());
svc_svc->setTrackString(RDSvc::Traffic,svc_tfc_track_edit->text()); svc_svc->setTrackString(RDSvc::Traffic,svc_tfc_track_edit->text());
svc_tfc_fields->readFields(svc_svc,RDSvc::Traffic);
svc_svc->setImportPath(RDSvc::Music,svc_mus_path_edit->text()); svc_svc->setImportPath(RDSvc::Music,svc_mus_path_edit->text());
svc_svc->setPreimportCommand(RDSvc::Music,svc_mus_preimport_cmd_edit->text()); svc_svc->setPreimportCommand(RDSvc::Music,svc_mus_preimport_cmd_edit->text());
if(svc_mus_import_template_box->currentItem()==0) { if(svc_mus_import_template_box->currentItem()==0) {
svc_svc->setImportTemplate(RDSvc::Music,""); svc_svc->setImportTemplate(RDSvc::Music,"");
svc_mus_fields->readFields(svc_svc,RDSvc::Music);
} }
else { else {
svc_svc->setImportTemplate(RDSvc::Music, svc_svc->setImportTemplate(RDSvc::Music,
@ -673,7 +759,6 @@ void EditSvc::Save()
svc_svc->setBreakString(svc_mus_break_edit->text()); svc_svc->setBreakString(svc_mus_break_edit->text());
svc_svc->setTrackString(RDSvc::Music,svc_mus_track_edit->text()); svc_svc->setTrackString(RDSvc::Music,svc_mus_track_edit->text());
svc_svc->setLabelCart(RDSvc::Music,svc_mus_label_cart_edit->text()); svc_svc->setLabelCart(RDSvc::Music,svc_mus_label_cart_edit->text());
svc_mus_fields->readFields(svc_svc,RDSvc::Music);
import_changed=false; import_changed=false;
if(svc_voice_group_box->currentItem()==0) { if(svc_voice_group_box->currentItem()==0) {
svc_svc->setTrackGroup(""); svc_svc->setTrackGroup("");

View File

@ -45,7 +45,9 @@ class EditSvc : public RDDialog
void autofillData(); void autofillData();
void enableHostsData(); void enableHostsData();
void trafficData(); void trafficData();
void trafficCopyData();
void musicData(); void musicData();
void musicCopyData();
void textChangedData(const QString &); void textChangedData(const QString &);
void tfcTemplateActivatedData(int index); void tfcTemplateActivatedData(int index);
void musTemplateActivatedData(int index); void musTemplateActivatedData(int index);
@ -85,6 +87,8 @@ class EditSvc : public RDDialog
QCheckBox *svc_shelflife_box; QCheckBox *svc_shelflife_box;
QSpinBox *svc_shelflife_spin; QSpinBox *svc_shelflife_spin;
QCheckBox *svc_import_markers_check; QCheckBox *svc_import_markers_check;
QPushButton *svc_tfc_copy_button;
QPushButton *svc_mus_copy_button;
bool import_changed; bool import_changed;
}; };

View File

@ -4179,6 +4179,11 @@ uloženo. Uložit nyní?</translation>
<source>Include Import Markers in Finished Logs</source> <source>Include Import Markers in Finished Logs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Copy To
Custom</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditSvcPerms</name> <name>EditSvcPerms</name>

View File

@ -4052,6 +4052,11 @@ gespeichert werden. Jetzt speichern?</translation>
<source>Include Import Markers in Finished Logs</source> <source>Include Import Markers in Finished Logs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Copy To
Custom</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditSvcPerms</name> <name>EditSvcPerms</name>

View File

@ -4136,6 +4136,11 @@ debe guardarse. ¿Hacerlo ahora?</translation>
<source>Include Import Markers in Finished Logs</source> <source>Include Import Markers in Finished Logs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Copy To
Custom</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditSvcPerms</name> <name>EditSvcPerms</name>

View File

@ -3342,6 +3342,11 @@ must be saved. Save now?</source>
<source>Include Import Markers in Finished Logs</source> <source>Include Import Markers in Finished Logs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Copy To
Custom</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditSvcPerms</name> <name>EditSvcPerms</name>

View File

@ -3953,6 +3953,11 @@ Lagre no?</translation>
<source>Include Import Markers in Finished Logs</source> <source>Include Import Markers in Finished Logs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Copy To
Custom</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditSvcPerms</name> <name>EditSvcPerms</name>

View File

@ -3953,6 +3953,11 @@ Lagre no?</translation>
<source>Include Import Markers in Finished Logs</source> <source>Include Import Markers in Finished Logs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Copy To
Custom</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditSvcPerms</name> <name>EditSvcPerms</name>

View File

@ -4032,6 +4032,11 @@ deve ser salva. Salvar Agora?</translation>
<source>Include Import Markers in Finished Logs</source> <source>Include Import Markers in Finished Logs</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Copy To
Custom</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditSvcPerms</name> <name>EditSvcPerms</name>