2020-11-22 Fred Gleason <fredg@paravelsystems.com>

* Added a 'SYSTEM.ORIGIN_EMAIL_ADDRESS' field to the database.
	* Added a 'GROUPS.NOTIFY_EMAIL_ADDRESS' field to the database.
	* Incremented the database version to 344.
	* Added an 'Origin E-Mail Address' control to the 'System-Wide
	Settings' dialog in rdadmin(1).
	* Added a 'Notification E-Mail Addresses' control to the 'Group'
	dialog in rdadmin(1).

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2020-11-22 13:58:59 -05:00
parent 5386947984
commit deb363f6eb
22 changed files with 213 additions and 56 deletions

View File

@ -20610,3 +20610,11 @@
* Added a '--dry-run' switch to the 'sendmail_test' test harness.
2020-11-18 Fred Gleason <fredg@paravelsystems.com>
* Added a '--body-file' switch to the 'sendmail_test' test harness.
2020-11-22 Fred Gleason <fredg@paravelsystems.com>
* Added a 'SYSTEM.ORIGIN_EMAIL_ADDRESS' field to the database.
* Added a 'GROUPS.NOTIFY_EMAIL_ADDRESS' field to the database.
* Incremented the database version to 344.
* Added an 'Origin E-Mail Address' control to the 'System-Wide
Settings' dialog in rdadmin(1).
* Added a 'Notification E-Mail Addresses' control to the 'Group'
dialog in rdadmin(1).

View File

@ -19,3 +19,4 @@ REPORT_TFC enum('N','Y')
REPORT_MUS enum('N','Y')
ENABLE_NOW_NEXT enum('N','Y')
COLOR varchar(7)
NOTIFY_EMAIL_ADDRESS text

View File

@ -14,3 +14,4 @@ TEMP_CART_GROUP varchar(10) From 'GROUPS.NAME'
SHOW_USER_LIST enum('N','Y')
NOTIFICATION_ADDRESS varchar(15)
RSS_PROCESSOR_STATION varchar(64)
ORIGIN_EMAIL_ADDRESS varchar(64)

View File

@ -24,7 +24,7 @@
/*
* Current Database Version
*/
#define RD_VERSION_DATABASE 343
#define RD_VERSION_DATABASE 344
#endif // DBVERSION_H

View File

