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

* Added support for notifications to rdlibrary(1).
This commit is contained in:
Fred Gleason
2018-03-21 14:16:52 -04:00
parent 7ce4b2ff10
commit e3fb53d0cf
5 changed files with 126 additions and 25 deletions

View File

@@ -20,6 +20,15 @@
#include "rdnotification.h"
RDNotification::RDNotification(RDNotification::Type type,
RDNotification::Action action,unsigned cartnum)
{
notify_type=type;
notify_action=action;
notify_id=QVariant(cartnum);
}
RDNotification::RDNotification()
{
notify_type=RDNotification::NullType;
@@ -84,7 +93,7 @@ bool RDNotification::read(const QString &str)
RDNotification::Type type=(RDNotification::Type)i;
if(args[1]==RDNotification::typeString(type)) {
notify_type=type;
notify_id=QVariant(args[2].toUInt());
notify_id=QVariant(args[3].toUInt());
}
}
if(notify_type==RDNotification::NullType) {

View File

@@ -30,6 +30,7 @@ class RDNotification
enum Type {NullType=0,CartType=1,LastType=2};
enum Action {NoAction=0,AddAction=1,DeleteAction=2,ModifyAction=3,
LastAction=4};
RDNotification(Type type,Action action,unsigned cartnum);
RDNotification();
Type type() const;
void setType(Type type);