FACT++  1.0
void FactGui::handleWrite ( const Time time,
const string &  text,
int  qos 
)
inlineprivate

Definition at line 2834 of file FactGui.h.

References Time::GetAsStr(), i, MessageImp::kDebug, and kDebug.

Referenced by Write().

2835  {
2836  stringstream out;
2837 
2838  if (text.substr(0, 6)=="CHAT: ")
2839  {
2840  if (qos==MessageImp::kDebug)
2841  return;
2842 
2843  out << "<font size='-1' color='navy'>[<B>";
2844  out << time.GetAsStr("%H:%M:%S");
2845  out << "</B>]</FONT> " << text.substr(6);
2846  fChatText->append(out.str().c_str());
2847 
2848  if (fTabWidget->tabText(fTabWidget->currentIndex())=="Chat")
2849  return;
2850 
2851  static int num = 0;
2852  if (num++<2)
2853  return;
2854 
2855  for (int i=0; i<fTabWidget->count(); i++)
2856  if (fTabWidget->tabText(i)=="Chat")
2857  {
2858  fTabWidget->setTabIcon(i, QIcon(":/Resources/icons/warning 3.png"));
2859  break;
2860  }
2861 
2862  return;
2863  }
2864 
2865 
2866  out << "<font style='font-family:monospace' color='";
2867 
2868  switch (qos)
2869  {
2870  case kMessage: out << "black"; break;
2871  case kInfo: out << "green"; break;
2872  case kWarn: out << "#FF6600"; break;
2873  case kError: out << "maroon"; break;
2874  case kFatal: out << "maroon"; break;
2875  case kDebug: out << "navy"; break;
2876  default: out << "navy"; break;
2877  }
2878  out << "'>";
2879  out << time.GetAsStr("%H:%M:%S.%f").substr(0,12);
2880  out << " - " << text << "</font>";
2881 
2882  fLogText->append(out.str().c_str());
2883 
2884  if (qos>=kWarn && qos!=kDebug && qos!=kComment)
2885  fTextEdit->append(out.str().c_str());
2886  }
A warning, things that somehow might result in unexpected or unwanted bahaviour.
Definition: MessageImp.h:18
int i
Definition: db_dim_client.c:21
An info telling something which can be interesting to know.
Definition: MessageImp.h:17
Just a message, usually obsolete.
Definition: MessageImp.h:16
uint16_t qos
Definition: HeadersGPS.h:29
A message used for debugging only.
Definition: MessageImp.h:23
Error, something unexpected happened, but can still be handled by the program.
Definition: MessageImp.h:19
A comment which is always printed.
Definition: MessageImp.h:22
std::string GetAsStr(const char *fmt="%Y-%m-%d %H:%M:%S") const
Definition: Time.cc:240
An error which cannot be handled at all happend, the only solution is program termination.
Definition: MessageImp.h:21

+ Here is the call graph for this function:

+ Here is the caller graph for this function: