mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-29 16:50:13 +01:00
2021-02-11 Fred Gleason <fredg@paravelsystems.com>
* Added 'RDSchedRulesModel'. * Added a pseudo-schema change to force checking of schedule code rules. * Incremented the database version to 348. * Added a check for scheduler code rules to rddbmgr(8). * Refactored the 'Scheduler Rules' dialog in rdlogmanager(1) to use the model based API. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -83,7 +83,7 @@ ListSchedCodes::ListSchedCodes(QWidget *parent)
|
||||
// Schedule Codes List
|
||||
//
|
||||
list_schedcodes_view=new RDTableView(this);
|
||||
list_schedcodes_model=new RDSchedCodeListModel(this);
|
||||
list_schedcodes_model=new RDSchedCodeListModel(false,this);
|
||||
list_schedcodes_model->setFont(defaultFont());
|
||||
list_schedcodes_model->setPalette(palette());
|
||||
list_schedcodes_view->setModel(list_schedcodes_model);
|
||||
@@ -122,15 +122,20 @@ void ListSchedCodes::addData()
|
||||
QString scode;
|
||||
|
||||
if(list_add_schedcode_dialog->exec(&scode)) {
|
||||
QModelIndex index=list_schedcodes_model->addSchedCode(scode);
|
||||
if(index.isValid()) {
|
||||
list_schedcodes_view->selectRow(index.row());
|
||||
if(list_edit_schedcode_dialog->exec(scode)) {
|
||||
QModelIndex index=list_schedcodes_model->addSchedCode(scode);
|
||||
if(index.isValid()) {
|
||||
list_schedcodes_view->selectRow(index.row());
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
QString sql=QString("delete from SCHED_CODES where ")+
|
||||
"CODE=\""+RDEscapeString(scode)+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
sql=QString("delete from RULE_LINES where ")+
|
||||
"CODE=\""+RDEscapeString(scode)+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,6 +180,10 @@ void ListSchedCodes::deleteData()
|
||||
"SCHED_CODE=\""+RDEscapeString(codename)+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
|
||||
sql=QString("delete from RULE_LINES where ")+
|
||||
"CODE=\""+RDEscapeString(codename)+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
|
||||
sql=QString("delete from SCHED_CODES where ")+
|
||||
"CODE=\""+RDEscapeString(codename)+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
|
||||
Reference in New Issue
Block a user