2018-03-24 Fred Gleason <fredg@paravelsystems.com>

* Added a 'LogType' value to the 'RDNotification::Type
	enumeration.
	* Added support for notifications to rdlogedit(1).
This commit is contained in:
Fred Gleason
2018-03-24 15:47:20 -04:00
parent 04cc669175
commit af0ac339a6
11 changed files with 246 additions and 33 deletions

View File

@@ -902,16 +902,17 @@ void MainWidget::notificationReceivedData(RDNotification *notify)
RDSqlQuery *q;
if(notify->type()==RDNotification::CartType) {
unsigned cartnum=notify->id().toUInt();
switch(notify->action()) {
case RDNotification::AddAction:
sql=QString("select CART.NUMBER from CART ")+
"left join CUTS on CART.NUMBER=CUTS.CART_NUMBER "+
WhereClause()+
QString().sprintf(" && CART.NUMBER=%u ",notify->id().toUInt());
QString().sprintf(" && CART.NUMBER=%u ",cartnum);
q=new RDSqlQuery(sql);
if(q->first()) {
item=new RDListViewItem(lib_cart_list);
item->setText(1,QString().sprintf("%06u",notify->id().toUInt()));
item->setText(1,QString().sprintf("%06u",cartnum));
RefreshLine(item);
}
delete q;
@@ -919,17 +920,17 @@ void MainWidget::notificationReceivedData(RDNotification *notify)
case RDNotification::ModifyAction:
if((item=(RDListViewItem *)lib_cart_list->
findItem(QString().sprintf("%06u",notify->id().toUInt()),1))!=NULL) {
findItem(QString().sprintf("%06u",cartnum),1))!=NULL) {
RefreshLine(item);
}
break;
case RDNotification::DeleteAction:
if(lib_edit_pending) {
lib_deleted_carts.push_back(notify->id().toUInt());
lib_deleted_carts.push_back(cartnum);
}
else {
if((item=(RDListViewItem *)lib_cart_list->findItem(QString().sprintf("%06u",notify->id().toUInt()),1))!=NULL) {
if((item=(RDListViewItem *)lib_cart_list->findItem(QString().sprintf("%06u",cartnum),1))!=NULL) {
delete item;
}
}