Index: mapselector.cc
===================================================================
--- mapselector.cc	(revision 85)
+++ mapselector.cc	(revision 112)
@@ -1,9 +1,18 @@
 #include "mapselector.h"
 
-MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, NewMapWin & newmapw, int identifier, bool edge):gdc(grdispc),ms(mapst),nmw(newmapw),id(identifier),itisedge(edge),default_state(true),set_new_map(false),node_to_update(INVALID),edge_to_update(INVALID)
+MapSelector::MapSelector(std::vector<std::string> ml, std::string act, int identifier, bool edge):id(identifier),itisedge(edge),set_new_map(false)
 {
-  update_list();
+  update_list(ml);
 
-  cbt.set_active(0);
+  if(act=="")
+    {
+      cbt.set_active(0);
+      default_state=true;
+    }
+  else
+    {
+      cbt.set_active_text((Glib::ustring)act);
+      default_state=false;
+    }
 
   //binding signal to the actual entry
@@ -51,27 +60,21 @@
 {
   set_new_map=true;
-  nmw.showByPreChoose(itisedge);
+  signal_newmapwin.emit(itisedge);
 }
 
-void MapSelector::update_list()
+void MapSelector::update_list( std::vector< std::string > ml )
 {
+  int prev_act=cbt.get_active_row_number();
   cbt.clear();
-  if(itisedge)
+  std::vector< std::string >::iterator emsi=ml.begin();
+  for(;emsi!=ml.end();emsi++)
     {
-      std::map< std::string,Graph::EdgeMap<double> * >::iterator emsi=ms.beginOfEdgeMaps();
-      for(;emsi!=ms.endOfEdgeMaps();emsi++)
-	{
-	  cbt.append_text(emsi->first);
-	}
-    }
-  else
-    {
-      std::map< std::string,Graph::NodeMap<double> * >::iterator emsi=ms.beginOfNodeMaps();
-      for(;emsi!=ms.endOfNodeMaps();emsi++)
-	{
-	  cbt.append_text(emsi->first);
-	}
+      cbt.append_text(*emsi);
     }
   cbt.prepend_text("Default values");
+  if(prev_act!=-1)
+    {
+      cbt.set_active(prev_act);
+    }
 }
 
@@ -84,46 +87,5 @@
       if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
 	{
-	  if(itisedge)
-	    {
-	      if( ( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() ) )
-		{
-		  Edge edge=edge_to_update;
-		  switch(id)
-		    {
-		    case E_WIDTH:
-		      gdc.changeEdgeWidth(mapname, edge);
-		      break;
-		    case E_COLOR:
-		      gdc.changeEdgeColor(mapname, edge);
-		      break;
-		    case E_TEXT:
-		      gdc.changeEdgeText(mapname, edge);
-		      break;
-		    default:
-		      std::cerr<<"Error\n";
-		    }
-		}
-	    }
-	  else
-	    {
-	      if( ( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() ) )
-		{
-		  Node node=node_to_update;
-		  switch(id)
-		    {
-		    case N_RADIUS:
-		      gdc.changeNodeRadius(mapname, node);
-		      break;
-		    case N_COLOR:
-		      gdc.changeNodeColor(mapname, node);
-		      break;
-		    case N_TEXT:
-		      gdc.changeNodeText(mapname, node);
-		      break;
-		    default:
-		      std::cerr<<"Error\n";
-		    }
-		}
-	    }
+	  signal_cbt.emit(mapname);
 	}
     }
@@ -137,71 +99,10 @@
 {
   default_state=true;
+
   cbt.set_active(0);
 
-  if(itisedge)
-    {
-      Edge edge=edge_to_update;
-      switch(id)
-	{
-	case E_WIDTH:
-	  gdc.resetEdgeWidth(edge);
-	  break;
-	case E_COLOR:
-	  gdc.resetEdgeColor(edge);
-	  break;
-	case E_TEXT:
-	  gdc.resetEdgeText(edge);
-	  break;
-	default:
-	  std::cerr<<"Error\n";
-	}
-    }
-  else
-    {
-      Node node=node_to_update;	
-      switch(id)
-	{
-	case N_RADIUS:
-	  gdc.resetNodeRadius(node);
-	  break;
-	case N_COLOR:
-	  gdc.resetNodeColor(node);
-	  break;
-	case N_TEXT:
-	  gdc.resetNodeText(node);
-	  break;
-	default:
-	  std::cerr<<"Error\n";
-	}
-    }
+  signal_cbt.emit("");
 }
 
-void MapSelector::update(Node node)
-{
-  node_to_update=node;
-  if(default_state)
-    {
-      reset();
-    }
-  else
-    {
-      comboChanged();
-    }
-  node_to_update=INVALID;
-}
-
-void MapSelector::update(Edge edge)
-{
-  edge_to_update=edge;
-  if(default_state)
-    {
-      reset();
-    }
-  else
-    {
-      comboChanged();
-    }
-  edge_to_update=INVALID;
-}
 
 Glib::ustring MapSelector::get_active_text()
@@ -224,2 +125,12 @@
     }
 }
+
+sigc::signal<void, std::string> MapSelector::signal_cbt_ch()
+{
+  return signal_cbt;
+}
+
+sigc::signal<void, bool> MapSelector::signal_newmapwin_needed()
+{
+  return signal_newmapwin;
+}
