static void setLabelImage(INode* root, QString indent="")
{
  if (!root) return;
  qDebug("%s%s",indent.latin1(),root->name().latin1());
  root->setGeoRegion(root->attributeFloat("file_geoWest"),
                     root->attributeFloat("file_geoNorth"),
                     root->attributeFloat("file_geoEast"),
                     root->attributeFloat("file_geoSouth"));
  QPtrList<INode>& children=root->children();
  if (children.count()==0) return;
  indent+=" ";
  for (INode *in=children.first(); in!=0; in=children.next())
    setLabelImage(in,indent);
}
void colorChooser::setNewImage(const QImage& newImage) {

  // [Warning: we used to setPermStatus here, but the bold font causes the
  // size of imageScroll to decrease by 1, which causes zoomToImage to
  // not work unless you are 1) shown, by which I mean _on_ _screen_ of
  // course, 2) updateGeometry()ed, 3) pending event queue cleared
  // So we don't do setPermStatus here anymore]
  setPermanentStatusEnabled(true);
  setLabelImage(newImage);
  zoomToImage();
  processMode_.clearColorLists();
  clickedDock_->setColorList(processMode_.clickedColorList());
  generatedDock_->clearList();
  generatedDockHolder_->setEnabled(false);
  setStatus(processMode_.statusHint());
}
/** Testfunktion */
void MainGui::test()
{
  try {
    if (!semNet.rootNode() || (semNet.rootNode())->children().isEmpty()) {
      receiveMessage("No semantic net defined");
      qDebug("Start analyze - no semantic net, nothing to do");
      return;
    }
#ifdef DEBUGMSG
  	qDebug("Start analyze (mode: %d)", mode_);
#endif
#if 0
    treeEditor->disconnectSlots();
    sceneViewer->disconnectSlots();
    sceneViewer->rootNode(0);
    trashViewer->disconnectSlots();
    trashViewer->rootNode(0);
    mapViewer->set(0,0);
#endif
   	if (analysis_) delete analysis_;
    analysis_=0;
  	interactive(TRUE);//enable some analysis buttons
  	readyToAna(FALSE);  //disable some analysis buttons
  	analysis_ = new Analysis(&semNet, &geoImageList_,&labelImageList_); //set the semantic net GeoImageList
  	connect(analysis_,SIGNAL(message(QString)),this,SLOT(receiveMessage(QString)));
  	connect(analysis_,SIGNAL(sigMapView(INode*,GeoImage*)),mapViewer,SLOT(set(INode*,GeoImage*)));
  	connect(analysis_,SIGNAL(sigInteractive(bool)),this,SLOT(slotInteractive(bool)));
  	opMode(mode_);

  	connect(analysis_, SIGNAL(sigReady(INode*,GeoImage*)), this, SLOT(slotAnalysisReady(INode*,GeoImage*)) );
    connect(analysis_, SIGNAL(sigNodeChange(INode*)), this, SLOT(slotNodeChange(INode*)) );
  	analysis_->genGoal(iNode_);
    setLabelImage(iNode_);
    analysis_->prepareResultImage();
  }
  catch (FatalError err) {
  	emit interactive(FALSE);//disable some analysis buttons
  	emit readyToAna(TRUE);  //enable some analysis buttons
  	receiveMessage(err.message());
  }
}