mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-19 06:32:34 +02:00
2021-08-21 Fred Gleason <fredg@paravelsystems.com>
* Added a 'SYSTEM.REALM_NAME' field to the database. * Incremented the database version to 353. * Added 'RDSystem::realmName()' and 'RDSystem::setREalmName()' methods. * Added a 'realm_name' member to the 'rd_system_settings' struct in the RivWebCApi library. * Added a 'Realm Name' control to the 'System-Wide Settings' dialog in rdadmin(1). Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
83c35bfa6a
commit
abe00acce8
@ -22326,3 +22326,12 @@
|
||||
2021-08-20 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a regression that broke searching for carts by
|
||||
Scheduler Code.
|
||||
2021-08-21 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added a 'SYSTEM.REALM_NAME' field to the database.
|
||||
* Incremented the database version to 353.
|
||||
* Added 'RDSystem::realmName()' and 'RDSystem::setREalmName()'
|
||||
methods.
|
||||
* Added a 'realm_name' member to the 'rd_system_settings' struct
|
||||
in the RivWebCApi library.
|
||||
* Added a 'Realm Name' control to the 'System-Wide Settings'
|
||||
dialog in rdadmin(1).
|
||||
|
@ -63,6 +63,9 @@ static void XMLCALL __ListSystemSettingsElementEnd(void *data, const char *el)
|
||||
struct xml_data *xml_data=(struct xml_data *)data;
|
||||
struct rd_system_settings *system_settings=xml_data->system_settings;
|
||||
|
||||
if(strcasecmp(el,"realmName")==0){
|
||||
strlcpy(system_settings->realm_name,xml_data->strbuf,256);
|
||||
}
|
||||
if(strcasecmp(el,"sampleRate")==0) {
|
||||
sscanf(xml_data->strbuf,"%u",&system_settings->sample_rate);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
*
|
||||
* Header for the List System Settings Rivendell Access Library
|
||||
*
|
||||
* (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
* (C) Copyright 2017 Todd Baker <bakert@rfa.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -22,6 +23,7 @@
|
||||
#define RD_LISTSYSTEMSETTINGS_H
|
||||
|
||||
struct rd_system_settings {
|
||||
char realm_name[257];
|
||||
unsigned sample_rate;
|
||||
int dup_cart_titles;
|
||||
unsigned max_post_length;
|
||||
|
@ -98,11 +98,18 @@ int main(int argc,char *argv[])
|
||||
// List the Results
|
||||
//
|
||||
for(i=0;i<numrecs;i++) {
|
||||
printf(" System Sample Rate : %u\n",system_settings[i].sample_rate);
|
||||
printf(" Allow Duplicate Cart Titles : %d\n",system_settings[i].dup_cart_titles);
|
||||
printf(" ISCI Cross Reference_Path : %s\n",system_settings[i].isci_xreference_path);
|
||||
printf(" Maximum Remote Post Length : %u\n",system_settings[i].max_post_length);
|
||||
printf(" Temporary Cart Group : %s\n",system_settings[i].temp_cart_group);
|
||||
printf(" Realm Name : %s\n",
|
||||
system_settings[i].realm_name);
|
||||
printf(" System Sample Rate : %u\n",
|
||||
system_settings[i].sample_rate);
|
||||
printf(" Allow Duplicate Cart Titles : %d\n",
|
||||
system_settings[i].dup_cart_titles);
|
||||
printf(" ISCI Cross Reference_Path : %s\n",
|
||||
system_settings[i].isci_xreference_path);
|
||||
printf(" Maximum Remote Post Length : %u\n",
|
||||
system_settings[i].max_post_length);
|
||||
printf(" Temporary Cart Group : %s\n",
|
||||
system_settings[i].temp_cart_group);
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
@ -193,11 +200,18 @@ int main(int argc,char *argv[])
|
||||
// List the Results
|
||||
//
|
||||
for(i=0;i<numrecs;i++) {
|
||||
printf(" System Sample Rate : %u\n",system_settings[i].sample_rate);
|
||||
printf(" Allow Duplicate Cart Titles : %d\n",system_settings[i].dup_cart_titles);
|
||||
printf(" ISCI Cross Reference_Path : %s\n",system_settings[i].isci_xreference_path);
|
||||
printf(" Maximum Remote Post Length : %u\n",system_settings[i].max_post_length);
|
||||
printf(" Temporary Cart Group : %s\n",system_settings[i].temp_cart_group);
|
||||
printf(" Realm Name : %s\n",
|
||||
system_settings[i].realm_name);
|
||||
printf(" System Sample Rate : %u\n",
|
||||
system_settings[i].sample_rate);
|
||||
printf(" Allow Duplicate Cart Titles : %d\n",
|
||||
system_settings[i].dup_cart_titles);
|
||||
printf(" ISCI Cross Reference_Path : %s\n",
|
||||
system_settings[i].isci_xreference_path);
|
||||
printf(" Maximum Remote Post Length : %u\n",
|
||||
system_settings[i].max_post_length);
|
||||
printf(" Temporary Cart Group : %s\n",
|
||||
system_settings[i].temp_cart_group);
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ The SYSTEM table contains system-wide settings.
|
||||
FIELD NAME TYPE REMARKS
|
||||
---------------------------------------------------------------
|
||||
ID int(11) Auto increment, primary key
|
||||
REALM_NAME varchar(64)
|
||||
SAMPLE_RATE int(10) unsigned
|
||||
DUP_CART_TITLE enum('N','Y')
|
||||
FIX_DUP_CART_TITLES enum('N','Y')
|
||||
|
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* Current Database Version
|
||||
*/
|
||||
#define RD_VERSION_DATABASE 352
|
||||
#define RD_VERSION_DATABASE 353
|
||||
|
||||
|
||||
#endif // DBVERSION_H
|
||||
|
@ -30,6 +30,18 @@ RDSystem::RDSystem()
|
||||
}
|
||||
|
||||
|
||||
QString RDSystem::realmName() const
|
||||
{
|
||||
return GetValue("REALM_NAME").toString();
|
||||
}
|
||||
|
||||
|
||||
void RDSystem::setRealmName(const QString &str) const
|
||||
{
|
||||
SetRow("REALM_NAME",str);
|
||||
}
|
||||
|
||||
|
||||
unsigned RDSystem::sampleRate() const
|
||||
{
|
||||
return GetValue("SAMPLE_RATE").toUInt();
|
||||
@ -244,6 +256,7 @@ void RDSystem::setShowTwelveHourTime(bool state) const
|
||||
QString RDSystem::xml() const
|
||||
{
|
||||
QString xml="<systemSettings>\n";
|
||||
xml+=RDXmlField("realmName",realmName());
|
||||
xml+=RDXmlField("sampleRate",sampleRate());
|
||||
xml+=RDXmlField("duplicateTitles",allowDuplicateCartTitles());
|
||||
xml+=RDXmlField("fixDuplicateTitles",fixDuplicateCartTitles());
|
||||
|
@ -28,6 +28,8 @@ class RDSystem
|
||||
{
|
||||
public:
|
||||
RDSystem();
|
||||
QString realmName() const;
|
||||
void setRealmName(const QString &str) const;
|
||||
unsigned sampleRate() const;
|
||||
void setSampleRate(unsigned rate) const;
|
||||
bool allowDuplicateCartTitles() const;
|
||||
|
@ -55,6 +55,16 @@ EditSystem::EditSystem(QWidget *parent)
|
||||
//
|
||||
edit_test_datetimes_dialog=new TestDatetimes(this);
|
||||
|
||||
//
|
||||
// Realm Name
|
||||
//
|
||||
edit_realm_name_edit=new QLineEdit(this);
|
||||
edit_realm_name_edit->setMaxLength(64);
|
||||
edit_realm_name_label=new QLabel(tr("Realm Name")+":",this);
|
||||
edit_realm_name_label->setFont(labelFont());
|
||||
edit_realm_name_label->
|
||||
setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
|
||||
//
|
||||
// System Sample Rate
|
||||
//
|
||||
@ -67,7 +77,6 @@ EditSystem::EditSystem(QWidget *parent)
|
||||
edit_sample_rate_label->
|
||||
setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
edit_sample_rate_unit_label=new QLabel(tr("samples/second"),this);
|
||||
edit_sample_rate_unit_label->setGeometry(325,10,sizeHint().width()-285,20);
|
||||
edit_sample_rate_unit_label->setFont(labelFont());
|
||||
edit_sample_rate_unit_label->
|
||||
setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
|
||||
@ -255,6 +264,7 @@ EditSystem::EditSystem(QWidget *parent)
|
||||
//
|
||||
// Load Values
|
||||
//
|
||||
edit_realm_name_edit->setText(edit_system->realmName());
|
||||
edit_duplicate_carts_box->setChecked(edit_system->allowDuplicateCartTitles());
|
||||
edit_fix_duplicate_carts_box->
|
||||
setChecked(edit_system->fixDuplicateCartTitles());
|
||||
@ -306,7 +316,7 @@ EditSystem::~EditSystem()
|
||||
|
||||
QSize EditSystem::sizeHint() const
|
||||
{
|
||||
return QSize(500,406+y_pos);
|
||||
return QSize(500,428+y_pos);
|
||||
}
|
||||
|
||||
|
||||
@ -500,6 +510,7 @@ void EditSystem::okData()
|
||||
}
|
||||
delete pd;
|
||||
}
|
||||
edit_system->setRealmName(edit_realm_name_edit->text());
|
||||
edit_system->
|
||||
setFixDuplicateCartTitles(edit_fix_duplicate_carts_box->isChecked());
|
||||
edit_system->setSampleRate(edit_sample_rate_box->currentText().toUInt());
|
||||
@ -554,37 +565,41 @@ void EditSystem::BuildDuplicatesList(std::map<unsigned,QString> *dups)
|
||||
|
||||
void EditSystem::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
edit_sample_rate_box->setGeometry(250,10,70,20);
|
||||
edit_sample_rate_label->setGeometry(10,10,235,20);
|
||||
edit_realm_name_edit->setGeometry(250,10,size().width()-260,20);
|
||||
edit_realm_name_label->setGeometry(10,10,235,20);
|
||||
|
||||
edit_duplicate_carts_box->setGeometry(20,32,15,15);
|
||||
edit_duplicate_label->setGeometry(40,30,size().width()-50,20);
|
||||
edit_fix_duplicate_carts_box->setGeometry(30,52,15,15);
|
||||
edit_fix_duplicate_carts_label->setGeometry(50,50,size().width()-60,20);
|
||||
edit_sample_rate_label->setGeometry(10,32,235,20);
|
||||
edit_sample_rate_box->setGeometry(250,32,70,20);
|
||||
edit_sample_rate_unit_label->setGeometry(325,32,sizeHint().width()-285,20);
|
||||
|
||||
edit_show_user_list_box->setGeometry(20,74,15,15);
|
||||
edit_show_user_list_label->setGeometry(40,72,size().width()-50,20);
|
||||
edit_duplicate_carts_box->setGeometry(20,54,15,15);
|
||||
edit_duplicate_label->setGeometry(40,52,size().width()-50,20);
|
||||
edit_fix_duplicate_carts_box->setGeometry(30,74,15,15);
|
||||
edit_fix_duplicate_carts_label->setGeometry(50,72,size().width()-60,20);
|
||||
|
||||
edit_isci_path_edit->setGeometry(250,98,size().width()-260,20);
|
||||
edit_isci_path_label->setGeometry(10,98,235,20);
|
||||
edit_show_user_list_box->setGeometry(20,96,15,15);
|
||||
edit_show_user_list_label->setGeometry(40,94,size().width()-50,20);
|
||||
|
||||
edit_origin_email_addr_edit->setGeometry(250,120,size().width()-260,20);
|
||||
edit_origin_email_addr_label->setGeometry(10,120,235,20);
|
||||
edit_isci_path_edit->setGeometry(250,120,size().width()-260,20);
|
||||
edit_isci_path_label->setGeometry(10,120,235,20);
|
||||
|
||||
edit_notification_address_edit->setGeometry(250,142,150,20);
|
||||
edit_notification_address_label->setGeometry(10,142,235,20);
|
||||
edit_origin_email_addr_edit->setGeometry(250,142,size().width()-260,20);
|
||||
edit_origin_email_addr_label->setGeometry(10,142,235,20);
|
||||
|
||||
edit_maxpost_spin->setGeometry(250,164,60,20);
|
||||
edit_maxpost_label->setGeometry(10,164,235,20);
|
||||
edit_maxpost_unit_label->setGeometry(315,164,60,20);
|
||||
edit_notification_address_edit->setGeometry(250,164,150,20);
|
||||
edit_notification_address_label->setGeometry(10,164,235,20);
|
||||
|
||||
edit_temp_cart_group_box->setGeometry(250,185,140,20);
|
||||
edit_temp_cart_group_label->setGeometry(10,185,235,20);
|
||||
edit_maxpost_spin->setGeometry(250,186,60,20);
|
||||
edit_maxpost_label->setGeometry(10,186,235,20);
|
||||
edit_maxpost_unit_label->setGeometry(315,186,60,20);
|
||||
|
||||
edit_rss_processor_label->setGeometry(10,207,235,20);
|
||||
edit_rss_processor_box->setGeometry(250,207,200,20);
|
||||
edit_temp_cart_group_box->setGeometry(250,207,140,20);
|
||||
edit_temp_cart_group_label->setGeometry(10,207,235,20);
|
||||
|
||||
edit_datetime_group->setGeometry(10,229,size().width()-20,100);
|
||||
edit_rss_processor_label->setGeometry(10,229,235,20);
|
||||
edit_rss_processor_box->setGeometry(250,229,200,20);
|
||||
|
||||
edit_datetime_group->setGeometry(10,251,size().width()-20,100);
|
||||
edit_datetime_test_button->setGeometry(5,22,80,35);
|
||||
edit_datetime_defaults_button->setGeometry(5,60,80,35);
|
||||
edit_long_date_label->setGeometry(110,27,120,20);
|
||||
@ -594,9 +609,9 @@ void EditSystem::resizeEvent(QResizeEvent *e)
|
||||
edit_time_label->setGeometry(110,71,120,20);
|
||||
edit_time_box->setGeometry(235,71,edit_time_box->sizeHint().width(),20);
|
||||
|
||||
edit_duplicate_hidden_label->setGeometry(15,329,size().width()-30,50);
|
||||
edit_duplicate_view->setGeometry(10,377,size().width()-20,215);
|
||||
edit_save_button->setGeometry(size().width()-85,597,70,25);
|
||||
edit_duplicate_hidden_label->setGeometry(15,351,size().width()-30,50);
|
||||
edit_duplicate_view->setGeometry(10,399,size().width()-20,215);
|
||||
edit_save_button->setGeometry(size().width()-85,619,70,25);
|
||||
|
||||
edit_encoders_button->setGeometry(10,size().height()-60,120,50);
|
||||
edit_ok_button->setGeometry(size().width()-180,size().height()-60,80,50);
|
||||
|
@ -63,6 +63,8 @@ class EditSystem : public RDDialog
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
|
||||
private:
|
||||
QLabel *edit_realm_name_label;
|
||||
QLineEdit *edit_realm_name_edit;
|
||||
QLabel *edit_sample_rate_label;
|
||||
QComboBox *edit_sample_rate_box;
|
||||
QLabel *edit_sample_rate_unit_label;
|
||||
|
@ -40,6 +40,15 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
|
||||
// NEW SCHEMA REVERSIONS GO HERE...
|
||||
|
||||
|
||||
//
|
||||
// Revert 353
|
||||
//
|
||||
if((cur_schema==353)&&(set_schema<cur_schema)) {
|
||||
DropColumn("SYSTEM","REALM_NAME");
|
||||
|
||||
WriteSchemaVersion(--cur_schema);
|
||||
}
|
||||
|
||||
//
|
||||
// Revert 352
|
||||
//
|
||||
|
@ -160,7 +160,7 @@ void MainObject::InitializeSchemaMap() {
|
||||
global_version_map["3.4"]=317;
|
||||
global_version_map["3.5"]=346;
|
||||
global_version_map["3.6"]=347;
|
||||
global_version_map["4.0"]=352;
|
||||
global_version_map["4.0"]=353;
|
||||
}
|
||||
|
||||
|
||||
|
@ -10867,6 +10867,28 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
|
||||
WriteSchemaVersion(++cur_schema);
|
||||
}
|
||||
|
||||
if((cur_schema<353)&&(set_schema>cur_schema)) {
|
||||
sql=QString("alter table `SYSTEM` ")+
|
||||
"add column `REALM_NAME` varchar(64) after `ID`";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
srand(time(NULL));
|
||||
sql=QString("update `SYSTEM` set ")+
|
||||
"`REALM_NAME`='"+
|
||||
RDEscapeString(QString().sprintf("Rivendell_%d",rand()))+"'";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
sql=QString("alter table `SYSTEM` ")+
|
||||
"modify column `REALM_NAME` varchar(64) not null";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WriteSchemaVersion(++cur_schema);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// NEW SCHEMA UPDATES GO HERE...
|
||||
|
Loading…
x
Reference in New Issue
Block a user