@ -241,6 +241,19 @@ void RDGroup::setColor(const QColor &color)
}
QString RDGroup::notifyEmailAddress() const
{
return RDGetSqlValue("GROUPS","NAME",group_name,"NOTIFY_EMAIL_ADDRESS").
toString();
}
void RDGroup::setNotifyEmailAddress(const QString &addr) const
{
SetRow("NOTIFY_EMAIL_ADDRESS",addr);
}
unsigned RDGroup::nextFreeCart(unsigned startcart) const
{
return GetNextFreeCart(startcart);

View File

@ -58,6 +58,8 @@ class RDGroup
void setEnableNowNext(bool state) const;
QColor color() const;
void setColor(const QColor &color);
QString notifyEmailAddress() const;
void setNotifyEmailAddress(const QString &addr) const;
unsigned nextFreeCart(unsigned startcart=0) const;
int freeCartQuantity() const;
bool reserveCarts(std::vector<unsigned> *cart_nums,

View File

@ -135,6 +135,18 @@ void RDSystem::setIsciXreferencePath(const QString &str) const
}
QString RDSystem::originEmailAddress() const
{
return GetValue("ORIGIN_EMAIL_ADDRESS").toString();
}
void RDSystem::setOriginEmailAddress(const QString &str) const
{
SetRow("ORIGIN_EMAIL_ADDRESS",str);
}
QString RDSystem::tempCartGroup() const
{
return GetValue("TEMP_CART_GROUP").toString();

View File

@ -38,6 +38,8 @@ class RDSystem
void setMaxPostLength(unsigned bytes) const;
QString isciXreferencePath() const;
void setIsciXreferencePath(const QString &str) const;
QString originEmailAddress() const;
void setOriginEmailAddress(const QString &str) const;
QString tempCartGroup() const;
void setTempCartGroup(const QString &str) const;
bool showUserList() const;

View File

@ -50,10 +50,7 @@ EditGroup::EditGroup(QString group,QWidget *parent)
//
// Fix the Window Size
//
setMinimumWidth(sizeHint().width());
setMaximumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
setMinimumSize(sizeHint());
group_group=new RDGroup(group);
@ -96,6 +93,16 @@ EditGroup::EditGroup(QString group,QWidget *parent)
group_title_label->setFont(labelFont());
group_title_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
// Default Title
//
group_notify_email_addrs_edit=new QLineEdit(this);
group_notify_email_addrs_label=
new QLabel(group_notify_email_addrs_edit,
tr("Notification E-Mail Addresses")+":",this);
group_notify_email_addrs_label->setFont(labelFont());
group_notify_email_addrs_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
// Default Cart Type
//
@ -240,6 +247,7 @@ EditGroup::EditGroup(QString group,QWidget *parent)
group_name_edit->setText(group_group->name());
group_description_edit->setText(group_group->description());
group_title_edit->setText(group_group->defaultTitle());
group_notify_email_addrs_edit->setText(group_group->notifyEmailAddress());
group_carttype_box->setCurrentItem(group_group->defaultCartType()-1);
group_lowcart_box->setValue(group_group->defaultLowCart());
group_highcart_box->setValue(group_group->defaultHighCart());
@ -289,7 +297,7 @@ EditGroup::~EditGroup()
QSize EditGroup::sizeHint() const
{
return QSize(400,493);
return QSize(500,524);
}
@ -356,6 +364,7 @@ void EditGroup::okData()
group_group->setDescription(group_description_edit->text());
group_group->setDefaultTitle(group_title_edit->text());
group_group->setNotifyEmailAddress(group_notify_email_addrs_edit->text());
group_group->
setDefaultCartType((RDCart::Type)(group_carttype_box->currentItem()+1));
group_group->setDefaultLowCart(group_lowcart_box->value());
@ -430,54 +439,60 @@ void EditGroup::cancelData()
void EditGroup::resizeEvent(QResizeEvent *e)
{
group_name_edit->setGeometry(165,11,100,19);
group_name_label->setGeometry(10,11,150,19);
int w=size().width();
int h=size().height();
group_description_edit->setGeometry(165,32,size().width()-175,19);
group_description_label->setGeometry(10,32,150,19);
group_name_edit->setGeometry(215,11,100,19);
group_name_label->setGeometry(10,11,200,19);
group_title_edit->setGeometry(165,53,size().width()-175,19);
group_title_label->setGeometry(10,53,150,19);
group_description_edit->setGeometry(215,32,w-225,19);
group_description_label->setGeometry(10,32,200,19);
group_carttype_box->setGeometry(165,74,100,19);
group_carttype_label->setGeometry(10,74,150,19);
group_title_edit->setGeometry(215,53,w-225,19);
group_title_label->setGeometry(10,53,200,19);
group_lowcart_box->setGeometry(165,95,70,19);
group_cartrange_label->setGeometry(10,95,150,19);
group_highcart_box->setGeometry(265,95,70,19);
group_highcart_label->setGeometry(240,95,20,19);
group_notify_email_addrs_edit->setGeometry(215,74,w-225,19);
group_notify_email_addrs_label->setGeometry(10,74,200,19);
group_enforcerange_box->setGeometry(20,118,15,15);
group_enforcerange_label->setGeometry(40,118,size().width()-50,19);
group_carttype_box->setGeometry(215,95,100,19);
group_carttype_label->setGeometry(10,95,200,19);
group_traffic_check->setGeometry(20,145,15,15);
group_traffic_label->setGeometry(40,143,size().width()-50,19);
group_lowcart_box->setGeometry(215,116,70,19);
group_cartrange_label->setGeometry(10,116,200,19);
group_highcart_box->setGeometry(315,116,70,19);
group_highcart_label->setGeometry(290,116,20,19);
group_music_check->setGeometry(20,166,15,15);
group_music_label->setGeometry(40,164,size().width()-50,19);
group_enforcerange_box->setGeometry(20,139,15,15);
group_enforcerange_label->setGeometry(40,139,w-50,19);
group_cutlife_check->setGeometry(20,193,15,15);
group_cutlife_label->setGeometry(40,193,140,19);
group_cutlife_spin->setGeometry(185,191,45,19);
group_cutlife_unit->setGeometry(245,193,size().width()-245,19);
group_traffic_check->setGeometry(20,166,15,15);
group_traffic_label->setGeometry(40,164,w-50,19);
group_shelflife_check->setGeometry(20,214,15,15);
group_shelflife_spin->setGeometry(200,212,40,19);
group_shelflife_label->setGeometry(40,214,160,19);
group_shelflife_unit->setGeometry(250,214,50,19);
group_music_check->setGeometry(20,187,15,15);
group_music_label->setGeometry(40,185,w-50,19);
group_delete_carts_check->setGeometry(40,235,15,15);
group_delete_carts_label->setGeometry(60,235,160,19);
group_cutlife_check->setGeometry(20,214,15,15);
group_cutlife_label->setGeometry(40,214,140,19);
group_cutlife_spin->setGeometry(185,212,45,19);
group_cutlife_unit->setGeometry(245,214,w-245,19);
group_nownext_check->setGeometry(20,263,15,15);
group_nownext_label->setGeometry(40,262,size().width()-50,19);
group_shelflife_check->setGeometry(20,235,15,15);
group_shelflife_spin->setGeometry(200,234,40,19);
group_shelflife_label->setGeometry(40,235,160,19);
group_shelflife_unit->setGeometry(250,235,50,19);
group_svcs_sel->setGeometry(10,285,401,130);
group_delete_carts_check->setGeometry(40,256,15,15);
group_delete_carts_label->setGeometry(60,256,160,19);
group_color_button->setGeometry(10,size().height()-60,80,50);
group_nownext_check->setGeometry(20,277,15,15);
group_nownext_label->setGeometry(40,276,w-50,19);
group_ok_button->setGeometry(size().width()-180,size().height()-60,80,50);
group_cancel_button->setGeometry(size().width()-90,size().height()-60,80,50);
group_svcs_sel->setGeometry(10,298,w-20,h-370);
group_color_button->setGeometry(10,h-60,80,50);
group_ok_button->setGeometry(w-180,h-60,80,50);
group_cancel_button->setGeometry(w-90,h-60,80,50);
}

View File

@ -63,6 +63,8 @@ class EditGroup : public RDDialog
QLineEdit *group_name_edit;
QLabel *group_description_label;
QLineEdit *group_description_edit;
QLabel *group_notify_email_addrs_label;
QLineEdit *group_notify_email_addrs_edit;
QLabel *group_cartrange_label;
QSpinBox *group_lowcart_box;
QLabel *group_highcart_label;

View File

@ -98,6 +98,17 @@ EditSystem::EditSystem(QWidget *parent)
edit_isci_path_label->
setAlignment(Qt::AlignRight|Qt::AlignVCenter|Qt::TextShowMnemonic);
//
// Origin Email Address
//
edit_origin_email_addr_edit=new QLineEdit(this);
edit_origin_email_addr_edit->setMaxLength(64);
edit_origin_email_addr_label=
new QLabel(edit_origin_email_addr_edit,tr("Origin E-Mail Address")+":",this);
edit_origin_email_addr_label->setFont(labelFont());
edit_origin_email_addr_label->
setAlignment(Qt::AlignRight|Qt::AlignVCenter|Qt::TextShowMnemonic);
//
// Notification Address
//
@ -220,6 +231,7 @@ EditSystem::EditSystem(QWidget *parent)
duplicatesCheckedData(edit_system->allowDuplicateCartTitles());
edit_maxpost_spin->setValue(edit_system->maxPostLength()/1000000);
edit_isci_path_edit->setText(edit_system->isciXreferencePath());
edit_origin_email_addr_edit->setText(edit_system->originEmailAddress());
edit_notification_address_edit->
setText(edit_system->notificationAddress().toString());
edit_show_user_list_box->setChecked(edit_system->showUserList());
@ -259,7 +271,7 @@ EditSystem::~EditSystem()
QSize EditSystem::sizeHint() const
{
return QSize(500,284+y_pos);
return QSize(500,306+y_pos);
}
@ -375,9 +387,7 @@ void EditSystem::okData()
Q3ListViewItem *item;
y_pos=305;
setMinimumWidth(sizeHint().width());
setMaximumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
edit_duplicate_carts_box->setChecked(true);
edit_duplicate_hidden_label->show();
edit_duplicate_list->show();
@ -427,6 +437,7 @@ void EditSystem::okData()
edit_system->setSampleRate(edit_sample_rate_box->currentText().toUInt());
edit_system->setMaxPostLength(edit_maxpost_spin->value()*1000000);
edit_system->setIsciXreferencePath(edit_isci_path_edit->text());
edit_system->setOriginEmailAddress(edit_origin_email_addr_edit->text());
edit_system->
setNotificationAddress(QHostAddress(edit_notification_address_edit->text()));
edit_system->setTempCartGroup(edit_temp_cart_group_box->currentText());
@ -486,22 +497,25 @@ void EditSystem::resizeEvent(QResizeEvent *e)
edit_isci_path_edit->setGeometry(250,98,size().width()-260,20);
edit_isci_path_label->setGeometry(10,98,235,20);
edit_notification_address_edit->setGeometry(250,120,150,20);
edit_notification_address_label->setGeometry(10,120,235,20);
edit_origin_email_addr_edit->setGeometry(250,120,size().width()-260,20);
edit_origin_email_addr_label->setGeometry(10,120,235,20);
edit_maxpost_spin->setGeometry(250,142,60,20);
edit_maxpost_label->setGeometry(10,142,235,20);
edit_maxpost_unit_label->setGeometry(315,142,60,20);
edit_notification_address_edit->setGeometry(250,142,150,20);
edit_notification_address_label->setGeometry(10,142,235,20);
edit_temp_cart_group_box->setGeometry(250,163,100,20);
edit_temp_cart_group_label->setGeometry(10,163,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_rss_processor_label->setGeometry(10,185,235,20);
edit_rss_processor_box->setGeometry(250,185,200,20);
edit_temp_cart_group_box->setGeometry(250,185,100,20);
edit_temp_cart_group_label->setGeometry(10,185,235,20);
edit_duplicate_hidden_label->setGeometry(15,207,size().width()-30,50);
edit_duplicate_list->setGeometry(10,255,size().width()-20,215);
edit_save_button->setGeometry(size().width()-85,475,70,25);
edit_rss_processor_label->setGeometry(10,207,235,20);
edit_rss_processor_box->setGeometry(250,207,200,20);
edit_duplicate_hidden_label->setGeometry(15,229,size().width()-30,50);
edit_duplicate_list->setGeometry(10,277,size().width()-20,215);
edit_save_button->setGeometry(size().width()-85,497,70,25);
edit_encoders_button->setGeometry(10,size().height()-60,120,50);
edit_ok_button->setGeometry(size().width()-180,size().height()-60,80,50);

View File

@ -71,6 +71,8 @@ class EditSystem : public RDDialog
QLabel *edit_maxpost_unit_label;
QLabel *edit_isci_path_label;
QLineEdit *edit_isci_path_edit;
QLabel *edit_origin_email_addr_label;
QLineEdit *edit_origin_email_addr_edit;
QLabel *edit_temp_cart_group_label;
QComboBox *edit_temp_cart_group_box;
QComboBox *edit_rss_processor_station_box;

View File

@ -1893,6 +1893,10 @@ Stále ještě chcete uložit?</translation>
<source>days after cut creation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification E-Mail Addresses</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditHostvar</name>
@ -4476,6 +4480,10 @@ Přepsat?</translation>
List</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Origin E-Mail Address</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditTtys</name>

View File

@ -1727,6 +1727,10 @@ Do you still want to save?</source>
<source>days after cut creation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification E-Mail Addresses</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditHostvar</name>
@ -4221,6 +4225,10 @@ Overwrite?</source>
List</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Origin E-Mail Address</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditTtys</name>

View File

@ -1891,6 +1891,10 @@ Do you still want to save?</source>
<source>days after cut creation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification E-Mail Addresses</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditHostvar</name>
@ -4417,6 +4421,10 @@ Overwrite?</source>
List</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Origin E-Mail Address</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditTtys</name>

View File

@ -1393,6 +1393,10 @@ Do you still want to save?</source>
<source>days after cut creation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification E-Mail Addresses</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditHostvar</name>
@ -3480,6 +3484,10 @@ Overwrite?</source>
List</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Origin E-Mail Address</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditTtys</name>

View File

@ -1698,6 +1698,10 @@ Vil du framleis lagra?</translation>
<source>days after cut creation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification E-Mail Addresses</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditHostvar</name>
@ -4126,6 +4130,10 @@ Overwrite?</source>
List</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Origin E-Mail Address</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditTtys</name>

View File

@ -1698,6 +1698,10 @@ Vil du framleis lagra?</translation>
<source>days after cut creation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification E-Mail Addresses</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditHostvar</name>
@ -4126,6 +4130,10 @@ Overwrite?</source>
List</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Origin E-Mail Address</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditTtys</name>

View File

@ -1704,6 +1704,10 @@ Você ainda quer salvar?</translation>
<source>days after cut creation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Notification E-Mail Addresses</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditHostvar</name>
@ -4201,6 +4205,10 @@ Overwrite?</source>
List</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Origin E-Mail Address</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditTtys</name>

View File

@ -49,6 +49,17 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
WriteSchemaVersion(--cur_schema);
}
//
// Revert 344
//
if((cur_schema==344)&&(set_schema<cur_schema)) {
DropColumn("GROUPS","NOTIFY_EMAIL_ADDRESS");
DropColumn("SYSTEM","ORIGIN_EMAIL_ADDRESS");
WriteSchemaVersion(--cur_schema);
}
//
// Revert 342
//

View File

@ -161,7 +161,7 @@ void MainObject::InitializeSchemaMap() {
global_version_map["3.2"]=311;
global_version_map["3.3"]=314;
global_version_map["3.4"]=317;
global_version_map["3.5"]=343;
global_version_map["3.5"]=344;
}

View File

@ -10400,6 +10400,24 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
WriteSchemaVersion(++cur_schema);
}
if((cur_schema<344)&&(set_schema>cur_schema)) {
sql=QString("alter table SYSTEM add column ")+
"ORIGIN_EMAIL_ADDRESS varchar(64) not null "+
"default 'Rivendell <noreply@example.com>' "+
"after RSS_PROCESSOR_STATION";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
sql=QString("alter table GROUPS add column ")+
"NOTIFY_EMAIL_ADDRESS text after COLOR";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
WriteSchemaVersion(++cur_schema);
}
// NEW SCHEMA UPDATES GO HERE...