Index: trunk/FACT++/gui/FactGui.h
===================================================================
--- trunk/FACT++/gui/FactGui.h	(revision 11265)
+++ trunk/FACT++/gui/FactGui.h	(revision 11266)
@@ -20,4 +20,5 @@
 #include "src/DimNetwork.h"
 #include "src/tools.h"
+
 
 #include "TROOT.h"
@@ -524,29 +525,4 @@
     }
 
-    void RemoveServer(const std::string &s)
-    {
-        UnsubscribeServer(s);
-
-        DimNetwork::RemoveServer(s);
-
-        QApplication::postEvent(this,
-           new FunctionEvent(boost::bind(&FactGui::handleRemoveServer, this, s)));
-    }
-
-    void RemoveAllServers()
-    {
-        UnsubscribeAllServers();
-
-        vector<string> v = GetServerList();
-        for (vector<string>::iterator i=v.begin(); i<v.end(); i++)
-            QApplication::postEvent(this,
-                                    new FunctionEvent(boost::bind(&FactGui::handleStateOffline, this, *i)));
-
-        DimNetwork::RemoveAllServers();
-
-        QApplication::postEvent(this,
-           new FunctionEvent(boost::bind(&FactGui::handleRemoveAllServers, this)));
-    }
-
     void AddService(const std::string &server, const std::string &service, const std::string &fmt, bool iscmd)
     {
@@ -557,6 +533,5 @@
     void RemoveService(const std::string &server, const std::string &service, bool iscmd)
     {
-        if (fServices.find(server+'/'+service)!=fServices.end())
-            UnsubscribeService(server+'/'+service);
+        UnsubscribeService(server+'/'+service);
 
         QApplication::postEvent(this,
@@ -566,5 +541,5 @@
     void RemoveAllServices(const std::string &server)
     {
-        UnsubscribeServer(server);
+        UnsubscribeAllServices(server);
 
         QApplication::postEvent(this,
@@ -584,20 +559,4 @@
         const State s = GetState(server, GetCurrentState(server));
         handleStateChanged(Time(), server, s);
-    }
-
-    void handleRemoveServer(const string &server)
-    {
-        handleStateOffline(server);
-        handleRemoveAllServices(server);
-    }
-
-    void handleRemoveAllServers()
-    {
-        QStandardItemModel *m = 0;
-        if ((m=dynamic_cast<QStandardItemModel*>(fDimCmdServers->model())))
-            m->removeRows(0, m->rowCount());
-
-        if ((m = dynamic_cast<QStandardItemModel*>(fDimSvcServers->model())))
-            m->removeRows(0, m->rowCount());
     }
 
@@ -634,4 +593,6 @@
     void handleRemoveAllServices(const std::string &server)
     {
+        handleStateChanged(Time(), server, State(-2, "Offline", "No connection via DIM."));
+
         QStandardItemModel *m = 0;
         if ((m=dynamic_cast<QStandardItemModel*>(fDimCmdServers->model())))
@@ -686,5 +647,5 @@
     }
 
-    void UnsubscribeServer(const string &server)
+    void UnsubscribeAllServices(const string &server)
     {
         for (map<string,DimInfo*>::iterator i=fServices.begin();
@@ -695,13 +656,4 @@
                 fServices.erase(i);
             }
-    }
-
-    void UnsubscribeAllServers()
-    {
-        for (map<string,DimInfo*>::iterator i=fServices.begin();
-             i!=fServices.end(); i++)
-            delete i->second;
-
-        fServices.clear();
     }
 
@@ -1797,5 +1749,5 @@
         const FTM::DimError &sdata = d.ref<FTM::DimError>();
 
-        SetFtuLed(sdata.fError.fDestAddress , sdata.fError.fNumCalls, d.time);
+        SetFtuLed(sdata.fError.fDestAddress, sdata.fError.fNumCalls, d.time);
         SetFtuStatusLed(d.time);
 
@@ -1835,5 +1787,7 @@
             fRatesWidget->setEnabled(enable);
 
-            if (!enable)
+            if (s.index>=FTM::kConnected)
+                SetFtuStatusLed(time);
+            else
             {
                 SetLedColor(fStatusFTULed, kLedGray, time);
@@ -1841,5 +1795,5 @@
                 fStatusFTULabel->setToolTip("FTM is not online.");
             }
-    }
+        }
 
         if (server=="FAD_CONTROL")
@@ -1939,9 +1893,4 @@
             SetLedColor(fStatusSchedulerLed, s.index>=0 ? kLedGreen : kLedRed, time);
         }
-    }
-
-    void handleStateOffline(const string &server)
-    {
-        handleStateChanged(Time(), server, State(-2, "Offline", "No connection via DIM."));
     }
 
@@ -2830,5 +2779,9 @@
     ~FactGui()
     {
-	UnsubscribeAllServers();
+        // Unsubscribe all services
+        for (map<string,DimInfo*>::iterator i=fServices.begin();
+             i!=fServices.end(); i++)
+            delete i->second;
+
         delete fEventData;
     }
