Changeset 224 for Evidence/Edd


Ignore:
Timestamp:
06/17/10 09:00:51 (14 years ago)
Author:
ogrimm
Message:
Message severity encoded now using standard DIM structure, other updates
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Evidence/Edd/Edd.cc

    r222 r224  
    9999
    100100// Update widget
    101 void EddLineDisplay::Update(QString Name, int Time, QByteArray Array, QString Format, QString Text) {
     101void EddLineDisplay::Update(QString Name, int Time, QByteArray, QString Format, QString Text) {
    102102
    103103  if (ServiceName != Name) return;
     
    109109    setText("n/a");
    110110    Pal.setColor(QPalette::Base, Qt::lightGray);
    111   }
    112   else {
    113     // Backgound colour determined by last byte
    114     switch (Array[Array.size()]) {
     111        setPalette(Pal);
     112        return;
     113  }
     114
     115  // Message service backgound colour determined by severity
     116  if (Name.endsWith("/Message")) {
     117    switch (Text.section(' ', 0, 0).toInt()) {
    115118      case 0:  Pal.setColor(QPalette::Base, Qt::white); break;
    116119      case 1:  Pal.setColor(QPalette::Base, Qt::yellow); break;
     
    119122      default: break;
    120123    }
    121        
    122         if (Format[0].toUpper() != 'C') Text = Text.section(' ', Index, Index);
    123 
    124         if (!ShowAsTime) setText(Text);
    125         else setText(QDateTime::fromTime_t(Text.toInt()).toString());
    126         setCursorPosition(0);
    127   }
    128  
     124        Text = Text.section(' ', 1);
     125  }     
     126  else if (Format[0].toUpper() != 'C') Text = Text.section(' ', Index, Index);
     127
     128  if (!ShowAsTime) setText(Text);
     129  else setText(QDateTime::fromTime_t(Text.toInt()).toString());
     130
     131  setCursorPosition(0); 
    129132  setPalette(Pal);
    130133}
Note: See TracChangeset for help on using the changeset viewer.