2018-07-16 Fred Gleason <fredg@paravelsystems.com>

* Cleaned up SQL quieries in 'rdadmin/' ensure UTF-8 compatibility.
This commit is contained in:
Fred Gleason 2018-07-16 17:31:07 -04:00
parent 363dbb7878
commit 36269f7725
61 changed files with 1430 additions and 1254 deletions

View File

@ -17123,3 +17123,5 @@
* Fixed a bug in rddbmgr(8) that caused reversion 289 to fail.
2018-07-12 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up SQL quieries in 'lib/' ensure UTF-8 compatibility.
2018-07-16 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up SQL quieries in 'rdadmin/' ensure UTF-8 compatibility.

View File

@ -1,8 +1,8 @@
// add_encoder.cpp
//
// Add a Rivendell Service
// Add a Rivendell Encoder
//
// (C) Copyright 2002,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -113,10 +113,9 @@ void AddEncoder::okData()
QString sql;
RDSqlQuery *q;
sql=QString().sprintf("select NAME from ENCODERS \
where (NAME=\"%s\")&&(STATION_NAME=\"%s\")",
(const char *)RDEscapeString(encoder_name_edit->text()),
(const char *)RDEscapeString(encoder_stationname));
sql=QString("select NAME from ENCODERS where ")+
"(NAME=\""+RDEscapeString(encoder_name_edit->text())+"\")&&"+
"(STATION_NAME=\""+RDEscapeString(encoder_stationname)+"\")";
q=new RDSqlQuery(sql);
if(q->first()) {
QMessageBox::warning(this,tr("Add Encoder Error"),
@ -129,10 +128,9 @@ void AddEncoder::okData()
//
// Create Encoder
//
sql=QString().sprintf("insert into ENCODERS set NAME=\"%s\",\
STATION_NAME=\"%s\"",
(const char *)RDEscapeString(encoder_name_edit->text()),
(const char *)RDEscapeString(encoder_stationname));
sql=QString("insert into ENCODERS set ")+
"NAME=\""+RDEscapeString(encoder_name_edit->text())+"\""+
"STATION_NAME=\""+RDEscapeString(encoder_stationname)+"\"";
q=new RDSqlQuery(sql);
delete q;
*encoder_name=encoder_name_edit->text();

View File

@ -134,8 +134,8 @@ void AddFeed::okData()
RDSqlQuery *q;
RDSqlQuery *q1;
sql=QString().sprintf("select KEY_NAME from FEEDS where KEY_NAME=\"%s\"",
(const char *)feed_keyname_edit->text());
sql=QString("select KEY_NAME from FEEDS where ")+
"KEY_NAME=\""+RDEscapeString(feed_keyname_edit->text())+"\"";
q=new RDSqlQuery(sql);
if(q->first()) {
QMessageBox::warning(this,tr("Add Feed Error"),
@ -149,14 +149,13 @@ void AddFeed::okData()
// Create Default Feed Perms
//
if(feed_users_box->isChecked()) {
sql="select LOGIN_NAME from USERS \
where (ADMIN_USERS_PRIV='N')&&(ADMIN_CONFIG_PRIV='N')";
sql=QString("select LOGIN_NAME from USERS where ")+
"(ADMIN_USERS_PRIV='N')&&(ADMIN_CONFIG_PRIV='N')";
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString().sprintf("insert into FEED_PERMS set USER_NAME=\"%s\",\
KEY_NAME=\"%s\"",
(const char *)q->value(0).toString(),
(const char *)feed_keyname_edit->text());
sql=QString("insert into FEED_PERMS set ")+
"USER_NAME=\""+RDEscapeString(q->value(0).toString())+"\","+
"KEY_NAME=\""+RDEscapeString(feed_keyname_edit->text())+"\"";
q1=new RDSqlQuery(sql);
delete q1;
}
@ -166,23 +165,18 @@ void AddFeed::okData()
//
// Create Feed
//
sql=QString().sprintf("insert into FEEDS set KEY_NAME=\"%s\",\
ORIGIN_DATETIME=\"%s %s\",HEADER_XML=\"%s\",\
CHANNEL_XML=\"%s\",ITEM_XML=\"%s\"",
(const char *)feed_keyname_edit->text(),
(const char *)QDate::currentDate().
toString("yyyy-MM-dd"),
(const char *)QTime::currentTime().
toString("hh:mm:ss"),
(const char *)RDEscapeString(DEFAULT_HEADER_XML),
(const char *)RDEscapeString(DEFAULT_CHANNEL_XML),
(const char *)RDEscapeString(DEFAULT_ITEM_XML));
sql=QString("insert into FEEDS set ")+
"KEY_NAME=\""+RDEscapeString(feed_keyname_edit->text())+"\","+
"ORIGIN_DATETIME=now(),"+
"HEADER_XML=\""+RDEscapeString(DEFAULT_HEADER_XML)+"\","+
"CHANNEL_XML=\""+RDEscapeString(DEFAULT_CHANNEL_XML)+"\","+
"ITEM_XML=\""+RDEscapeString(DEFAULT_ITEM_XML)+"\"";
q=new RDSqlQuery(sql);
delete q;
RDCreateFeedLog(feed_keyname_edit->text());
RDCreateAuxFieldsTable(feed_keyname_edit->text(),rda->config());
sql=QString().sprintf("select ID from FEEDS where KEY_NAME=\"%s\"",
(const char *)feed_keyname_edit->text());
sql=QString("select ID from FEEDS where ")+
"KEY_NAME=\""+RDEscapeString(feed_keyname_edit->text())+"\"";
q=new RDSqlQuery(sql);
if(q->first()) {
*feed_id=q->value(0).toUInt();

View File

@ -150,8 +150,8 @@ void AddGroup::okData()
return;
}
sql=QString().sprintf("insert into GROUPS set NAME=\"%s\"",
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("insert into GROUPS set ")+
"NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
if(!q->isActive()) {
@ -169,10 +169,9 @@ void AddGroup::okData()
sql="select LOGIN_NAME from USERS";
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString().sprintf("insert into USER_PERMS set USER_NAME=\"%s\",\
GROUP_NAME=\"%s\"",
(const char *)q->value(0).toString(),
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("insert into USER_PERMS set ")+
"USER_NAME=\""+RDEscapeString(q->value(0).toString())+"\","+
"GROUP_NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q1=new RDSqlQuery(sql);
delete q1;
}
@ -186,10 +185,9 @@ void AddGroup::okData()
sql="select NAME from SERVICES";
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString().sprintf("insert into AUDIO_PERMS set SERVICE_NAME=\"%s\",\
GROUP_NAME=\"%s\"",
(const char *)q->value(0).toString(),
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("insert into AUDIO_PERMS set ")+
"SERVICE_NAME=\""+RDEscapeString(q->value(0).toString())+"\","+
"GROUP_NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q1=new RDSqlQuery(sql);
delete q1;
}
@ -198,16 +196,16 @@ void AddGroup::okData()
EditGroup *group=new EditGroup(group_name_edit->text(),this);
if(group->exec()<0) {
sql=QString().sprintf("delete from USER_PERMS where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("delete from USER_PERMS where ")+
"GROUP_NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from AUDIO_PERMS where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("delete from AUDIO_PERMS where ")+
"GROUP_NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from GROUPS where NAME=\"%s\"",
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("delete from GROUPS where ")+
"NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
delete group;

View File

@ -2,7 +2,7 @@
//
// Add a Rivendell Replicator Configuration
//
// (C) Copyright 2010,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2010,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -31,11 +31,13 @@
#include <qbuttongroup.h>
#include <rddb.h>
#include <edit_replicator.h>
#include <add_replicator.h>
#include <rdescape_string.h>
#include <rdpasswd.h>
#include <rdtextvalidator.h>
#include "edit_replicator.h"
#include "add_replicator.h"
AddReplicator::AddReplicator(QString *rname,QWidget *parent)
: QDialog(parent,"",true)
{
@ -126,9 +128,8 @@ void AddReplicator::okData()
return;
}
sql=QString().sprintf("insert into REPLICATORS set NAME=\"%s\"",
(const char *)repl_name_edit->text());
sql=QString("insert into REPLICATORS set ")+
"NAME=\""+RDEscapeString(repl_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
if(!q->isActive()) {
QMessageBox::warning(this,tr("Replicator Exists"),tr("A replicator with that name already exists!"));
@ -139,8 +140,8 @@ void AddReplicator::okData()
EditReplicator *replicator=new EditReplicator(repl_name_edit->text(),this);
if(replicator->exec()<0) {
sql=QString().sprintf("delete from REPLICATORS where NAME=\"%s\"",
(const char *)repl_name_edit->text());
sql=QString("delete from REPLICATORS where ")+
"NAME=\""+RDEscapeString(repl_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
delete replicator;

View File

@ -30,14 +30,15 @@
#include <qcheckbox.h>
#include <qbuttongroup.h>
#include <rddb.h>
#include <rd.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rdtextvalidator.h>
#include <add_report.h>
#include <test_import.h>
#include <autofill_carts.h>
#include <edit_svc_perms.h>
#include "add_report.h"
#include "test_import.h"
#include "autofill_carts.h"
#include "edit_svc_perms.h"
AddReport::AddReport(QString *rptname,QWidget *parent)
: QDialog(parent,"",true)
@ -122,8 +123,8 @@ void AddReport::okData()
tr("You must provide a report name!"));
return;
}
sql=QString().sprintf("select NAME from REPORTS where NAME=\"%s\"",
(const char *)add_name_edit->text());
sql=QString("select NAME from REPORTS where ")+
"NAME=\""+RDEscapeString(add_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
if(q->first()) {
QMessageBox::warning(this,tr("Report Exists"),
@ -132,8 +133,8 @@ void AddReport::okData()
return;
}
delete q;
sql=QString().sprintf("insert into REPORTS set NAME=\"%s\"",
(const char *)add_name_edit->text());
sql=QString("insert into REPORTS set ")+
"NAME=\""+RDEscapeString(add_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
*add_name=add_name_edit->text();

View File

@ -2,7 +2,7 @@
//
// Add scheduler codes dialog
//
// Stefan Gabriel <stg@st-gabriel.de>
// Copyright 2005-2018 Stefan Gabriel <stg@st-gabriel.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -31,11 +31,12 @@
#include <qbuttongroup.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rdpasswd.h>
#include <rdtextvalidator.h>
#include <edit_schedcodes.h>
#include <add_schedcodes.h>
#include "edit_schedcodes.h"
#include "add_schedcodes.h"
AddSchedCode::AddSchedCode(QString *schedCode,QWidget *parent)
: QDialog(parent,"",true)
@ -128,9 +129,8 @@ void AddSchedCode::okData()
return;
}
sql=QString().sprintf("insert into SCHED_CODES set CODE=\"%s\"",
(const char *)schedCode_name_edit->text());
sql=QString("insert into SCHED_CODES set ")+
"CODE=\""+RDEscapeString(schedCode_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
if(!q->isActive()) {
QMessageBox::warning(this,tr("Code Exists"),tr("Code Already Exists!"),

View File

@ -2,7 +2,7 @@
//
// Add a Rivendell Workstation
//
// (C) Copyright 2002-2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -33,12 +33,12 @@
#include <rddb.h>
#include <rdairplay_conf.h>
#include <rdescape_string.h>
#include <edit_station.h>
#include <add_station.h>
#include <rdpasswd.h>
#include <rdtextvalidator.h>
#include "add_station.h"
#include "edit_station.h"
AddStation::AddStation(QString *stationname,QWidget *parent)
: QDialog(parent,"",true)
{
@ -185,17 +185,14 @@ void AddStation::CloneEncoderValues(const QString &paramname,
RDSqlQuery *q;
RDSqlQuery *q1;
sql=QString().sprintf("select %s from ENCODER_%s where ENCODER_ID=%d",
(const char *)RDEscapeString(paramname),
(const char *)RDEscapeString(paramname),
src_id);
sql=QString("select ")+
paramname+" from `ENCODER_"+paramname+"` where "+
QString().sprintf("ENCODER_ID=%d",src_id);
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString().sprintf("insert into ENCODER_%s set %s=%d,ENCODER_ID=%d",
(const char *)RDEscapeString(paramname),
(const char *)RDEscapeString(paramname),
q->value(0).toInt(),
dest_id);
sql=QString("insert into `ENCODER_")+
paramname+"` set "+paramname+
QString().sprintf("=%d,ENCODER_ID=%d",q->value(0).toInt(),dest_id);
q1=new RDSqlQuery(sql);
delete q1;
}

View File

@ -121,9 +121,9 @@ void AddUser::okData()
return;
}
sql=QString().sprintf("insert into USERS set LOGIN_NAME=\"%s\",\
PASSWORD=PASSWORD(\"\")",
(const char *)username);
sql=QString("insert into USERS set ")+
"LOGIN_NAME=\""+RDEscapeString(username)+"\","+
"PASSWORD=PASSWORD(\"\")";
q=new RDSqlQuery(sql);
if(!q->isActive()) {
QMessageBox::warning(this,tr("User Exists"),tr("User Already Exists!"),
@ -135,22 +135,21 @@ void AddUser::okData()
sql="select NAME from GROUPS";
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString().sprintf("insert into USER_PERMS set USER_NAME=\"%s\",\
GROUP_NAME=\"%s\"",
(const char *)username,
(const char *)q->value(0).toString());
sql=QString("insert into USER_PERMS set ")+
"USER_NAME=\""+RDEscapeString(username)+"\","+
"GROUP_NAME=\""+RDEscapeString(q->value(0).toString())+"\"";
q1=new RDSqlQuery(sql);
delete q1;
}
delete q;
EditUser *user=new EditUser(user_name_edit->text(),this);
if(user->exec()<0) {
sql=QString().sprintf("delete from USER_PERMS where USER_NAME=\"%s\"",
(const char *)username);
sql=QString("delete from USER_PERMS where ")+
"USER_NAME=\""+RDEscapeString(username)+"\"";
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from USERS where LOGIN_NAME=\"%s\"",
(const char *)username);
sql=QString("delete from USERS where ")+
"LOGIN_NAME=\""+RDEscapeString(username)+"\"";
q=new RDSqlQuery(sql);
delete q;
delete user;

View File

@ -33,8 +33,9 @@
#include <rd.h>
#include <rdapplication.h>
#include <rdcart_dialog.h>
#include <rddb.h>
#include <rdconf.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rduser.h>
#include "autofill_carts.h"
@ -55,9 +56,7 @@ AutofillCarts::AutofillCarts(RDSvc *svc,QWidget *parent)
svc_svc=svc;
str=QString(tr("Autofill Carts - Service:"));
setCaption(QString().sprintf("%s %s",(const char *)str,
(const char *)svc_svc->name()));
setCaption(tr("Autofill Carts - Service:")+" "+svc_svc->name());
//
// Create Fonts
@ -175,15 +174,15 @@ void AutofillCarts::deleteData()
void AutofillCarts::okData()
{
QString sql=QString().sprintf("delete from AUTOFILLS where SERVICE=\"%s\"",
(const char *)svc_svc->name());
QString sql=QString("delete from AUTOFILLS where ")+
"SERVICE=\""+RDEscapeString(svc_svc->name())+"\"";
RDSqlQuery *q=new RDSqlQuery(sql);
delete q;
QListViewItem *item=svc_cart_list->firstChild();
while(item!=NULL) {
sql=QString().sprintf("insert into AUTOFILLS set SERVICE=\"%s\",\
CART_NUMBER=%u",(const char *)svc_svc->name(),
item->text(0).toUInt());
sql=QString("insert into AUTOFILLS set ")+
"SERVICE=\""+RDEscapeString(svc_svc->name())+"\","+
QString().sprintf("CART_NUMBER=%u",item->text(0).toUInt());
q=new RDSqlQuery(sql);
delete q;
item=item->nextSibling();
@ -203,12 +202,13 @@ void AutofillCarts::RefreshList()
QListViewItem *item;
svc_cart_list->clear();
QString sql=QString().sprintf("select AUTOFILLS.CART_NUMBER,\
CART.FORCED_LENGTH,CART.TITLE,CART.ARTIST\
from AUTOFILLS left join CART\
on AUTOFILLS.CART_NUMBER=CART.NUMBER\
where SERVICE=\"%s\"",
(const char *)svc_svc->name());
QString sql=QString("select ")+
"AUTOFILLS.CART_NUMBER,"+ // 00
"CART.FORCED_LENGTH,"+ // 01
"CART.TITLE,CART.ARTIST "+ // 02
"from AUTOFILLS left join CART "+
"on AUTOFILLS.CART_NUMBER=CART.NUMBER where "+
"SERVICE=\""+RDEscapeString(svc_svc->name())+"\"";
RDSqlQuery *q=new RDSqlQuery(sql);
while(q->next()) {
item=new QListViewItem(svc_cart_list);

View File

@ -98,7 +98,7 @@ EditAudioPorts::EditAudioPorts(QString station,QWidget *parent)
// Input Port Controls
//
str=QString(tr("Input Port"));
label=new QLabel(QString().sprintf("%s %d",(const char *)str,j*4+i),this);
label=new QLabel(str+QString().sprintf(" %d",j*4+i),this);
label->setGeometry(50+170*i,55+j*180,170,22);
label->setFont(font);
label->setAlignment(AlignHCenter);
@ -140,7 +140,7 @@ EditAudioPorts::EditAudioPorts(QString station,QWidget *parent)
// Output Port Controls
//
str=QString(tr("Output Port"));
label=new QLabel(QString().sprintf("%s %d",(const char *)str,j*4+i),this);
label=new QLabel(str+QString().sprintf(" %d",j*4+i),this);
label->setGeometry(50+170*i,170+j*180,170,22);
label->setFont(font);
label->setAlignment(AlignHCenter);

View File

@ -123,10 +123,9 @@ void EditAuxField::okData()
QString sql;
RDSqlQuery *q;
sql=QString().sprintf("update AUX_METADATA set CAPTION=\"%s\" \
where ID=%u",
(const char *)RDEscapeString(edit_caption_edit->text()),
edit_field_id);
sql=QString("update AUX_METADATA set ")+
"CAPTION=\""+RDEscapeString(edit_caption_edit->text())+"\" where "+
QString().sprintf("ID=%u",edit_field_id);
q=new RDSqlQuery(sql);
delete q;

View File

@ -782,12 +782,10 @@ int EditDecks::GetOutput()
{
int output=-1;
QString sql=QString().sprintf("select NUMBER from OUTPUTS where \
(STATION_NAME=\"%s\")&&(MATRIX=%d)&&\
(NAME=\"%s\")",
(const char *)edit_swstation_box->currentText(),
GetMatrix(),
(const char *)edit_swoutput_box->currentText());
QString sql=QString("select NUMBER from OUTPUTS where ")+
"(STATION_NAME=\""+RDEscapeString(edit_swstation_box->currentText())+"\")&&"+
QString().sprintf("(MATRIX=%d)&&",GetMatrix())+
"(NAME=\""+RDEscapeString(edit_swoutput_box->currentText())+"\")";
RDSqlQuery *q=new RDSqlQuery(sql);
if(q->first()) {
output=q->value(0).toInt();

View File

@ -575,7 +575,6 @@ void EditDropbox::resetData()
}
QString sql=QString("delete from DROPBOX_PATHS where ")+
QString().sprintf("DROPBOX_ID=%d",box_dropbox->id());
printf("SQL: %s\n",(const char *)sql);
RDSqlQuery *q=new RDSqlQuery(sql);
delete q;
QMessageBox::information(this,"RDAdmin - "+tr("Reset Dropbox"),

View File

@ -157,10 +157,9 @@ void EditEncoder::okData()
QString sql;
RDSqlQuery *q;
sql=QString().
sprintf("update ENCODERS set DEFAULT_EXTENSION=\"%s\",COMMAND_LINE=\"%s\"",
(const char *)RDEscapeString(edit_extension_edit->text()),
(const char *)RDEscapeString(edit_commandline_edit->text()));
sql=QString("update ENCODERS set ")+
"DEFAULT_EXTENSION=\""+RDEscapeString(edit_extension_edit->text())+"\","+
"COMMAND_LINE=\""+RDEscapeString(edit_commandline_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
SaveList("CHANNELS",edit_channel_edit);
@ -183,12 +182,10 @@ void EditEncoder::LoadList(const QString &paramname,RDIntegerEdit *edit)
RDSqlQuery *q;
std::vector<int> values;
sql=QString().sprintf("select %s from ENCODER_%s where ENCODER_ID=%d\
order by %s",
(const char *)paramname,
(const char *)paramname,
edit_encoder_id,
(const char *)paramname);
sql=QString("select ")+
paramname+" from `ENCODER_"+paramname+"` where "+
QString().sprintf("ENCODER_ID=%d ",edit_encoder_id)+
"order by "+paramname;
q=new RDSqlQuery(sql);
while(q->next()) {
values.push_back(q->value(0).toInt());
@ -204,17 +201,15 @@ void EditEncoder::SaveList(const QString &paramname,RDIntegerEdit *edit)
RDSqlQuery *q;
std::vector<int> values;
sql=QString().sprintf("delete from ENCODER_%s where ENCODER_ID=%d",
(const char *)paramname,edit_encoder_id);
sql=QString("delete from `ENCODER_")+paramname+"` where "+
QString().sprintf("ENCODER_ID=%d",edit_encoder_id);
q=new RDSqlQuery(sql);
delete q;
edit->values(&values);
for(unsigned i=0;i<values.size();i++) {
sql=QString().sprintf("insert into ENCODER_%s set ENCODER_ID=%d,%s=%d",
(const char *)paramname,
edit_encoder_id,
(const char *)paramname,
values[i]);
sql=QString("insert into `ENCODER_")+paramname+"` set "+
QString().sprintf("ENCODER_ID=%d,",edit_encoder_id)+
paramname+QString().sprintf("=%d",values[i]);
q=new RDSqlQuery(sql);
delete q;
}

View File

@ -2,7 +2,7 @@
//
// Edit Rivendell RSS Feed Permissions
//
// (C) Copyright 2002-2005,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2005,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -31,9 +31,11 @@
#include <qbuttongroup.h>
#include <rddb.h>
#include <edit_feed_perms.h>
#include <rduser.h>
#include <rdescape_string.h>
#include <rdpasswd.h>
#include <rduser.h>
#include "edit_feed_perms.h"
EditFeedPerms::EditFeedPerms(RDUser *user,QWidget *parent)
: QDialog(parent,"",true)
@ -90,9 +92,8 @@ EditFeedPerms::EditFeedPerms(RDUser *user,QWidget *parent)
//
// Populate Fields
//
sql=QString().sprintf("select KEY_NAME from FEED_PERMS \
where USER_NAME=\"%s\"",
(const char *)feed_user->name());
sql=QString("select KEY_NAME from FEED_PERMS where ")+
"USER_NAME=\""+RDEscapeString(feed_user->name())+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
@ -137,18 +138,15 @@ void EditFeedPerms::okData()
// Add New Groups
//
for(unsigned i=0;i<feed_host_sel->destCount();i++) {
sql=QString().sprintf("select KEY_NAME from FEED_PERMS \
where USER_NAME=\"%s\" && KEY_NAME=\"%s\"",
(const char *)feed_user->name(),
(const char *)feed_host_sel->destText(i));
sql=QString("select KEY_NAME from FEED_PERMS where ")+
"USER_NAME=\""+RDEscapeString(feed_user->name())+"\" && "+
"KEY_NAME=\""+RDEscapeString(feed_host_sel->destText(i))+"\"";
q=new RDSqlQuery(sql);
if(q->size()==0) {
delete q;
sql=QString().
sprintf("insert into FEED_PERMS (USER_NAME,KEY_NAME) \
values (\"%s\",\"%s\")",
(const char *)feed_user->name(),
(const char *)feed_host_sel->destText(i));
sql=QString("insert into FEED_PERMS (USER_NAME,KEY_NAME) ")+
"values (\""+RDEscapeString(feed_user->name())+"\","+
"\""+RDEscapeString(feed_host_sel->destText(i))+"\")";
q=new RDSqlQuery(sql);
}
delete q;
@ -157,11 +155,11 @@ void EditFeedPerms::okData()
//
// Delete Old Groups
//
sql=QString().sprintf("delete from FEED_PERMS where USER_NAME=\"%s\"",
(const char *)feed_user->name());
sql=QString("delete from FEED_PERMS where ")+
"USER_NAME=\""+RDEscapeString(feed_user->name())+"\"";
for(unsigned i=0;i<feed_host_sel->destCount();i++) {
sql+=QString().sprintf(" && KEY_NAME<>\"%s\"",
(const char *)feed_host_sel->destText(i));
sql+=QString(" && KEY_NAME<>\"")+
RDEscapeString(feed_host_sel->destText(i))+"\"";
}
q=new RDSqlQuery(sql);
delete q;

View File

@ -32,15 +32,12 @@ EditGpi::EditGpi(int gpi,int *oncart,QString *ondesc,
int *offcart,QString *offdesc,QWidget *parent)
: QDialog(parent,"",true)
{
QString str;
edit_gpi=gpi;
edit_oncart=oncart;
edit_offcart=offcart;
edit_ondescription=ondesc;
edit_offdescription=offdesc;
str=QString(tr("Edit GPI"));
setCaption(QString().sprintf("%s %d",(const char *)str,gpi));
setCaption(tr("Edit GPI")+QString().sprintf(" %d",gpi));
//
// Fix the Window Size

View File

@ -2,7 +2,7 @@
//
// Edit a Rivendell Group
//
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2004,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -30,13 +30,15 @@
#include <qmessagebox.h>
#include <qcheckbox.h>
#include <qbuttongroup.h>
#include <rddb.h>
#include <qcolordialog.h>
#include <edit_group.h>
#include <rduser.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rdpasswd.h>
#include <rdtextvalidator.h>
#include <rduser.h>
#include "edit_group.h"
EditGroup::EditGroup(QString group,QWidget *parent)
: QDialog(parent,"",true)
@ -261,9 +263,8 @@ EditGroup::EditGroup(QString group,QWidget *parent)
}
purgeEnabledData(group_shelflife_check->isChecked());
group_nownext_check->setChecked(group_group->enableNowNext());
sql=QString().sprintf("select SERVICE_NAME from AUDIO_PERMS \
where GROUP_NAME=\"%s\"",
(const char *)group_group->name());
sql=QString("select SERVICE_NAME from AUDIO_PERMS where ")+
"GROUP_NAME=\""+RDEscapeString(group_group->name())+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
group_svcs_sel->destInsertItem(q->value(0).toString());
@ -395,17 +396,15 @@ void EditGroup::okData()
// Add New Services
//
for(unsigned i=0;i<group_svcs_sel->destCount();i++) {
sql=QString().sprintf("select SERVICE_NAME from AUDIO_PERMS \
where GROUP_NAME=\"%s\" && SERVICE_NAME=\"%s\"",
(const char *)group_group->name(),
(const char *)group_svcs_sel->destText(i));
sql=QString("select SERVICE_NAME from AUDIO_PERMS where ")+
"GROUP_NAME=\""+RDEscapeString(group_group->name())+"\" && "+
"SERVICE_NAME=\""+RDEscapeString(group_svcs_sel->destText(i))+"\"";
q=new RDSqlQuery(sql);
if(q->size()==0) {
delete q;
sql=QString().sprintf("insert into AUDIO_PERMS (GROUP_NAME,SERVICE_NAME) \
values (\"%s\",\"%s\")",
(const char *)group_group->name(),
(const char *)group_svcs_sel->destText(i));
sql=QString("insert into AUDIO_PERMS (GROUP_NAME,SERVICE_NAME) ")+
"values (\""+RDEscapeString(group_group->name())+"\","+
"\""+RDEscapeString(group_svcs_sel->destText(i))+"\")";
q=new RDSqlQuery(sql);
}
delete q;
@ -414,11 +413,11 @@ values (\"%s\",\"%s\")",
//
// Delete Old Services
//
sql=QString().sprintf("delete from AUDIO_PERMS where GROUP_NAME=\"%s\"",
(const char *)group_group->name());
sql=QString("delete from AUDIO_PERMS where ")+
"GROUP_NAME=\""+RDEscapeString(group_group->name())+"\"";
for(unsigned i=0;i<group_svcs_sel->destCount();i++) {
sql+=QString().sprintf(" && SERVICE_NAME<>\"%s\"",
(const char *)group_svcs_sel->destText(i));
sql+=QString(" && SERVICE_NAME<>\"")+
RDEscapeString(group_svcs_sel->destText(i))+"\"";
}
q=new RDSqlQuery(sql);
delete q;
@ -498,16 +497,19 @@ bool EditGroup::CheckRange()
QString msg=
tr("The selected cart range conflicts with the following groups:\n\n");
sql=QString().sprintf("select NAME,DEFAULT_LOW_CART,DEFAULT_HIGH_CART\
from GROUPS where NAME!=\"%s\"",
(const char *)group_name_edit->text());
sql=QString("select ")+
"NAME,"+ // 00
"DEFAULT_LOW_CART,"+ // 01
"DEFAULT_HIGH_CART "+ // 02
"from GROUPS where "+
"NAME!=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
if(((group_lowcart_box->value()<=q->value(1).toInt())&&
(group_highcart_box->value()>=q->value(1).toInt()))||
((group_lowcart_box->value()<=q->value(2).toInt())&&
(group_highcart_box->value()>=q->value(2).toInt()))) {
msg+=QString().sprintf(" %s\n",(const char *)q->value(0).toString());
msg+=QString(" ")+q->value(0).toString()+"\n";
conflict_found=true;
}
}

View File

@ -2,7 +2,7 @@
//
// Edit the Hot Key Configuration for a Rivendell Workstation.
//
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2004,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -25,9 +25,12 @@
#include <qsqldatabase.h>
#include <qmessagebox.h>
#include <qlistbox.h>
#include <rdescape_string.h>
#include <rdhotkeylist.h>
#include <edit_hotkeys.h>
#include <globals.h>
#include "edit_hotkeys.h"
#include "globals.h"
EditHotkeys::EditHotkeys(const QString &station,const QString &module,
@ -201,8 +204,7 @@ void EditHotkeys::save()
stringlist[i++][0] = QString("");
}
else {
stringlist[i++][0] = QString().sprintf("%s",
(const char *) start->current()->text(1));
stringlist[i++][0]=start->current()->text(1);
}
++(*start);
}
@ -212,9 +214,8 @@ void EditHotkeys::save()
for (cur = top + 1; cur < i; cur ++) {
if ( (strcmp(stringlist[top][0],stringlist[cur][0]) == 0) &&
(!(stringlist[top][0].isEmpty()) ) ){
QString str = tr(QString().sprintf( \
"Duplicate Hotkey defined %s\n No Duplicates allowed.",
(const char *)stringlist[cur][0] ));
QString str=tr("Duplicate Hotkey defined")+" "+stringlist[cur][0]+"\n "+
tr("No Duplicates allowed.");
QMessageBox::warning(this,tr("Duplicate Entries"),str);
return;
}
@ -223,15 +224,12 @@ void EditHotkeys::save()
start = new QListViewItemIterator(list_view);
while (start->current()) {
sql = QString().sprintf("UPDATE RDHOTKEYS SET KEY_VALUE = \"%s\" \
WHERE KEY_LABEL = \"%s\" AND \
STATION_NAME = \"%s\" AND \
MODULE_NAME = \"%s\"",
(const char *)start->current()->text(1),
(const char *)start->current()->text(0),
(const char *)hotkey_conf,
(const char *)hotkey_module);
while(start->current()) {
sql=QString("update RDHOTKEYS set ")+
"KEY_VALUE=\""+RDEscapeString(start->current()->text(1))+"\" where "+
"KEY_LABEL=\""+RDEscapeString(start->current()->text(0))+"\" && "+
"STATION_NAME=\""+RDEscapeString(hotkey_conf)+"\" && "+
"MODULE_NAME=\""+RDEscapeString(hotkey_module)+"\"";
q=new RDSqlQuery(sql);
delete q;
++(*start);
@ -374,11 +372,11 @@ void EditHotkeys::keyReleaseEvent (QKeyEvent *e)
CtrlKeyHit = false;
if (keystrokecount > 0) keystrokecount--;
}
keystroke->setText(QString().sprintf("%s",(const char *)hotkeystrokes));
keystroke->setText(hotkeystrokes);
return;
}
if (keystrokecount > 2) {
keystroke->setText(QString().sprintf("%s",(const char *)hotkeystrokes));
keystroke->setText(hotkeystrokes);
return;
}
@ -401,7 +399,7 @@ void EditHotkeys::keyReleaseEvent (QKeyEvent *e)
}
hotkeystrokes += mystring;
keystroke->setText(QString().sprintf("%s",(const char *)hotkeystrokes));
keystroke->setText(hotkeystrokes);
keystrokecount = 0;
return;
}
@ -420,13 +418,13 @@ void EditHotkeys::RefreshList()
// Build Rows of List View I do this in reverse...
sql=QString().sprintf("select KEY_LABEL , KEY_VALUE from RDHOTKEYS \
where STATION_NAME = \"%s\" AND \
MODULE_NAME = \"%s\" \
ORDER BY KEY_ID DESC",
(const char *)hotkey_conf,
(const char *)hotkey_module);
sql=QString("select ")+
"KEY_LABEL,"+ // 00
"KEY_VALUE "+ // 01
"from RDHOTKEYS where "+
"STATION_NAME=\""+RDEscapeString(hotkey_conf)+"\" && "+
"MODULE_NAME=\""+RDEscapeString(hotkey_module)+"\" "+
"order by KEY_ID DESC";
q=new RDSqlQuery(sql);
while(q->next()) {
l=new QListViewItem(list_view);
@ -441,19 +439,19 @@ void EditHotkeys::Clone_RefreshList(const QString& clone_station)
QString sql;
RDSqlQuery *q;
QString tmp_hotkey_conf = QString().sprintf("%s",
(const char *)clone_station);
QString tmp_hotkey_conf=clone_station;
RDHotkeys *tmp_station_hotkeys= new RDHotkeys(tmp_hotkey_conf,hotkey_module);
keyupdated = true;
QListViewItem *l;
list_view->clear();
sql=QString().sprintf("select KEY_LABEL , KEY_VALUE from RDHOTKEYS \
where STATION_NAME = \"%s\" AND \
MODULE_NAME = \"%s\" \
ORDER BY ID DESC",
(const char *)tmp_hotkey_conf,
(const char *)hotkey_module);
sql=QString("select ")+
"KEY_LABEL,"+ // 00
"KEY_VALUE "+ // 01
"from RDHOTKEYS where "+
"STATION_NAME=\""+RDEscapeString(tmp_hotkey_conf)+"\" && "+
"MODULE_NAME=\""+RDEscapeString(hotkey_module)+"\" "+
"order by ID DESC";
q=new RDSqlQuery(sql);
while(q->next()) {
@ -463,7 +461,7 @@ void EditHotkeys::Clone_RefreshList(const QString& clone_station)
}
delete q;
hotkeystrokes = QString ("");
keystroke->setText(QString().sprintf("%s",(const char *)hotkeystrokes));
keystroke->setText(hotkeystrokes);
delete tmp_station_hotkeys;
}

View File

@ -344,10 +344,13 @@ void EditJack::RefreshList()
RDListViewItem *l;
edit_jack_client_view->clear();
QString sql=QString().
sprintf("select ID,DESCRIPTION,COMMAND_LINE from JACK_CLIENTS \
where STATION_NAME=\"%s\" order by DESCRIPTION",
(const char *)edit_station->name());
QString sql=QString("select ")+
"ID,"+ // 00
"DESCRIPTION,"+ // 01
"COMMAND_LINE "+ // 02
"from JACK_CLIENTS where "+
"STATION_NAME=\""+RDEscapeString(edit_station->name())+"\" "+
"order by DESCRIPTION";
RDSqlQuery *q=new RDSqlQuery(sql);
while(q->next()) {
l=new RDListViewItem(edit_jack_client_view);

View File

@ -210,15 +210,11 @@ void EditNode::okData()
}
if((*edit_id)<0) {
sql=QString().sprintf("select ID from SWITCHER_NODES \
where (STATION_NAME=\"%s\")&&\
(MATRIX=%d)&&\
(HOSTNAME=\"%s\")&&\
(TCP_PORT=%d)",
(const char *)edit_matrix->station(),
edit_matrix->matrix(),
(const char *)edit_hostname_edit->text(),
edit_tcpport_spin->value());
sql=QString("select ID from SWITCHER_NODES where ")+
"(STATION_NAME=\""+RDEscapeString(edit_matrix->station())+"\") && "+
QString().sprintf("(MATRIX=%d) && ",edit_matrix->matrix())+
"(HOSTNAME=\""+RDEscapeString(edit_hostname_edit->text())+"\") && "+
QString().sprintf("(TCP_PORT=%d)",edit_tcpport_spin->value());
q=new RDSqlQuery(sql);
if(q->first()) {
delete q;
@ -237,39 +233,26 @@ void EditNode::okData()
*edit_id=1;
}
delete q;
sql=QString().sprintf("insert into SWITCHER_NODES set \
ID=%d,\
STATION_NAME=\"%s\",\
MATRIX=%d,\
HOSTNAME=\"%s\",\
TCP_PORT=%d,\
DESCRIPTION=\"%s\",\
BASE_OUTPUT=%d,\
PASSWORD=\"%s\"",
*edit_id,
(const char *)edit_matrix->station(),
edit_matrix->matrix(),
(const char *)edit_hostname_edit->text(),
edit_tcpport_spin->value(),
(const char *)edit_description_edit->text(),
edit_output_spin->value(),
(const char *)RDEscapeString(edit_password));
sql=QString("insert into SWITCHER_NODES set ")+
QString().sprintf("ID=%d,",*edit_id)+
"STATION_NAME=\""+RDEscapeString(edit_matrix->station())+"\","+
QString().sprintf("MATRIX=%d,",edit_matrix->matrix())+
"HOSTNAME=\""+RDEscapeString(edit_hostname_edit->text())+"\","+
QString().sprintf("TCP_PORT=%d,",edit_tcpport_spin->value())+
"DESCRIPTION=\""+RDEscapeString(edit_description_edit->text())+"\""+
QString().sprintf("BASE_OUTPUT=%d,",edit_output_spin->value())+
"PASSWORD=\""+RDEscapeString(edit_password)+"\"";
q=new RDSqlQuery(sql);
delete q;
}
else {
sql=QString().sprintf("update SWITCHER_NODES set HOSTNAME=\"%s\",\
TCP_PORT=%d,\
DESCRIPTION=\"%s\",\
BASE_OUTPUT=%d,\
PASSWORD=\"%s\" \
where ID=%d",
(const char *)edit_hostname_edit->text(),
edit_tcpport_spin->value(),
(const char *)edit_description_edit->text(),
edit_output_spin->value(),
(const char *)RDEscapeString(edit_password),
*edit_id);
sql=QString("update SWITCHER_NODES set ")+
"HOSTNAME=\""+RDEscapeString(edit_hostname_edit->text())+"\","+
QString().sprintf("TCP_PORT=%d,",edit_tcpport_spin->value())+
"DESCRIPTION=\""+RDEscapeString(edit_description_edit->text())+"\","+
QString().sprintf("BASE_OUTPUT=%d,",edit_output_spin->value())+
"PASSWORD=\""+RDEscapeString(edit_password)+"\" where "+
QString().sprintf("ID=%d",*edit_id);
q=new RDSqlQuery(sql);
delete q;
}

View File

@ -400,11 +400,13 @@ EditNowNext::EditNowNext(RDAirPlayConf *conf,QWidget *parent)
setText(QString().sprintf("%06u",nownext_conf->logNextCart(i)));
}
}
sql=QString().sprintf("select ID,PLUGIN_PATH,PLUGIN_ARG \
from NOWNEXT_PLUGINS \
where (STATION_NAME=\"%s\")&& \
(LOG_MACHINE=0)",
(const char *)nownext_conf->station());
sql=QString("select ")+
"ID,"+ // 00
"PLUGIN_PATH,"+ // 01
"PLUGIN_ARG "+ // 02
"from NOWNEXT_PLUGINS where "+
"(STATION_NAME=\""+RDEscapeString(nownext_conf->station())+"\") && "+
"(LOG_MACHINE=0)";
q=new RDSqlQuery(sql);
while(q->next()) {
item=new RDListViewItem(nownext_plugin_list);
@ -507,8 +509,6 @@ void EditNowNext::editNextcartData(int lognum)
void EditNowNext::okData()
{
QHostAddress addr[3];
QString str1;
QString str2;
QString sql;
RDSqlQuery *q;
RDListViewItem *item;
@ -518,14 +518,10 @@ void EditNowNext::okData()
nownext_address_edit[i]->setText("0.0.0.0");
}
if(!addr[i].setAddress(nownext_address_edit[i]->text())) {
str1=QString(tr("The IP address"));
str2=QString(tr("is invalid!"));
QMessageBox::warning(this,tr("Invalid Address"),
QString().
sprintf("%s \"%s\" %s",(const char *)str1,
(const char *)nownext_address_edit[i]->
text(),
(const char *)str2));
tr("The IP address")+
" \""+nownext_address_edit[i]->text()+"\" "+
tr("is invalid!"));
return;
}
}
@ -546,24 +542,19 @@ void EditNowNext::okData()
else {
nownext_conf->setLogNextCart(i,nownext_nextcart_edit[i]->text().toUInt());
}
sql=QString().sprintf("delete from NOWNEXT_PLUGINS where \
(STATION_NAME=\"%s\")&&(LOG_MACHINE=%d)",
(const char *)RDEscapeString(nownext_conf->station()),
i);
sql=QString("delete from NOWNEXT_PLUGINS where ")+
"(STATION_NAME=\""+RDEscapeString(nownext_conf->station())+"\")&&"+
QString().sprintf("(LOG_MACHINE=%d)",i);
q=new RDSqlQuery(sql);
delete q;
}
item=(RDListViewItem *)nownext_plugin_list->firstChild();
while(item!=NULL) {
sql=QString().sprintf("insert into NOWNEXT_PLUGINS set \
STATION_NAME=\"%s\", \
LOG_MACHINE=0, \
PLUGIN_PATH=\"%s\", \
PLUGIN_ARG=\"%s\"",
(const char *)
RDEscapeString(nownext_conf->station()),
(const char *)RDEscapeString(item->text(0)),
(const char *)RDEscapeString(item->text(1)));
sql=QString("insert into NOWNEXT_PLUGINS set ")+
"STATION_NAME=\""+RDEscapeString(nownext_conf->station())+"\","+
"LOG_MACHINE=0,"+
"PLUGIN_PATH=\""+RDEscapeString(item->text(0))+"\","+
"PLUGIN_ARG=\""+RDEscapeString(item->text(1))+"\"";
q=new RDSqlQuery(sql);
delete q;
item=(RDListViewItem *)item->nextSibling();

View File

@ -34,14 +34,15 @@
#include <rd.h>
#include <rddb.h>
#include <rdtextvalidator.h>
#include <rdescape_string.h>
#include <rdlist_logs.h>
#include <globals.h>
#include <rdtextvalidator.h>
#include <edit_rdairplay.h>
#include <edit_hotkeys.h>
#include <edit_now_next.h>
#include <edit_channelgpios.h>
#include "edit_rdairplay.h"
#include "edit_hotkeys.h"
#include "edit_now_next.h"
#include "edit_channelgpios.h"
#include "globals.h"
EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
QWidget *parent)
@ -913,9 +914,8 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
air_default_transtype_box->setCurrentItem(air_conf->defaultTransType());
air_defaultsvc_box->insertItem(tr("[none]"));
QString defaultsvc=air_conf->defaultSvc();
sql=QString().sprintf("select SERVICE_NAME from SERVICE_PERMS \
where STATION_NAME=\"%s\"",
(const char *)air_conf->station());
sql=QString("select SERVICE_NAME from SERVICE_PERMS where ")+
"STATION_NAME=\""+RDEscapeString(air_conf->station())+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
air_defaultsvc_box->insertItem(q->value(0).toString());

View File

@ -32,14 +32,14 @@
#include <qpainter.h>
#include <qfiledialog.h>
#include <rddb.h>
#include <rd.h>
#include <rdtextvalidator.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rdlist_logs.h>
#include <rdtextvalidator.h>
#include <edit_rdpanel.h>
#include <edit_now_next.h>
#include "edit_now_next.h"
#include "edit_rdpanel.h"
EditRDPanel::EditRDPanel(RDStation *station,RDStation *cae_station,
QWidget *parent)
@ -363,9 +363,8 @@ EditRDPanel::EditRDPanel(RDStation *station,RDStation *cae_station,
air_defaultsvc_box->insertItem(tr("[none]"));
QString defaultsvc=air_conf->defaultSvc();
sql=QString().sprintf("select SERVICE_NAME from SERVICE_PERMS \
where STATION_NAME=\"%s\"",
(const char *)air_conf->station());
sql=QString("select SERVICE_NAME from SERVICE_PERMS where ")+
"STATION_NAME=\""+RDEscapeString(air_conf->station())+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
air_defaultsvc_box->insertItem(q->value(0).toString());

View File

@ -251,9 +251,8 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
repl_normalize_box->setChecked(true);
repl_normalize_spin->setValue(repl_replicator->normalizeLevel()/1000);
}
sql=QString().sprintf("select GROUP_NAME from REPLICATOR_MAP \
where REPLICATOR_NAME=\"%s\"",
(const char *)RDEscapeString(repl_name_edit->text()));
sql=QString("select GROUP_NAME from REPLICATOR_MAP where ")+
"REPLICATOR_NAME=\""+RDEscapeString(repl_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
repl_groups_sel->destInsertItem(q->value(0).toString());
@ -334,17 +333,15 @@ void EditReplicator::okData()
// Add New Groups
//
for(unsigned i=0;i<repl_groups_sel->destCount();i++) {
sql=QString().sprintf("select GROUP_NAME from REPLICATOR_MAP \
where REPLICATOR_NAME=\"%s\" && GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(repl_name_edit->text()),
(const char *)RDEscapeString(repl_groups_sel->destText(i)));
sql=QString("select GROUP_NAME from REPLICATOR_MAP where ")+
"REPLICATOR_NAME=\""+RDEscapeString(repl_name_edit->text())+"\" && "+
"GROUP_NAME=\""+RDEscapeString(repl_groups_sel->destText(i))+"\"";
q=new RDSqlQuery(sql);
if(q->size()==0) {
delete q;
sql=QString().sprintf("insert into REPLICATOR_MAP (REPLICATOR_NAME,GROUP_NAME) \
values (\"%s\",\"%s\")",
(const char *)RDEscapeString(repl_name_edit->text()),
(const char *)RDEscapeString(repl_groups_sel->destText(i)));
sql=QString("insert into REPLICATOR_MAP (REPLICATOR_NAME,GROUP_NAME) ")+
"values (\""+RDEscapeString(repl_name_edit->text())+"\","+
"\""+RDEscapeString(repl_groups_sel->destText(i))+"\")";
q=new RDSqlQuery(sql);
}
delete q;
@ -353,11 +350,11 @@ values (\"%s\",\"%s\")",
//
// Delete Old Groups
//
sql=QString().sprintf("delete from REPLICATOR_MAP where REPLICATOR_NAME=\"%s\"",
(const char *)RDEscapeString(repl_name_edit->text()));
sql=QString("delete from REPLICATOR_MAP where ")+
"REPLICATOR_NAME=\""+RDEscapeString(repl_name_edit->text())+"\"";
for(unsigned i=0;i<repl_groups_sel->destCount();i++) {
sql+=QString().sprintf(" && GROUP_NAME<>\"%s\"",
(const char *)RDEscapeString(repl_groups_sel->destText(i)));
sql+=QString(" && GROUP_NAME<>\"")+
RDEscapeString(repl_groups_sel->destText(i))+"\"";
}
q=new RDSqlQuery(sql);
delete q;

View File

@ -33,6 +33,7 @@
#include <rd.h>
#include <rdapplication.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rdtextvalidator.h>
#include "autofill_carts.h"
@ -46,7 +47,6 @@ EditReport::EditReport(QString rptname,QWidget *parent)
{
QString sql;
RDSqlQuery *q;
QString str;
bool ok=false;
//
@ -58,9 +58,7 @@ EditReport::EditReport(QString rptname,QWidget *parent)
setMaximumHeight(sizeHint().height());
edit_report=new RDReport(rptname,rda->station(),rda->config());
str=QString(tr("Edit Report"));
setCaption(QString().sprintf("%s - %s",(const char *)str,
(const char *)rptname));
setCaption(tr("Edit Report")+" "+rptname);
//
// Create Fonts
@ -439,9 +437,8 @@ EditReport::EditReport(QString rptname,QWidget *parent)
edit_endtime_edit->setDisabled(ok);
edit_daypart_check->setChecked(!ok);
sql=QString().sprintf("select SERVICE_NAME from REPORT_SERVICES \
where REPORT_NAME=\"%s\"",
(const char *)edit_report->name());
sql=QString("select SERVICE_NAME from REPORT_SERVICES where ")+
"REPORT_NAME=\""+RDEscapeString(edit_report->name())+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
edit_service_sel->destInsertItem(q->value(0).toString());
@ -457,9 +454,8 @@ EditReport::EditReport(QString rptname,QWidget *parent)
}
delete q;
sql=QString().sprintf("select STATION_NAME from REPORT_STATIONS \
where REPORT_NAME=\"%s\"",
(const char *)edit_report->name());
sql=QString("select STATION_NAME from REPORT_STATIONS where ")+
"REPORT_NAME=\""+RDEscapeString(edit_report->name())+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
edit_station_sel->destInsertItem(q->value(0).toString());
@ -477,9 +473,8 @@ EditReport::EditReport(QString rptname,QWidget *parent)
edit_group_box->setChecked(edit_report->filterGroups());
edit_group_sel->setEnabled(edit_report->filterGroups());
sql=QString().sprintf("select GROUP_NAME from REPORT_GROUPS \
where REPORT_NAME=\"%s\"",
(const char *)edit_report->name());
sql=QString("select GROUP_NAME from REPORT_GROUPS where ")+
"REPORT_NAME=\""+RDEscapeString(edit_report->name())+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
edit_group_sel->destInsertItem(q->value(0).toString());
@ -577,18 +572,15 @@ void EditReport::okData()
// Add New Services
//
for(unsigned i=0;i<edit_service_sel->destCount();i++) {
sql=QString().sprintf("select SERVICE_NAME from REPORT_SERVICES \
where REPORT_NAME=\"%s\" && SERVICE_NAME=\"%s\"",
(const char *)edit_report->name(),
(const char *)edit_service_sel->destText(i));
sql=QString("select SERVICE_NAME from REPORT_SERVICES where ")+
"REPORT_NAME=\""+RDEscapeString(edit_report->name())+"\" && "+
"SERVICE_NAME=\""+RDEscapeString(edit_service_sel->destText(i))+"\"";
q=new RDSqlQuery(sql);
if(q->size()==0) {
delete q;
sql=QString().
sprintf("insert into REPORT_SERVICES (REPORT_NAME,SERVICE_NAME) \
values (\"%s\",\"%s\")",
(const char *)edit_report->name(),
(const char *)edit_service_sel->destText(i));
sql=QString("insert into REPORT_SERVICES (REPORT_NAME,SERVICE_NAME) ")+
"values (\""+RDEscapeString(edit_report->name())+"\","+
"\""+RDEscapeString(edit_service_sel->destText(i))+"\")";
q=new RDSqlQuery(sql);
}
delete q;
@ -597,11 +589,11 @@ where REPORT_NAME=\"%s\" && SERVICE_NAME=\"%s\"",
//
// Delete Old Services
//
sql=QString().sprintf("delete from REPORT_SERVICES where REPORT_NAME=\"%s\"",
(const char *)edit_report->name());
sql=QString("delete from REPORT_SERVICES where ")+
"REPORT_NAME=\""+RDEscapeString(edit_report->name())+"\"";
for(unsigned i=0;i<edit_service_sel->destCount();i++) {
sql+=QString().sprintf(" && SERVICE_NAME<>\"%s\"",
(const char *)edit_service_sel->destText(i));
sql+=QString(" && SERVICE_NAME<>\"")+
RDEscapeString(edit_service_sel->destText(i))+"\"";
}
q=new RDSqlQuery(sql);
delete q;
@ -610,18 +602,15 @@ where REPORT_NAME=\"%s\" && SERVICE_NAME=\"%s\"",
// Add New Stations
//
for(unsigned i=0;i<edit_station_sel->destCount();i++) {
sql=QString().sprintf("select STATION_NAME from REPORT_STATIONS \
where REPORT_NAME=\"%s\" && STATION_NAME=\"%s\"",
(const char *)edit_report->name(),
(const char *)edit_station_sel->destText(i));
sql=QString("select STATION_NAME from REPORT_STATIONS where ")+
"REPORT_NAME=\""+RDEscapeString(edit_report->name())+"\" && "+
"STATION_NAME=\""+RDEscapeString(edit_station_sel->destText(i))+"\"";
q=new RDSqlQuery(sql);
if(q->size()==0) {
delete q;
sql=QString().
sprintf("insert into REPORT_STATIONS (REPORT_NAME,STATION_NAME) \
values (\"%s\",\"%s\")",
(const char *)edit_report->name(),
(const char *)edit_station_sel->destText(i));
sql=QString("insert into REPORT_STATIONS (REPORT_NAME,STATION_NAME) ")+
"values (\""+RDEscapeString(edit_report->name())+"\","+
"\""+RDEscapeString(edit_station_sel->destText(i))+"\")";
q=new RDSqlQuery(sql);
}
delete q;
@ -630,11 +619,11 @@ where REPORT_NAME=\"%s\" && STATION_NAME=\"%s\"",
//
// Delete Old Stations
//
sql=QString().sprintf("delete from REPORT_STATIONS where REPORT_NAME=\"%s\"",
(const char *)edit_report->name());
sql=QString("delete from REPORT_STATIONS where ")+
"REPORT_NAME=\""+RDEscapeString(edit_report->name())+"\"";
for(unsigned i=0;i<edit_station_sel->destCount();i++) {
sql+=QString().sprintf(" && STATION_NAME<>\"%s\"",
(const char *)edit_station_sel->destText(i));
sql+=QString(" && STATION_NAME<>\"")+
RDEscapeString(edit_station_sel->destText(i))+"\"";
}
q=new RDSqlQuery(sql);
delete q;
@ -643,18 +632,15 @@ where REPORT_NAME=\"%s\" && STATION_NAME=\"%s\"",
// Add New Groups
//
for(unsigned i=0;i<edit_group_sel->destCount();i++) {
sql=QString().sprintf("select GROUP_NAME from REPORT_GROUPS \
where REPORT_NAME=\"%s\" && GROUP_NAME=\"%s\"",
(const char *)edit_report->name(),
(const char *)edit_group_sel->destText(i));
sql=QString("select GROUP_NAME from REPORT_GROUPS where ")+
"REPORT_NAME=\""+RDEscapeString(edit_report->name())+"\" && "+
"GROUP_NAME=\""+RDEscapeString(edit_group_sel->destText(i))+"\"";
q=new RDSqlQuery(sql);
if(q->size()==0) {
delete q;
sql=QString().
sprintf("insert into REPORT_GROUPS (REPORT_NAME,GROUP_NAME) \
values (\"%s\",\"%s\")",
(const char *)edit_report->name(),
(const char *)edit_group_sel->destText(i));
sql=QString("insert into REPORT_GROUPS (REPORT_NAME,GROUP_NAME) ")+
"values (\""+RDEscapeString(edit_report->name())+"\","+
"\""+RDEscapeString(edit_group_sel->destText(i))+"\")";
q=new RDSqlQuery(sql);
}
delete q;
@ -663,11 +649,11 @@ where REPORT_NAME=\"%s\" && GROUP_NAME=\"%s\"",
//
// Delete Old Groups
//
sql=QString().sprintf("delete from REPORT_GROUPS where REPORT_NAME=\"%s\"",
(const char *)edit_report->name());
sql=QString("delete from REPORT_GROUPS where ")+
"REPORT_NAME=\""+RDEscapeString(edit_report->name())+"\"";
for(unsigned i=0;i<edit_group_sel->destCount();i++) {
sql+=QString().sprintf(" && GROUP_NAME<>\"%s\"",
(const char *)edit_group_sel->destText(i));
sql+=QString(" && GROUP_NAME<>\"")+
RDEscapeString(edit_group_sel->destText(i))+"\"";
}
q=new RDSqlQuery(sql);
delete q;

View File

@ -3,6 +3,7 @@
// Edit scheduler codes dialog
//
// Stefan Gabriel <stg@st-gabriel.de>
// (C) Copyright 2005-2018
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -27,12 +28,14 @@
#include <qmessagebox.h>
#include <qbuttongroup.h>
#include <rduser.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rdpasswd.h>
#include <rdtextvalidator.h>
#include <rddb.h>
#include <edit_group.h>
#include <edit_schedcodes.h>
#include <rduser.h>
#include "edit_group.h"
#include "edit_schedcodes.h"
EditSchedCode::EditSchedCode(QString schedCode,QString description,
QWidget *parent)
@ -140,8 +143,9 @@ void EditSchedCode::okData()
RDSqlQuery *q;
QString sql;
sql=QString().sprintf("update SCHED_CODES set DESCRIPTION=\"%s\" where CODE=\"%s\"",(const char *)schedCode_description_edit->text(),(const char *)schedCode_name_edit->text());
sql=QString("update SCHED_CODES set ")+
"DESCRIPTION=\""+RDEscapeString(schedCode_description_edit->text())+"\" "+
"where CODE=\""+RDEscapeString(schedCode_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;

View File

@ -336,10 +336,9 @@ void EditSettings::okData()
int step_size=q->size()/10;
pd->setProgress(0,10);
while(q->next()) {
sql=QString().sprintf("select NUMBER from CART \
where (TITLE=\"%s\")&&(NUMBER!=%u)",
(const char *)RDEscapeString(q->value(1).toString()),
q->value(0).toUInt());
sql=QString("select NUMBER from CART where ")+
"(TITLE=\""+RDEscapeString(q->value(1).toString())+"\")&&"+
QString().sprintf("(NUMBER!=%u)",q->value(0).toUInt());
q1=new RDSqlQuery(sql);
while(q1->next()) {
dups[q1->value(0).toUInt()]=q->value(1).toString();
@ -434,10 +433,9 @@ void EditSettings::BuildDuplicatesList(std::map<unsigned,QString> *dups)
sql="select NUMBER,TITLE from CART order by NUMBER";
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString().sprintf("select NUMBER from CART \
where (TITLE=\"%s\")&&(NUMBER!=%u)",
(const char *)RDEscapeString(q->value(1).toString()),
q->value(0).toUInt());
sql=QString("select NUMBER from CART where ")+
"(TITLE=\""+RDEscapeString(q->value(1).toString())+"\")&&"+
QString().sprintf("(NUMBER!=%u)",q->value(0).toUInt());
q1=new RDSqlQuery(sql);
while(q1->next()) {
(*dups)[q1->value(0).toUInt()]=q->value(1).toString();

View File

@ -542,9 +542,8 @@ EditStation::EditStation(QString sname,QWidget *parent)
station_http_station_box->insertItem("localhost");
station_cae_station_box->insertItem("localhost");
sql=QString().sprintf("select NAME from STATIONS \
where NAME!=\"%s\" order by NAME",
(const char *)RDEscapeString(sname));
sql=QString("select NAME from STATIONS where ")+
"NAME!=\""+RDEscapeString(sname)+"\" order by NAME";
q=new RDSqlQuery(sql);
while(q->next()) {
station_http_station_box->insertItem(q->value(0).toString());
@ -658,9 +657,9 @@ void EditStation::okData()
RDSqlQuery *q;
if(!station_maint_box->isChecked()) {
sql=QString().sprintf("select NAME from STATIONS where \
(NAME!=\"%s\")&&(SYSTEM_MAINT=\"Y\")",
(const char *)RDEscapeString(station_station->name()));
sql=QString("select NAME from STATIONS where ")+
"(NAME!=\""+RDEscapeString(station_station->name())+"\")&&"+
"(SYSTEM_MAINT=\"Y\")";
q=new RDSqlQuery(sql);
if(!q->first()) {
QMessageBox::warning(this,tr("System Maintenance"),

View File

@ -39,8 +39,6 @@
EditTtys::EditTtys(QString station,QWidget *parent)
: QDialog(parent,"",true)
{
QString str;
//
// Fix the Window Size
//
@ -169,9 +167,8 @@ EditTtys::EditTtys(QString station,QWidget *parent)
//
// Populate Data
//
str=QString(tr("Serial"));
for(int i=0;i<MAX_TTYS;i++) {
edit_port_box->insertItem(QString().sprintf("%s%d",(const char *)str,i));
edit_port_box->insertItem(tr("Serial")+QString().sprintf("%d",i));
}
edit_baudrate_box->insertItem("50");
edit_baudrate_box->insertItem("75");

View File

@ -125,10 +125,9 @@ void EditUserServicePerms::okData()
// Add New Groups
//
for(unsigned i=0;i<user_host_sel->destCount();i++) {
sql=QString().sprintf("select SERVICE_NAME from USER_SERVICE_PERMS \
where USER_NAME=\"%s\" && SERVICE_NAME=\"%s\"",
(const char *)user_user->name(),
(const char *)user_host_sel->destText(i));
sql=QString("select SERVICE_NAME from USER_SERVICE_PERMS where ")+
"USER_NAME=\""+RDEscapeString(user_user->name())+"\" && "+
"SERVICE_NAME=\""+RDEscapeString(user_host_sel->destText(i))+"\"";
q=new RDSqlQuery(sql);
if(q->size()==0) {
delete q;

View File

@ -48,8 +48,6 @@
InfoDialog::InfoDialog(QWidget *parent)
: QDialog(parent,"",true)
{
QString str;
//
// Fix the Window Size
//
@ -111,14 +109,12 @@ InfoDialog::InfoDialog(QWidget *parent)
//
// Version
//
str=QString(tr("Version"));
label=new QLabel(QString().sprintf("%s %s",(const char *)str,VERSION),this);
label=new QLabel(tr("Version")+" "+VERSION,this);
label->setGeometry(10,73,200,14);
label->setFont(font);
str=QString(tr("Database Schema"));
label=new QLabel(QString().sprintf("%s %d",(const char *)str,
RD_VERSION_DATABASE),this);
label=new QLabel(tr("Database Schema")+
QString().sprintf(" %d",RD_VERSION_DATABASE),this);
label->setGeometry(210,73,120,14);
label->setAlignment(AlignVCenter|AlignRight);
label->setFont(font);
@ -126,9 +122,7 @@ InfoDialog::InfoDialog(QWidget *parent)
//
// Signature
//
str=QString(tr("Copyright 2002-2018"));
label=new QLabel(QString().sprintf("%s %s",(const char *)str,
PACKAGE_BUGREPORT),this);
label=new QLabel(tr("Copyright 2002-2018")+" "+PACKAGE_BUGREPORT,this);
label->setGeometry(10,87,sizeHint().width()-20,14);
label->setFont(font);

View File

@ -176,8 +176,8 @@ void ListAuxFields::deleteData()
delete q;
keyname.replace(" ","_");
QString varname=item->text(0).mid(1,item->text(0).length()-2);
sql=QString().sprintf("alter table %s_FIELDS drop column %s",
(const char *)keyname,(const char *)varname);
sql=QString("alter table `")+
keyname+"_FIELDS` drop column "+varname;
q=new RDSqlQuery(sql);
}
delete q;

View File

@ -2,7 +2,7 @@
//
// List Rivendell Dropboxes
//
// (C) Copyright 2002,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002,2016-2018 Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -30,9 +30,10 @@
#include <qbuttongroup.h>
#include <rddb.h>
#include <list_dropboxes.h>
#include <edit_dropbox.h>
#include <rdescape_string.h>
#include "edit_dropbox.h"
#include "list_dropboxes.h"
ListDropboxes::ListDropboxes(const QString &stationname,QWidget *parent)
: QDialog(parent,"",true)
@ -45,8 +46,7 @@ ListDropboxes::ListDropboxes(const QString &stationname,QWidget *parent)
setMinimumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setCaption(QString().sprintf("Rivendell Dropbox Configurations on %s",
(const char *)stationname));
setCaption(tr("Rivendell Dropbox Configurations on")+" "+stationname);
//
// Create Fonts
@ -229,17 +229,22 @@ void ListDropboxes::RefreshList()
RDListViewItem *item;
list_dropboxes_view->clear();
sql=QString().sprintf("select DROPBOXES.ID,DROPBOXES.GROUP_NAME,\
DROPBOXES.PATH,DROPBOXES.NORMALIZATION_LEVEL,\
DROPBOXES.AUTOTRIM_LEVEL,\
DROPBOXES.TO_CART,DROPBOXES.USE_CARTCHUNK_ID,\
DROPBOXES.DELETE_CUTS,DROPBOXES.METADATA_PATTERN,\
DROPBOXES.FIX_BROKEN_FORMATS,\
DROPBOXES.SET_USER_DEFINED,GROUPS.COLOR \
from DROPBOXES left join GROUPS on \
DROPBOXES.GROUP_NAME=GROUPS.NAME \
where DROPBOXES.STATION_NAME=\"%s\"",
(const char *)list_stationname);
sql=QString("select ")+
"DROPBOXES.ID,"+ // 00
"DROPBOXES.GROUP_NAME,"+ // 01
"DROPBOXES.PATH,"+ // 02
"DROPBOXES.NORMALIZATION_LEVEL,"+ // 03
"DROPBOXES.AUTOTRIM_LEVEL,"+ // 04
"DROPBOXES.TO_CART,"+ // 05
"DROPBOXES.USE_CARTCHUNK_ID,"+ // 06
"DROPBOXES.DELETE_CUTS,"+ // 07
"DROPBOXES.METADATA_PATTERN,"+ // 08
"DROPBOXES.FIX_BROKEN_FORMATS,"+ // 09
"DROPBOXES.SET_USER_DEFINED,"+ // 10
"GROUPS.COLOR "+ // 11
"from DROPBOXES left join GROUPS "+
"on DROPBOXES.GROUP_NAME=GROUPS.NAME where "+
"DROPBOXES.STATION_NAME=\""+RDEscapeString(list_stationname)+"\"";
q=new RDSqlQuery(sql);
while (q->next()) {
item=new RDListViewItem(list_dropboxes_view);

View File

@ -143,10 +143,9 @@ void ListEncoders::addData()
AddEncoder *ad=new AddEncoder(&name,list_stationname,this);
if(ad->exec()==0) {
sql=QString().sprintf("select ID from ENCODERS \
where (NAME=\"%s\")&&(STATION_NAME=\"%s\")",
(const char *)RDEscapeString(name),
(const char *)RDEscapeString(list_stationname));
sql=QString("select ID from ENCODERS where ")+
"(NAME=\""+RDEscapeString(name)+"\")&&"+
"(STATION_NAME=\""+RDEscapeString(list_stationname)+"\")";
q=new RDSqlQuery(sql);
if(q->first()) {
EditEncoder *ee=new EditEncoder(q->value(0).toInt());
@ -158,10 +157,9 @@ void ListEncoders::addData()
list_list_view->ensureItemVisible(item);
}
else {
sql=QString().sprintf("delete from ENCODERS \
where (NAME=\"%s\")&&(STATION_NAME=\"%s\")",
(const char *)RDEscapeString(name),
(const char *)RDEscapeString(list_stationname));
sql=QString("delete from ENCODERS where ")+
"(NAME=\""+RDEscapeString(name)+"\")&&"+
"(STATION_NAME=\""+RDEscapeString(list_stationname)+"\")";
q1=new RDSqlQuery(sql);
delete q1;
}
@ -170,10 +168,9 @@ void ListEncoders::addData()
delete q;
}
else {
sql=QString().sprintf("delete from ENCODERS \
where (NAME=\"%s\")&&(STATION_NAME=\"%s\")",
(const char *)RDEscapeString(name),
(const char *)RDEscapeString(list_stationname));
sql=QString("delete from ENCODERS where ")+
"(NAME=\""+RDEscapeString(name)+"\")&&"+
"(STATION_NAME=\""+RDEscapeString(list_stationname)+"\")";
q1=new RDSqlQuery(sql);
delete q1;
}
@ -252,9 +249,8 @@ void ListEncoders::RefreshList()
RDSqlQuery *q;
RDListViewItem *item=NULL;
sql=QString().sprintf("select ID,NAME,COMMAND_LINE from ENCODERS\
where STATION_NAME=\"%s\"",
(const char *)RDEscapeString(list_stationname));
sql=QString("select ID,NAME,COMMAND_LINE from ENCODERS where ")+
"STATION_NAME=\""+RDEscapeString(list_stationname)+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
item=new RDListViewItem(list_list_view);
@ -289,12 +285,10 @@ QString ListEncoders::BuildList(int encoder_id,const QString &paramname)
RDSqlQuery *q;
QString ret;
sql=QString().sprintf("select %s from ENCODER_%s where ENCODER_ID=%d\
order by %s",
(const char *)paramname,
(const char *)paramname,
encoder_id,
(const char *)paramname);
sql=QString("select ")+
paramname+" from `ENCODER_"+paramname+"` where "+
QString().sprintf("ENCODER_ID=%d",encoder_id)+
"order by "+paramname;
q=new RDSqlQuery(sql);
while(q->next()) {
ret=ret+QString().sprintf("%d,",q->value(0).toInt());

View File

@ -2,7 +2,7 @@
//
// List a Rivendell Endpoints
//
// (C) Copyright 2002-2003,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2003,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -25,11 +25,13 @@
#include <qmessagebox.h>
#include <rd.h>
#include <rdpasswd.h>
#include <rddb.h>
#include <edit_user.h>
#include <list_endpoints.h>
#include <edit_endpoint.h>
#include <rdescape_string.h>
#include <rdpasswd.h>
#include "edit_user.h"
#include "list_endpoints.h"
#include "edit_endpoint.h"
ListEndpoints::ListEndpoints(RDMatrix *matrix,RDMatrix::Endpoint endpoint,
QWidget *parent)
@ -186,68 +188,83 @@ ListEndpoints::ListEndpoints(RDMatrix *matrix,RDMatrix::Endpoint endpoint,
switch(list_matrix->type()) {
case RDMatrix::Unity4000:
if(list_endpoint==RDMatrix::Input) {
sql=QString().sprintf("select NUMBER,NAME,FEED_NAME,CHANNEL_MODE\
from %s where STATION_NAME=\"%s\" && \
MATRIX=%d order by NUMBER",
(const char *)list_table,
(const char *)list_matrix->station(),
list_matrix->matrix());
sql=QString("select ")+
"NUMBER,"+ // 00
"NAME,"+ // 01
"FEED_NAME,"+ // 02
"CHANNEL_MODE "+ // 03
"from `"+list_table+"` where "+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\" && "+
QString().sprintf("MATRIX=%d ",list_matrix->matrix())+
"order by NUMBER";
}
else {
sql=QString().sprintf("select NUMBER,NAME from %s\
where STATION_NAME=\"%s\" && \
MATRIX=%d order by NUMBER",
(const char *)list_table,
(const char *)list_matrix->station(),
list_matrix->matrix());
sql=QString("select ")+
"NUMBER,"+ // 00
"NAME "+ // 01
"from `"+list_table+"` where "+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\" && "+
QString().sprintf("MATRIX=%d ",list_matrix->matrix())+
"order by NUMBER";
}
break;
case RDMatrix::LogitekVguest:
sql=QString().sprintf("select NUMBER,NAME,ENGINE_NUM,DEVICE_NUM\
from %s where (STATION_NAME=\"%s\")&&\
MATRIX=%d order by NUMBER",
(const char *)list_table,
(const char *)list_matrix->station(),
list_matrix->matrix());
sql=QString("select ")+
"NUMBER,"+ // 00
"NAME,"+ // 01
"ENGINE_NUM,"+ // 02
"DEVICE_NUM "+ // 03
"from `"+list_table+"` where "+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("MATRIX=%d ",list_matrix->matrix())+
"order by NUMBER";
break;
case RDMatrix::StarGuideIII:
if(list_endpoint==RDMatrix::Input) {
sql=QString().sprintf("select NUMBER,NAME,ENGINE_NUM,DEVICE_NUM,\
CHANNEL_MODE\
from %s where (STATION_NAME=\"%s\")&&\
MATRIX=%d order by NUMBER",
(const char *)list_table,
(const char *)list_matrix->station(),
list_matrix->matrix());
sql=QString("select ")+
"NUMBER,"+ // 00
"NAME,"+ // 01
"ENGINE_NUM,"+ // 02
"DEVICE_NUM,"+ // 03
"CHANNEL_MODE "+ // 04
"from `"+list_table+"` where "+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("MATRIX=%d ",list_matrix->matrix())+
"order by NUMBER";
}
else {
sql=QString().sprintf("select NUMBER,NAME from %s\
where STATION_NAME=\"%s\" && \
MATRIX=%d order by NUMBER",
(const char *)list_table,
(const char *)list_matrix->station(),
list_matrix->matrix());
sql=QString("select ")+
"NUMBER,"+ // 00
"NAME "+ // 01
"from `"+list_table+"` where "+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\" && "+
QString().sprintf("MATRIX=%d ",list_matrix->matrix())+
"order by NUMBER";
}
break;
case RDMatrix::LiveWireLwrpAudio:
sql=QString().sprintf("select NUMBER,NAME,NODE_HOSTNAME,NODE_SLOT \
from %s where STATION_NAME=\"%s\" && \
MATRIX=%d order by NUMBER",
(const char *)list_table,
(const char *)list_matrix->station(),
list_matrix->matrix());
sql=QString("select ")+
"NUMBER,"+ // 00
"NAME,"+ // 01
"NODE_HOSTNAME,"+ // 02
"NODE_SLOT "+ // 03
"from `"+list_table+"` where "+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\" && "+
QString().sprintf("MATRIX=%d ",list_matrix->matrix())+
"order by NUMBER";
break;
default:
sql=QString().sprintf("select NUMBER,NAME from %s\
where STATION_NAME=\"%s\" && \
MATRIX=%d order by NUMBER",
(const char *)list_table,
(const char *)list_matrix->station(),
list_matrix->matrix());
sql=QString("select ")+
"NUMBER,"+ // 00
"NAME "+ // 01
"from `"+list_table+"` where "+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\" && "+
QString().sprintf("MATRIX=%d ",list_matrix->matrix())+
"order by NUMBER";
break;
}
q=new RDSqlQuery(sql);
@ -268,92 +285,92 @@ ListEndpoints::ListEndpoints(RDMatrix *matrix,RDMatrix::Endpoint endpoint,
if(q->isValid()&&(q->value(0).toInt()==(i+1))){
l->setText(1,q->value(1).toString());
switch(list_matrix->type()) {
case RDMatrix::Unity4000:
if(list_endpoint==RDMatrix::Input) {
l->setText(2,q->value(2).toString());
switch((RDMatrix::Mode)q->value(3).toInt()) {
case RDMatrix::Stereo:
l->setText(3,tr("Stereo"));
break;
case RDMatrix::Unity4000:
if(list_endpoint==RDMatrix::Input) {
l->setText(2,q->value(2).toString());
switch((RDMatrix::Mode)q->value(3).toInt()) {
case RDMatrix::Stereo:
l->setText(3,tr("Stereo"));
break;
case RDMatrix::Left:
l->setText(3,tr("Left"));
break;
case RDMatrix::Left:
l->setText(3,tr("Left"));
break;
case RDMatrix::Right:
l->setText(3,tr("Right"));
break;
}
case RDMatrix::Right:
l->setText(3,tr("Right"));
break;
}
break;
}
break;
case RDMatrix::LogitekVguest:
case RDMatrix::LogitekVguest:
if(q->value(2).toInt()>=0) {
l->setText(2,QString().sprintf("%04X",q->value(2).toInt()));
}
else {
l->setText(2,"");
}
if(q->value(3).toInt()>=0) {
l->setText(3,QString().sprintf("%04X",q->value(3).toInt()));
}
else {
l->setText(3,"");
}
break;
case RDMatrix::StarGuideIII:
if(list_endpoint==RDMatrix::Input) {
if(q->value(2).toInt()>=0) {
l->setText(2,QString().sprintf("%04X",q->value(2).toInt()));
}
else {
l->setText(2,"");
l->setText(2,q->value(2).toString());
}
if(q->value(3).toInt()>=0) {
l->setText(3,QString().sprintf("%04X",q->value(3).toInt()));
l->setText(3,q->value(3).toString());
}
else {
l->setText(3,"");
}
break;
case RDMatrix::StarGuideIII:
if(list_endpoint==RDMatrix::Input) {
if(q->value(2).toInt()>=0) {
l->setText(2,q->value(2).toString());
}
if(q->value(3).toInt()>=0) {
l->setText(3,q->value(3).toString());
}
switch((RDMatrix::Mode)q->value(4).toInt()) {
case RDMatrix::Stereo:
l->setText(4,tr("Stereo"));
break;
switch((RDMatrix::Mode)q->value(4).toInt()) {
case RDMatrix::Stereo:
l->setText(4,tr("Stereo"));
break;
case RDMatrix::Left:
l->setText(4,tr("Left"));
break;
case RDMatrix::Left:
l->setText(4,tr("Left"));
break;
case RDMatrix::Right:
l->setText(4,tr("Right"));
break;
}
case RDMatrix::Right:
l->setText(4,tr("Right"));
break;
}
break;
}
break;
default:
break;
default:
break;
}
q->next();
}
else {
switch(list_endpoint) {
case RDMatrix::Input:
str=QString(tr("Input"));
l->setText(1,QString().sprintf("%s %03d",(const char *)str,i+1));
switch(list_matrix->type()) {
case RDMatrix::Unity4000:
l->setText(3,tr("Stereo"));
break;
case RDMatrix::StarGuideIII:
l->setText(4,tr("Stereo"));
break;
default:
break;
}
case RDMatrix::Input:
str=QString(tr("Input"));
l->setText(1,str+QString().sprintf(" %03d",i+1));
switch(list_matrix->type()) {
case RDMatrix::Unity4000:
l->setText(3,tr("Stereo"));
break;
case RDMatrix::StarGuideIII:
l->setText(4,tr("Stereo"));
break;
default:
break;
}
break;
case RDMatrix::Output:
str=QString(tr("Output"));
l->setText(1,QString().sprintf("%s %03d",(const char *)str,i+1));
break;
case RDMatrix::Output:
str=QString(tr("Output"));
l->setText(1,str+QString().sprintf(" %03d",i+1));
break;
}
}
}
@ -546,74 +563,66 @@ void ListEndpoints::okData()
if(item->text(modecol).lower()==QString(tr("right"))) {
mode=RDMatrix::Right;
}
sql=QString().sprintf("select ID from %s where\
STATION_NAME=\"%s\" && \
MATRIX=%d && \
NUMBER=%d",
(const char *)list_table,
(const char *)list_matrix->station(),
list_matrix->matrix(),
i+1);
sql=QString("select ID from `")+
list_table+"` where "+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\" && "+
QString().sprintf("MATRIX=%d && ",list_matrix->matrix())+
QString().sprintf("NUMBER=%d",i+1);
q=new RDSqlQuery(sql);
if(!q->first()) {
delete q;
sql=QString().sprintf("insert into %s set STATION_NAME=\"%s\",\
MATRIX=%d,\
NUMBER=%d,\
NAME=\"%s\"",
(const char *)list_table,
(const char *)list_matrix->station(),
list_matrix->matrix(),
i+1,
(const char *)item->text(1));
sql=QString("insert into `")+list_table+"` set "+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\","+
QString().sprintf("MATRIX=%d,",list_matrix->matrix())+
QString().sprintf("NUMBER=%d,",i+1)+
"NAME=\""+RDEscapeString(item->text(1))+"\"";
switch(list_matrix->type()) {
case RDMatrix::Unity4000:
if(list_endpoint==RDMatrix::Input) {
sql+=QString().sprintf(",FEED_NAME=\"%s\",CHANNEL_MODE=%d",
(const char *)item->text(2),
mode);
}
break;
case RDMatrix::Unity4000:
if(list_endpoint==RDMatrix::Input) {
sql+=QString(",FEED_NAME=\"")+RDEscapeString(item->text(2))+"\","+
QString().sprintf("CHANNEL_MODE=%d",mode);
}
break;
case RDMatrix::LogitekVguest:
if(item->text(2).isEmpty()) {
sql+=",ENGINE_NUM=-1";
}
else {
sql+=QString().sprintf(",ENGINE_NUM=%d",
item->text(2).toInt(NULL,16));
}
if(item->text(3).isEmpty()) {
sql+=",DEVICE_NUM=-1";
}
else {
sql+=QString().sprintf(",DEVICE_NUM=%d",
item->text(3).toInt(NULL,16));
}
break;
case RDMatrix::LogitekVguest:
if(item->text(2).isEmpty()) {
sql+=",ENGINE_NUM=-1";
}
else {
sql+=QString().sprintf(",ENGINE_NUM=%d",
item->text(2).toInt(NULL,16));
}
if(item->text(3).isEmpty()) {
sql+=",DEVICE_NUM=-1";
}
else {
sql+=QString().sprintf(",DEVICE_NUM=%d",
item->text(3).toInt(NULL,16));
}
break;
case RDMatrix::StarGuideIII:
if(item->text(2).isEmpty()) {
sql+=",ENGINE_NUM=-1";
}
else {
sql+=QString().sprintf(",ENGINE_NUM=%d",
item->text(2).toInt());
}
if(item->text(3).isEmpty()) {
sql+=",DEVICE_NUM=-1";
}
else {
sql+=QString().sprintf(",DEVICE_NUM=%d",
item->text(3).toInt());
}
if(list_endpoint==RDMatrix::Input) {
sql+=QString().sprintf(",CHANNEL_MODE=%d",mode);
}
break;
default:
break;
case RDMatrix::StarGuideIII:
if(item->text(2).isEmpty()) {
sql+=",ENGINE_NUM=-1";
}
else {
sql+=QString().sprintf(",ENGINE_NUM=%d",
item->text(2).toInt());
}
if(item->text(3).isEmpty()) {
sql+=",DEVICE_NUM=-1";
}
else {
sql+=QString().sprintf(",DEVICE_NUM=%d",
item->text(3).toInt());
}
if(list_endpoint==RDMatrix::Input) {
sql+=QString().sprintf(",CHANNEL_MODE=%d",mode);
}
break;
default:
break;
}
q=new RDSqlQuery(sql);
delete q;
@ -621,104 +630,79 @@ void ListEndpoints::okData()
else {
delete q;
switch(list_matrix->type()) {
case RDMatrix::Unity4000:
if(list_endpoint==RDMatrix::Input) {
sql=QString().sprintf("update %s set NAME=\"%s\",\
FEED_NAME=\"%s\",\
CHANNEL_MODE=%d where\
STATION_NAME=\"%s\" && \
MATRIX=%d && \
NUMBER=%d",
(const char *)list_table,
(const char *)item->text(1),
(const char *)item->text(2),
mode,
(const char *)list_matrix->station(),
list_matrix->matrix(),
i+1);
}
else {
sql=QString().sprintf("update %s set NAME=\"%s\" where \
STATION_NAME=\"%s\" && \
MATRIX=%d && \
NUMBER=%d",
(const char *)list_table,
(const char *)item->text(1),
(const char *)list_matrix->station(),
list_matrix->matrix(),
i+1);
}
break;
case RDMatrix::Unity4000:
if(list_endpoint==RDMatrix::Input) {
sql=QString("update `")+list_table+"` set "+
"NAME=\""+RDEscapeString(item->text(1))+"\","+
"FEED_NAME=\""+RDEscapeString(item->text(2))+"\","+
QString().sprintf("CHANNEL_MODE=%d where ",mode)+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\" && "+
QString().sprintf("MATRIX=%d && ",list_matrix->matrix())+
QString().sprintf("NUMBER=%d",i+1);
}
else {
sql=QString("update `")+list_table+"` set "+
"NAME=\""+RDEscapeString(item->text(1))+"\" where "+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\" && "+
QString().sprintf("MATRIX=%d && ",list_matrix->matrix())+
QString().sprintf("NUMBER=%d",i+1);
}
break;
case RDMatrix::LogitekVguest:
if(item->text(2).isEmpty()) {
enginenum=-1;
}
else {
enginenum=item->text(2).toInt(NULL,16);
}
if(item->text(3).isEmpty()) {
devicenum=-1;
}
else {
devicenum=item->text(3).toInt(NULL,16);
}
sql=QString("update `")+list_table+"` set "+
"NAME=\""+RDEscapeString(item->text(1))+"\","+
QString().sprintf("ENGINE_NUM=%d,",enginenum)+
QString().sprintf("DEVICE_NUM=%d where ",devicenum)+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\" && "+
QString().sprintf("MATRIX=%d && ",list_matrix->matrix())+
QString().sprintf("NUMBER=%d",i+1);
break;
case RDMatrix::LogitekVguest:
case RDMatrix::StarGuideIII:
if(list_endpoint==RDMatrix::Input) {
if(item->text(2).isEmpty()) {
enginenum=-1;
}
else {
enginenum=item->text(2).toInt(NULL,16);
enginenum=item->text(2).toInt(NULL);
}
if(item->text(3).isEmpty()) {
devicenum=-1;
}
else {
devicenum=item->text(3).toInt(NULL,16);
devicenum=item->text(3).toInt(NULL);
}
sql=QString().sprintf("update %s set NAME=\"%s\",\
ENGINE_NUM=%d,DEVICE_NUM=%d where\
STATION_NAME=\"%s\" && \
MATRIX=%d && \
NUMBER=%d",
(const char *)list_table,
(const char *)item->text(1),
enginenum,
devicenum,
(const char *)list_matrix->station(),
list_matrix->matrix(),
i+1);
break;
sql=QString("update `")+list_table+"` set "+
"NAME=\""+RDEscapeString(item->text(1))+"\","+
QString().sprintf("ENGINE_NUM=%d,",enginenum)+
QString().sprintf("DEVICE_NUM=%d,",devicenum)+
QString().sprintf("CHANNEL_MODE=%d where ",mode)+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\" && "+
QString().sprintf("MATRIX=%d && ",list_matrix->matrix())+
QString().sprintf("NUMBER=%d",i+1);
}
break;
case RDMatrix::StarGuideIII:
if(list_endpoint==RDMatrix::Input) {
if(item->text(2).isEmpty()) {
enginenum=-1;
}
else {
enginenum=item->text(2).toInt(NULL);
}
if(item->text(3).isEmpty()) {
devicenum=-1;
}
else {
devicenum=item->text(3).toInt(NULL);
}
sql=QString().sprintf("update %s set NAME=\"%s\",\
ENGINE_NUM=%d,DEVICE_NUM=%d,\
CHANNEL_MODE=%d where\
STATION_NAME=\"%s\" && \
MATRIX=%d && \
NUMBER=%d",
(const char *)list_table,
(const char *)item->text(1),
enginenum,
devicenum,
mode,
(const char *)list_matrix->station(),
list_matrix->matrix(),
i+1);
}
break;
default:
sql=QString().sprintf("update %s set NAME=\"%s\" where\
STATION_NAME=\"%s\" && \
MATRIX=%d && \
NUMBER=%d",
(const char *)list_table,
(const char *)item->text(1),
(const char *)list_matrix->station(),
list_matrix->matrix(),
i+1);
break;
default:
sql=QString("update `")+list_table+"` set "+
"NAME=\""+RDEscapeString(item->text(1))+"\" where "+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\" && "+
QString().sprintf("MATRIX=%d && ",list_matrix->matrix())+
QString().sprintf("NUMBER=%d",i+1);
break;
}
q=new RDSqlQuery(sql);
delete q;

View File

@ -38,6 +38,7 @@
#include <rdapplication.h>
#include <rdcart.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rdfeedlog.h>
#include <rdpodcast.h>
#include <rdtextfile.h>
@ -163,12 +164,12 @@ void ListFeeds::addData()
EditFeed *edit_feed=new EditFeed(feed,this);
if(edit_feed->exec()<0) {
sql=QString().sprintf("delete from FEED_PERMS where KEY_NAME=\"%s\"",
(const char *)feed);
sql=QString("delete from FEED_PERMS where ")+
"KEY_NAME=\""+RDEscapeString(feed)+"\"";
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from FEEDS where KEY_NAME=\"%s\"",
(const char *)feed);
sql=QString("delete from FEEDS where ")+
"KEY_NAME=\""+RDEscapeString(feed)+"\"";
q=new RDSqlQuery(sql);
delete q;
RDDeleteFeedLog(feed);
@ -219,9 +220,7 @@ void ListFeeds::deleteData()
if(feedname.isEmpty()) {
return;
}
str=QString(tr("Are you sure you want to delete feed"));
warning+=QString().sprintf("%s %s?",(const char *)str,
(const char *)feedname);
warning+=tr("Are you sure you want to delete feed")+" \""+feedname+"\"?";
switch(QMessageBox::warning(this,tr("Delete Feed"),warning,
QMessageBox::Yes,QMessageBox::No)) {
case QMessageBox::No:
@ -266,12 +265,12 @@ void ListFeeds::deleteData()
//
// Delete Feed
//
sql=QString().sprintf("delete from FEED_PERMS where KEY_NAME=\"%s\"",
(const char *)feedname);
sql=QString("delete from FEED_PERMS where ")+
"KEY_NAME=\""+RDEscapeString(feedname)+"\"";
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from FEEDS where KEY_NAME=\"%s\"",
(const char *)feedname);
sql=QString("delete from FEEDS where ")+
"KEY_NAME=\""+RDEscapeString(feedname)+"\"";
q=new RDSqlQuery(sql);
delete q;
RDDeleteFeedLog(feedname);

View File

@ -27,6 +27,7 @@
#include <rd.h>
#include <rdapplication.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rdmacro.h>
#include <rdpasswd.h>
#include <rdstation.h>
@ -140,22 +141,16 @@ ListGpis::ListGpis(RDMatrix *matrix,RDMatrix::GpioType type,QWidget *parent)
//
// Load Values
//
sql=QString().sprintf("select %s.NUMBER,%s.MACRO_CART,%s.OFF_MACRO_CART,\
CART.TITLE \
from %s left join CART \
on %s.MACRO_CART=CART.NUMBER \
where (%s.STATION_NAME=\"%s\")&&(%s.MATRIX=%d)\
order by %s.NUMBER",
(const char *)list_tablename,
(const char *)list_tablename,
(const char *)list_tablename,
(const char *)list_tablename,
(const char *)list_tablename,
(const char *)list_tablename,
(const char *)list_matrix->station(),
(const char *)list_tablename,
list_matrix->matrix(),
(const char *)list_tablename);
sql=QString("select ")+
list_tablename+".NUMBER,"+ // 00
list_tablename+".MACRO_CART,"+ // 01
list_tablename+".OFF_MACRO_CART,"+ // 02
"CART.TITLE "+ // 03
"from "+list_tablename+" left join CART "+
"on "+list_tablename+".MACRO_CART=CART.NUMBER where "+
"("+list_tablename+".STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
"("+list_tablename+QString().sprintf(".MATRIX=%d)",list_matrix->matrix())+
"order by "+list_tablename+".NUMBER";
q=new RDSqlQuery(sql);
if(list_matrix->type()==RDMatrix::LiveWireLwrpAudio) {
while(q->next()) {
@ -288,11 +283,9 @@ void ListGpis::okData()
RDSqlQuery *q;
RDMacro rml;
sql=QString().sprintf("delete from %s where (STATION_NAME=\"%s\")&&\
MATRIX=%d",
(const char *)list_tablename,
(const char *)list_matrix->station(),
list_matrix->matrix());
sql=QString("delete from ")+list_tablename+" where "+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("MATRIX=%d",list_matrix->matrix());
q=new RDSqlQuery(sql);
delete q;
RDStation *station=new RDStation(list_matrix->station());
@ -315,14 +308,12 @@ void ListGpis::okData()
QListViewItem *item=list_list_view->firstChild();
while(item!=NULL) {
sql=QString().sprintf("insert into %s set STATION_NAME=\"%s\",\
MATRIX=%d,NUMBER=%d,MACRO_CART=%d,OFF_MACRO_CART=%d",
(const char *)list_tablename,
(const char *)list_matrix->station(),
list_matrix->matrix(),
item->text(0).toInt(),
item->text(1).toInt(),
item->text(3).toInt());
sql=QString("insert into ")+list_tablename+" set "+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\","+
QString().sprintf("MATRIX=%d,",list_matrix->matrix())+
QString().sprintf("NUMBER=%d,",item->text(0).toInt())+
QString().sprintf("MACRO_CART=%d,",item->text(1).toInt())+
QString().sprintf("OFF_MACRO_CART=%d",item->text(3).toInt());
q=new RDSqlQuery(sql);
delete q;
rml.setArg(2,item->text(0).toInt());

View File

@ -225,33 +225,27 @@ void ListGroups::deleteData()
RDSqlQuery *q;
QString warning;
int carts=0;
QString str;
QString groupname=item->text(0);
if(groupname.isEmpty()) {
return;
}
sql=QString().sprintf("select NUMBER from CART where GROUP_NAME=\"%s\"",
(const char *)groupname);
sql=QString("select NUMBER from CART where ")+
"GROUP_NAME=\""+RDEscapeString(groupname)+"\"";
q=new RDSqlQuery(sql);
if((carts=q->size())>0) {
str=QString(tr("member carts will be deleted along with group"));
warning=QString().
sprintf("%d %s %s!\n",
carts,(const char *)str,(const char *)groupname);
warning=QString().sprintf("%d ",carts)+tr("member carts will be deleted along with group")+" \""+groupname+"\"!";
}
str=QString(tr("Are you sure you want to delete group"));
warning+=QString().sprintf("%s %s?",(const char *)str,
(const char *)groupname);
warning+=tr("Are you sure you want to delete group")+" \""+groupname+"\"?";
switch(QMessageBox::warning(this,tr("Delete Group"),warning,
QMessageBox::Yes,QMessageBox::No)) {
case QMessageBox::No:
case QMessageBox::NoButton:
delete q;
return;
case QMessageBox::No:
case QMessageBox::NoButton:
delete q;
return;
default:
break;
default:
break;
}
//
@ -268,32 +262,32 @@ void ListGroups::deleteData()
//
// Delete Member Audio Perms
//
sql=QString().sprintf("delete from AUDIO_PERMS where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(groupname));
sql=QString("delete from AUDIO_PERMS where ")+
"GROUP_NAME=\""+RDEscapeString(groupname)+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Delete Member User Perms
//
sql=QString().sprintf("delete from USER_PERMS where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(groupname));
sql=QString("delete from USER_PERMS where ")+
"GROUP_NAME=\""+RDEscapeString(groupname)+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Delete Replicator Map Records
//
sql=QString().sprintf("delete from REPLICATOR_MAP where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(groupname));
sql=QString("delete from REPLICATOR_MAP where ")+
"GROUP_NAME=\""+RDEscapeString(groupname)+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Delete from Group List
//
sql=QString().sprintf("delete from GROUPS where NAME=\"%s\"",
(const char *)RDEscapeString(groupname));
sql=QString("delete from GROUPS where ")+
"NAME=\""+RDEscapeString(groupname)+"\"";
q=new RDSqlQuery(sql);
delete q;
item->setSelected(false);
@ -311,19 +305,25 @@ void ListGroups::reportData()
// Generate Header
//
report=" Rivendell Group Report\n";
report+=QString().sprintf("Generated: %s\n",
(const char *)QDateTime(QDate::currentDate(),
QTime::currentTime()).
toString("MM/dd/yyyy - hh:mm:ss"));
report+=QString("Generated: ")+
QDateTime::currentDateTime().toString("MM/dd/yyyy - hh:mm:ss")+"\n";
report+="\n";
report+="-Name----- -Description-------------------------------- -Cart Range---- Enf DefType Mus Tfc N&N\n";
//
// Generate Body
//
sql="select NAME,DESCRIPTION,DEFAULT_LOW_CART,DEFAULT_HIGH_CART,\
ENFORCE_CART_RANGE,DEFAULT_CART_TYPE,REPORT_MUS,REPORT_TFC,\
ENABLE_NOW_NEXT from GROUPS order by NAME";
sql=QString("select ")+
"NAME,"+ // 00
"DESCRIPTION,"+ // 01
"DEFAULT_LOW_CART,"+ // 02
"DEFAULT_HIGH_CART,"+ // 03
"ENFORCE_CART_RANGE,"+ // 04
"DEFAULT_CART_TYPE,"+ // 05
"REPORT_MUS,"+ // 06
"REPORT_TFC,"+ // 07
"ENABLE_NOW_NEXT "+ // 08
"from GROUPS order by NAME";
q=new RDSqlQuery(sql);
while(q->next()) {
//
@ -356,17 +356,17 @@ void ListGroups::reportData()
// Default Cart Type
//
switch((RDCart::Type)q->value(5).toInt()) {
case RDCart::Audio:
report+="Audio ";
break;
case RDCart::Audio:
report+="Audio ";
break;
case RDCart::Macro:
report+="Macro ";
break;
case RDCart::Macro:
report+="Macro ";
break;
default:
report+="Unknown ";
break;
default:
report+="Unknown ";
break;
}
//
@ -430,10 +430,19 @@ void ListGroups::RefreshList()
RDListViewItem *item;
list_groups_view->clear();
q=new RDSqlQuery("select NAME,DESCRIPTION,DEFAULT_LOW_CART,DEFAULT_HIGH_CART,\
ENFORCE_CART_RANGE,DEFAULT_CART_TYPE,REPORT_TFC,REPORT_MUS,\
ENABLE_NOW_NEXT,COLOR from GROUPS",
0);
sql=QString("select ")+
"NAME,"+ // 00
"DESCRIPTION,"+ // 01
"DEFAULT_LOW_CART,"+ // 02
"DEFAULT_HIGH_CART,"+ // 03
"ENFORCE_CART_RANGE,"+ // 04
"DEFAULT_CART_TYPE,"+ // 05
"REPORT_TFC,"+ // 06
"REPORT_MUS,"+ // 07
"ENABLE_NOW_NEXT,"+ // 08
"COLOR "+ // 09
"from GROUPS";
q=new RDSqlQuery(sql);
while (q->next()) {
item=new RDListViewItem(list_groups_view);
WriteItem(item,q);
@ -447,11 +456,19 @@ void ListGroups::RefreshItem(RDListViewItem *item)
QString sql;
RDSqlQuery *q;
sql=QString().sprintf("select NAME,DESCRIPTION,DEFAULT_LOW_CART,\
DEFAULT_HIGH_CART,ENFORCE_CART_RANGE,\
DEFAULT_CART_TYPE,REPORT_TFC,REPORT_MUS,\
ENABLE_NOW_NEXT,COLOR from GROUPS where NAME=\"%s\"",
(const char *)item->text(0));
sql=QString("select ")+
"NAME,"+ // 00
"DESCRIPTION,"+ // 01
"DEFAULT_LOW_CART,"+ // 02
"DEFAULT_HIGH_CART,"+ // 03
"ENFORCE_CART_RANGE,"+ // 04
"DEFAULT_CART_TYPE,"+ // 05
"REPORT_TFC,"+ // 06
"REPORT_MUS,"+ // 07
"ENABLE_NOW_NEXT,"+ // 08
"COLOR "+ // 09
"from GROUPS where "+
"NAME=\""+RDEscapeString(item->text(0))+"\"";
q=new RDSqlQuery(sql);
if(q->next()) {
WriteItem(item,q);
@ -475,17 +492,17 @@ void ListGroups::WriteItem(RDListViewItem *item,RDSqlQuery *q)
}
item->setText(4,q->value(4).toString());
switch((RDCart::Type)q->value(5).toUInt()) {
case RDCart::Audio:
item->setText(5,"Audio");
break;
case RDCart::Audio:
item->setText(5,"Audio");
break;
case RDCart::Macro:
item->setText(5,"Macro");
break;
case RDCart::Macro:
item->setText(5,"Macro");
break;
default:
item->setText(5,"[none]");
break;
default:
item->setText(5,"[none]");
break;
}
item->setText(6,q->value(6).toString());
item->setText(7,q->value(7).toString());

View File

@ -2,7 +2,7 @@
//
// List Rivendell Host Variables
//
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2004,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -29,12 +29,14 @@
#include <qmessagebox.h>
#include <qbuttongroup.h>
#include <rdstation.h>
#include <rddb.h>
#include <globals.h>
#include <list_hostvars.h>
#include <add_hostvar.h>
#include <edit_hostvar.h>
#include <rdescape_string.h>
#include <rdstation.h>
#include "add_hostvar.h"
#include "edit_hostvar.h"
#include "globals.h"
#include "list_hostvars.h"
ListHostvars::ListHostvars(QString station,QWidget *parent)
: QDialog(parent,"",true)
@ -51,8 +53,7 @@ ListHostvars::ListHostvars(QString station,QWidget *parent)
list_station=station;
str=QString(tr("Host Variables for"));
setCaption(QString().sprintf("%s %s",(const char *)str,
(const char *)station.upper()));
setCaption(tr("Host Variables for")+" "+station);
//
// Create Fonts
@ -193,9 +194,9 @@ void ListHostvars::deleteData()
if(item==NULL) {
return;
}
if(QMessageBox::question(this,"Delete Host Variable",
QString().sprintf("Are you sure you want to delete the variable %s?",
(const char *)item->text(0)),
if(QMessageBox::question(this,"RDAdmin - "+tr("Delete Host Variable"),
tr("Are you sure you want to delete the variable")+
" \""+item->text(0)+"\"?",
QMessageBox::Yes,QMessageBox::No)!=QMessageBox::Yes) {
return;
}
@ -214,18 +215,17 @@ void ListHostvars::okData()
QString sql;
RDSqlQuery *q;
sql=QString().sprintf("delete from HOSTVARS where STATION_NAME=\"%s\"",
(const char *)list_station);
sql=QString("delete from HOSTVARS where ")+
"STATION_NAME=\""+RDEscapeString(list_station)+"\"";
q=new RDSqlQuery(sql);
delete q;
QListViewItem *item=list_view->firstChild();
while(item!=NULL) {
sql=QString().sprintf("insert into HOSTVARS set STATION_NAME=\"%s\",\
NAME=\"%s\",VARVALUE=\"%s\",REMARK=\"%s\"",
(const char *)list_station,
(const char *)item->text(0),
(const char *)item->text(1),
(const char *)item->text(2));
sql=QString("insert into HOSTVARS set ")+
"STATION_NAME=\""+RDEscapeString(list_station)+"\","+
"NAME=\""+RDEscapeString(item->text(0))+"\","+
"VARVALUE=\""+RDEscapeString(item->text(1))+"\","+
"REMARK=\""+RDEscapeString(item->text(2))+"\"";
q=new RDSqlQuery(sql);
delete q;
item=item->nextSibling();
@ -245,9 +245,13 @@ void ListHostvars::RefreshList()
QListViewItem *l;
list_view->clear();
QString sql=QString().sprintf("select NAME,VARVALUE,REMARK from HOSTVARS \
where STATION_NAME=\"%s\" order by NAME",
(const char *)list_station);
QString sql=QString("select ")+
"NAME,"+ // 00
"VARVALUE,"+ // 01
"REMARK " // 02
"from HOSTVARS where "+
"STATION_NAME=\""+RDEscapeString(list_station)+"\" "+
"order by NAME";
RDSqlQuery *q=new RDSqlQuery(sql);
while(q->next()) {
l=new QListViewItem(list_view);

View File

@ -29,9 +29,9 @@
#include <qmessagebox.h>
#include <qbuttongroup.h>
//#include <rdstation.h>
#include <rdapplication.h>
#include <rddb.h>
#include <rdescape_string.h>
#include "add_matrix.h"
#include "edit_matrix.h"
@ -190,25 +190,15 @@ void ListMatrices::editData()
void ListMatrices::deleteData()
{
QString str1;
QString str2;
QString str3;
if(list_view->currentItem()==NULL) {
return;
}
int matrix=list_view->currentItem()->text(0).toInt();
QString desc=list_view->currentItem()->text(1);
str1=QString(tr("Are you sure you want to delete switcher"));
str2=QString(tr("on"));
str3=QString(tr("ALL references to this switcher will be deleted!"));
QString msg=QString().sprintf("%s \"%d:%s\" %s \"%s\"?\n%s",
(const char *)str1,
matrix,
(const char *)desc,
(const char *)str2,
(const char *)list_station,
(const char *)str3);
QString msg=tr("Are you sure you want to delete switcher")+
" \""+list_view->currentItem()->text(0)+":"+list_view->currentItem()->text(1)+"\" "+
tr("on")+" \""+list_station+"\"?"+"\n"+
tr("ALL references to this switcher will be deleted!");
if(QMessageBox::warning(this,tr("Deleting Switcher"),msg,
QMessageBox::Yes,QMessageBox::No)!=
QMessageBox::Yes) {
@ -251,46 +241,39 @@ void ListMatrices::closeData()
void ListMatrices::DeleteMatrix(int matrix)
{
QString sql=QString().sprintf("delete from MATRICES where \
STATION_NAME=\"%s\" && MATRIX=%d",
(const char *)list_station,
matrix);
QString sql=QString("delete from MATRICES where ")+
"STATION_NAME=\""+RDEscapeString(list_station)+"\" && "+
QString().sprintf("MATRIX=%d",matrix);
RDSqlQuery *q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from INPUTS where \
STATION_NAME=\"%s\" && MATRIX=%d",
(const char *)list_station,
matrix);
sql=QString("delete from INPUTS where ")+
"STATION_NAME=\""+RDEscapeString(list_station)+"\" && "+
QString().sprintf("MATRIX=%d",matrix);
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from OUTPUTS where \
STATION_NAME=\"%s\" && MATRIX=%d",
(const char *)list_station,
matrix);
sql=QString("delete from OUTPUTS where ")+
"STATION_NAME=\""+RDEscapeString(list_station)+"\" && "+
QString().sprintf("MATRIX=%d",matrix);
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from SWITCHER_NODES where \
STATION_NAME=\"%s\" && MATRIX=%d",
(const char *)list_station,
matrix);
sql=QString("delete from SWITCHER_NODES where ")+
"STATION_NAME=\""+RDEscapeString(list_station)+"\" && "+
QString().sprintf("MATRIX=%d",matrix);
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from GPIS where \
STATION_NAME=\"%s\" && MATRIX=%d",
(const char *)list_station,
matrix);
sql=QString("delete from GPIS where ")+
"STATION_NAME=\""+RDEscapeString(list_station)+"\" && "+
QString().sprintf("MATRIX=%d",matrix);
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from GPOS where \
STATION_NAME=\"%s\" && MATRIX=%d",
(const char *)list_station,
matrix);
sql=QString("delete from GPOS where ")+
"STATION_NAME=\""+RDEscapeString(list_station)+"\" && "+
QString().sprintf("MATRIX=%d",matrix);
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from VGUEST_RESOURCES where \
STATION_NAME=\"%s\" && MATRIX_NUM=%d",
(const char *)list_station,
matrix);
sql=QString("delete from VGUEST_RESOURCES where ")+
"STATION_NAME=\""+RDEscapeString(list_station)+"\" && "+
QString().sprintf("MATRIX_NUM=%d",matrix);
q=new RDSqlQuery(sql);
delete q;
}
@ -301,9 +284,13 @@ void ListMatrices::RefreshList()
QListViewItem *l;
list_view->clear();
QString sql=QString().sprintf("select MATRIX,NAME,TYPE from MATRICES \
where STATION_NAME=\"%s\" order by MATRIX",
(const char *)list_station);
QString sql=QString("select ")+
"MATRIX,"+ // 00
"NAME,"+ // 01
"TYPE "+ // 02
"from MATRICES where "+
"STATION_NAME=\""+RDEscapeString(list_station)+"\" "+
"order by MATRIX";
RDSqlQuery *q=new RDSqlQuery(sql);
while(q->next()) {
l=new QListViewItem(list_view);

View File

@ -2,7 +2,7 @@
//
// List Rivendell LiveWire Nodes
//
// (C) Copyright 2002-2003,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2003,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -25,12 +25,13 @@
#include <qmessagebox.h>
#include <rd.h>
#include <rdpasswd.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rdpasswd.h>
#include <edit_node.h>
#include <list_nodes.h>
#include <edit_endpoint.h>
#include "edit_node.h"
#include "list_nodes.h"
#include "edit_endpoint.h"
ListNodes::ListNodes(RDMatrix *matrix,QWidget *parent)
: QDialog(parent,"",true)
@ -207,11 +208,15 @@ void ListNodes::RefreshList()
RDListViewItem *item;
list_list_view->clear();
sql=QString().sprintf("select ID,HOSTNAME,DESCRIPTION,BASE_OUTPUT,TCP_PORT \
from SWITCHER_NODES \
where (STATION_NAME=\"%s\")&&(MATRIX=%d)",
(const char *)list_matrix->station(),
list_matrix->matrix());
sql=QString("select ")+
"ID,"+
"HOSTNAME,"+
"DESCRIPTION,"+
"BASE_OUTPUT,"+
"TCP_PORT "+
"from SWITCHER_NODES where "+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX=%d)",list_matrix->matrix());
q=new RDSqlQuery(sql);
while(q->next()) {
item=new RDListViewItem(list_list_view);
@ -258,16 +263,13 @@ void ListNodes::PurgeEndpoints(const QString &tablename)
QString sql;
RDSqlQuery *q;
sql=QString().sprintf("delete from %s where \
(STATION_NAME=\"%s\")&&\
(MATRIX=%d)&&",
(const char *)tablename,
(const char *)list_matrix->station(),
list_matrix->matrix());
sql=QString("delete from ")+tablename+" where "+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX=%d)&&",list_matrix->matrix());
RDListViewItem *item=(RDListViewItem *)list_list_view->firstChild();
while(item!=NULL) {
sql+=QString().sprintf("((NODE_HOSTNAME!=\"%s\")&&(NODE_TCP_PORT!=%d))&&",
(const char *)item->text(0),item->text(3).toInt());
sql+=QString("((NODE_HOSTNAME!=\"")+RDEscapeString(item->text(0))+"\")&&"+
QString().sprintf("(NODE_TCP_PORT!=%d))&&",item->text(3).toInt());
item=(RDListViewItem *)item->nextSibling();
}
sql=sql.left(sql.length()-2);

View File

@ -166,9 +166,9 @@ void ListReplicatorCarts::repostAllData()
QString sql;
RDSqlQuery *q;
sql=QString().sprintf("update REPL_CART_STATE set REPOST=\"Y\" \
where REPLICATOR_NAME=\"%s\"",
(const char *)list_replicator_name);
sql=QString("update REPL_CART_STATE set ")+
"REPOST=\"Y\" where "+
"REPLICATOR_NAME=\""+RDEscapeString(list_replicator_name)+"\"";
q=new RDSqlQuery(sql);
delete q;
}
@ -187,9 +187,11 @@ void ListReplicatorCarts::refreshTimeoutData()
RDSqlQuery *q;
RDListViewItem *item;
sql=QString().sprintf("select ID,ITEM_DATETIME from REPL_CART_STATE \
where REPLICATOR_NAME=\"%s\"",
(const char *)RDEscapeString(list_replicator_name));
sql=QString("select ")+
"ID,"+
"ITEM_DATETIME "+
"from REPL_CART_STATE where "+
"REPLICATOR_NAME=\""+RDEscapeString(list_replicator_name)+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
item=(RDListViewItem *)list_view->firstChild();
@ -223,15 +225,16 @@ void ListReplicatorCarts::RefreshList()
RDListViewItem *item;
list_view->clear();
sql=QString().sprintf("select REPL_CART_STATE.ID,\
CART.TYPE,REPL_CART_STATE.CART_NUMBER,\
CART.TITLE,\
REPL_CART_STATE.ITEM_DATETIME,\
REPL_CART_STATE.POSTED_FILENAME \
from REPL_CART_STATE left join CART \
on REPL_CART_STATE.CART_NUMBER=CART.NUMBER \
where REPLICATOR_NAME=\"%s\"",
(const char *)RDEscapeString(list_replicator_name));
sql=QString("select ")+
"REPL_CART_STATE.ID,"+ // 00
"CART.TYPE,"+ // 01
"REPL_CART_STATE.CART_NUMBER,"+ // 02
"CART.TITLE,"+ // 03
"REPL_CART_STATE.ITEM_DATETIME,"+ // 04
"REPL_CART_STATE.POSTED_FILENAME "+ // 05
"from REPL_CART_STATE left join CART "+
"on REPL_CART_STATE.CART_NUMBER=CART.NUMBER where "+
"REPLICATOR_NAME=\""+RDEscapeString(list_replicator_name)+"\"";
q=new RDSqlQuery(sql);
while (q->next()) {
item=new RDListViewItem(list_view);

View File

@ -188,51 +188,46 @@ void ListReplicators::deleteData()
QString sql;
RDSqlQuery *q;
QString warning;
QString str;
QString name=RDEscapeString(item->text(0));
str=QString(tr("Are you sure you want to delete replicator"));
warning+=QString().sprintf("%s \"%s\"?",(const char *)str,
(const char *)item->text(0));
warning+=tr("Are you sure you want to delete replicator")+
" \""+item->text(0)+"\"?";
switch(QMessageBox::warning(this,tr("Delete Replicator"),warning,
QMessageBox::Yes,QMessageBox::No)) {
case QMessageBox::No:
case QMessageBox::NoButton:
return;
case QMessageBox::No:
case QMessageBox::NoButton:
return;
default:
break;
default:
break;
}
//
// Delete Group Assignments
//
sql=QString().sprintf("delete from REPLICATOR_MAP \
where REPLICATOR_NAME=\"%s\"",
(const char *)name);
sql=QString("delete from REPLICATOR_MAP where ")+
"REPLICATOR_NAME=\""+RDEscapeString(name)+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Delete State Records
//
sql=QString().sprintf("delete from REPL_CART_STATE \
where REPLICATOR_NAME=\"%s\"",
(const char *)name);
sql=QString("delete from REPL_CART_STATE where ")+
"REPLICATOR_NAME=\""+RDEscapeString(name)+"\"";
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from REPL_CUT_STATE \
where REPLICATOR_NAME=\"%s\"",
(const char *)name);
sql=QString("delete from REPL_CUT_STATE where ")+
"REPLICATOR_NAME=\""+RDEscapeString(name)+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Delete from Replicator List
//
sql=QString().sprintf("delete from REPLICATORS where NAME=\"%s\"",
(const char *)name);
sql=QString("delete from REPLICATORS where ")+
"NAME=\""+RDEscapeString(name)+"\"";
q=new RDSqlQuery(sql);
delete q;
delete item;
@ -301,9 +296,12 @@ void ListReplicators::RefreshItem(RDListViewItem *item)
QString sql;
RDSqlQuery *q;
sql=QString().sprintf("select TYPE_ID,DESCRIPTION,STATION_NAME \
from REPLICATORS where NAME=\"%s\"",
(const char *)RDEscapeString(item->text(0)));
sql=QString("select ")+
"TYPE_ID,"+ // 00
"DESCRIPTION,"+ // 01
"STATION_NAME "+ // 02
"from REPLICATORS where "+
"NAME=\""+RDEscapeString(item->text(0))+"\"";
q=new RDSqlQuery(sql);
if(q->first()) {
item->setText(1,

View File

@ -2,7 +2,7 @@
//
// List Rivendell Reports
//
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2004,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -30,9 +30,11 @@
#include <qbuttongroup.h>
#include <rddb.h>
#include <list_reports.h>
#include <edit_report.h>
#include <add_report.h>
#include <rdescape_string.h>
#include "add_report.h"
#include "edit_report.h"
#include "list_reports.h"
ListReports::ListReports(QWidget *parent)
: QDialog(parent,"",true)
@ -158,16 +160,12 @@ void ListReports::editData()
void ListReports::deleteData()
{
QString str;
if(list_box->currentText().isEmpty()) {
return;
}
str=QString(tr("Are you sure you want to delete report"));
if(QMessageBox::warning(this,tr("Delete Report"),
QString().sprintf(
"%s \"%s\"?",(const char *)str,
(const char *)list_box->currentText()),
if(QMessageBox::warning(this,"RDAdmin - "+tr("Delete Report"),
tr("Are you sure you want to delete report")+
" \""+list_box->currentText()+"\"?",
QMessageBox::Yes,QMessageBox::No)==
QMessageBox::Yes) {
DeleteReport(list_box->currentText());
@ -197,16 +195,16 @@ void ListReports::DeleteReport(QString rptname)
QString sql;
RDSqlQuery *q;
sql=QString().sprintf("delete from REPORTS where NAME=\"%s\"",
(const char *)rptname);
sql=QString("delete from REPORTS where ")+
"NAME=\""+RDEscapeString(rptname)+"\"";
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from REPORT_SERVICES where \
REPORT_NAME=\"%s\"",(const char *)rptname);
sql=QString("delete from REPORT_SERVICES where ")+
"REPORT_NAME=\""+RDEscapeString(rptname)+"\"";
q=new RDSqlQuery(sql);
delete q;
sql=QString().sprintf("delete from REPORT_STATIONS where \
REPORT_NAME=\"%s\"",(const char *)rptname);
sql=QString("delete from REPORT_STATIONS where ")+
"REPORT_NAME=\""+RDEscapeString(rptname)+"\"";
q=new RDSqlQuery(sql);
delete q;
}

View File

@ -206,40 +206,31 @@ void ListSasResources::okData()
if(!item->text(3).isEmpty()) {
relay_num=item->text(3).toInt();
}
sql=QString().sprintf("select ID from VGUEST_RESOURCES where\
(STATION_NAME=\"%s\")&&\
(MATRIX_NUM=%d)&&\
(NUMBER=%d)",
(const char *)list_matrix->station(),
list_matrix->matrix(),item->text(0).toInt());
sql=QString("select ID from VGUEST_RESOURCES where" )+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX_NUM=%d)&&",list_matrix->matrix())+
QString().sprintf("(NUMBER=%d)",item->text(0).toInt());
q=new RDSqlQuery(sql);
if(q->first()) {
sql=QString().sprintf("update VGUEST_RESOURCES set\
ENGINE_NUM=%d,DEVICE_NUM=%d,\
SURFACE_NUM=%d,RELAY_NUM=%d\
where\
(STATION_NAME=\"%s\")&&\
(MATRIX_NUM=%d)&&\
(NUMBER=%d)",
engine_num,device_num,surface_num,
relay_num,
(const char *)list_matrix->station(),
list_matrix->matrix(),
item->text(0).toInt());
sql=QString("update VGUEST_RESOURCES set ")+
QString().sprintf("ENGINE_NUM=%d,",engine_num)+
QString().sprintf("DEVICE_NUM=%d,",device_num)+
QString().sprintf("SURFACE_NUM=%d,",surface_num)+
QString().sprintf("RELAY_NUM=%d where ",relay_num)+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX_NUM=%d)&&",list_matrix->matrix())+
QString().sprintf("(NUMBER=%d)",item->text(0).toInt());
}
else {
sql=QString().sprintf("insert into VGUEST_RESOURCES set\
STATION_NAME=\"%s\",MATRIX_NUM=%d,\
NUMBER=%d,\
ENGINE_NUM=%d,DEVICE_NUM=%d,\
SURFACE_NUM=%d,RELAY_NUM=%d",
(const char *)list_matrix->station(),
list_matrix->matrix(),
item->text(0).toInt(),
engine_num,device_num,surface_num,
relay_num);
sql=QString("insert into VGUEST_RESOURCES set ")+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\","+
QString().sprintf("MATRIX_NUM=%d,",list_matrix->matrix())+
QString().sprintf("NUMBER=%d,",item->text(0).toInt())+
QString().sprintf("ENGINE_NUM=%d,",engine_num)+
QString().sprintf("DEVICE_NUM=%d,",device_num)+
QString().sprintf("SURFACE_NUM=%d,",surface_num)+
QString().sprintf("RELAY_NUM=%d",relay_num);
}
delete q;
q=new RDSqlQuery(sql);
delete q;
item=item->nextSibling();
@ -266,10 +257,9 @@ void ListSasResources::RefreshList()
//
// Populate Resource Records
//
sql=QString().sprintf("select GPIS from MATRICES \
where (STATION_NAME=\"%s\")&&(MATRIX=%d)",
(const char *)RDEscapeString(list_matrix->station()),
list_matrix->matrix());
sql=QString("select GPIS from MATRICES where ")+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX=%d)",list_matrix->matrix());
q=new RDSqlQuery(sql);
if(!q->first()) {
delete q;
@ -278,33 +268,31 @@ void ListSasResources::RefreshList()
gpis=q->value(0).toInt();
delete q;
for(int i=0;i<gpis;i++) {
sql=QString().sprintf("select NUMBER from VGUEST_RESOURCES \
where (STATION_NAME=\"%s\")&&(MATRIX_NUM=%d)&&\
(NUMBER=%d)",
(const char *)RDEscapeString(list_matrix->station()),
list_matrix->matrix(),
i+1);
sql=QString("select NUMBER from VGUEST_RESOURCES where ")+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX_NUM=%d)&&",list_matrix->matrix())+
QString().sprintf("(NUMBER=%d)",i+1);
q=new RDSqlQuery(sql);
if(!q->first()) {
sql=QString().sprintf("insert into VGUEST_RESOURCES set \
NUMBER=%d,\
STATION_NAME=\"%s\",\
MATRIX_NUM=%d",
i+1,
(const char *)RDEscapeString(list_matrix->station()),
list_matrix->matrix());
sql=QString("insert into VGUEST_RESOURCES set ")+
QString().sprintf("NUMBER=%d,",i+1)+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\","+
QString().sprintf("MATRIX_NUM=%d",list_matrix->matrix());
q1=new RDSqlQuery(sql);
delete q1;
}
delete q;
}
sql=QString().sprintf("select NUMBER,ENGINE_NUM,DEVICE_NUM,RELAY_NUM \
from VGUEST_RESOURCES where\
(STATION_NAME=\"%s\")&&(MATRIX_NUM=%d) \
order by NUMBER",
(const char *)RDEscapeString(list_matrix->station()),
list_matrix->matrix());
sql=QString("select ")+
"NUMBER,"+
"ENGINE_NUM,"+
"DEVICE_NUM,"+
"RELAY_NUM "+
"from VGUEST_RESOURCES where "+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX_NUM=%d)",list_matrix->matrix())+
"order by NUMBER";
q=new RDSqlQuery(sql);
list_list_view->clear();
while(q->next()) {

View File

@ -2,7 +2,7 @@
//
// List Rivendell Workstations
//
// (C) Copyright 2002-2017 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -29,12 +29,13 @@
#include <qmessagebox.h>
#include <qbuttongroup.h>
#include <rddb.h>
#include <rdairplay_conf.h>
#include <rdescape_string.h>
#include <rddb.h>
#include <list_stations.h>
#include <edit_station.h>
#include <add_station.h>
#include "add_station.h"
#include "edit_station.h"
#include "list_stations.h"
ListStations::ListStations(QWidget *parent)
: QDialog(parent,"",true)
@ -155,15 +156,10 @@ void ListStations::editData()
void ListStations::deleteData()
{
QString str;
str=QString(tr("Are you sure you want to delete host"));
if(QMessageBox::warning(this,tr("Delete Station"),
QString().sprintf(
"%s %s?",(const char *)str,
(const char *)list_box->currentText()),
QMessageBox::Yes,QMessageBox::No)==
QMessageBox::Yes) {
if(QMessageBox::warning(this,"RDAdmin - "+tr("Delete Station"),
tr("Are you sure you want to delete host")+
" \""+list_box->currentText()+"\"?",
QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes) {
RDStation::remove(list_box->currentText());
list_box->removeItem(list_box->currentItem());
if(list_box->currentItem()>=0) {

View File

@ -31,6 +31,7 @@
#include <rdapplication.h>
#include <rddb.h>
#include <rdescape_string.h>
#include "add_svc.h"
#include "edit_svc.h"
@ -155,31 +156,22 @@ void ListSvcs::editData()
void ListSvcs::deleteData()
{
QString str1;
QString str2;
QString sql;
RDSqlQuery *q;
str1=QString(tr("Are you sure you want to delete service"));
if(QMessageBox::warning(this,tr("Delete Service"),
QString().sprintf(
"%s %s?",(const char *)str1,
(const char *)list_box->currentText()),
QMessageBox::Yes,QMessageBox::No)!=
QMessageBox::Yes) {
if(QMessageBox::warning(this,"RDAdmin- "+tr("Delete Service"),
tr("Are you sure you want to delete service")+
" \""+list_box->currentText()+"\"?",
QMessageBox::Yes,QMessageBox::No)!=QMessageBox::Yes) {
return;
}
sql=QString().sprintf("select NAME from LOGS where SERVICE=\"%s\"",
(const char *)list_box->currentText());
sql=QString("select NAME from LOGS where ")+
"SERVICE=\""+RDEscapeString(list_box->currentText())+"\"";
q=new RDSqlQuery(sql);
if(q->first()) {
str1=tr("There are");
str2=tr("logs owned by this service that will also be deleted.\nDo you still want to proceed?");
if(QMessageBox::warning(this,tr("Logs Exist"),
QString().sprintf("%s %d %s",
(const char *)str1,
q->size(),
(const char *)str2),
if(QMessageBox::warning(this,"RDAdmin - "+tr("Logs Exist"),
tr("There are")+QString().sprintf(" %d ",q->size())+
tr("logs owned by this service that will also be deleted.")+"\n"+tr("Do you still want to proceed?"),
QMessageBox::Yes,QMessageBox::No)!=
QMessageBox::Yes) {
delete q;

View File

@ -205,8 +205,8 @@ void ListUsers::deleteData()
//
// Check for default user assignments
//
sql=QString().sprintf("select NAME from STATIONS where DEFAULT_NAME=\"%s\"",
(const char *)username);
sql=QString("select NAME from STATIONS where ")+
"DEFAULT_NAME=\""+RDEscapeString(username)+"\"";
q=new RDSqlQuery(sql);
if(q->size()>0) {
str=tr("This user is set as the default user for the following hosts:\n\n");
@ -222,47 +222,46 @@ void ListUsers::deleteData()
delete q;
str=QString(tr("Are you sure you want to delete user"));
warning+=QString().sprintf("%s \"%s\"?",(const char *)str,
(const char *)item->text(1));
switch(QMessageBox::warning(this,tr("Delete User"),warning,
warning+=str+" \""+item->text(1)+"\"?";
switch(QMessageBox::warning(this,"RDAdmin - "+tr("Delete User"),warning,
QMessageBox::Yes,QMessageBox::No)) {
case QMessageBox::No:
case QMessageBox::NoButton:
return;
case QMessageBox::No:
case QMessageBox::NoButton:
return;
default:
break;
default:
break;
}
//
// Delete RSS Feed Perms
//
sql=QString().sprintf("delete from FEED_PERMS where USER_NAME=\"%s\"",
(const char *)username);
sql=QString("delete from FEED_PERMS where ")+
"USER_NAME=\""+RDEscapeString(username)+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Delete Member User Perms
//
sql=QString().sprintf("delete from USER_PERMS where USER_NAME=\"%s\"",
(const char *)username);
sql=QString("delete from USER_PERMS where ")+
"USER_NAME=\""+RDEscapeString(username)+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Delete from User List
//
sql=QString().sprintf("delete from USERS where LOGIN_NAME=\"%s\"",
(const char *)username);
sql=QString("delete from USERS where ")+
"LOGIN_NAME=\""+RDEscapeString(username)+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Delete from Cached Web Connections
//
sql=QString().sprintf("delete from WEB_CONNECTIONS where LOGIN_NAME=\"%s\"",
(const char *)username);
sql=QString("delete from WEB_CONNECTIONS where ")+
"LOGIN_NAME=\""+RDEscapeString(username)+"\"";
q=new RDSqlQuery(sql);
delete q;
@ -324,9 +323,12 @@ void ListUsers::RefreshItem(RDListViewItem *item)
QString sql;
RDSqlQuery *q;
sql=QString().sprintf("select ADMIN_CONFIG_PRIV,FULL_NAME,DESCRIPTION \
from USERS where LOGIN_NAME=\"%s\"",
(const char *)RDEscapeString(item->text(1)));
sql=QString("select ")+
"ADMIN_CONFIG_PRIV,"+ // 00
"FULL_NAME,"+ // 01
"DESCRIPTION "+ // 02
"from USERS where "+
"LOGIN_NAME=\""+RDEscapeString(item->text(1))+"\"";
q=new RDSqlQuery(sql);
if(q->first()) {
if(q->value(0).toString()=="Y") {

View File

@ -2,7 +2,7 @@
//
// List vGuest Resources.
//
// (C) Copyright 2002-2005,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2005,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -26,9 +26,11 @@
#include <rd.h>
#include <rddb.h>
#include <edit_user.h>
#include <list_vguest_resources.h>
#include <edit_vguest_resource.h>
#include <rdescape_string.h>
#include "edit_user.h"
#include "edit_vguest_resource.h"
#include "list_vguest_resources.h"
ListVguestResources::ListVguestResources(RDMatrix *matrix,
RDMatrix::VguestType type,int size,
@ -263,41 +265,33 @@ void ListVguestResources::okData()
case RDMatrix::VguestTypeDisplay:
break;
}
sql=QString().sprintf("select ID from VGUEST_RESOURCES where\
(STATION_NAME=\"%s\")&&\
(MATRIX_NUM=%d)&&\
(VGUEST_TYPE=%d)&&\
(NUMBER=%d)",
(const char *)list_matrix->station(),
list_matrix->matrix(),list_type,
item->text(0).toInt());
sql=QString("select ID from VGUEST_RESOURCES where ")+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX_NUM=%d)&&",list_matrix->matrix())+
QString().sprintf("(VGUEST_TYPE=%d)&&",list_type)+
QString().sprintf("(NUMBER=%d)",item->text(0).toInt());
q=new RDSqlQuery(sql);
if(q->first()) {
sql=QString().sprintf("update VGUEST_RESOURCES set\
ENGINE_NUM=%d,DEVICE_NUM=%d,\
SURFACE_NUM=%d,RELAY_NUM=%d\
where\
(STATION_NAME=\"%s\")&&\
(MATRIX_NUM=%d)&&\
(VGUEST_TYPE=%d)&&\
(NUMBER=%d)",
engine_num,device_num,surface_num,
relay_num,
(const char *)list_matrix->station(),
list_matrix->matrix(),
list_type,item->text(0).toInt());
sql=QString("update VGUEST_RESOURCES set ")+
QString().sprintf("ENGINE_NUM=%d,",engine_num)+
QString().sprintf("DEVICE_NUM=%d,",device_num)+
QString().sprintf("SURFACE_NUM=%d,",surface_num)+
QString().sprintf("RELAY_NUM=%d where ",relay_num)+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX_NUM=%d)&&",list_matrix->matrix())+
QString().sprintf("(VGUEST_TYPE=%d)&&",list_type)+
QString().sprintf("(NUMBER=%d)",item->text(0).toInt());
}
else {
sql=QString().sprintf("insert into VGUEST_RESOURCES set\
STATION_NAME=\"%s\",MATRIX_NUM=%d,\
VGUEST_TYPE=%d,NUMBER=%d,\
ENGINE_NUM=%d,DEVICE_NUM=%d,\
SURFACE_NUM=%d,RELAY_NUM=%d",
(const char *)list_matrix->station(),
list_matrix->matrix(),
list_type,item->text(0).toInt(),
engine_num,device_num,surface_num,
relay_num);
sql=QString("insert into VGUEST_RESOURCES set ")+
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\","+
QString().sprintf("MATRIX_NUM=%d,",list_matrix->matrix())+
QString().sprintf("VGUEST_TYPE=%d,",list_type)+
QString().sprintf("NUMBER=%d,",item->text(0).toInt())+
QString().sprintf("ENGINE_NUM=%d,",engine_num)+
QString().sprintf("DEVICE_NUM=%d,",device_num)+
QString().sprintf("SURFACE_NUM=%d,",surface_num)+
QString().sprintf("RELAY_NUM=%d",relay_num);
}
delete q;
q=new RDSqlQuery(sql);
@ -321,13 +315,18 @@ void ListVguestResources::RefreshList()
QListViewItem *item;
int n=1;
sql=QString().sprintf("select NUMBER,ENGINE_NUM,DEVICE_NUM,SURFACE_NUM,\
RELAY_NUM,BUSS_NUM from VGUEST_RESOURCES where\
(STATION_NAME=\"%s\")&&(MATRIX_NUM=%d)&&\
(VGUEST_TYPE=%d) order by NUMBER",
(const char *)list_matrix->station(),
list_matrix->matrix(),
list_type);
sql=QString("select ")+
"NUMBER,"+ // 00
"ENGINE_NUM,"+ // 01
"DEVICE_NUM,"+ // 02
"SURFACE_NUM,"+ // 03
"RELAY_NUM,"+ // 04
"BUSS_NUM "+ // 05
"from VGUEST_RESOURCES where "+
"(STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
QString().sprintf("(MATRIX_NUM=%d)&&",list_matrix->matrix())+
QString().sprintf("(VGUEST_TYPE=%d) ",list_type)+
"order by NUMBER";
q=new RDSqlQuery(sql);
list_list_view->clear();
while(q->next()) {

View File

@ -134,10 +134,7 @@ MainWidget::MainWidget(QWidget *parent)
QMessageBox::critical(this,"RDAdmin - "+tr("Error"),err_msg);
exit(1);
}
str=QString(tr("RDAdmin")+" v"+VERSION+" - Host:");
setCaption(QString().
sprintf("%s %s",(const char *)str,
(const char *)rda->config()->stationName()));
setCaption(QString("RDAdmin v")+VERSION+" - "+tr("Host")+": "+rda->config()->stationName());
//
// Check (and possibly start) daemons
@ -183,7 +180,7 @@ MainWidget::MainWidget(QWidget *parent)
name_label->setGeometry(0,5,sizeHint().width(),20);
name_label->setAlignment(Qt::AlignVCenter|Qt::AlignCenter);
name_label->setFont(font);
name_label->setText(QString().sprintf("USER: %s",(const char *)rda->user()->name()));
name_label->setText(tr("User")+": "+rda->user()->name());
QLabel *description_label=new QLabel(this);
description_label->setGeometry(0,24,sizeHint().width(),14);

View File

@ -1859,6 +1859,14 @@ Stále ještě chcete uložit?</translation>
<source>Please Select an Item From the List</source>
<translation>Vyberte, prosím, položku ze seznamu</translation>
</message>
<message>
<source>Duplicate Hotkey defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No Duplicates allowed.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditJack</name>
@ -4564,6 +4572,10 @@ Jste si jistý, že chcete pokračovat?</translation>
<source>User Defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rivendell Dropbox Configurations on</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListEncoders</name>
@ -4992,6 +5004,14 @@ Stále ještě jej chcete smazat?</translation>
<source>&amp;Cancel</source>
<translation>Z&amp;rušit</translation>
</message>
<message>
<source>Delete Host Variable</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the variable</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListLiveWireGpios</name>
@ -5360,13 +5380,21 @@ vozíky</translation>
<message>
<source>logs owned by this service that will also be deleted.
Do you still want to proceed?</source>
<translation>zápisy náležející této službě, které budou taktéž smazány.
<translation type="obsolete">zápisy náležející této službě, které budou taktéž smazány.
Stále ještě chcete pokračovat?</translation>
</message>
<message>
<source>Logs Exist</source>
<translation>Zápisy existují</translation>
</message>
<message>
<source>logs owned by this service that will also be deleted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you still want to proceed?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListUsers</name>
@ -5602,12 +5630,20 @@ zopakování</translation>
</message>
<message>
<source>RDAdmin</source>
<translation type="unfinished">RDAdmin</translation>
<translation type="obsolete">RDAdmin</translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Host</source>
<translation type="unfinished">Server</translation>
</message>
<message>
<source>User</source>
<translation type="unfinished">Uživatel</translation>
</message>
</context>
<context>
<name>MySqlLogin</name>
@ -5916,13 +5952,21 @@ a záloha původní databáze uložena v </translation>
<message>
<source>group already exists.
Do you want to combine the two?</source>
<translation>skupina již existuje.
<translation type="obsolete">skupina již existuje.
Chcete obě spojit?</translation>
</message>
<message>
<source>Group Exists</source>
<translation>Skupina existuje</translation>
</message>
<message>
<source>Do you want to combine the two?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>group already exists.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TestImport</name>
@ -6108,11 +6152,11 @@ Prověřte, prosím, svá nastavení a zkuste to znovu.</translation>
</message>
<message>
<source>Inputs:</source>
<translation>Vstupy:</translation>
<translation type="obsolete">Vstupy:</translation>
</message>
<message>
<source>Outputs:</source>
<translation>Výstupy:</translation>
<translation type="obsolete">Výstupy:</translation>
</message>
<message>
<source>NO DATA AVAILABLE
@ -6142,5 +6186,13 @@ pro naplnění databáze zdroji zvuku.</translation>
<translation type="unfinished"> PCM 24 Linear
</translation>
</message>
<message>
<source>Inputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outputs</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -1822,6 +1822,14 @@ Do you still want to save?</source>
<source>Hot Key Configuration for</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Hotkey defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No Duplicates allowed.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditJack</name>
@ -4511,6 +4519,10 @@ Are you sure you want to continue?</source>
<source>User Defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rivendell Dropbox Configurations on</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListEncoders</name>
@ -4939,6 +4951,14 @@ Generieren</translation>
<source>&amp;Cancel</source>
<translation>Abbre&amp;chen</translation>
</message>
<message>
<source>Delete Host Variable</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the variable</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListLiveWireGpios</name>
@ -5305,13 +5325,21 @@ Carts</source>
<message>
<source>logs owned by this service that will also be deleted.
Do you still want to proceed?</source>
<translation>Logs die diesem Service gehören, die auch gelöscht werden.
<translation type="obsolete">Logs die diesem Service gehören, die auch gelöscht werden.
Wollen Sie immernoch fortfahren?</translation>
</message>
<message>
<source>Logs Exist</source>
<translation>Logs existieren</translation>
</message>
<message>
<source>logs owned by this service that will also be deleted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you still want to proceed?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListUsers</name>
@ -5546,12 +5574,16 @@ Replicators</source>
managen</translation>
</message>
<message>
<source>RDAdmin</source>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished"></translation>
<source>Host</source>
<translation type="unfinished">Host</translation>
</message>
<message>
<source>User</source>
<translation type="unfinished">Benutzer</translation>
</message>
</context>
<context>
@ -5731,13 +5763,21 @@ Fortfahren?</translation>
<message>
<source>group already exists.
Do you want to combine the two?</source>
<translation>Gruppe existiert bereits.
<translation type="obsolete">Gruppe existiert bereits.
Wollen Sie die beiden kombinieren?</translation>
</message>
<message>
<source>Group Exists</source>
<translation>Gruppe Existiert</translation>
</message>
<message>
<source>Do you want to combine the two?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>group already exists.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TestImport</name>
@ -5922,11 +5962,11 @@ Bitte überprüfen Sie ihre Einstellungen und versuchen sie es erneut.</translat
</message>
<message>
<source>Inputs:</source>
<translation>Eingänge:</translation>
<translation type="obsolete">Eingänge:</translation>
</message>
<message>
<source>Outputs:</source>
<translation>Ausgänge:</translation>
<translation type="obsolete">Ausgänge:</translation>
</message>
<message>
<source>NO DATA AVAILABLE
@ -5956,5 +5996,13 @@ eingeben um die Audioressourcendatenbank zu füllen.</translation>
<translation type="unfinished"> PCM 24 Linear
</translation>
</message>
<message>
<source>Inputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outputs</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -1853,6 +1853,14 @@ Do you still want to save?</source>
<source>Hot Key Configuration for</source>
<translation>Atajos de teclado para</translation>
</message>
<message>
<source>Duplicate Hotkey defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No Duplicates allowed.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditJack</name>
@ -4519,6 +4527,10 @@ Are you sure you want to continue?</source>
<source>User Defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rivendell Dropbox Configurations on</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListEncoders</name>
@ -4947,6 +4959,14 @@ Do you still want to delete it?</source>
<source>&amp;Cancel</source>
<translation>&amp;Cancelar</translation>
</message>
<message>
<source>Delete Host Variable</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the variable</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListLiveWireGpios</name>
@ -5318,13 +5338,21 @@ Cartuchos</translation>
<message>
<source>logs owned by this service that will also be deleted.
Do you still want to proceed?</source>
<translation>PlayLists pertenecientes a este servicio que serán eliminados.
<translation type="obsolete">PlayLists pertenecientes a este servicio que serán eliminados.
¿Desea continuar y eliminarlos?</translation>
</message>
<message>
<source>Logs Exist</source>
<translation>El PlayList ya existe</translation>
</message>
<message>
<source>logs owned by this service that will also be deleted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you still want to proceed?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListUsers</name>
@ -5560,12 +5588,20 @@ Replicadores</translation>
</message>
<message>
<source>RDAdmin</source>
<translation type="unfinished">RDAdmin</translation>
<translation type="obsolete">RDAdmin</translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Host</source>
<translation type="unfinished">Equipo</translation>
</message>
<message>
<source>User</source>
<translation type="unfinished">Usuario</translation>
</message>
</context>
<context>
<name>MySqlLogin</name>
@ -5875,13 +5911,21 @@ y un respaldo de la base de datos se guardó en </translation>
<message>
<source>group already exists.
Do you want to combine the two?</source>
<translation>ya existe.
<translation type="obsolete">ya existe.
¿Desea combinar ambos?</translation>
</message>
<message>
<source>Group Exists</source>
<translation>El grupo ya existe</translation>
</message>
<message>
<source>Do you want to combine the two?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>group already exists.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TestImport</name>
@ -6061,11 +6105,11 @@ Revise los parámetros e intente de nuevo.</translation>
</message>
<message>
<source>Inputs:</source>
<translation>Entradas:</translation>
<translation type="obsolete">Entradas:</translation>
</message>
<message>
<source>Outputs:</source>
<translation>Salidas:</translation>
<translation type="obsolete">Salidas:</translation>
</message>
<message>
<source>NO DATA AVAILABLE
@ -6093,5 +6137,13 @@ Revise los parámetros e intente de nuevo.</translation>
</source>
<translation type="unfinished">PCM24 lineal</translation>
</message>
<message>
<source>Inputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outputs</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -1587,6 +1587,14 @@ Do you still want to save?</source>
<source>Hot Key Configuration for</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Hotkey defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No Duplicates allowed.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditJack</name>
@ -4031,6 +4039,10 @@ Are you sure you want to continue?</source>
<source>User Defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rivendell Dropbox Configurations on</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListEncoders</name>
@ -4454,6 +4466,14 @@ Do you still want to delete it?</source>
<source>&amp;Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delete Host Variable</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the variable</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListLiveWireGpios</name>
@ -4758,12 +4778,15 @@ Carts</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>logs owned by this service that will also be deleted.
Do you still want to proceed?</source>
<source>Logs Exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Logs Exist</source>
<source>logs owned by this service that will also be deleted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you still want to proceed?</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -4924,11 +4947,15 @@ Replicators</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>RDAdmin</source>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<source>Host</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>User</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -4978,12 +5005,15 @@ Replicators</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>group already exists.
Do you want to combine the two?</source>
<source>Group Exists</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Group Exists</source>
<source>Do you want to combine the two?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>group already exists.</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -5151,14 +5181,6 @@ please check your settings and try again.</source>
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inputs:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outputs:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>NO DATA AVAILABLE
@ -5183,5 +5205,13 @@ please check your settings and try again.</source>
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outputs</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -1809,6 +1809,14 @@ Vil du framleis lagra?</translation>
<source>Hot Key Configuration for</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Hotkey defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No Duplicates allowed.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditJack</name>
@ -4485,6 +4493,10 @@ Are you sure you want to continue?</source>
<source>User Defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rivendell Dropbox Configurations on</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListEncoders</name>
@ -4917,6 +4929,14 @@ Do you still want to delete it?</source>
<source>&amp;Cancel</source>
<translation>&amp;Avbryt</translation>
</message>
<message>
<source>Delete Host Variable</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the variable</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListLiveWireGpios</name>
@ -5275,13 +5295,21 @@ Carts</source>
<message>
<source>logs owned by this service that will also be deleted.
Do you still want to proceed?</source>
<translation>loggar som òg vil bli sletta.
<translation type="obsolete">loggar som òg vil bli sletta.
Er du sikker at du vil halda fram?</translation>
</message>
<message>
<source>Logs Exist</source>
<translation>Loggen eksisterer</translation>
</message>
<message>
<source>logs owned by this service that will also be deleted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you still want to proceed?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListUsers</name>
@ -5515,11 +5543,15 @@ Replicators</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>RDAdmin</source>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<source>Host</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>User</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -5686,13 +5718,21 @@ på denne maskina i nokre sekund. Halda fram?</translation>
<message>
<source>group already exists.
Do you want to combine the two?</source>
<translation>gruppe eksisterer frå før.
<translation type="obsolete">gruppe eksisterer frå før.
Vil du kombinera desse to?</translation>
</message>
<message>
<source>Group Exists</source>
<translation>Gruppa eksisterer</translation>
</message>
<message>
<source>Do you want to combine the two?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>group already exists.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TestImport</name>
@ -5878,11 +5918,11 @@ Sjekk oppsettet ditt og prøv att.</translation>
</message>
<message>
<source>Inputs:</source>
<translation>Inngangar:</translation>
<translation type="obsolete">Inngangar:</translation>
</message>
<message>
<source>Outputs:</source>
<translation>Utgangar:</translation>
<translation type="obsolete">Utgangar:</translation>
</message>
<message>
<source>NO DATA AVAILABLE
@ -5910,5 +5950,13 @@ Sjekk oppsettet ditt og prøv att.</translation>
</source>
<translation type="unfinished">Lineær PCM24</translation>
</message>
<message>
<source>Inputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outputs</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -1809,6 +1809,14 @@ Vil du framleis lagra?</translation>
<source>Hot Key Configuration for</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Hotkey defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No Duplicates allowed.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditJack</name>
@ -4485,6 +4493,10 @@ Are you sure you want to continue?</source>
<source>User Defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rivendell Dropbox Configurations on</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListEncoders</name>
@ -4917,6 +4929,14 @@ Do you still want to delete it?</source>
<source>&amp;Cancel</source>
<translation>&amp;Avbryt</translation>
</message>
<message>
<source>Delete Host Variable</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the variable</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListLiveWireGpios</name>
@ -5275,13 +5295,21 @@ Carts</source>
<message>
<source>logs owned by this service that will also be deleted.
Do you still want to proceed?</source>
<translation>loggar som òg vil bli sletta.
<translation type="obsolete">loggar som òg vil bli sletta.
Er du sikker at du vil halda fram?</translation>
</message>
<message>
<source>Logs Exist</source>
<translation>Loggen eksisterer</translation>
</message>
<message>
<source>logs owned by this service that will also be deleted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you still want to proceed?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListUsers</name>
@ -5515,11 +5543,15 @@ Replicators</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>RDAdmin</source>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<source>Host</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>User</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -5686,13 +5718,21 @@ på denne maskina i nokre sekund. Halda fram?</translation>
<message>
<source>group already exists.
Do you want to combine the two?</source>
<translation>gruppe eksisterer frå før.
<translation type="obsolete">gruppe eksisterer frå før.
Vil du kombinera desse to?</translation>
</message>
<message>
<source>Group Exists</source>
<translation>Gruppa eksisterer</translation>
</message>
<message>
<source>Do you want to combine the two?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>group already exists.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TestImport</name>
@ -5878,11 +5918,11 @@ Sjekk oppsettet ditt og prøv att.</translation>
</message>
<message>
<source>Inputs:</source>
<translation>Inngangar:</translation>
<translation type="obsolete">Inngangar:</translation>
</message>
<message>
<source>Outputs:</source>
<translation>Utgangar:</translation>
<translation type="obsolete">Utgangar:</translation>
</message>
<message>
<source>NO DATA AVAILABLE
@ -5910,5 +5950,13 @@ Sjekk oppsettet ditt og prøv att.</translation>
</source>
<translation type="unfinished">Lineær PCM24</translation>
</message>
<message>
<source>Inputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outputs</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -1807,6 +1807,14 @@ Você ainda quer salvar?</translation>
<source>Hot Key Configuration for</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Hotkey defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No Duplicates allowed.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditJack</name>
@ -4504,6 +4512,10 @@ Are you sure you want to continue?</source>
<source>User Defined</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rivendell Dropbox Configurations on</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListEncoders</name>
@ -4932,6 +4944,14 @@ Você ainda quer Deletar?</translation>
<source>&amp;Cancel</source>
<translation>&amp;Cancelar</translation>
</message>
<message>
<source>Delete Host Variable</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to delete the variable</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListLiveWireGpios</name>
@ -5290,13 +5310,21 @@ Carts</source>
<message>
<source>logs owned by this service that will also be deleted.
Do you still want to proceed?</source>
<translation>listas pertencentes a este serviço que serão deletadas também.
<translation type="obsolete">listas pertencentes a este serviço que serão deletadas também.
Você quer proceder?</translation>
</message>
<message>
<source>Logs Exist</source>
<translation>Lista Existente</translation>
</message>
<message>
<source>logs owned by this service that will also be deleted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you still want to proceed?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ListUsers</name>
@ -5529,12 +5557,16 @@ Replicators</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>RDAdmin</source>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error</source>
<translation type="unfinished"></translation>
<source>Host</source>
<translation type="unfinished">Cliente</translation>
</message>
<message>
<source>User</source>
<translation type="unfinished">Usuário</translation>
</message>
</context>
<context>
@ -5709,12 +5741,20 @@ esta ação PARARÁ por alguns segundos qualquer
<message>
<source>group already exists.
Do you want to combine the two?</source>
<translation>grupo existe. Você gostaria de Unir os dois?</translation>
<translation type="obsolete">grupo existe. Você gostaria de Unir os dois?</translation>
</message>
<message>
<source>Group Exists</source>
<translation>Grupo Existente</translation>
</message>
<message>
<source>Do you want to combine the two?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>group already exists.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TestImport</name>
@ -5901,11 +5941,11 @@ por favor, cheque suas configurações e tente novamente</translation>
</message>
<message>
<source>Inputs:</source>
<translation>Entradas:</translation>
<translation type="obsolete">Entradas:</translation>
</message>
<message>
<source>Outputs:</source>
<translation>Saídas:</translation>
<translation type="obsolete">Saídas:</translation>
</message>
<message>
<source>NO DATA AVAILABLE
@ -5933,5 +5973,13 @@ por favor, cheque suas configurações e tente novamente</translation>
</translation>
</message>
<message>
<source>Inputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Outputs</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -141,8 +141,6 @@ void RenameGroup::okData()
QString sql;
RDSqlQuery *q;
bool merging=false;
QString str1;
QString str2;
if(group_newname_edit->text().isEmpty()) {
QMessageBox::warning(this,tr("Invalid Group"),
@ -150,17 +148,14 @@ void RenameGroup::okData()
return;
}
sql=QString().
sprintf("select NAME from GROUPS where NAME=\"%s\"",
(const char *)RDEscapeString(group_newname_edit->text()));
sql=QString("select NAME from GROUPS where ")+
"NAME=\""+RDEscapeString(group_newname_edit->text())+"\"";
q=new RDSqlQuery(sql);
if(q->first()) {
str1=QString(tr("A"));
str2=QString(tr("group already exists.\nDo you want to combine the two?"));
if(QMessageBox::question(this,tr("Group Exists"),
QString().sprintf("%s %s %s",(const char *)str1,
(const char *)RDEscapeString(group_newname_edit->text()),
(const char *)str2),
if(QMessageBox::question(this,"RDAdmin - "+tr("Group Exists"),
tr("A")+" \""+group_newname_edit->text()+"\" "+
tr("group already exists.")+"\n"+
tr("Do you want to combine the two?"),
QMessageBox::Yes,QMessageBox::No)!=QMessageBox::Yes) {
delete q;
return;
@ -172,42 +167,36 @@ void RenameGroup::okData()
//
// Update Cart List
//
sql=QString().
sprintf("update CART set GROUP_NAME=\"%s\" where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(group_newname_edit->text()),
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("update CART set ")+
"GROUP_NAME=\""+RDEscapeString(group_newname_edit->text())+"\" where "+
"GROUP_NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Update LogManager Events
//
sql=QString().
sprintf("update EVENTS set SCHED_GROUP=\"%s\" where SCHED_GROUP=\"%s\"",
(const char *)RDEscapeString(group_newname_edit->text()),
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("update EVENTS set ")+
"SCHED_GROUP=\""+RDEscapeString(group_newname_edit->text())+"\" where "+
"SCHED_GROUP=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Update Replicators
//
sql=QString().
sprintf("update REPLICATOR_MAP set GROUP_NAME=\"%s\" \
where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(group_newname_edit->text()),
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("update REPLICATOR_MAP set ")+
"GROUP_NAME=\""+RDEscapeString(group_newname_edit->text())+"\" where "+
"GROUP_NAME=\""+RDEscapeString(group_name_edit->text())+"\"",
q=new RDSqlQuery(sql);
delete q;
//
// Update Dropboxes
//
sql=QString().
sprintf("update DROPBOXES set GROUP_NAME=\"%s\" \
where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(group_newname_edit->text()),
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("update DROPBOXES set ")+
"GROUP_NAME=\""+RDEscapeString(group_newname_edit->text())+"\" where "+
"GROUP_NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
@ -215,56 +204,49 @@ void RenameGroup::okData()
// Update Group List
//
if(!merging) {
sql=QString().
sprintf("update GROUPS set NAME=\"%s\" where NAME=\"%s\"",
(const char *)RDEscapeString(group_newname_edit->text()),
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("update GROUPS set ")+
"NAME=\""+RDEscapeString(group_newname_edit->text())+"\" where "+
"NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Update AUDIO_PERMS
//
sql=QString().
sprintf("update AUDIO_PERMS set GROUP_NAME=\"%s\" \
where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(group_newname_edit->text()),
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("update AUDIO_PERMS set ")+
"GROUP_NAME=\""+RDEscapeString(group_newname_edit->text())+"\" where "+
"GROUP_NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Update USER_PERMS
//
sql=QString().
sprintf("update USER_PERMS set GROUP_NAME=\"%s\" where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(group_newname_edit->text()),
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("update USER_PERMS set ")+
"GROUP_NAME=\""+RDEscapeString(group_newname_edit->text())+"\" where "+
"GROUP_NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
}
else {
sql=QString().
sprintf("delete from GROUPS where NAME=\"%s\"",
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("delete from GROUPS where ")+
"NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Update AUDIO_PERMS
//
sql=QString().
sprintf("delete from AUDIO_PERMS where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("delete from AUDIO_PERMS where ")+
"GROUP_NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
//
// Update USER_PERMS
//
sql=QString().
sprintf("delete from USER_PERMS where GROUP_NAME=\"%s\"",
(const char *)RDEscapeString(group_name_edit->text()));
sql=QString("delete from USER_PERMS where ")+
"GROUP_NAME=\""+RDEscapeString(group_name_edit->text())+"\"";
q=new RDSqlQuery(sql);
delete q;
}

View File

@ -208,8 +208,7 @@ void TestImport::importData()
item->setLine(next_line++);
item->setText(0,RDSvc::timeString(q->value(0).toInt(),
q->value(1).toInt()));
item->setText(1,QString().
sprintf("[%s]",(const char *)q->value(11).toString()));
item->setText(1,"["+q->value(11).toString()+"]");
}
}
else {
@ -218,8 +217,7 @@ void TestImport::importData()
item->setLine(next_line++);
item->setText(0,RDSvc::timeString(q->value(0).toInt(),
q->value(1).toInt()));
item->setText(1,QString().
sprintf("[%s]",(const char *)q->value(11).toString()));
item->setText(1,"["+q->value(11).toString()+"]");
}
if(q->value(7).toString()=="Y") {
item=new RDListViewItem(test_events_list);

View File

@ -2,7 +2,7 @@
//
// Display Audio Adapter Information
//
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2004,2016-2018 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -31,9 +31,6 @@
ViewAdapters::ViewAdapters(RDStation *rdstation,QWidget *parent)
: QDialog(parent,"",true)
{
QString str1;
QString str2;
//
// Fix the Window Size
//
@ -42,7 +39,7 @@ ViewAdapters::ViewAdapters(RDStation *rdstation,QWidget *parent)
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
setCaption(tr("Audio Resource Information"));
setCaption("RDADmin - "+tr("Audio Resource Information"));
//
// Create Fonts
@ -55,11 +52,7 @@ ViewAdapters::ViewAdapters(RDStation *rdstation,QWidget *parent)
//
// Title
//
str1=tr("Audio Resources on");
QLabel *label=
new QLabel(QString().sprintf("%s %s",(const char *)str1,
(const char *)rdstation->name()),
this,"title_label");
QLabel *label=new QLabel(tr("Audio Resources on")+" "+rdstation->name(),this);
label->setGeometry(15,10,sizeHint().width()-20,16);
label->setFont(font);
@ -73,16 +66,16 @@ ViewAdapters::ViewAdapters(RDStation *rdstation,QWidget *parent)
if(rdstation->scanned()) {
text+=tr("SUPPORTED AUDIO DRIVERS\n");
if(!rdstation->driverVersion(RDStation::Hpi).isEmpty()) {
text+=QString().sprintf(" AudioScience HPI [%s]\n",
(const char *)rdstation->driverVersion(RDStation::Hpi));
text+=QString(" AudioScience HPI [")+
rdstation->driverVersion(RDStation::Hpi)+"]\n";
}
if(!rdstation->driverVersion(RDStation::Jack).isEmpty()) {
text+=QString().sprintf(" JACK Audio Connection Kit [%s]\n",
(const char *)rdstation->driverVersion(RDStation::Jack));
text+=QString(" JACK Audio Connection Kit [")+
rdstation->driverVersion(RDStation::Jack)+"]\n";
}
if(!rdstation->driverVersion(RDStation::Alsa).isEmpty()) {
text+=QString().sprintf(" Advanced Linux Sound Architecture (ALSA) [%s]\n",
(const char *)rdstation->driverVersion(RDStation::Alsa));
text+=QString(" Advanced Linux Sound Architecture (ALSA) [")+
rdstation->driverVersion(RDStation::Alsa)+"]\n";
}
text+="\n";
@ -129,39 +122,34 @@ ViewAdapters::ViewAdapters(RDStation *rdstation,QWidget *parent)
text+=tr("AUDIO ADAPTERS\n");
for(int i=0;i<RD_MAX_CARDS;i++) {
str1=QString(tr("Card"));
str2=QString(tr("Not present"));
if(rdstation->cardName(i).isEmpty()) {
text+=QString().sprintf(" %s %d: %s\n\n",(const char *)str1,i,
(const char *)str2);
text+=QString(" ")+tr("Card")+QString().sprintf(" %d: ",i)+
tr("Not present");
}
else {
text+=QString().sprintf(" %s %d: %s\n",(const char *)str1,i,
(const char *)rdstation->cardName(i));
text+=QString(" ")+tr("Card")+QString().sprintf(" %d: ",i)+
rdstation->cardName(i);
switch(rdstation->cardDriver(i)) {
case RDStation::Hpi:
text+=QString(tr(" Driver: AudioScience HPI\n"));
break;
case RDStation::Hpi:
text+=tr(" Driver: AudioScience HPI\n");
break;
case RDStation::Jack:
text+=QString(tr(" Driver: JACK Audio Connection Kit\n"));
break;
case RDStation::Jack:
text+=tr(" Driver: JACK Audio Connection Kit\n");
break;
case RDStation::Alsa:
text+=QString(
tr(" Driver: Advanced Linux Sound Architecture (ALSA)\n"));
break;
case RDStation::Alsa:
text+=tr(" Driver: Advanced Linux Sound Architecture (ALSA)\n");
break;
case RDStation::None:
text+=QString(tr(" Driver: UNKNOWN\n"));
break;
case RDStation::None:
text+=tr(" Driver: UNKNOWN\n");
break;
}
str1=QString(tr("Inputs:"));
text+=QString().sprintf(" %s %d\n",(const char *)str1,
rdstation->cardInputs(i));
str1=QString(tr("Outputs:"));
text+=QString().sprintf(" %s %d\n\n",(const char *)str1,
rdstation->cardOutputs(i));
text+=QString(" ")+tr("Inputs")+
QString().sprintf(" %d\n",rdstation->cardInputs(i));
text+=QString(" ")+tr("Outputs")+
QString().sprintf(" %d\n",rdstation->cardOutputs(i));
}
}
}