mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 18:20:23 +00:00
Fix up the new "State" event system a bit.
This commit is contained in:
@@ -47,12 +47,14 @@ void EventWatcher::start(){
|
||||
EventWatcher::EVENT_TYPE EventWatcher::typeFromString(QString typ){
|
||||
if(typ=="dispatcher"){ return DISPATCHER; }
|
||||
else if(typ=="life-preserver"){ return LIFEPRESERVER; }
|
||||
else if(typ=="system-state"){ return SYSSTATE; }
|
||||
else{ return BADEVENT; }
|
||||
}
|
||||
|
||||
QString EventWatcher::typeToString(EventWatcher::EVENT_TYPE typ){
|
||||
if(typ==DISPATCHER){ return "dispatcher"; }
|
||||
else if(typ==LIFEPRESERVER){ return "life-preserver"; }
|
||||
else if(typ==SYSSTATE){ return "system-state"; }
|
||||
else{ return ""; }
|
||||
}
|
||||
|
||||
@@ -384,6 +386,6 @@ void EventWatcher::CheckSystemState(){
|
||||
|
||||
// Log and send out event
|
||||
LogManager::log(LogManager::EV_STATE, obj);
|
||||
emit NewEvent(STATE, obj);
|
||||
emit NewEvent(SYSSTATE, obj);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class EventWatcher : public QObject{
|
||||
Q_OBJECT
|
||||
public:
|
||||
//Add more event types here as needed
|
||||
enum EVENT_TYPE{ BADEVENT, DISPATCHER, LIFEPRESERVER, STATE};
|
||||
enum EVENT_TYPE{ BADEVENT, DISPATCHER, LIFEPRESERVER, SYSSTATE};
|
||||
|
||||
EventWatcher();
|
||||
~EventWatcher();
|
||||
|
||||
Reference in New Issue
Block a user