Index: trunk/tools/FlairGCS/src/ConnectionLayout.h
===================================================================
--- trunk/tools/FlairGCS/src/ConnectionLayout.h	(revision 247)
+++ trunk/tools/FlairGCS/src/ConnectionLayout.h	(revision 248)
@@ -35,5 +35,5 @@
 
 signals:
-  void UDTStats(QString stats);  
+  void UDTStats(QString stats,bool loosingPackets);  
 };
 
Index: trunk/tools/FlairGCS/src/Manager.cpp
===================================================================
--- trunk/tools/FlairGCS/src/Manager.cpp	(revision 247)
+++ trunk/tools/FlairGCS/src/Manager.cpp	(revision 248)
@@ -37,5 +37,5 @@
   qRegisterMetaType<QModelIndex>("QModelIndex"); // pour le file ui??
   this->name = name;
-//ffprintf(stderr,stderr,"Manager %x\n",thread());
+//fprintf(stderr,stderr,"Manager %x\n",thread());
   setWindowTitle(name);
 
@@ -97,6 +97,7 @@
 
   
-  icon_ok = QIcon(":green.png");
-  icon_ko = QIcon(":red.png");
+  icon_green = QIcon(":green.png");
+  icon_red = QIcon(":red.png");
+  icon_orange = QIcon(":orange.png");
   
   
@@ -108,6 +109,8 @@
 Manager::~Manager() {
   for (int i = 0; i < connections.count(); i++) {
-    connections.at(i).socket->kill();
-    connections.at(i).socket->thread()->wait();
+    if(connections.at(i).socket!=NULL) {
+      connections.at(i).socket->kill();
+      connections.at(i).socket->thread()->wait();
+    }
   }
 
@@ -146,6 +149,6 @@
   
   ConnectionLayout *newLayout = new ConnectionLayout(udtSocket, name);
-  connect(udtSocket, SIGNAL(UDTStats(QString)), newLayout, SIGNAL(UDTStats(QString)));//connection in 2 steps to get udtsocket as sender
-  connect(newLayout, SIGNAL(UDTStats(QString)), this, SLOT(printUDTStats(QString)));
+  connect(udtSocket, SIGNAL(UDTStats(QString,bool)), newLayout, SIGNAL(UDTStats(QString,bool)));//connection in 2 steps to get udtsocket as sender
+  connect(newLayout, SIGNAL(UDTStats(QString,bool)), this, SLOT(printUDTStats(QString,bool)));
   connect(udtSocket, SIGNAL(dataReady(char *, int)), newLayout,SLOT(receive(char *, int)),Qt::BlockingQueuedConnection);
   connect(newLayout, SIGNAL(destroyed(QObject *)), this, SLOT(layoutDestroyed(QObject *)));
@@ -170,20 +173,19 @@
   }
   if (connections.count() == 2) {
-    tabBar->addTab(icon_ok,hiddenTabName);
+    tabBar->addTab(icon_green,hiddenTabName);
     currentTab = 0;
   }
   if (connections.count() > 1) {
-    tabBar->addTab(icon_ok,name);
+    tabBar->addTab(icon_green,name);
   }
 }
 
 void Manager::udtSocketDestroyed(QObject *obj) {
-  fprintf(stderr,"sockets -1\n");
   //mark socket as not valid, it can be a connection lost
   //in this case we keep the layout for reading, and mark it as problematic
-  fprintf(stderr,"change icon\n");
   for(int i=0;i<connections.count();i++) {
     if(connections.at(i).socket==(UdtSocket *)obj) {
       connections[i].socket=NULL;
+      tabBar->setTabIcon(i,icon_red);
       break;
     }
@@ -192,5 +194,4 @@
 
 void Manager::layoutDestroyed(QObject *obj) {
-  fprintf(stderr,"layout -1\n");
   //remove the connection, it comes from a proper close
   int index=-1;
@@ -240,5 +241,5 @@
 }
 
-void Manager::printUDTStats(QString stats) {
+void Manager::printUDTStats(QString stats,bool loosingPackets) {
   int index = -1;
   for(int i=0;i<connections.count();i++) {
@@ -250,4 +251,10 @@
   
   if(index==-1) return;
+  
+  if(!loosingPackets) {
+    tabBar->setTabIcon(index,icon_green);
+  } else {
+    tabBar->setTabIcon(index,icon_orange);
+  }
   
   if (tabBar->count() == 0) {
Index: trunk/tools/FlairGCS/src/Manager.h
===================================================================
--- trunk/tools/FlairGCS/src/Manager.h	(revision 247)
+++ trunk/tools/FlairGCS/src/Manager.h	(revision 248)
@@ -47,5 +47,5 @@
   QGridLayout *button_layout;
   QStatusBar *status;
-  QIcon icon_ok,icon_ko;
+  QIcon icon_red,icon_green,icon_orange;
 
 private slots:
@@ -56,5 +56,5 @@
   void reset(void);
   void tabBarCurrentChanged(int index);
-  void printUDTStats(QString stats);
+  void printUDTStats(QString stats,bool loosingPackets);
   void newFileUI(UDTSOCKET socket);
   void deleteFileUI(void);
Index: trunk/tools/FlairGCS/src/UdtSocket.cpp
===================================================================
--- trunk/tools/FlairGCS/src/UdtSocket.cpp	(revision 247)
+++ trunk/tools/FlairGCS/src/UdtSocket.cpp	(revision 248)
@@ -36,4 +36,5 @@
   socketType=unknown;
   total_received=0;
+  pktSndLossTotal=0;
  
   bool blocking = false;
@@ -54,5 +55,4 @@
   udtstats_timer->stop();
   if(destroySocket) UDT::close(socket);
-fprintf(stderr,"fin udt\n");
 }
 
@@ -95,7 +95,9 @@
       
   }*/
+  bool loosingPackets=false;
+  if(perf.pktSndLossTotal>pktSndLossTotal) loosingPackets=true;
+  pktSndLossTotal=perf.pktSndLossTotal;
   stats=QString("rx rate %1kB/s, round trip %2ms, lost packets %3").arg(rxRate,0,'f',3).arg(perf.msRTT,0,'f',3).arg(perf.pktSndLossTotal);
-  UDTStats(stats);
-  
+  UDTStats(stats,loosingPackets);
 }
 
@@ -124,5 +126,5 @@
     return;
   }
-  //ffprintf(stderr,stderr,"receiveData %x\n",thread());
+  //fprintf(stderr,stderr,"receiveData %x\n",thread());
   
   while (!stop) {
Index: trunk/tools/FlairGCS/src/UdtSocket.h
===================================================================
--- trunk/tools/FlairGCS/src/UdtSocket.h	(revision 247)
+++ trunk/tools/FlairGCS/src/UdtSocket.h	(revision 248)
@@ -31,4 +31,5 @@
   unsigned int total_received;
   QString stats;
+  int pktSndLossTotal;
 
 signals:
@@ -36,5 +37,5 @@
   void newFileUI(UDTSOCKET socket);
   void newConnectionLayout(QString name);
-  void UDTStats(QString stats);
+  void UDTStats(QString stats,bool loosingPackets);
 
 public slots:
Index: trunk/tools/FlairGCS/src/file_ui.cpp
===================================================================
--- trunk/tools/FlairGCS/src/file_ui.cpp	(revision 247)
+++ trunk/tools/FlairGCS/src/file_ui.cpp	(revision 248)
@@ -45,5 +45,5 @@
     
   dialog = new QDialog();
-//ffprintf(stderr,stderr,"creator file ui %x\n",thread());
+
   dialog->setWindowTitle("log files");
   QGridLayout *main_layout = new QGridLayout(dialog);
Index: trunk/tools/FlairGCS/src/ressources.qrc
===================================================================
--- trunk/tools/FlairGCS/src/ressources.qrc	(revision 247)
+++ trunk/tools/FlairGCS/src/ressources.qrc	(revision 248)
@@ -6,4 +6,5 @@
   <file>cross.png</file>
   <file>green.png</file>
+  <file>orange.png</file>
   <file>red.png</file>
 </qresource>
