From 52d1d8be52f3c5b0f1225fa4cf7930aae3d63324 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Sun, 15 Oct 2017 10:40:29 -0400 Subject: [PATCH] 2017-10-15 Fred Gleason * Added a 'STATIONS.SHORT_NAME' field to the database. * Incremented the database version to 270. * Added 'RDStation::shortName()' and 'RDStation::setShortName()' methods. * Removed the 'Broadcast Security Model' control from the 'Edit Host' dialog. * Added a 'Short Name' control to the 'Edit Host' dialog. * Implemented a '%R' wildcard for Rivendell Host Short Name. --- ChangeLog | 9 + docs/datetime_wildcards.txt | 2 +- docs/tables/stations.txt | 1 + lib/dbversion.h | 2 +- lib/export_bmiemr.cpp | 12 +- lib/export_cutlog.cpp | 12 +- lib/export_deltaflex.cpp | 12 +- lib/export_musicclassical.cpp | 11 +- lib/export_musicplayout.cpp | 11 +- lib/export_musicsummary.cpp | 11 +- lib/export_nprsoundex.cpp | 11 +- lib/export_radiotraffic.cpp | 11 +- lib/export_soundex.cpp | 13 +- lib/export_spincount.cpp | 14 +- lib/export_technical.cpp | 12 +- lib/export_textlog.cpp | 13 +- lib/rddatedecode.cpp | 15 +- lib/rddatedecode.h | 8 +- lib/rdreport.cpp | 60 ++-- lib/rdreport.h | 51 ++-- lib/rdstation.cpp | 14 + lib/rdstation.h | 2 + lib/rdsvc.cpp | 15 +- lib/rdsvc.h | 4 +- rdadmin/add_svc.cpp | 2 +- rdadmin/createdb.cpp | 35 ++- rdadmin/edit_report.cpp | 2 +- rdadmin/edit_station.cpp | 464 ++++++++++++++++------------- rdadmin/edit_station.h | 45 ++- rdadmin/edit_svc.cpp | 2 +- rdadmin/list_svcs.cpp | 2 +- rdadmin/rdadmin_cs.ts | 10 +- rdadmin/rdadmin_de.ts | 10 +- rdadmin/rdadmin_es.ts | 10 +- rdadmin/rdadmin_fr.ts | 16 +- rdadmin/rdadmin_nb.ts | 16 +- rdadmin/rdadmin_nn.ts | 16 +- rdadmin/rdadmin_pt_BR.ts | 10 +- rdadmin/test_import.cpp | 2 +- rdairplay/rdairplay.cpp | 6 +- rdairplay/rlmhost.cpp | 6 +- rdcatchd/batch.cpp | 2 +- rdcatchd/catch_event.cpp | 9 +- rdcatchd/catch_event.h | 4 +- rdcatchd/local_macros.cpp | 2 +- rdcatchd/rdcatchd.cpp | 8 +- rdcatchd/rdcatchd.h | 2 +- rdlogedit/voice_tracker.cpp | 2 +- rdlogmanager/commandline_ops.cpp | 11 +- rdlogmanager/generate_log.cpp | 30 +- rdlogmanager/pick_report_dates.cpp | 6 +- tests/datedecode_test.cpp | 19 +- utils/rdclilogedit/operations.cpp | 2 +- utils/rddgimport/rddgimport.cpp | 5 +- utils/rdrevert/rdrevert.cpp | 19 +- utils/rdrevert/rdrevert.h | 1 + web/rdxport/logs.cpp | 2 +- web/rdxport/services.cpp | 2 +- 58 files changed, 600 insertions(+), 506 deletions(-) diff --git a/ChangeLog b/ChangeLog index a481e3e4..b08b2d32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16132,3 +16132,12 @@ 2017-10-14 Fred Gleason * Fixed a bug in RDStation that caused matrix parameters to fail to be copied as part of the profile of a new host. +2017-10-15 Fred Gleason + * Added a 'STATIONS.SHORT_NAME' field to the database. + * Incremented the database version to 270. + * Added 'RDStation::shortName()' and 'RDStation::setShortName()' + methods. + * Removed the 'Broadcast Security Model' control from the 'Edit + Host' dialog. + * Added a 'Short Name' control to the 'Edit Host' dialog. + * Implemented a '%R' wildcard for Rivendell Host Short Name. diff --git a/docs/datetime_wildcards.txt b/docs/datetime_wildcards.txt index d24a9edb..d145a84c 100644 --- a/docs/datetime_wildcards.txt +++ b/docs/datetime_wildcards.txt @@ -85,7 +85,7 @@ where: r -- Rivendell Host Name [not FQDN] - R -- [unassigned] + R -- Rivendell Host Short Name s -- Service Name diff --git a/docs/tables/stations.txt b/docs/tables/stations.txt index e4195475..17c75ec2 100644 --- a/docs/tables/stations.txt +++ b/docs/tables/stations.txt @@ -6,6 +6,7 @@ Following is the layout of a record in the SERVICES table: FIELD NAME TYPE REMARKS --------------------------------------------------------------- NAME char(64) Primary Key +SHORT_NAME char(64) DESCRIPTION char(64) Indexed USER_NAME char(255) Current User DEFAULT_NAME char(255) Default User diff --git a/lib/dbversion.h b/lib/dbversion.h index 5177fb43..b5b7492d 100644 --- a/lib/dbversion.h +++ b/lib/dbversion.h @@ -24,7 +24,7 @@ /* * Current Database Version */ -#define RD_VERSION_DATABASE 269 +#define RD_VERSION_DATABASE 270 #endif // DBVERSION_H diff --git a/lib/export_bmiemr.cpp b/lib/export_bmiemr.cpp index 095cd39a..a1b3f021 100644 --- a/lib/export_bmiemr.cpp +++ b/lib/export_bmiemr.cpp @@ -25,8 +25,8 @@ #include -bool RDReport::ExportBmiEmr(const QDate &startdate,const QDate &enddate, - const QString &mixtable) +bool RDReport::ExportBmiEmr(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable) { QString sql; RDSqlQuery *q; @@ -38,14 +38,6 @@ bool RDReport::ExportBmiEmr(const QDate &startdate,const QDate &enddate, QString usage_code; QString station_format=stationFormat(); -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); -#endif - // // Station Type // diff --git a/lib/export_cutlog.cpp b/lib/export_cutlog.cpp index 65acb8a6..d636180f 100644 --- a/lib/export_cutlog.cpp +++ b/lib/export_cutlog.cpp @@ -29,8 +29,8 @@ #include #include -bool RDReport::ExportCutLog(const QDate &startdate,const QDate &enddate, - const QString &mixtable) +bool RDReport::ExportCutLog(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable) { QString sql; RDSqlQuery *q; @@ -40,14 +40,6 @@ bool RDReport::ExportCutLog(const QDate &startdate,const QDate &enddate, QString cart_fmt; QString cart_num; -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); -#endif - QFile file(filename); if((f=fopen((const char *)filename,"w"))==NULL) { report_error_code=RDReport::ErrorCantOpen; diff --git a/lib/export_deltaflex.cpp b/lib/export_deltaflex.cpp index bfe549fb..a81767c3 100644 --- a/lib/export_deltaflex.cpp +++ b/lib/export_deltaflex.cpp @@ -34,22 +34,14 @@ #include -bool RDReport::ExportDeltaflex(const QDate &startdate,const QDate &enddate, - const QString &mixtable) +bool RDReport::ExportDeltaflex(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable) { QString sql; RDSqlQuery *q; FILE *f; QString air_fmt; -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); -#endif - QFile file(filename); if((f=fopen((const char *)filename,"wb"))==NULL) { report_error_code=RDReport::ErrorCantOpen; diff --git a/lib/export_musicclassical.cpp b/lib/export_musicclassical.cpp index e07a1ee6..e500449c 100644 --- a/lib/export_musicclassical.cpp +++ b/lib/export_musicclassical.cpp @@ -29,7 +29,8 @@ #include #include -bool RDReport::ExportMusicClassical(const QDate &startdate,const QDate &enddate, +bool RDReport::ExportMusicClassical(const QString &filename, + const QDate &startdate,const QDate &enddate, const QString &mixtable) { QString sql; @@ -40,14 +41,6 @@ bool RDReport::ExportMusicClassical(const QDate &startdate,const QDate &enddate, QString cart_fmt; QString cart_num; -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); -#endif - QFile file(filename); if((f=fopen((const char *)filename,"w"))==NULL) { report_error_code=RDReport::ErrorCantOpen; diff --git a/lib/export_musicplayout.cpp b/lib/export_musicplayout.cpp index 1b1817ed..6af931e8 100644 --- a/lib/export_musicplayout.cpp +++ b/lib/export_musicplayout.cpp @@ -29,7 +29,8 @@ #include #include -bool RDReport::ExportMusicPlayout(const QDate &startdate,const QDate &enddate, +bool RDReport::ExportMusicPlayout(const QString &filename, + const QDate &startdate,const QDate &enddate, const QString &mixtable) { QString sql; @@ -40,14 +41,6 @@ bool RDReport::ExportMusicPlayout(const QDate &startdate,const QDate &enddate, QString cart_fmt; QString cart_num; -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); -#endif - QFile file(filename); if((f=fopen((const char *)filename,"w"))==NULL) { report_error_code=RDReport::ErrorCantOpen; diff --git a/lib/export_musicsummary.cpp b/lib/export_musicsummary.cpp index a31da4da..8e6dd599 100644 --- a/lib/export_musicsummary.cpp +++ b/lib/export_musicsummary.cpp @@ -30,7 +30,8 @@ #include -bool RDReport::ExportMusicSummary(const QDate &startdate,const QDate &enddate, +bool RDReport::ExportMusicSummary(const QString &filename, + const QDate &startdate,const QDate &enddate, const QString &mixtable) { QString sql; @@ -39,14 +40,6 @@ bool RDReport::ExportMusicSummary(const QDate &startdate,const QDate &enddate, QString cut; QString str; -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); -#endif - QFile file(filename); if((f=fopen((const char *)filename,"w"))==NULL) { report_error_code=RDReport::ErrorCantOpen; diff --git a/lib/export_nprsoundex.cpp b/lib/export_nprsoundex.cpp index b736ba16..cb5e3eb4 100644 --- a/lib/export_nprsoundex.cpp +++ b/lib/export_nprsoundex.cpp @@ -36,8 +36,8 @@ // for more information. // -bool RDReport::ExportNprSoundEx(const QDate &startdate,const QDate &enddate, - const QString &mixtable) +bool RDReport::ExportNprSoundEx(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable) { QString sql; RDSqlQuery *q; @@ -50,13 +50,6 @@ bool RDReport::ExportNprSoundEx(const QDate &startdate,const QDate &enddate, QString trans_category=stationFormat(); QString channel_name=stationId(); -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); -#endif if((f=fopen(filename,"wb"))==NULL) { report_error_code=RDReport::ErrorCantOpen; return false; diff --git a/lib/export_radiotraffic.cpp b/lib/export_radiotraffic.cpp index fbb848bd..5fcca1b8 100644 --- a/lib/export_radiotraffic.cpp +++ b/lib/export_radiotraffic.cpp @@ -29,7 +29,8 @@ #include -bool RDReport::ExportRadioTraffic(const QDate &startdate,const QDate &enddate, +bool RDReport::ExportRadioTraffic(const QString &filename, + const QDate &startdate,const QDate &enddate, const QString &mixtable) { QString sql; @@ -37,14 +38,6 @@ bool RDReport::ExportRadioTraffic(const QDate &startdate,const QDate &enddate, FILE *f; QString air_fmt; -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); -#endif - QFile file(filename); if((f=fopen((const char *)filename,"wb"))==NULL) { report_error_code=RDReport::ErrorCantOpen; diff --git a/lib/export_soundex.cpp b/lib/export_soundex.cpp index 461ebe76..23bd63a0 100644 --- a/lib/export_soundex.cpp +++ b/lib/export_soundex.cpp @@ -29,9 +29,8 @@ #include #include - -bool RDReport::ExportSoundEx(const QDate &startdate,const QDate &enddate, - const QString &mixtable) +bool RDReport::ExportSoundEx(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable) { QString sql; RDSqlQuery *q; @@ -47,14 +46,6 @@ bool RDReport::ExportSoundEx(const QDate &startdate,const QDate &enddate, QString trans_category=stationFormat(); QString channel_name=stationId(); -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); -#endif - // // Get ATH Value // diff --git a/lib/export_spincount.cpp b/lib/export_spincount.cpp index 433a589e..c396175f 100644 --- a/lib/export_spincount.cpp +++ b/lib/export_spincount.cpp @@ -31,9 +31,8 @@ #include #include - -bool RDReport::ExportSpinCount(const QDate &startdate,const QDate &enddate, - const QString &mixtable) +bool RDReport::ExportSpinCount(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable) { QString sql; RDSqlQuery *q; @@ -48,15 +47,6 @@ bool RDReport::ExportSpinCount(const QDate &startdate,const QDate &enddate, std::map labels; std::map albums; - -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); -#endif - QFile file(filename); if((f=fopen((const char *)filename,"w"))==NULL) { report_error_code=RDReport::ErrorCantOpen; diff --git a/lib/export_technical.cpp b/lib/export_technical.cpp index c6dcef08..c1ac4a24 100644 --- a/lib/export_technical.cpp +++ b/lib/export_technical.cpp @@ -29,9 +29,8 @@ #include #include - -bool RDReport::ExportTechnical(const QDate &startdate,const QDate &enddate, - bool incl_hdr,bool incl_crs, +bool RDReport::ExportTechnical(const QString &filename,const QDate &startdate, + const QDate &enddate,bool incl_hdr,bool incl_crs, const QString &mixtable) { QString sql; @@ -43,16 +42,9 @@ bool RDReport::ExportTechnical(const QDate &startdate,const QDate &enddate, QString cart_num; char eol[3]="\n"; -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); if(incl_crs) { strcpy(eol,"\r\n"); } -#endif QFile file(filename); if((f=fopen((const char *)filename,"w"))==NULL) { diff --git a/lib/export_textlog.cpp b/lib/export_textlog.cpp index 43792b91..29f53381 100644 --- a/lib/export_textlog.cpp +++ b/lib/export_textlog.cpp @@ -29,9 +29,8 @@ #include #include - -bool RDReport::ExportTextLog(const QDate &startdate,const QDate &enddate, - const QString &mixtable) +bool RDReport::ExportTextLog(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable) { QString sql; RDSqlQuery *q; @@ -41,14 +40,6 @@ bool RDReport::ExportTextLog(const QDate &startdate,const QDate &enddate, QString cart_fmt; QString cart_num; -#ifdef WIN32 - QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, - report_config,serviceName()); -#else - QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, - report_config,serviceName()); -#endif - QFile file(filename); if((f=fopen((const char *)filename,"w"))==NULL) { report_error_code=RDReport::ErrorCantOpen; diff --git a/lib/rddatedecode.cpp b/lib/rddatedecode.cpp index e53f056f..9015bf51 100644 --- a/lib/rddatedecode.cpp +++ b/lib/rddatedecode.cpp @@ -22,8 +22,8 @@ #include -QString RDDateDecode(QString str,const QDate &date,RDConfig *config, - const QString &svcname) +QString RDDateDecode(QString str,const QDate &date,RDStation *station, + RDConfig *config,const QString &svcname) { QString string; int yearnum; @@ -122,6 +122,10 @@ QString RDDateDecode(QString str,const QDate &date,RDConfig *config, field=config->stationName(); break; + case 'R': // Rivendell Host Short Name + field=station->shortName(); + break; + case 's': // Service name if(!svcname.isEmpty()) { field=svcname; @@ -176,7 +180,8 @@ QString RDDateDecode(QString str,const QDate &date,RDConfig *config, QString RDDateTimeDecode(QString str,const QDateTime &datetime, - RDConfig *config,const QString &svcname) + RDStation *station,RDConfig *config, + const QString &svcname) { QString string; int yearnum; @@ -303,6 +308,10 @@ QString RDDateTimeDecode(QString str,const QDateTime &datetime, field=config->stationName(); break; + case 'R': // Rivendell Host Short Name + field=station->shortName(); + break; + case 'S': // Second (SS) field=QString().sprintf("%02d",datetime.time().second()); break; diff --git a/lib/rddatedecode.h b/lib/rddatedecode.h index f76e7977..067e15e8 100644 --- a/lib/rddatedecode.h +++ b/lib/rddatedecode.h @@ -23,12 +23,14 @@ #include +#include #include -QString RDDateDecode(QString str,const QDate &date,RDConfig *config, - const QString &svcname=""); +QString RDDateDecode(QString str,const QDate &date,RDStation *station, + RDConfig *config,const QString &svcname=""); QString RDDateTimeDecode(QString str,const QDateTime &datetime, - RDConfig *config,const QString &svcname=""); + RDStation *station,RDConfig *config, + const QString &svcname=""); #endif // RDDATEDECODE diff --git a/lib/rdreport.cpp b/lib/rdreport.cpp index e6836f3d..1c803d90 100644 --- a/lib/rdreport.cpp +++ b/lib/rdreport.cpp @@ -32,9 +32,11 @@ #include #include -RDReport::RDReport(const QString &rptname,RDConfig *config,QObject *parent) +RDReport::RDReport(const QString &rptname,RDStation *station,RDConfig *config, + QObject *parent) { report_name=rptname; + report_station=station; report_config=config; report_error_code=RDReport::ErrorOk; } @@ -312,11 +314,11 @@ bool RDReport::outputExists(const QDate &startdate) { QString out_path; #ifdef WIN32 - out_path=RDDateDecode(exportPath(RDReport::Windows),startdate,report_config, - serviceName()); + out_path=RDDateDecode(exportPath(RDReport::Windows),startdate,report_station, + report_config,serviceName()); #else - out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_config, - serviceName()); + out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_station, + report_config,serviceName()); #endif return QFile::exists(out_path); } @@ -451,7 +453,7 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate, (const char *)name()); q=new RDSqlQuery(sql); while(q->next()) { - svc=new RDSvc(q->value(0).toString(),report_config); + svc=new RDSvc(q->value(0).toString(),report_station,report_config); if(svc->exists()) { rec_name=q->value(0).toString(); rec_name.replace(" ","_"); @@ -602,71 +604,79 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate, delete q; bool ret=false; +#ifdef WIN32 + QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate, + report_station,report_config,serviceName()); +#else + QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate, + report_station,report_config,serviceName()); +#endif + switch(filter()) { case RDReport::CbsiDeltaFlex: - ret=ExportDeltaflex(startdate,enddate,mixname); + ret=ExportDeltaflex(filename,startdate,enddate,mixname); break; case RDReport::TextLog: - ret=ExportTextLog(startdate,enddate,mixname); + ret=ExportTextLog(filename,startdate,enddate,mixname); break; case RDReport::BmiEmr: - ret=ExportBmiEmr(startdate,enddate,mixname); + ret=ExportBmiEmr(filename,startdate,enddate,mixname); break; case RDReport::NaturalLog: case RDReport::Technical: - ret=ExportTechnical(startdate,enddate,true,false,mixname); + ret=ExportTechnical(filename,startdate,enddate,true,false,mixname); break; case RDReport::SoundExchange: - ret=ExportSoundEx(startdate,enddate,mixname); + ret=ExportSoundEx(filename,startdate,enddate,mixname); break; case RDReport::NprSoundExchange: - ret=ExportNprSoundEx(startdate,enddate,mixname); + ret=ExportNprSoundEx(filename,startdate,enddate,mixname); break; case RDReport::RadioTraffic: - ret=ExportRadioTraffic(startdate,enddate,mixname); + ret=ExportRadioTraffic(filename,startdate,enddate,mixname); break; case RDReport::VisualTraffic: - ret=ExportDeltaflex(startdate,enddate,mixname); + ret=ExportDeltaflex(filename,startdate,enddate,mixname); break; case RDReport::CounterPoint: case RDReport::WideOrbit: - ret=ExportRadioTraffic(startdate,enddate,mixname); + ret=ExportRadioTraffic(filename,startdate,enddate,mixname); break; case RDReport::Music1: - ret=ExportRadioTraffic(startdate,enddate,mixname); + ret=ExportRadioTraffic(filename,startdate,enddate,mixname); break; case RDReport::MusicClassical: - ret=ExportMusicClassical(startdate,enddate,mixname); + ret=ExportMusicClassical(filename,startdate,enddate,mixname); break; case RDReport::MusicPlayout: - ret=ExportMusicPlayout(startdate,enddate,mixname); + ret=ExportMusicPlayout(filename,startdate,enddate,mixname); break; case RDReport::SpinCount: - ret=ExportSpinCount(startdate,enddate,mixname); + ret=ExportSpinCount(filename,startdate,enddate,mixname); break; case RDReport::MusicSummary: - ret=ExportMusicSummary(startdate,enddate,mixname); + ret=ExportMusicSummary(filename,startdate,enddate,mixname); break; case RDReport::MrMaster: - ret=ExportTechnical(startdate,enddate,false,true,mixname); + ret=ExportTechnical(filename,startdate,enddate,false,true,mixname); break; case RDReport::CutLog: - ret=ExportCutLog(startdate,enddate,mixname); + ret=ExportCutLog(filename,startdate,enddate,mixname); break; default: @@ -678,10 +688,10 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate, QString post_cmd=RDDateDecode(postExportCommand(RDReport::Windows),startdate, report_config,serviceName()); #else - *out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_config, - serviceName()); + *out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_station, + report_config,serviceName()); QString post_cmd=RDDateDecode(postExportCommand(RDReport::Linux),startdate, - report_config,serviceName()); + report_station,report_config,serviceName()); #endif system(post_cmd); // printf("MIXDOWN TABLE: %s_SRT\n",(const char *)mixname); diff --git a/lib/rdreport.h b/lib/rdreport.h index 68c87c20..63390cf1 100644 --- a/lib/rdreport.h +++ b/lib/rdreport.h @@ -42,7 +42,8 @@ class RDReport enum ExportType {Generic=0,Traffic=1,Music=2}; enum StationType {TypeOther=0,TypeAm=1,TypeFm=2,TypeLast=3}; enum ErrorCode {ErrorOk=0,ErrorCanceled=1,ErrorCantOpen=2}; - RDReport(const QString &rptname,RDConfig *config,QObject *parent=0); + RDReport(const QString &rptname,RDStation *station,RDConfig *config, + QObject *parent=0); QString name() const; bool exists() const; QString description() const; @@ -94,30 +95,31 @@ class RDReport static QString errorText(RDReport::ErrorCode code); private: - bool ExportDeltaflex(const QDate &startdate,const QDate &enddate, + bool ExportDeltaflex(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable); + bool ExportTextLog(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable); + bool ExportBmiEmr(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable); + bool ExportTechnical(const QString &filename,const QDate &startdate, + const QDate &enddate,bool incl_hdr,bool incl_crs, const QString &mixtable); - bool ExportTextLog(const QDate &startdate,const QDate &enddate, - const QString &mixtable); - bool ExportBmiEmr(const QDate &startdate,const QDate &enddate, - const QString &mixtable); - bool ExportTechnical(const QDate &startdate,const QDate &enddate, - bool incl_hdr,bool incl_crs,const QString &mixtable); - bool ExportSoundEx(const QDate &startdate,const QDate &enddate, - const QString &mixtable); - bool ExportNprSoundEx(const QDate &startdate,const QDate &enddate, - const QString &mixtable); - bool ExportRadioTraffic(const QDate &startdate,const QDate &enddate, - const QString &mixtable); - bool ExportMusicClassical(const QDate &startdate,const QDate &enddate, - const QString &mixtable); - bool ExportMusicPlayout(const QDate &startdate,const QDate &enddate, - const QString &mixtable); - bool ExportMusicSummary(const QDate &startdate,const QDate &enddate, - const QString &mixtable); - bool ExportSpinCount(const QDate &startdate,const QDate &enddate, - const QString &mixtable); - bool ExportCutLog(const QDate &startdate,const QDate &enddate, - const QString &mixtable); + bool ExportSoundEx(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable); + bool ExportNprSoundEx(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable); + bool ExportRadioTraffic(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable); + bool ExportMusicClassical(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable); + bool ExportMusicPlayout(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable); + bool ExportMusicSummary(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable); + bool ExportSpinCount(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable); + bool ExportCutLog(const QString &filename,const QDate &startdate, + const QDate &enddate,const QString &mixtable); QString StringField(const QString &str,const QString &null_text="") const; void SetRow(const QString ¶m,const QString &value) const; void SetRow(const QString ¶m,int value) const; @@ -128,6 +130,7 @@ class RDReport QString OsFieldName(ExportOs os) const; QString TypeFieldName(ExportType type,bool forced) const; QString report_name; + RDStation *report_station; RDConfig *report_config; RDReport::ErrorCode report_error_code; }; diff --git a/lib/rdstation.cpp b/lib/rdstation.cpp index 939592de..98136021 100644 --- a/lib/rdstation.cpp +++ b/lib/rdstation.cpp @@ -56,6 +56,18 @@ QString RDStation::name() const } +QString RDStation::shortName() const +{ + return RDGetSqlValue("STATIONS","NAME",station_name,"SHORT_NAME").toString(); +} + + +void RDStation::setShortName(const QString &str) const +{ + SetRow("SHORT_NAME",str); +} + + QString RDStation::description() const { return RDGetSqlValue("STATIONS","NAME",station_name,"DESCRIPTION").toString(); @@ -678,6 +690,7 @@ bool RDStation::create(const QString &name,QString *err_msg, if(exemplar.isEmpty()) { // Create Blank Host Config sql=QString("insert into STATIONS set ")+ "NAME=\""+RDEscapeString(name)+"\","+ + "SHORT_NAME=\""+RDEscapeString(name)+"\","+ "IPV4_ADDRESS=\""+RDEscapeString(addr.toString())+"\","+ "DESCRIPTION=\"Workstation "+RDEscapeString(name)+"\","+ "USER_NAME=\"user\","+ @@ -774,6 +787,7 @@ bool RDStation::create(const QString &name,QString *err_msg, if(q->first()) { sql=QString("insert into STATIONS set ")+ "NAME=\""+RDEscapeString(name)+"\","+ + "SHORT_NAME=\""+RDEscapeString(name)+"\","+ "IPV4_ADDRESS=\""+RDEscapeString(addr.toString())+"\","+ "DESCRIPTION=\""+RDEscapeString("Workstation "+name)+"\","+ "USER_NAME=\""+RDEscapeString(q->value(0).toString())+"\","+ diff --git a/lib/rdstation.h b/lib/rdstation.h index 57d8adc8..5c17f757 100644 --- a/lib/rdstation.h +++ b/lib/rdstation.h @@ -46,6 +46,8 @@ class RDStation ~RDStation(); QString name() const; bool exists() const; + QString shortName() const; + void setShortName(const QString &str) const; QString description() const; void setDescription(QString path) const; QString userName() const; diff --git a/lib/rdsvc.cpp b/lib/rdsvc.cpp index 6400f38e..ce5032e5 100644 --- a/lib/rdsvc.cpp +++ b/lib/rdsvc.cpp @@ -34,10 +34,11 @@ // // Global Classes // -RDSvc::RDSvc(QString svcname,RDConfig *config,QObject *parent) +RDSvc::RDSvc(QString svcname,RDStation *station,RDConfig *config,QObject *parent) : QObject(parent) { svc_name=svcname; + svc_station=station; svc_config=config; } @@ -338,7 +339,8 @@ QString RDSvc::importFilename(ImportSource src,const QDate &date) const QString ret; RDSqlQuery *q=new RDSqlQuery(sql); if(q->first()) { - ret=RDDateDecode(q->value(0).toString(),date,svc_config,svc_name); + ret=RDDateDecode(q->value(0).toString(),date,svc_station,svc_config, + svc_name); } delete q; return ret; @@ -418,7 +420,8 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str, // // Open Source File // - if((infile=fopen(RDDateDecode(infilename,date,svc_config,svc_name),"r"))== + if((infile= + fopen(RDDateDecode(infilename,date,svc_station,svc_config,svc_name),"r"))== NULL) { return false; } @@ -427,7 +430,7 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str, // Run Preimport Command // if(!preimport_cmd.isEmpty()) { - system(RDDateDecode(preimport_cmd,date,svc_config,svc_name)); + system(RDDateDecode(preimport_cmd,date,svc_station,svc_config,svc_name)); } QString parser_table; @@ -735,7 +738,7 @@ bool RDSvc::generateLog(const QDate &date,const QString &logname, MODIFIED_DATETIME=now(),START_DATE=null,\ END_DATE=null,NEXT_ID=0", (const char *)RDEscapeString(svc_name), - (const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date,svc_config,svc_name)), + (const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date,svc_station,svc_config,svc_name)), "RDLogManager"); if(!purge_date.isValid()) { sql+=(",PURGE_DATE=\""+purge_date.toString("yyyy-MM-dd")+"\""); @@ -757,7 +760,7 @@ bool RDSvc::generateLog(const QDate &date,const QString &logname, PURGE_DATE=%s", (const char *)RDEscapeString(logname), (const char *)RDEscapeString(svc_name), - (const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date,svc_config,svc_name)), + (const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date,svc_station,svc_config,svc_name)), "RDLogManager", (const char *)RDCheckDateTime(purge_date,"yyyy-MM-dd")); q=new RDSqlQuery(sql); diff --git a/lib/rdsvc.h b/lib/rdsvc.h index fcd6ad24..c616709d 100644 --- a/lib/rdsvc.h +++ b/lib/rdsvc.h @@ -26,6 +26,7 @@ #include #include +#include #include class RDSvc : public QObject @@ -37,7 +38,7 @@ class RDSvc : public QObject enum ImportField {CartNumber=0,ExtData=3,ExtEventId=4,ExtAnncType=5, Title=6,StartHours=7,StartMinutes=8,StartSeconds=9, LengthHours=10,LengthMinutes=11,LengthSeconds=12}; - RDSvc(QString svcname,RDConfig *config,QObject *parent=0); + RDSvc(QString svcname,RDStation *station,RDConfig *config,QObject *parent=0); QString name() const; bool exists() const; QString description() const; @@ -111,6 +112,7 @@ class RDSvc : public QObject QString *label_cart,QString *track_cart); bool CheckId(std::vector *v,int value); QString svc_name; + RDStation *svc_station; RDConfig *svc_config; }; diff --git a/rdadmin/add_svc.cpp b/rdadmin/add_svc.cpp index 2fe12e53..95b3d1c0 100644 --- a/rdadmin/add_svc.cpp +++ b/rdadmin/add_svc.cpp @@ -147,7 +147,7 @@ void AddSvc::okData() return; } - RDSvc *svc=new RDSvc(svc_name_edit->text(),admin_config,this); + RDSvc *svc=new RDSvc(svc_name_edit->text(),admin_station,admin_config,this); if(svc->exists()) { QMessageBox::warning(this,tr("Service Exists"), tr("Service Already Exists!")); diff --git a/rdadmin/createdb.cpp b/rdadmin/createdb.cpp index 73272f47..0b726b0c 100644 --- a/rdadmin/createdb.cpp +++ b/rdadmin/createdb.cpp @@ -611,6 +611,7 @@ bool CreateDb(QString name,QString pwd) // sql=QString("CREATE TABLE IF NOT EXISTS STATIONS (\ NAME CHAR(64) PRIMARY KEY NOT NULL,\ + SHORT_NAME char(64),\ DESCRIPTION CHAR(64),\ USER_NAME CHAR(255),\ DEFAULT_NAME CHAR(255),\ @@ -2588,7 +2589,7 @@ bool InitDb(QString name,QString pwd,QString station_name) // // Create Default Service // - RDSvc *svc=new RDSvc(RD_SERVICE_NAME,admin_config); + RDSvc *svc=new RDSvc(RD_SERVICE_NAME,admin_station,admin_config); svc->create(""); svc->setDescription(RD_SERVICE_DESCRIPTION); delete svc; @@ -8436,13 +8437,13 @@ int UpdateDb(int ver) "on `"+RDLog::tableName(q->value(0).toString())+ "`.CART_NUMBER=CART.NUMBER where "+ "CART.OWNER is not null"; - q1=new RDSqlQuery(sql); + q1=new QSqlQuery(sql); int completed=q1->size(); delete q1; sql=QString("select ID from `")+RDLog::tableName(q->value(0).toString())+ "` where "+QString().sprintf("TYPE=%d",RDLogLine::Track); - q1=new RDSqlQuery(sql); + q1=new QSqlQuery(sql); int scheduled=q1->size()+completed; delete q1; @@ -8450,7 +8451,7 @@ int UpdateDb(int ver) QString().sprintf("SCHEDULED_TRACKS=%d,",scheduled)+ QString().sprintf("COMPLETED_TRACKS=%u ",completed)+ "where NAME=\""+RDEscapeString(q->value(0).toString())+"\""; - q1=new RDSqlQuery(sql); + q1=new QSqlQuery(sql); delete q1; } delete q; @@ -8459,26 +8460,44 @@ int UpdateDb(int ver) if(ver<267) { sql=QString("alter table CUTS add column ORIGIN_LOGIN_NAME char(255) ")+ "after ORIGIN_NAME"; - q=new RDSqlQuery(sql); + q=new QSqlQuery(sql); delete q; sql=QString("alter table CUTS add column SOURCE_HOSTNAME char(255) ")+ "after ORIGIN_LOGIN_NAME"; - q=new RDSqlQuery(sql); + q=new QSqlQuery(sql); delete q; } if(ver<268) { sql=QString("alter table DROPBOXES add column ")+ "FORCE_TO_MONO enum('N','Y') default 'N' after TO_CART"; - q=new RDSqlQuery(sql); + q=new QSqlQuery(sql); delete q; } if(ver<269) { sql=QString("alter table GROUPS add column ")+ "DEFAULT_CUT_LIFE int default -1 after DEFAULT_HIGH_CART"; - q=new RDSqlQuery(sql); + q=new QSqlQuery(sql); + delete q; + } + + if(ver<270) { + sql=QString("alter table STATIONS add column ")+ + "SHORT_NAME char(64) after NAME"; + q=new QSqlQuery(sql); + delete q; + + sql=QString("select NAME from STATIONS"); + q=new QSqlQuery(sql); + while(q->next()) { + sql=QString("update STATIONS set ")+ + "SHORT_NAME=\""+RDEscapeString(q->value(0).toString())+"\" where "+ + "NAME=\""+RDEscapeString(q->value(0).toString())+"\""; + q1=new QSqlQuery(sql); + delete q1; + } delete q; } diff --git a/rdadmin/edit_report.cpp b/rdadmin/edit_report.cpp index cb30ceb3..43e07ae3 100644 --- a/rdadmin/edit_report.cpp +++ b/rdadmin/edit_report.cpp @@ -56,7 +56,7 @@ EditReport::EditReport(QString rptname,QWidget *parent) setMinimumHeight(sizeHint().height()); setMaximumHeight(sizeHint().height()); - edit_report=new RDReport(rptname,admin_config); + edit_report=new RDReport(rptname,admin_station,admin_config); str=QString(tr("Edit Report")); setCaption(QString().sprintf("%s - %s",(const char *)str, (const char *)rptname)); diff --git a/rdadmin/edit_station.cpp b/rdadmin/edit_station.cpp index d77e5084..16c2d06f 100644 --- a/rdadmin/edit_station.cpp +++ b/rdadmin/edit_station.cpp @@ -73,9 +73,7 @@ EditStation::EditStation(QString sname,QWidget *parent) // // Fix the Window Size // - setMinimumWidth(sizeHint().width()); - setMaximumWidth(sizeHint().width()); - setMinimumHeight(sizeHint().height()); + setMinimumSize(sizeHint()); setMaximumHeight(sizeHint().height()); station_station=new RDStation(sname); @@ -99,24 +97,29 @@ EditStation::EditStation(QString sname,QWidget *parent) // Station Name // station_name_edit=new QLineEdit(this); - station_name_edit->setGeometry(115,11,80,19); station_name_edit->setReadOnly(true); - QLabel *station_name_label= - new QLabel(station_name_edit,tr("Ho&st Name:"),this); - station_name_label->setGeometry(10,11,100,19); + station_name_label=new QLabel(station_name_edit,tr("Ho&st Name:"),this); station_name_label->setFont(font); station_name_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); + // + // Station Short Name + // + station_short_name_edit=new QLineEdit(this); + station_short_name_edit->setMaxLength(64); + station_short_name_label= + new QLabel(station_short_name_edit,tr("Short Name:"),this); + station_short_name_label->setFont(font); + station_short_name_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); + // // Station Description // station_description_edit=new QLineEdit(this); - station_description_edit->setGeometry(115,32,sizeHint().width()-125,19); station_description_edit->setMaxLength(64); station_description_edit->setValidator(validator); - QLabel *station_description_label=new QLabel(station_description_edit, - tr("&Description:"),this); - station_description_label->setGeometry(10,32,100,19); + station_description_label= + new QLabel(station_description_edit,tr("&Description:"),this); station_description_label->setFont(font); station_description_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); @@ -124,39 +127,20 @@ EditStation::EditStation(QString sname,QWidget *parent) // Station Default Name // station_default_name_edit=new QComboBox(this); - station_default_name_edit->setGeometry(115,53,160,19); station_default_name_edit->setEditable(false); - QLabel *station_default_name_label=new QLabel(station_default_name_edit, - tr("Default &User:"),this); - station_default_name_label->setGeometry(10,53,100,19); + station_default_name_label= + new QLabel(station_default_name_edit,tr("Default &User:"),this); station_default_name_label->setFont(font); station_default_name_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); - // - // Broadcast security model - // - station_broadcast_sec_edit=new QComboBox(this); - station_broadcast_sec_edit->setGeometry(115,74,140,19); - // Index values should match RDStation class enum and database schema. - station_broadcast_sec_edit->insertItem(tr("Host"),0); - station_broadcast_sec_edit->insertItem(tr("User"),1); - station_broadcast_sec_edit->setEditable(false); - QLabel *station_broadcast_sec_label=new QLabel(station_broadcast_sec_edit, - tr("Security Model:"),this); - station_broadcast_sec_label->setGeometry(10,74,100,19); - station_broadcast_sec_label->setFont(font); - station_broadcast_sec_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); - // // Station IP Address // station_address_edit=new QLineEdit(this); - station_address_edit->setGeometry(115,95,120,19); station_address_edit->setMaxLength(15); station_address_edit->setValidator(validator); - QLabel *station_address_label=new QLabel(station_address_edit, - tr("&IP Address:"),this); - station_address_label->setGeometry(10,95,100,19); + station_address_label= + new QLabel(station_address_edit,tr("&IP Address:"),this); station_address_label->setFont(font); station_address_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); @@ -164,11 +148,9 @@ EditStation::EditStation(QString sname,QWidget *parent) // Station Editor Command // station_editor_cmd_edit=new QLineEdit(this); - station_editor_cmd_edit->setGeometry(115,116,sizeHint().width()-130,19); station_editor_cmd_edit->setMaxLength(255); - QLabel *station_editor_cmd_label=new QLabel(station_editor_cmd_edit, - tr("Editor &Command:"),this); - station_editor_cmd_label->setGeometry(10,116,100,19); + station_editor_cmd_label= + new QLabel(station_editor_cmd_edit,tr("Editor &Command:"),this); station_editor_cmd_label->setFont(font); station_editor_cmd_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); @@ -176,12 +158,10 @@ EditStation::EditStation(QString sname,QWidget *parent) // Station Time Offset // station_timeoffset_box=new QSpinBox(this); - station_timeoffset_box->setGeometry(115,137,80,19); station_timeoffset_box->setRange(-RD_MAX_TIME_OFFSET,RD_MAX_TIME_OFFSET); station_timeoffset_box->setSuffix(tr(" mS")); - QLabel *station_timeoffset_label=new QLabel(station_timeoffset_box, - tr("&Time Offset:"),this); - station_timeoffset_label->setGeometry(10,137,100,19); + station_timeoffset_label= + new QLabel(station_timeoffset_box,tr("&Time Offset:"),this); station_timeoffset_label->setFont(font); station_timeoffset_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); @@ -189,55 +169,45 @@ EditStation::EditStation(QString sname,QWidget *parent) // Startup Cart // station_startup_cart_edit=new QLineEdit(this); - station_startup_cart_edit->setGeometry(115,158,60,19); station_startup_cart_edit->setMaxLength(15); station_startup_cart_edit->setValidator(macro_validator); - QLabel *station_startup_cart_label=new QLabel(station_startup_cart_edit, - tr("&Startup Cart:"),this); - station_startup_cart_label->setGeometry(10,158,100,19); + station_startup_cart_label= + new QLabel(station_startup_cart_edit,tr("&Startup Cart:"),this); station_startup_cart_label->setFont(font); station_startup_cart_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); - QPushButton *select_button=new QPushButton(tr("Select"),this); - select_button->setFont(small_font); - select_button->setGeometry(180,157,50,22); - connect(select_button,SIGNAL(clicked()),this,SLOT(selectClicked())); + station_startup_select_button=new QPushButton(tr("Select"),this); + station_startup_select_button->setFont(small_font); + connect(station_startup_select_button,SIGNAL(clicked()), + this,SLOT(selectClicked())); // // Cue Output // station_cue_sel=new RDCardSelector(this); - station_cue_sel->setGeometry(90,179,110,117); - QLabel *station_cue_sel_label=new QLabel(station_cue_sel, - tr("Cue &Output:"),this); - station_cue_sel_label->setGeometry(10,179,100,19); + station_cue_sel_label= + new QLabel(station_cue_sel,tr("Cue &Output:"),this); station_cue_sel_label->setFont(font); station_cue_sel_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); station_start_cart_edit=new QLineEdit(this); - station_start_cart_edit->setGeometry(270,179,60,20); station_start_cart_edit->setValidator(macro_validator); - QLabel *station_start_cart_label=new QLabel(station_start_cart_edit, - tr("Start Cart")+":",this); - station_start_cart_label->setGeometry(205,179,60,20); + station_start_cart_label= + new QLabel(station_start_cart_edit,tr("Start Cart")+":",this); station_start_cart_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); station_start_cart_button=new QPushButton(tr("Select"),this); - station_start_cart_button->setGeometry(335,178,50,22); station_start_cart_button->setFont(small_font); connect(station_start_cart_button,SIGNAL(clicked()), this,SLOT(startCartClickedData())); station_stop_cart_edit=new QLineEdit(this); - station_stop_cart_edit->setGeometry(270,201,60,20); station_stop_cart_edit->setValidator(macro_validator); - QLabel *station_stop_cart_label=new QLabel(station_stop_cart_edit, - tr("Stop Cart")+":",this); - station_stop_cart_label->setGeometry(205,201,60,20); + station_stop_cart_label= + new QLabel(station_stop_cart_edit,tr("Stop Cart")+":",this); station_stop_cart_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); station_stop_cart_button=new QPushButton(tr("Select"),this); - station_stop_cart_button->setGeometry(335,200,50,22); station_stop_cart_button->setFont(small_font); connect(station_stop_cart_button,SIGNAL(clicked()), this,SLOT(stopCartClickedData())); @@ -247,11 +217,10 @@ EditStation::EditStation(QString sname,QWidget *parent) // Heartbeat Checkbox // station_heartbeat_box=new QCheckBox(this); - station_heartbeat_box->setGeometry(10,226,15,15); - QLabel *label=new QLabel(station_heartbeat_box,tr("Enable Heartbeat"),this); - label->setGeometry(30,224,150,20); - label->setFont(font); - label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix); + station_heartbeat_label= + new QLabel(station_heartbeat_box,tr("Enable Heartbeat"),this); + station_heartbeat_label->setFont(font); + station_heartbeat_label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix); connect(station_heartbeat_box,SIGNAL(toggled(bool)), this,SLOT(heartbeatToggledData(bool))); @@ -259,24 +228,20 @@ EditStation::EditStation(QString sname,QWidget *parent) // Filter Checkbox // station_filter_box=new QCheckBox(this); - station_filter_box->setGeometry(210,226,15,15); - label=new QLabel(station_filter_box,tr("Use Realtime Filtering"),this); - label->setGeometry(230,226,150,20); - label->setFont(font); - label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix); + station_filter_label= + new QLabel(station_filter_box,tr("Use Realtime Filtering"),this); + station_filter_label->setFont(font); + station_filter_label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix); // // Heartbeat Cart // station_hbcart_edit=new QLineEdit(this); - station_hbcart_edit->setGeometry(65,248,60,19); station_hbcart_edit->setValidator(macro_validator); station_hbcart_label=new QLabel(station_hbcart_edit,tr("Cart:"),this); - station_hbcart_label->setGeometry(10,248,50,19); station_hbcart_label->setFont(font); station_hbcart_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); station_hbcart_button=new QPushButton(this); - station_hbcart_button->setGeometry(140,245,60,26); station_hbcart_button->setFont(font); station_hbcart_button->setText(tr("Select")); connect(station_hbcart_button,SIGNAL(clicked()), @@ -286,15 +251,12 @@ EditStation::EditStation(QString sname,QWidget *parent) // Heartbeat Interval // station_hbinterval_spin=new QSpinBox(this); - station_hbinterval_spin->setGeometry(275,248,45,19); station_hbinterval_spin->setRange(1,300); station_hbinterval_label= new QLabel(station_hbinterval_spin,tr("Interval:"),this); - station_hbinterval_label->setGeometry(220,248,50,19); station_hbinterval_label->setFont(font); station_hbinterval_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); station_hbinterval_unit=new QLabel(tr("secs"),this); - station_hbinterval_unit->setGeometry(325,248,100,19); station_hbinterval_unit->setFont(font); station_hbinterval_unit->setAlignment(AlignLeft|AlignVCenter|ShowPrefix); @@ -302,32 +264,26 @@ EditStation::EditStation(QString sname,QWidget *parent) // System Maintenance Checkbox // station_maint_box=new QCheckBox(this); - station_maint_box->setGeometry(10,275,15,15); - label= + station_maint_label= new QLabel(station_maint_box,tr("Include in System Maintenance Pool"),this); - label->setGeometry(30,273,sizeHint().width()-40,20); - label->setFont(font); - label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix); + station_maint_label->setFont(font); + station_maint_label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix); // // Enable Drag & Drop Checkbox // station_dragdrop_box=new QCheckBox(this); - station_dragdrop_box->setGeometry(10,296,15,15); - label=new QLabel(station_dragdrop_box,tr("Enable Drag && Drop"),this); - label->setGeometry(30,293,sizeHint().width()-40,20); - label->setFont(font); - label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix); + station_dragdrop_label=new QLabel(station_dragdrop_box,tr("Enable Drag && Drop"),this); + station_dragdrop_label->setFont(font); + station_dragdrop_label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix); // // Enforce Panel Setup Checkbox // station_panel_enforce_box=new QCheckBox(this); - station_panel_enforce_box->setGeometry(25,314,15,15); station_panel_enforce_label= new QLabel(station_panel_enforce_box, tr("Allow Drops on Panels not in Setup Mode"),this); - station_panel_enforce_label->setGeometry(45,312,sizeHint().width()-55,20); station_panel_enforce_label->setFont(font); station_panel_enforce_label->setAlignment(AlignLeft|AlignVCenter|ShowPrefix); connect(station_dragdrop_box,SIGNAL(toggled(bool)), @@ -338,20 +294,17 @@ EditStation::EditStation(QString sname,QWidget *parent) // // System Services Section // - label=new QLabel(tr("System Services"),this); - label->setGeometry(30,333,110,20); - label->setFont(font); - label->setAlignment(AlignCenter|ShowPrefix); + station_systemservices_label=new QLabel(tr("System Services"),this); + station_systemservices_label->setFont(font); + station_systemservices_label->setAlignment(AlignCenter|ShowPrefix); // // HTTP Service Host // station_http_station_box=new QComboBox(this); - station_http_station_box->setGeometry(145,354,200,19); station_http_station_box->setEditable(false); - QLabel *station_http_station_label= + station_http_station_label= new QLabel(station_http_station_box,tr("HTTP Xport:"),this); - station_http_station_label->setGeometry(11,354,130,19); station_http_station_label->setFont(font); station_http_station_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); @@ -359,166 +312,157 @@ EditStation::EditStation(QString sname,QWidget *parent) // CAE Service Host // station_cae_station_box=new QComboBox(this); - station_cae_station_box->setGeometry(145,375,200,19); station_cae_station_box->setEditable(false); connect(station_cae_station_box,SIGNAL(activated(const QString &)), this,SLOT(caeStationActivatedData(const QString &))); - QLabel *station_cae_station_label=new QLabel(station_cae_station_box, - tr("Core Audio Engine:"),this); - station_cae_station_label->setGeometry(11,375,130,19); + station_cae_station_label= + new QLabel(station_cae_station_box,tr("Core Audio Engine:"),this); station_cae_station_label->setFont(font); station_cae_station_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix); // // RDLibrary Configuration Button // - QPushButton *button=new QPushButton(this); - button->setGeometry(20,413,80,50); - button->setFont(font); - button->setText(tr("RD&Library")); - connect(button,SIGNAL(clicked()),this,SLOT(editLibraryData())); + station_rdlibrary_button=new QPushButton(this); + station_rdlibrary_button->setFont(font); + station_rdlibrary_button->setText(tr("RD&Library")); + connect(station_rdlibrary_button,SIGNAL(clicked()),this,SLOT(editLibraryData())); // // RDCatch Configuration Button // - button=new QPushButton(this); - button->setGeometry(110,413,80,50); - button->setFont(font); - button->setText(tr("RDCatch")); - connect(button,SIGNAL(clicked()),this,SLOT(editDeckData())); + station_rdcatch_button=new QPushButton(this); + station_rdcatch_button->setFont(font); + station_rdcatch_button->setText(tr("RDCatch")); + connect(station_rdcatch_button,SIGNAL(clicked()),this,SLOT(editDeckData())); // // RDAirPlay Configuration Button // - button=new QPushButton(this); - button->setGeometry(200,413,80,50); - button->setFont(font); - button->setText(tr("RDAirPlay")); - connect(button,SIGNAL(clicked()),this,SLOT(editAirPlayData())); + station_rdairplay_button=new QPushButton(this); + station_rdairplay_button->setFont(font); + station_rdairplay_button->setText(tr("RDAirPlay")); + connect(station_rdairplay_button,SIGNAL(clicked()), + this,SLOT(editAirPlayData())); // // RDPanel Configuration Button // - button=new QPushButton(this); - button->setGeometry(290,413,80,50); - button->setFont(font); - button->setText(tr("RDPanel")); - connect(button,SIGNAL(clicked()),this,SLOT(editPanelData())); + station_rdpanel_button=new QPushButton(this); + station_rdpanel_button->setFont(font); + station_rdpanel_button->setText(tr("RDPanel")); + connect(station_rdpanel_button,SIGNAL(clicked()),this,SLOT(editPanelData())); // // RDLogEdit Configuration Button // - button=new QPushButton(this); - button->setGeometry(20,473,80,50); - button->setFont(font); - button->setText(tr("RDLogEdit")); - connect(button,SIGNAL(clicked()),this,SLOT(editLogEditData())); + station_rdlogedit_button=new QPushButton(this); + station_rdlogedit_button->setFont(font); + station_rdlogedit_button->setText(tr("RDLogEdit")); + connect(station_rdlogedit_button,SIGNAL(clicked()), + this,SLOT(editLogEditData())); // // RDCartSlots Configuration Button // - button=new QPushButton(this); - button->setGeometry(110,473,80,50); - button->setFont(font); - button->setText(tr("RDCart\nSlots")); - connect(button,SIGNAL(clicked()),this,SLOT(editCartSlotsData())); + station_rdcartslots_button=new QPushButton(this); + station_rdcartslots_button->setFont(font); + station_rdcartslots_button->setText(tr("RDCart\nSlots")); + connect(station_rdcartslots_button,SIGNAL(clicked()), + this,SLOT(editCartSlotsData())); // // Dropboxes Configuration Button // - button=new QPushButton(this); - button->setGeometry(200,473,80,50); - button->setFont(font); - button->setText(tr("Dropboxes")); - connect(button,SIGNAL(clicked()),this,SLOT(editDropboxesData())); + station_dropboxes_button=new QPushButton(this); + station_dropboxes_button->setFont(font); + station_dropboxes_button->setText(tr("Dropboxes")); + connect(station_dropboxes_button,SIGNAL(clicked()), + this,SLOT(editDropboxesData())); // // Switcher Configuration Button // - button=new QPushButton(this); - button->setGeometry(290,473,80,50); - button->setFont(font); - button->setText(tr("Switchers\nGPIO")); - connect(button,SIGNAL(clicked()),this,SLOT(editSwitcherData())); + station_switchers_button=new QPushButton(this); + station_switchers_button->setFont(font); + station_switchers_button->setText(tr("Switchers\nGPIO")); + connect(station_switchers_button,SIGNAL(clicked()), + this,SLOT(editSwitcherData())); // // Host Variables Configuration Button // - button=new QPushButton(this); - button->setGeometry(20,533,80,50); - button->setFont(font); - button->setText(tr("Host\nVariables")); - connect(button,SIGNAL(clicked()),this,SLOT(editHostvarsData())); + station_hostvars_button=new QPushButton(this); + station_hostvars_button->setFont(font); + station_hostvars_button->setText(tr("Host\nVariables")); + connect(station_hostvars_button,SIGNAL(clicked()), + this,SLOT(editHostvarsData())); // // Audio Ports Configuration Button // - button=new QPushButton(this); - button->setGeometry(110,533,80,50); - button->setFont(font); - button->setText(tr("Audio\nPorts")); - connect(button,SIGNAL(clicked()),this,SLOT(editAudioData())); + station_audioports_button=new QPushButton(this); + station_audioports_button->setFont(font); + station_audioports_button->setText(tr("Audio\nPorts")); + connect(station_audioports_button,SIGNAL(clicked()), + this,SLOT(editAudioData())); // // TTY Configuration Button // - button=new QPushButton(this); - button->setGeometry(200,533,80,50); - button->setFont(font); - button->setText(tr("Serial\nPorts")); - connect(button,SIGNAL(clicked()),this,SLOT(editTtyData())); + station_ttys_button=new QPushButton(this); + station_ttys_button->setFont(font); + station_ttys_button->setText(tr("Serial\nPorts")); + connect(station_ttys_button,SIGNAL(clicked()),this,SLOT(editTtyData())); // // View Adapters (Audio Resources) Configuration Button // - button=new QPushButton(this); - button->setGeometry(290,533,80,50); - button->setFont(font); - button->setText(tr("Audio\nResources")); - connect(button,SIGNAL(clicked()),this,SLOT(viewAdaptersData())); + station_adapters_button=new QPushButton(this); + station_adapters_button->setFont(font); + station_adapters_button->setText(tr("Audio\nResources")); + connect(station_adapters_button,SIGNAL(clicked()), + this,SLOT(viewAdaptersData())); // // JACK Settings Button // - button=new QPushButton(this); - button->setGeometry(110,593,80,50); - button->setFont(font); - button->setText(tr("JACK\nSettings")); - connect(button,SIGNAL(clicked()),this,SLOT(jackSettingsData())); + station_jack_button=new QPushButton(this); + station_jack_button->setFont(font); + station_jack_button->setText(tr("JACK\nSettings")); + connect(station_jack_button,SIGNAL(clicked()),this,SLOT(jackSettingsData())); // // Backups Configuration Button // - button=new QPushButton(this); - button->setGeometry(200,593,80,50); - button->setFont(font); - button->setText(tr("Backups")); - connect(button,SIGNAL(clicked()),this,SLOT(editBackupsData())); + station_backups_button=new QPushButton(this); + station_backups_button->setFont(font); + station_backups_button->setText(tr("Backups")); + connect(station_backups_button,SIGNAL(clicked()), + this,SLOT(editBackupsData())); // // Ok Button // - QPushButton *ok_button=new QPushButton(this); - ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50); - ok_button->setDefault(true); - ok_button->setFont(font); - ok_button->setText(tr("&OK")); - connect(ok_button,SIGNAL(clicked()),this,SLOT(okData())); + station_ok_button=new QPushButton(this); + station_ok_button->setDefault(true); + station_ok_button->setFont(font); + station_ok_button->setText(tr("&OK")); + connect(station_ok_button,SIGNAL(clicked()),this,SLOT(okData())); // // Cancel Button // - QPushButton *cancel_button=new QPushButton(this); - cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60, - 80,50); - cancel_button->setFont(font); - cancel_button->setText(tr("&Cancel")); - connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData())); + station_cancel_button=new QPushButton(this); + station_cancel_button->setFont(font); + station_cancel_button->setText(tr("&Cancel")); + connect(station_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData())); // // Populate Fields // station_name_edit->setText(station_station->name()); + station_short_name_edit->setText(station_station->shortName()); station_description_edit->setText(station_station->description()); station_address_edit->setText(station_station->address().toString()); station_editor_cmd_edit->setText(station_station->editorPath()); @@ -568,9 +512,6 @@ EditStation::EditStation(QString sname,QWidget *parent) item++; } delete q; - station_broadcast_sec_edit-> - setCurrentItem((RDStation::BroadcastSecurityMode)station_station-> - broadcastSecurity()); if((cartnum=station_station->heartbeatCart())>0) { station_heartbeat_box->setChecked(true); station_hbcart_edit->setText(QString().sprintf("%u",cartnum)); @@ -600,9 +541,7 @@ EditStation::EditStation(QString sname,QWidget *parent) } station_http_station_box->insertItem("localhost"); - //station_http_station_box->insertItem(RD_RDSELECT_LABEL); station_cae_station_box->insertItem("localhost"); - //station_cae_station_box->insertItem(RD_RDSELECT_LABEL); sql=QString().sprintf("select NAME from STATIONS \ where NAME!=\"%s\" order by NAME", (const char *)RDEscapeString(sname)); @@ -711,25 +650,6 @@ QSizePolicy EditStation::sizePolicy() const } -void EditStation::paintEvent(QPaintEvent *e) -{ - QPainter *p=new QPainter(this); - p->setPen(black); - p->setBrush(black); - - // - // System Services - // - p->moveTo(10,343); - p->lineTo(sizeHint().width()-10,343); - p->lineTo(sizeHint().width()-10,401); - p->lineTo(10,401); - p->lineTo(10,343); - - delete p; -} - - void EditStation::okData() { QHostAddress addr; @@ -771,15 +691,13 @@ void EditStation::okData() station_station->setHeartbeatCart(0); station_station->setHeartbeatInterval(0); } + station_station->setShortName(station_short_name_edit->text()); station_station->setCueCard(station_cue_sel->card()); station_station->setCuePort(station_cue_sel->port()); station_station->setCueStartCart(station_start_cart_edit->text().toInt()); station_station->setCueStopCart(station_stop_cart_edit->text().toInt()); station_station->setDescription(station_description_edit->text()); station_station->setDefaultName(station_default_name_edit->currentText()); - station_station-> - setBroadcastSecurity((RDStation::BroadcastSecurityMode) - station_broadcast_sec_edit->currentItem()); station_station->setAddress(addr); station_station-> setEditorPath(station_editor_cmd_edit->text()); @@ -968,6 +886,128 @@ void EditStation::stopCartClickedData() } +void EditStation::paintEvent(QPaintEvent *e) +{ + QPainter *p=new QPainter(this); + p->setPen(black); + p->setBrush(black); + + // + // System Services + // + p->moveTo(10,343); + p->lineTo(size().width()-10,343); + p->lineTo(size().width()-10,401); + p->lineTo(10,401); + p->lineTo(10,343); + + delete p; +} + + +void EditStation::resizeEvent(QResizeEvent *e) +{ + station_name_edit->setGeometry(115,11,size().width()-125,19); + station_name_label->setGeometry(10,11,100,19); + + station_short_name_edit->setGeometry(115,32,size().width()-125,19); + station_short_name_label->setGeometry(10,32,100,19); + + station_description_edit->setGeometry(115,53,size().width()-125,19); + station_description_label->setGeometry(10,53,100,19); + + station_default_name_edit->setGeometry(115,74,160,19); + station_default_name_label->setGeometry(10,74,100,19); + + station_address_edit->setGeometry(115,95,120,19); + station_address_label->setGeometry(10,95,100,19); + + station_editor_cmd_edit->setGeometry(115,116,size().width()-130,19); + station_editor_cmd_label->setGeometry(10,116,100,19); + + station_timeoffset_box->setGeometry(115,137,80,19); + station_timeoffset_label->setGeometry(10,137,100,19); + + station_startup_cart_edit->setGeometry(115,158,60,19); + station_startup_cart_label->setGeometry(10,158,100,19); + station_startup_select_button->setGeometry(180,157,50,22); + + station_cue_sel->setGeometry(90,179,110,117); + station_cue_sel_label->setGeometry(10,179,100,19); + + station_start_cart_edit->setGeometry(270,179,60,20); + station_start_cart_label->setGeometry(205,179,60,20); + station_start_cart_button->setGeometry(335,178,50,22); + + station_stop_cart_edit->setGeometry(270,201,60,20); + station_stop_cart_label->setGeometry(205,201,60,20); + station_stop_cart_button->setGeometry(335,200,50,22); + + station_heartbeat_box->setGeometry(10,226,15,15); + station_heartbeat_label->setGeometry(30,224,150,20); + + station_filter_box->setGeometry(210,226,15,15); + station_filter_label->setGeometry(230,226,150,20); + + station_hbcart_edit->setGeometry(65,248,60,19); + station_hbcart_label->setGeometry(10,248,50,19); + station_hbcart_button->setGeometry(140,245,60,26); + + station_hbinterval_spin->setGeometry(275,248,45,19); + station_hbinterval_label->setGeometry(220,248,50,19); + station_hbinterval_unit->setGeometry(325,248,100,19); + + station_maint_box->setGeometry(10,275,15,15); + station_maint_label->setGeometry(30,273,size().width()-40,20); + + station_dragdrop_box->setGeometry(10,296,15,15); + station_dragdrop_label->setGeometry(30,293,size().width()-40,20); + + station_panel_enforce_box->setGeometry(25,314,15,15); + station_panel_enforce_label->setGeometry(45,312,size().width()-55,20); + + station_systemservices_label->setGeometry(30,333,110,20); + + station_http_station_box->setGeometry(145,354,size().width()-165,19); + station_http_station_label->setGeometry(11,354,130,19); + + station_cae_station_box->setGeometry(145,375,size().width()-165,19); + station_cae_station_label->setGeometry(11,375,130,19); + + station_rdlibrary_button->setGeometry(20,413,80,50); + + station_rdcatch_button->setGeometry(110,413,80,50); + + station_rdairplay_button->setGeometry(200,413,80,50); + + station_rdpanel_button->setGeometry(290,413,80,50); + + station_rdlogedit_button->setGeometry(20,473,80,50); + + station_rdcartslots_button->setGeometry(110,473,80,50); + + station_dropboxes_button->setGeometry(200,473,80,50); + + station_switchers_button->setGeometry(290,473,80,50); + + station_hostvars_button->setGeometry(20,533,80,50); + + station_audioports_button->setGeometry(110,533,80,50); + + station_ttys_button->setGeometry(200,533,80,50); + + station_adapters_button->setGeometry(290,533,80,50); + + station_jack_button->setGeometry(110,593,80,50); + + station_backups_button->setGeometry(200,593,80,50); + + station_ok_button->setGeometry(size().width()-180,size().height()-60,80,50); + station_cancel_button-> + setGeometry(size().width()-90,size().height()-60,80,50); +} + + QString EditStation::DisplayPart(QString string) { for(unsigned i=0;icurrentText(),admin_config); + RDSvc *svc=new RDSvc(list_box->currentText(),admin_station,admin_config); svc->remove(); delete svc; list_box->removeItem(list_box->currentItem()); diff --git a/rdadmin/rdadmin_cs.ts b/rdadmin/rdadmin_cs.ts index c18f1f7f..af48f351 100644 --- a/rdadmin/rdadmin_cs.ts +++ b/rdadmin/rdadmin_cs.ts @@ -3655,15 +3655,15 @@ serveru Security Model: - Bezpečnostní model: + Bezpečnostní model: Host - Server + Server User - Uživatel + Uživatel Custom @@ -3738,6 +3738,10 @@ nastaveném pro běh služby CAE pro naplnění databáze se zdroji zvuku.Stop Cart + + Short Name: + + EditSvc diff --git a/rdadmin/rdadmin_de.ts b/rdadmin/rdadmin_de.ts index 5745b03e..60edd410 100644 --- a/rdadmin/rdadmin_de.ts +++ b/rdadmin/rdadmin_de.ts @@ -3615,15 +3615,15 @@ Variablen Security Model: - Sicherheitsmodell: + Sicherheitsmodell: Host - Host + Host User - Benutzer + Benutzer Custom @@ -3695,6 +3695,10 @@ configured to run the CAE service in order to populate the audio resources datab Stop Cart + + Short Name: + + EditSvc diff --git a/rdadmin/rdadmin_es.ts b/rdadmin/rdadmin_es.ts index e5302567..ab51b776 100644 --- a/rdadmin/rdadmin_es.ts +++ b/rdadmin/rdadmin_es.ts @@ -3654,15 +3654,15 @@ del Equipo Security Model: - Modelo segurid: + Modelo segurid: Host - Equipo + Equipo User - Usuario + Usuario Custom @@ -3735,6 +3735,10 @@ configured to run the CAE service in order to populate the audio resources datab Stop Cart + + Short Name: + + EditSvc diff --git a/rdadmin/rdadmin_fr.ts b/rdadmin/rdadmin_fr.ts index 9830b4ae..096fe6c4 100644 --- a/rdadmin/rdadmin_fr.ts +++ b/rdadmin/rdadmin_fr.ts @@ -3292,18 +3292,6 @@ Variables The Heartbeat Cart number is invalid! - - Security Model: - - - - Host - - - - User - - Include in System Maintenance Pool @@ -3368,6 +3356,10 @@ configured to run the CAE service in order to populate the audio resources datab Stop Cart + + Short Name: + + EditSvc diff --git a/rdadmin/rdadmin_nb.ts b/rdadmin/rdadmin_nb.ts index 8b6de7e6..178980f3 100644 --- a/rdadmin/rdadmin_nb.ts +++ b/rdadmin/rdadmin_nb.ts @@ -3609,18 +3609,6 @@ Variables The Heartbeat Cart number is invalid! Hjarteslag-korgnummeret er ugyldig! - - Host - - - - User - - - - Security Model: - - Include in System Maintenance Pool @@ -3685,6 +3673,10 @@ configured to run the CAE service in order to populate the audio resources datab Stop Cart + + Short Name: + + EditSvc diff --git a/rdadmin/rdadmin_nn.ts b/rdadmin/rdadmin_nn.ts index 8b6de7e6..178980f3 100644 --- a/rdadmin/rdadmin_nn.ts +++ b/rdadmin/rdadmin_nn.ts @@ -3609,18 +3609,6 @@ Variables The Heartbeat Cart number is invalid! Hjarteslag-korgnummeret er ugyldig! - - Host - - - - User - - - - Security Model: - - Include in System Maintenance Pool @@ -3685,6 +3673,10 @@ configured to run the CAE service in order to populate the audio resources datab Stop Cart + + Short Name: + + EditSvc diff --git a/rdadmin/rdadmin_pt_BR.ts b/rdadmin/rdadmin_pt_BR.ts index 431a4acc..19122a4d 100644 --- a/rdadmin/rdadmin_pt_BR.ts +++ b/rdadmin/rdadmin_pt_BR.ts @@ -3481,15 +3481,15 @@ Overwrite? Host - Cliente + Cliente User - Usuário + Usuário Security Model: - Modelo de Seg: + Modelo de Seg: &IP Address: @@ -3688,6 +3688,10 @@ configured to run the CAE service in order to populate the audio resources datab Stop Cart + + Short Name: + + EditSvc diff --git a/rdadmin/test_import.cpp b/rdadmin/test_import.cpp index e7d8277a..74bb6d0e 100644 --- a/rdadmin/test_import.cpp +++ b/rdadmin/test_import.cpp @@ -256,7 +256,7 @@ void TestImport::dateChangedData(const QDate &date) { test_filename_edit-> setText(RDDateDecode(test_svc->importPath(test_src,RDSvc::Linux),date, - admin_config,test_svc->name())); + admin_station,admin_config,test_svc->name())); } diff --git a/rdairplay/rdairplay.cpp b/rdairplay/rdairplay.cpp index e310fb23..09cfe031 100644 --- a/rdairplay/rdairplay.cpp +++ b/rdairplay/rdairplay.cpp @@ -163,7 +163,7 @@ MainWidget::MainWidget(QWidget *parent) if(cmd->value(j).at(k)==QChar(':')) { air_start_logname[i]= RDDateTimeDecode(cmd->value(j).left(k),air_startup_datetime, - air_config); + rdstation_conf,air_config); lineno=cmd->value(j).right(cmd->value(j).length()-(k+1)); if(lineno.right(1)=="+") { air_start_start[i]=true; @@ -970,7 +970,7 @@ void MainWidget::ripcConnected(bool state) case RDAirPlayConf::StartPrevious: air_start_logname[i]= RDDateTimeDecode(rdairplay_conf->currentLog(i), - air_startup_datetime,air_config); + air_startup_datetime,rdstation_conf,air_config); if(!air_start_logname[i].isEmpty()) { if(rdairplay_previous_exit_code==RDAirPlayConf::ExitDirty) { if((air_start_line[i]=rdairplay_conf->logCurrentLine(i))>=0) { @@ -988,7 +988,7 @@ void MainWidget::ripcConnected(bool state) case RDAirPlayConf::StartSpecified: air_start_logname[i]= RDDateTimeDecode(rdairplay_conf->logName(i), - air_startup_datetime,air_config); + air_startup_datetime,rdstation_conf,air_config); if(!air_start_logname[i].isEmpty()) { if(rdairplay_previous_exit_code==RDAirPlayConf::ExitDirty) { if(air_start_logname[i]==rdairplay_conf->currentLog(i)) { diff --git a/rdairplay/rlmhost.cpp b/rdairplay/rlmhost.cpp index 911f56a3..dc9b8fe2 100644 --- a/rdairplay/rlmhost.cpp +++ b/rdairplay/rlmhost.cpp @@ -35,8 +35,8 @@ RLMHost::RLMHost(const QString &path,const QString &arg, QSocketDevice *udp_socket,QObject *parent) : QObject(parent) { - plugin_path=RDDateDecode(path,QDate::currentDate(),air_config); - plugin_arg=RDDateDecode(arg,QDate::currentDate(),air_config); + plugin_path=RDDateDecode(path,QDate::currentDate(),rdstation_conf,air_config); + plugin_arg=RDDateDecode(arg,QDate::currentDate(),rdstation_conf,air_config); plugin_udp_socket=udp_socket; plugin_handle=NULL; plugin_start_sym=NULL; @@ -86,7 +86,7 @@ void RLMHost::sendEvent(const QString &svcname,const QString &logname, struct rlm_pad *now=new struct rlm_pad; struct rlm_pad *next=new struct rlm_pad; memset(svc,0,sizeof(struct rlm_svc)); - RDSvc *service=new RDSvc(svcname,air_config); + RDSvc *service=new RDSvc(svcname,rdstation_conf,air_config); if(!svcname.isEmpty()) { sprintf(svc->svc_name,"%s",(const char *)svcname.left(255)); if(!service->programCode().isEmpty()) { diff --git a/rdcatchd/batch.cpp b/rdcatchd/batch.cpp index cda0e6a9..b35ead26 100644 --- a/rdcatchd/batch.cpp +++ b/rdcatchd/batch.cpp @@ -156,7 +156,7 @@ void MainObject::RunBatch(RDCmdSwitch *cmd) fprintf(stderr,"rdcatchd: id %d not found\n",id); exit(256); } - batch_event=new CatchEvent(RDConfiguration()); + batch_event=new CatchEvent(catch_rdstation,RDConfiguration()); LoadEvent(q,batch_event,false); delete q; diff --git a/rdcatchd/catch_event.cpp b/rdcatchd/catch_event.cpp index 59e47035..d62d255a 100644 --- a/rdcatchd/catch_event.cpp +++ b/rdcatchd/catch_event.cpp @@ -22,8 +22,9 @@ #include -CatchEvent::CatchEvent(RDConfig *config) +CatchEvent::CatchEvent(RDStation *station,RDConfig *config) { + catch_station=station; catch_config=config; clear(); } @@ -660,9 +661,9 @@ void CatchEvent::resolveUrl(int time_offset) if((current_time.msecsTo(QTime(23,59,59))+1000) #include #include +#include class CatchEvent { public: - CatchEvent(RDConfig *config); + CatchEvent(RDStation *station,RDConfig *config); unsigned id() const; void setId(int id); bool isActive() const; @@ -192,6 +193,7 @@ class CatchEvent int catch_podcast_length; int catch_podcast_time; int catch_eventdate_offset; + RDStation *catch_station; RDConfig *catch_config; }; diff --git a/rdcatchd/local_macros.cpp b/rdcatchd/local_macros.cpp index 2d4ea073..5a0c9ae2 100644 --- a/rdcatchd/local_macros.cpp +++ b/rdcatchd/local_macros.cpp @@ -39,7 +39,7 @@ void MainObject::RunLocalMacros(RDMacro *rml) QDateTime dt; RDUser *user; bool ok=false; - CatchEvent e(RDConfiguration()); + CatchEvent e(catch_rdstation,RDConfiguration()); unsigned event_ptr=0; QString sql; RDSqlQuery *q; diff --git a/rdcatchd/rdcatchd.cpp b/rdcatchd/rdcatchd.cpp index 1fbef7f9..c1483145 100644 --- a/rdcatchd/rdcatchd.cpp +++ b/rdcatchd/rdcatchd.cpp @@ -821,7 +821,7 @@ void MainObject::engineData(int id) catch_events[event]. setResolvedUrl(RDDateTimeDecode(catch_events[event].url(), QDateTime(date.addDays(catch_events[event].eventdateOffset()), - current_time),RDConfiguration())); + current_time),catch_rdstation,RDConfiguration())); StartDownloadEvent(event); break; @@ -1911,7 +1911,7 @@ void MainObject::LoadEngine(bool adv_day) (const char *)catch_rdstation->name()); q=new RDSqlQuery(sql); while(q->next()) { - catch_events.push_back(CatchEvent(RDConfiguration())); + catch_events.push_back(CatchEvent(catch_rdstation,RDConfiguration())); LoadEvent(q,&catch_events.back(),true); } LogLine(RDConfig::LogInfo,QString().sprintf("loaded %d events",(int)catch_events.size())); @@ -2184,7 +2184,7 @@ bool MainObject::AddEvent(int id) (const char *)catch_rdstation->name(),id); q=new RDSqlQuery(sql); if(q->first()) { - catch_events.push_back(CatchEvent(RDConfiguration())); + catch_events.push_back(CatchEvent(catch_rdstation,RDConfiguration())); LoadEvent(q,&catch_events.back(),true); switch((RDRecording::Type)q->value(2).toInt()) { case RDRecording::Recording: @@ -2685,7 +2685,7 @@ void MainObject::StartRmlRecording(int chan,int cartnum,int cutnum,int maxlen) RDDeck *deck=new RDDeck(catch_config->stationName(),chan); RDCut *cut=new RDCut(cartnum,cutnum); QDateTime dt=QDateTime(QDate::currentDate(),QTime::currentTime()); - catch_events.push_back(CatchEvent(RDConfiguration())); + catch_events.push_back(CatchEvent(catch_rdstation,RDConfiguration())); catch_events.back().setId(GetNextDynamicId()); catch_events.back().setIsActive(true); catch_events.back().setOneShot(true); diff --git a/rdcatchd/rdcatchd.h b/rdcatchd/rdcatchd.h index 7a4afb88..1c4b2a16 100644 --- a/rdcatchd/rdcatchd.h +++ b/rdcatchd/rdcatchd.h @@ -262,4 +262,4 @@ class MainObject : public QObject }; -#endif +#endif // RDCATCHD_H diff --git a/rdlogedit/voice_tracker.cpp b/rdlogedit/voice_tracker.cpp index f60b014a..cda7b9c1 100644 --- a/rdlogedit/voice_tracker.cpp +++ b/rdlogedit/voice_tracker.cpp @@ -214,7 +214,7 @@ VoiceTracker::VoiceTracker(const QString &logname,QString *import_path, // Voicetrack Group // RDLog *log=new RDLog(logname); - RDSvc *svc=new RDSvc(log->service(),log_config); + RDSvc *svc=new RDSvc(log->service(),rdstation_conf,log_config); track_group=new RDGroup(svc->trackGroup()); track_tracks=log->scheduledTracks()-log->completedTracks(); delete svc; diff --git a/rdlogmanager/commandline_ops.cpp b/rdlogmanager/commandline_ops.cpp index f5df3db4..f2d559bb 100644 --- a/rdlogmanager/commandline_ops.cpp +++ b/rdlogmanager/commandline_ops.cpp @@ -77,14 +77,15 @@ int RunLogOperation(int argc,char *argv[],const QString &svcname, #ifndef WIN32 rduser=new RDUser(rdstation_conf->defaultName()); #endif // WIN32 - RDSvc *svc=new RDSvc(svcname,config); + RDSvc *svc=new RDSvc(svcname,rdstation_conf,config); if(!svc->exists()) { fprintf(stderr,"rdlogmanager: no such service\n"); return 256; } QDate start_date=QDate::currentDate().addDays(1+start_offset); QString logname= - RDDateDecode(svc->nameTemplate(),start_date,config,svc->name()); + RDDateDecode(svc->nameTemplate(),start_date,rdstation_conf,config, + svc->name()); RDLog *log=new RDLog(logname); // @@ -108,9 +109,9 @@ int RunLogOperation(int argc,char *argv[],const QString &svcname, delete q; if(!svc->generateLog(start_date, RDDateDecode(svc->nameTemplate(),start_date, - config,svc->name()), + rdstation_conf,config,svc->name()), RDDateDecode(svc->nameTemplate(),start_date.addDays(1), - config,svc->name()), + rdstation_conf,config,svc->name()), &unused_report)) { fprintf(stderr,"rdlogmanager: unable to generate log\n"); return 256; @@ -235,7 +236,7 @@ int RunReportOperation(int argc,char *argv[],const QString &rptname, // // Open Report Generator // - RDReport *report=new RDReport(rptname,config); + RDReport *report=new RDReport(rptname,rdstation_conf,config); if(!report->exists()) { fprintf(stderr,"rdlogmanager: no such report\n"); return 256; diff --git a/rdlogmanager/generate_log.cpp b/rdlogmanager/generate_log.cpp index e35c5af1..e2ce7c65 100644 --- a/rdlogmanager/generate_log.cpp +++ b/rdlogmanager/generate_log.cpp @@ -306,9 +306,10 @@ void GenerateLog::createData() // // Generate Log // - RDSvc *svc=new RDSvc(gen_service_box->currentText(),log_config,this); + RDSvc *svc= + new RDSvc(gen_service_box->currentText(),rdstation_conf,log_config,this); QString logname=RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - log_config,svc->name()); + rdstation_conf,log_config,svc->name()); RDLog *log=new RDLog(logname); if(log->exists()) { str1=QString(tr("The log for")); @@ -363,9 +364,10 @@ void GenerateLog::createData() gen_progress_dialog,SLOT(setProgress(int))); svc->generateLog(gen_date_edit->date(), RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - log_config,svc->name()), + rdstation_conf,log_config,svc->name()), RDDateDecode(svc->nameTemplate(),gen_date_edit->date(). - addDays(1),log_config,svc->name()), + addDays(1),rdstation_conf,log_config, + svc->name()), &unused_report); log->updateTracks(); delete log; @@ -394,9 +396,10 @@ void GenerateLog::musicData() { unsigned tracks=0; - RDSvc *svc=new RDSvc(gen_service_box->currentText(),log_config,this); + RDSvc *svc= + new RDSvc(gen_service_box->currentText(),rdstation_conf,log_config,this); QString logname=RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - log_config,svc->name()); + rdstation_conf,log_config,svc->name()); RDLog *log=new RDLog(logname); if(((log->linkState(RDLog::SourceMusic)==RDLog::LinkDone)|| (log->linkState(RDLog::SourceTraffic)==RDLog::LinkDone))) { @@ -446,9 +449,10 @@ void GenerateLog::musicData() void GenerateLog::trafficData() { - RDSvc *svc=new RDSvc(gen_service_box->currentText(),log_config,this); + RDSvc *svc= + new RDSvc(gen_service_box->currentText(),rdstation_conf,log_config,this); QString logname=RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - log_config,svc->name()); + rdstation_conf,log_config,svc->name()); RDLog *log=new RDLog(logname); if((log->linkState(RDLog::SourceTraffic)==RDLog::LinkDone)) { QString str1=QString(tr("The log for")); @@ -481,9 +485,10 @@ void GenerateLog::trafficData() void GenerateLog::fileScanData() { - RDSvc *svc=new RDSvc(gen_service_box->currentText(),log_config,this); + RDSvc *svc= + new RDSvc(gen_service_box->currentText(),rdstation_conf,log_config,this); QString logname=RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - log_config,svc->name()); + rdstation_conf,log_config,svc->name()); RDLog *log=new RDLog(logname); if(gen_music_enabled) { if(QFile::exists(svc-> @@ -550,9 +555,10 @@ void GenerateLog::resizeEvent(QResizeEvent *e) void GenerateLog::UpdateControls() { - RDSvc *svc=new RDSvc(gen_service_box->currentText(),log_config,this); + RDSvc *svc= + new RDSvc(gen_service_box->currentText(),rdstation_conf,log_config,this); QString logname=RDDateDecode(svc->nameTemplate(),gen_date_edit->date(), - log_config,svc->name()); + rdstation_conf,log_config,svc->name()); RDLog *log=new RDLog(logname); if(log->exists()) { if(log->linkQuantity(RDLog::SourceMusic)>0) { diff --git a/rdlogmanager/pick_report_dates.cpp b/rdlogmanager/pick_report_dates.cpp index 837aec84..bbcffccc 100644 --- a/rdlogmanager/pick_report_dates.cpp +++ b/rdlogmanager/pick_report_dates.cpp @@ -178,7 +178,8 @@ void PickReportDates::generateData() tr("The end date cannot be earlier than the start date!")); return; } - RDReport *report=new RDReport(edit_report_box->currentText(),log_config,this); + RDReport *report= + new RDReport(edit_report_box->currentText(),rdstation_conf,log_config,this); if((edit_startdate_edit->date()!=edit_enddate_edit->date())&& (!RDReport::multipleDaysAllowed(report->filter()))) { QMessageBox::warning(this,tr("Invalid Date Range"), @@ -200,7 +201,8 @@ void PickReportDates::generateData() #else QString filename= RDDateDecode(report->exportPath(RDReport::Linux), - edit_startdate_edit->date(),log_config,edit_svcname); + edit_startdate_edit->date(),rdstation_conf,log_config, + edit_svcname); #endif QFile file(filename); if(file.exists()) { diff --git a/tests/datedecode_test.cpp b/tests/datedecode_test.cpp index 7e1c4177..8b968d01 100644 --- a/tests/datedecode_test.cpp +++ b/tests/datedecode_test.cpp @@ -26,6 +26,7 @@ #include #include +#include #include "datedecode_test.h" @@ -35,6 +36,7 @@ MainObject::MainObject(QObject *parent) QString date=""; QString datetime=""; QString service=""; + unsigned schema=0; // // Read Command Options @@ -78,17 +80,30 @@ MainObject::MainObject(QObject *parent) RDConfig *config=new RDConfig(); config->load(); + // + // Open Database + // + QString err (tr("datedecode_test: ")); + QSqlDatabase *db=RDInitDb(&schema,&err); + if(!db) { + fprintf(stderr,err.ascii()); + delete cmd; + exit(256); + } + RDStation *station=new RDStation(config->stationName()); + // // Process Code // if(!date.isEmpty()) { printf("%s\n", - (const char *)RDDateDecode(date,QDate::currentDate(),config, + (const char *)RDDateDecode(date,QDate::currentDate(),station,config, service)); } if(!datetime.isEmpty()) { printf("%s\n",(const char *)RDDateTimeDecode(datetime, - QDateTime(QDate::currentDate(),QTime::currentTime()),config,service)); + QDateTime(QDate::currentDate(),QTime::currentTime()),station, + config,service)); } exit(0); } diff --git a/utils/rdclilogedit/operations.cpp b/utils/rdclilogedit/operations.cpp index 1dec76fd..a96a569b 100644 --- a/utils/rdclilogedit/operations.cpp +++ b/utils/rdclilogedit/operations.cpp @@ -509,7 +509,7 @@ void MainObject::Setpurgedate(const QDate &date) void MainObject::Setservice(const QString &str) { - RDSvc *svc=new RDSvc(str,edit_config); + RDSvc *svc=new RDSvc(str,edit_station,edit_config); if(svc->exists()) { edit_service=str; edit_modified=true; diff --git a/utils/rddgimport/rddgimport.cpp b/utils/rddgimport/rddgimport.cpp index eb742518..2e34d27e 100644 --- a/utils/rddgimport/rddgimport.cpp +++ b/utils/rddgimport/rddgimport.cpp @@ -209,7 +209,7 @@ void MainWidget::serviceActivatedData(int index) if(dg_svc!=NULL) { delete dg_svc; } - dg_svc=new RDSvc(dg_service_box->currentText(),dg_config); + dg_svc=new RDSvc(dg_service_box->currentText(),dg_station,dg_config); if(dg_group!=NULL) { delete dg_group; } @@ -391,7 +391,8 @@ bool MainWidget::WriteTrafficFile() // Open Output File // outname=RDDateDecode(dg_svc->importPath(RDSvc::Traffic,RDSvc::Linux), - dg_date_edit->date(),dg_config,dg_svc->name()); + dg_date_edit->date(),dg_station, + dg_config,dg_svc->name()); if((f=fopen(outname,"w"))==NULL) { LogMessage(tr("WARNING: Unable to open traffic output file")+" \""+ outname+"\" ["+strerror(errno)+"]."); diff --git a/utils/rdrevert/rdrevert.cpp b/utils/rdrevert/rdrevert.cpp index d6666b32..36fe42f5 100644 --- a/utils/rdrevert/rdrevert.cpp +++ b/utils/rdrevert/rdrevert.cpp @@ -235,6 +235,10 @@ void MainObject::Revert(int schema) const case 269: Revert269(); break; + + case 270: + Revert270(); + break; } } @@ -706,6 +710,19 @@ void MainObject::Revert269() const } +void MainObject::Revert270() const +{ + QString sql; + QSqlQuery *q; + + sql="alter table STATIONS drop column SHORT_NAME"; + q=new QSqlQuery(sql); + delete q; + + SetVersion(269); +} + + int MainObject::GetVersion() const { QString sql; @@ -750,7 +767,7 @@ int MainObject::MapSchema(const QString &ver) version_map["2.15"]=259; version_map["2.16"]=263; version_map["2.17"]=268; - version_map["2.18"]=269; + version_map["2.18"]=270; // // Normalize String diff --git a/utils/rdrevert/rdrevert.h b/utils/rdrevert/rdrevert.h index ed484d2a..d097c862 100644 --- a/utils/rdrevert/rdrevert.h +++ b/utils/rdrevert/rdrevert.h @@ -65,6 +65,7 @@ class MainObject : public QObject void Revert267() const; void Revert268() const; void Revert269() const; + void Revert270() const; int GetVersion() const; void SetVersion(int schema) const; int MapSchema(const QString &ver); diff --git a/web/rdxport/logs.cpp b/web/rdxport/logs.cpp index f7a443db..5d557545 100644 --- a/web/rdxport/logs.cpp +++ b/web/rdxport/logs.cpp @@ -52,7 +52,7 @@ void Xport::AddLog() if(!xport_post->getValue("SERVICE_NAME",&service_name)) { XmlExit("Missing SERVICE_NAME",400,"logs.cpp",LINE_NUMBER); } - RDSvc *svc=new RDSvc(service_name,xport_config); + RDSvc *svc=new RDSvc(service_name,xport_station,xport_config); if(!svc->exists()) { XmlExit("No such service",404,"logs.cpp",LINE_NUMBER); } diff --git a/web/rdxport/services.cpp b/web/rdxport/services.cpp index 406e40a6..f4489f1e 100644 --- a/web/rdxport/services.cpp +++ b/web/rdxport/services.cpp @@ -64,7 +64,7 @@ void Xport::ListServices() printf("\n"); printf("\n"); while(q->next()) { - svc=new RDSvc(q->value(0).toString(),xport_config); + svc=new RDSvc(q->value(0).toString(),xport_station,xport_config); printf("%s",(const char *)svc->xml()); delete svc; }