Index: configure.ac
===================================================================
--- configure.ac	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ configure.ac	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -38,5 +38,4 @@
 AX_BOOST_BASE([1.40])
 AX_BOOST_PROGRAM_OPTIONS
-#AX_BOOST_FOREACH
 AX_BOOST_FILESYSTEM
 AX_BOOST_THREAD
Index: src/Actions/MapOfActions.cpp
===================================================================
--- src/Actions/MapOfActions.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/Actions/MapOfActions.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -31,4 +31,5 @@
 #include <boost/optional.hpp>
 #include <boost/program_options.hpp>
+#include <boost/filesystem.hpp>
 
 #include <iostream>
@@ -190,4 +191,20 @@
   BV.zz = boost::lexical_cast<double>(components.at(5));
   v = boost::any(BoxValue(BV));
+}
+
+void validate(boost::any& v, const std::vector<std::string>& values, boost::filesystem::path *, int)
+{
+  boost::filesystem::path filename;
+  std::vector<std::string> components;
+
+  std::cout << "boost::filesystem::path validator used." << std::endl;
+
+  // split comma-separated values
+  if (values.size() != 1) {
+    cerr <<  "Not one file but " << components.size() << " given " << endl;
+    throw boost::program_options::validation_error("Unequal to one file given");
+  }
+  filename = values.at(0);
+  v = boost::any(boost::filesystem::path(filename));
 }
 
@@ -367,5 +384,5 @@
   TypeMap["fill-void"] = &typeid(std::string);
   TypeMap["fragment-mol"] = &typeid(std::string);
-  TypeMap["input"] = &typeid(std::string);
+  TypeMap["input"] = &typeid(boost::filesystem::path);
   TypeMap["linear-interpolate"] = &typeid(std::string);
   TypeMap["molecular-volume"] = &typeid(molecule);
@@ -446,4 +463,5 @@
   TypeEnumMap[&typeid(bool)] = Boolean;
   TypeEnumMap[&typeid(int)] = Integer;
+  TypeEnumMap[&typeid(boost::filesystem::path)] = File;
   TypeEnumMap[&typeid(std::vector<int>)] = ListOfIntegers;
   TypeEnumMap[&typeid(double)] = Double;
@@ -825,4 +843,20 @@
 }
 
+void MapOfActions::queryCurrentValue(const char * name, boost::filesystem::path&_T)
+{
+  std::string tmp;
+  if (typeid( boost::filesystem::path ) == *TypeMap[name]) {
+    if (CurrentValue.find(name) == CurrentValue.end())
+      throw MissingValueException(__FILE__, __LINE__);
+    std::istringstream stream(CurrentValue[name]);
+    CurrentValue.erase(name);
+    if (!stream.fail()) {
+      stream >> tmp >> ws;
+      _T = tmp;
+    }
+  } else
+    throw IllegalTypeException(__FILE__,__LINE__);
+}
+
 
 void MapOfActions::setCurrentValue(const char * name, class atom * &_T)
@@ -927,4 +961,14 @@
       stream << (*iter)->getId() << " ";
     }
+    CurrentValue[name] = stream.str();
+  } else
+    throw IllegalTypeException(__FILE__,__LINE__);
+}
+
+void MapOfActions::setCurrentValue(const char * name, boost::filesystem::path &_T)
+{
+  if (typeid( boost::filesystem::path ) == *TypeMap[name]) {
+    std::ostringstream stream;
+    stream << _T.string();
     CurrentValue[name] = stream.str();
   } else
@@ -1051,4 +1095,11 @@
               ;
             break;
+          case File:
+            ListRunner->second->add_options()
+              (getKeyAndShortForm(*OptionRunner).c_str(),
+                  po::value< boost::filesystem::path >(),
+                  getDescription(*OptionRunner).c_str())
+              ;
+            break;
           case Integer:
             ListRunner->second->add_options()
Index: src/Actions/MapOfActions.hpp
===================================================================
--- src/Actions/MapOfActions.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/Actions/MapOfActions.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -9,6 +9,7 @@
 #define MAPOFACTIONS_HPP_
 
+#include <boost/filesystem.hpp>
+#include <boost/lexical_cast.hpp>
 #include <boost/program_options.hpp>
-#include <boost/lexical_cast.hpp>
 
 #include <map>
@@ -31,4 +32,5 @@
 
 namespace po = boost::program_options;
+namespace fs = boost::filesystem;
 
 using boost::lexical_cast;
@@ -136,5 +138,5 @@
   friend class MapOfActionsTest;
 public:
-  enum OptionTypes { None, Boolean, Integer, ListOfIntegers, Double, ListOfDoubles, String, ListOfStrings, Vector, ListOfVectors, Box, Molecule, ListOfMolecules, Atom, ListOfAtoms, Element, ListOfElements };
+  enum OptionTypes { None, Boolean, Integer, File, ListOfIntegers, Double, ListOfDoubles, String, ListOfStrings, Vector, ListOfVectors, Box, Molecule, ListOfMolecules, Atom, ListOfAtoms, Element, ListOfElements };
 
   // getter for the action descriptions and short forms
@@ -173,4 +175,5 @@
   void queryCurrentValue(const char * name, std::vector<const element *>&_T);
   void queryCurrentValue(const char * name, std::vector<molecule *>&_T);
+  void queryCurrentValue(const char * name, fs::path&_T);
   template<typename T> void queryCurrentValue(const char * name, T &_T)
   {
@@ -208,4 +211,5 @@
   void setCurrentValue(const char * name, std::vector<const element *>&_T);
   void setCurrentValue(const char * name, std::vector<molecule *>&_T);
+  void setCurrentValue(const char * name, fs::path&_T);
   template<class T> void setCurrentValue(const char * name, T &_T)
   {
Index: src/Actions/WorldAction/InputAction.cpp
===================================================================
--- src/Actions/WorldAction/InputAction.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/Actions/WorldAction/InputAction.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -30,4 +30,6 @@
 #include <string>
 
+#include <boost/filesystem/fstream.hpp>
+
 using namespace std;
 
@@ -39,41 +41,42 @@
 /** =========== define the function ====================== */
 Action::state_ptr WorldInputAction::performCall() {
-  MoleculeListClass *molecules = World::getInstance().getMolecules();
-  molecule *mol = NULL;
-  std::ifstream test;
+//  MoleculeListClass *molecules = World::getInstance().getMolecules();
+//  molecule *mol = NULL;
+  boost::filesystem::ifstream test;
 
   // obtain information
   getParametersfromValueStorage();
 
-  DoLog(0) && (Log() << Verbose(0) << "Config file given." << endl);
-  if (params.filename.find('.') != string::npos) {
-    std::string FilenamePrefix = params.filename.substr(0,params.filename.find_last_of('.'));
-    std::string FilenameSuffix = params.filename.substr(params.filename.find_last_of('.')+1, params.filename.length());
+  DoLog(0) && (Log() << Verbose(0) << "Config file given " << params.filename << "." << endl);
+  // using the filename as prefix for all parsers
+  std::string FilenameSuffix;
+  std::string FilenamePrefix;
+  if (params.filename.has_filename()) {
+    // get suffix
+    FilenameSuffix = params.filename.extension().substr(1); // remove the prefixed "."
+    FilenamePrefix = params.filename.stem();
     DoLog(1) && (Log() << Verbose(1) << "Setting config file name prefix to " << FilenamePrefix << "." << endl);
-    test.open(params.filename.c_str());
-    if (test == NULL) {
-      DoLog(1) && (Log() << Verbose(1) << "Specified config file " << params.filename << " not found." << endl);
-    } else {
-      DoLog(1) && (Log() << Verbose(1) << "Specified config file found, parsing ... ");
-      FormatParserStorage::getInstance().get((std::istream &)test, FilenameSuffix);
-      test.close();
-    }
     FormatParserStorage::getInstance().SetOutputPrefixForAll(FilenamePrefix);
-    // set mol to first active molecule
-    if (molecules->ListOfMolecules.size() != 0) {
-      for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++)
-        if ((*ListRunner)->ActiveFlag) {
-          mol = *ListRunner;
-          break;
-        }
-    }
-    if (mol == NULL) {
-      mol = World::getInstance().createMolecule();
-      mol->ActiveFlag = true;
-      molecules->insert(mol);
-    }
-    mol->SetNameFromFilename(params.filename.substr(0,params.filename.find('.')).c_str());
   } else {
     DoeLog(1) && (eLog() << Verbose(1) << "Input file does not have a suffix, cannot recognize format." << endl);
+    return Action::failure;
+  }
+
+  // parsing file if present
+  if (!boost::filesystem::exists(params.filename)) {
+    DoLog(1) && (Log() << Verbose(1) << "Specified config file " << params.filename << " not found." << endl);
+    // DONT FAIL: it's just empty and we use the name. // return Action::failure;
+  } else {
+    DoLog(1) && (Log() << Verbose(1) << "Specified config file found, parsing ... ");
+
+    // parse the file
+    test.open(params.filename);
+    FormatParserStorage::getInstance().get(test, FilenameSuffix);
+    test.close();
+
+    // set file name of last molecule
+    MoleculeList::const_iterator iter = World::getInstance().getMolecules()->ListOfMolecules.end();
+    iter--;
+    (*iter)->SetNameFromFilename(FilenamePrefix.c_str());
   }
   return Action::success;
Index: src/Actions/WorldAction/InputAction.def
===================================================================
--- src/Actions/WorldAction/InputAction.def	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/Actions/WorldAction/InputAction.def	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -7,10 +7,10 @@
 
 // all includes and forward declarations necessary for non-integral types below
-
+#include <boost/filesystem.hpp>
 
 // i.e. there is an integer with variable name Z that can be found in
 // ValueStorage by the token "Z" -> first column: int, Z, "Z"
 // "undefine" if no parameters are required
-#define paramtypes (std::string)
+#define paramtypes (boost::filesystem::path)
 #define paramtokens (WorldInputAction::NAME)
 #define paramreferences (filename)
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/Makefile.am	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -120,23 +120,59 @@
   Thermostats/Woodcock.hpp
 
-QTUIMOC_HEADER = UIElements/QT4/QTDialog.hpp \
-	UIElements/QT4/QTMainWindow.hpp \
-	UIElements/Menu/QT4/QTMenu.hpp \
-	UIElements/Views/QT4/QTWorldView.hpp \
-	UIElements/Views/QT4/GLMoleculeView.hpp \
-	UIElements/Views/QT4/QTMoleculeView.hpp \
-	UIElements/Views/QT4/QTStatusBar.hpp
+QTUIMOC_HEADER = UIElements/Qt4/QtDialog.hpp \
+	UIElements/Qt4/QtMainWindow.hpp \
+	UIElements/Menu/Qt4/QtMenu.hpp \
+	UIElements/Views/Qt4/QtWorldView.hpp \
+	UIElements/Views/Qt4/GLMoleculeView.hpp \
+	UIElements/Views/Qt4/QtMoleculeView.hpp \
+	UIElements/Views/Qt4/QtStatusBar.hpp
 				  
 QTUISOURCE = allmocs.moc.cpp \
-	UIElements/QT4/QTMainWindow.cpp \
-	UIElements/QT4/QTDialog.cpp \
-	UIElements/QT4/QTUIFactory.cpp \
-	UIElements/Menu/QT4/QTMenu.cpp \
-	UIElements/Views/QT4/QTWorldView.cpp \
-	UIElements/Views/QT4/GLMoleculeView.cpp \
-	UIElements/Views/QT4/QTMoleculeView.cpp \
-	UIElements/Views/QT4/QTStatusBar.cpp
+  UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/FileQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/IntQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/StringQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp \
+  UIElements/Qt4/Query/AtomQtQuery.cpp \
+  UIElements/Qt4/Query/AtomsQtQuery.cpp \
+  UIElements/Qt4/Query/BooleanQtQuery.cpp \
+  UIElements/Qt4/Query/BoxQtQuery.cpp \
+  UIElements/Qt4/Query/DoubleQtQuery.cpp \
+  UIElements/Qt4/Query/DoublesQtQuery.cpp \
+  UIElements/Qt4/Query/ElementQtQuery.cpp \
+  UIElements/Qt4/Query/ElementsQtQuery.cpp \
+  UIElements/Qt4/Query/EmptyQtQuery.cpp \
+  UIElements/Qt4/Query/FileQtQuery.cpp \
+  UIElements/Qt4/Query/IntQtQuery.cpp \
+  UIElements/Qt4/Query/IntsQtQuery.cpp \
+  UIElements/Qt4/Query/MoleculeQtQuery.cpp \
+  UIElements/Qt4/Query/MoleculesQtQuery.cpp \
+  UIElements/Qt4/Query/StringQtQuery.cpp \
+  UIElements/Qt4/Query/StringsQtQuery.cpp \
+  UIElements/Qt4/Query/VectorQtQuery.cpp \
+  UIElements/Qt4/Query/VectorsQtQuery.cpp \
+	UIElements/Qt4/QtMainWindow.cpp \
+	UIElements/Qt4/QtDialog.cpp \
+	UIElements/Qt4/QtUIFactory.cpp \
+	UIElements/Menu/Qt4/QtMenu.cpp \
+	UIElements/Views/Qt4/QtWorldView.cpp \
+	UIElements/Views/Qt4/GLMoleculeView.cpp \
+	UIElements/Views/Qt4/QtMoleculeView.cpp \
+	UIElements/Views/Qt4/QtStatusBar.cpp
              
-QTUIHEADER = ${QTUIMOC_HEADER} UIElements/QT4/QTUIFactory.hpp
+QTUIHEADER = \
+  ${QTUIMOC_HEADER} \
+  UIElements/Qt4/Pipe/QtQueryListPipe.hpp \
+  UIElements/Qt4/QtUIFactory.hpp
 
 QTUI_DEFS =
@@ -289,5 +325,5 @@
 
 
-BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
+BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_THREAD_LIB)
 GUI_LIBS = ${QT_LDADD} ${QT_LIB_GUI} -lQtOpenGL ${GLU_LIBS}
 INCLUDES = -I$(top_srcdir)/src/unittests -I$(top_srcdir)/src/Actions -I$(top_srcdir)/src/UIElements
@@ -315,10 +351,7 @@
 	Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
 	Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
-	$(BOOST_LIB) \
-	${BOOST_THREAD_LIB} \
-	${BOOST_PROGRAM_OPTIONS_LIB}
-
-
-#Stuff for building the GUI using QT
+	$(BOOST_LIB)
+
+#Stuff for building the GUI using Qt
 molecuildergui_SOURCES = ${QTUISOURCE} builder.cpp
 molecuildergui_CXXFLAGS = ${QT_CXXFLAGS} ${GLU_CXXFLAGS} -DUSE_GUI_QT
@@ -326,5 +359,5 @@
 
 unity_SOURCES = unity.cpp
-unity_LDADD = $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
+unity_LDADD = $(BOOST_LIB)
 
 molecuildergui_LDADD = \
@@ -337,6 +370,4 @@
 	Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
 	$(BOOST_LIB) \
-	${BOOST_THREAD_LIB} \
-	${BOOST_PROGRAM_OPTIONS_LIB} \
 	${GUI_LIBS}
 
@@ -350,7 +381,5 @@
 	Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
 	Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
-	$(BOOST_LIB) \
-	${BOOST_THREAD_LIB} \
-	${BOOST_PROGRAM_OPTIONS_LIB}
+	$(BOOST_LIB)
 
 analyzer_SOURCES = analyzer.cpp datacreator.cpp periodentafel.hpp datacreator.hpp 
@@ -363,9 +392,7 @@
 	Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
 	Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
-	$(BOOST_LIB) \
-	${BOOST_THREAD_LIB} \
-	${BOOST_PROGRAM_OPTIONS_LIB}
-
-#Rules needed for QT4
+	$(BOOST_LIB)
+
+#Rules needed for Qt4
 # UI-Files are scattered throughout several subdirectories
 # Therfore `%'-rules do not seem to work
Index: src/Parser/MpqcParser.cpp
===================================================================
--- src/Parser/MpqcParser.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/Parser/MpqcParser.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -49,5 +49,6 @@
 void MpqcParser::load(istream *file)
 {
-  DoeLog(0) && (Log() << Verbose(0) << "Not yet implemented" << endl) ;
+  // TODO: MpqcParser::load implementation
+  ASSERT(false, "Not implemented yet");
 }
 
Index: src/Parser/PcpParser.cpp
===================================================================
--- src/Parser/PcpParser.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/Parser/PcpParser.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -355,10 +355,8 @@
   // 3. parse the molecule in
   molecule *mol = World::getInstance().createMolecule();
-  MoleculeListClass *molecules = World::getInstance().getMolecules();
-  molecules->insert(mol);
+  mol->ActiveFlag = true;
+  // TODO: Remove the insertion into molecule when saving does not depend on them anymore. Also, remove molecule.hpp include
+  World::getInstance().getMolecules()->insert(mol);
   LoadMolecule(mol, FileBuffer, World::getInstance().getPeriode(), FastParsing);
-  //mol->SetNameFromFilename(filename);
-  mol->ActiveFlag = true;
-  //MolList->insert(mol);
 
   // 4. dissect the molecule into connected subgraphs
Index: src/Parser/PdbParser.cpp
===================================================================
--- src/Parser/PdbParser.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/Parser/PdbParser.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -74,4 +74,6 @@
  */
 void PdbParser::load(istream* file) {
+  // TODO: PdbParser::load implementation
+  ASSERT(false, "Not implemented yet");
 //  string line;
 //  string::size_type location;
@@ -132,6 +134,6 @@
       elementNo[Z] = (elementNo[Z]+1) % 100;   // confine to two digits
       const molecule *mol = (*atomIt)->getMolecule();
-      if (mol == NULL) {  // for homeless atoms, MolNo = 0 is reserved
-        MolNo = 0;
+      if (mol == NULL) {  // for homeless atoms, MolNo = -1 is reserved
+        MolNo = -1;
       } else {
         MolNo = mol->getId();
Index: src/Parser/TremoloParser.cpp
===================================================================
--- src/Parser/TremoloParser.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/Parser/TremoloParser.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -92,4 +92,7 @@
   usedFields.clear();
   molecule *newmol = World::getInstance().createMolecule();
+  newmol->ActiveFlag = true;
+  // TODO: Remove the insertion into molecule when saving does not depend on them anymore. Also, remove molecule.hpp include
+  World::getInstance().getMolecules()->insert(newmol);
   while (file->good()) {
     std::getline(*file, line, '\n');
Index: src/UIElements/CommandLineUI/CommandLineDialog.cpp
===================================================================
--- src/UIElements/CommandLineUI/CommandLineDialog.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/UIElements/CommandLineUI/CommandLineDialog.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -20,30 +20,6 @@
 #include "Helpers/MemDebug.hpp"
 
-#include <iostream>
-#include <vector>
-
-#include <Descriptors/AtomDescriptor.hpp>
-#include <Descriptors/AtomIdDescriptor.hpp>
-#include <Descriptors/MoleculeDescriptor.hpp>
-#include <Descriptors/MoleculeIdDescriptor.hpp>
 #include "CommandLineUI/CommandLineDialog.hpp"
 
-#include "Actions/Values.hpp"
-
-#include "element.hpp"
-#include "periodentafel.hpp"
-#include "CommandLineParser.hpp"
-#include "defs.hpp"
-#include "Helpers/Log.hpp"
-#include "LinearAlgebra/Matrix.hpp"
-#include "periodentafel.hpp"
-#include "Helpers/Verbose.hpp"
-#include "World.hpp"
-#include "Box.hpp"
-
-#include "atom.hpp"
-#include "element.hpp"
-#include "molecule.hpp"
-#include "LinearAlgebra/Vector.hpp"
 
 using namespace std;
@@ -127,332 +103,9 @@
 }
 
-/************************** Query Infrastructure ************************/
-
-CommandLineDialog::EmptyCommandLineQuery::EmptyCommandLineQuery(string title, string _description) :
-    Dialog::EmptyQuery(title, _description)
-{}
-
-CommandLineDialog::EmptyCommandLineQuery::~EmptyCommandLineQuery() {}
-
-bool CommandLineDialog::EmptyCommandLineQuery::handle() {
-  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
-  return true;
+void CommandLineDialog::queryFile(const char* title, string _description){
+  registerQuery(new FileCommandLineQuery(title, _description));
 }
 
-CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(string title, string _description) :
-    Dialog::IntQuery(title, _description)
-{}
-
-CommandLineDialog::IntCommandLineQuery::~IntCommandLineQuery() {}
-
-bool CommandLineDialog::IntCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as<int>();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integer for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::IntsCommandLineQuery::IntsCommandLineQuery(string title, string _description) :
-    Dialog::IntsQuery(title, _description)
-{}
-
-CommandLineDialog::IntsCommandLineQuery::~IntsCommandLineQuery() {}
-
-bool CommandLineDialog::IntsCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integers for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(string title, string _description) :
-    Dialog::BooleanQuery(title, _description)
-{}
-
-CommandLineDialog::BooleanCommandLineQuery::~BooleanCommandLineQuery() {}
-
-bool CommandLineDialog::BooleanCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as<bool>();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing boolean for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title, string _description) :
-    Dialog::StringQuery(title, _description)
-{}
-
-CommandLineDialog::StringCommandLineQuery::~StringCommandLineQuery() {}
-
-bool CommandLineDialog::StringCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as<string>();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing string for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::StringsCommandLineQuery::StringsCommandLineQuery(string title, string _description) :
-    Dialog::StringsQuery(title, _description)
-{}
-
-CommandLineDialog::StringsCommandLineQuery::~StringsCommandLineQuery() {}
-
-bool CommandLineDialog::StringsCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as< vector<string> >();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing strings for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(string title, string _description) :
-    Dialog::DoubleQuery(title, _description)
-{}
-
-CommandLineDialog::DoubleCommandLineQuery::~DoubleCommandLineQuery() {}
-
-bool CommandLineDialog::DoubleCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as<double>();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing double for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::DoublesCommandLineQuery::DoublesCommandLineQuery(string title, string _description) :
-    Dialog::DoublesQuery(title, _description)
-{}
-
-CommandLineDialog::DoublesCommandLineQuery::~DoublesCommandLineQuery() {}
-
-bool CommandLineDialog::DoublesCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing doubles for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(string title, string _description) :
-    Dialog::AtomQuery(title, _description)
-{}
-
-CommandLineDialog::AtomCommandLineQuery::~AtomCommandLineQuery() {}
-
-bool CommandLineDialog::AtomCommandLineQuery::handle() {
-  int IdxOfAtom = -1;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>();
-    tmp = World::getInstance().getAtom(AtomById(IdxOfAtom));
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing atom for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::AtomsCommandLineQuery::AtomsCommandLineQuery(string title, string _description) :
-    Dialog::AtomsQuery(title, _description)
-{}
-
-CommandLineDialog::AtomsCommandLineQuery::~AtomsCommandLineQuery() {}
-
-bool CommandLineDialog::AtomsCommandLineQuery::handle() {
-  std::vector<int> IdxOfAtom;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
-    for (std::vector<int>::iterator iter = IdxOfAtom.begin(); iter != IdxOfAtom.end(); ++iter) {
-      temp = World::getInstance().getAtom(AtomById(*iter));
-      if (temp)
-        tmp.push_back(temp);
-    }
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing atoms for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, string _description) :
-    Dialog::MoleculeQuery(title, _description)
-{}
-
-CommandLineDialog::MoleculeCommandLineQuery::~MoleculeCommandLineQuery() {}
-
-bool CommandLineDialog::MoleculeCommandLineQuery::handle() {
-  int IdxOfMol = -1;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as<int>();
-    tmp = World::getInstance().getMolecule(MoleculeById(IdxOfMol));
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing molecule for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::MoleculesCommandLineQuery::MoleculesCommandLineQuery(string title, string _description) :
-    Dialog::MoleculesQuery(title, _description)
-{}
-
-CommandLineDialog::MoleculesCommandLineQuery::~MoleculesCommandLineQuery() {}
-
-bool CommandLineDialog::MoleculesCommandLineQuery::handle() {
-  std::vector<int> IdxOfMol;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
-    for (std::vector<int>::iterator iter = IdxOfMol.begin(); iter != IdxOfMol.end(); ++iter) {
-      temp = World::getInstance().getMolecule(MoleculeById(*iter));
-      if (temp)
-        tmp.push_back(temp);
-    }
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing molecules for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(string title, bool _check, string _description) :
-    Dialog::VectorQuery(title,_check, _description)
-{}
-
-CommandLineDialog::VectorCommandLineQuery::~VectorCommandLineQuery()
-{}
-
-bool CommandLineDialog::VectorCommandLineQuery::handle() {
-  VectorValue temp;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >();
-    tmp[0] = temp.x;
-    tmp[1] = temp.y;
-    tmp[2] = temp.z;
-    if ((check) && (!World::getInstance().getDomain().isInside(tmp))) {
-      DoeLog(1) && (eLog() << Verbose(1) << "Vector " << tmp << " would be outside of box domain." << endl);
-      return false;
-    }
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing vector for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(string title, bool _check, string _description) :
-    Dialog::VectorsQuery(title,_check, _description)
-{}
-
-CommandLineDialog::VectorsCommandLineQuery::~VectorsCommandLineQuery()
-{}
-
-bool CommandLineDialog::VectorsCommandLineQuery::handle() {
-  std::vector<VectorValue> temporary;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    temporary = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<VectorValue> >();
-    for(std::vector<VectorValue>::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) {
-      temp[0] = (*iter).x;
-      temp[1] = (*iter).y;
-      temp[2] = (*iter).z;
-      if ((!check) || (World::getInstance().getDomain().isInside(temp)))
-        tmp.push_back(temp);
-      else
-        DoeLog(1) && (eLog() << Verbose(1) << "Vector " << temp << " would be outside of box domain." << endl);
-    }
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing vectors for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(string title, string _description) :
-    Dialog::BoxQuery(title, _description)
-{}
-
-CommandLineDialog::BoxCommandLineQuery::~BoxCommandLineQuery()
-{}
-
-bool CommandLineDialog::BoxCommandLineQuery::handle() {
-  BoxValue temp;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    temp = CommandLineParser::getInstance().vm[getTitle()].as< BoxValue >();
-    Matrix M;
-    M.set(0,0, temp.xx);
-    M.set(0,1, temp.yx);
-    M.set(0,2, temp.zx);
-    M.set(1,0, temp.yx);
-    M.set(1,1, temp.yy);
-    M.set(1,2, temp.zy);
-    M.set(2,0, temp.zx);
-    M.set(2,1, temp.zy);
-    M.set(2,2, temp.zz);
-    tmp.setM(M);
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing symmetric box matrix for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(string title, string _description) :
-    Dialog::ElementQuery(title, _description)
-{}
-
-CommandLineDialog::ElementCommandLineQuery::~ElementCommandLineQuery()
-{}
-
-bool CommandLineDialog::ElementCommandLineQuery::handle() {
-  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
-  periodentafel *periode = World::getInstance().getPeriode();
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    int Z = CommandLineParser::getInstance().vm[getTitle()].as< int >();
-    tmp = periode->FindElement(Z);
-    ASSERT(tmp != NULL, "Invalid element specified in ElementCommandLineQuery");
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing element for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::ElementsCommandLineQuery::ElementsCommandLineQuery(string title, string _description) :
-    Dialog::ElementsQuery(title, _description)
-{}
-
-CommandLineDialog::ElementsCommandLineQuery::~ElementsCommandLineQuery()
-{}
-
-bool CommandLineDialog::ElementsCommandLineQuery::handle() {
-  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
-  periodentafel *periode = World::getInstance().getPeriode();
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    vector<int> AllElements = CommandLineParser::getInstance().vm[getTitle()].as< vector<int> >();
-    for (vector<int>::iterator ZRunner = AllElements.begin(); ZRunner != AllElements.end(); ++ZRunner) {
-      temp = periode->FindElement(*ZRunner);
-      ASSERT(temp != NULL, "Invalid element specified in ElementCommandLineQuery");
-      tmp.push_back(temp);
-    }
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing elements for " << getTitle() << "." << endl);
-    return false;
-  }
-}
+/************************** Query Infrastructure ************************/
+/*       ---> shifted to folder Query                                   */
+/************************************************************************/
Index: src/UIElements/CommandLineUI/CommandLineDialog.hpp
===================================================================
--- src/UIElements/CommandLineUI/CommandLineDialog.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/UIElements/CommandLineUI/CommandLineDialog.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -44,4 +44,5 @@
   virtual void queryElement(const char*, std::string = "");
   virtual void queryElements(const char*, std::string = "");
+  virtual void queryFile(const char*, std::string = "");
 
 protected:
@@ -165,4 +166,11 @@
     virtual bool handle();
   };
+
+  class FileCommandLineQuery : public Dialog::FileQuery {
+  public:
+    FileCommandLineQuery(std::string title, std::string _description = "");
+    virtual ~FileCommandLineQuery();
+    virtual bool handle();
+  };
 };
 
Index: src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,53 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "CommandLineParser.hpp"
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "World.hpp"
+#include "Box.hpp"
+
+using namespace std;
+
+CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(string title, string _description) :
+    Dialog::AtomQuery(title, _description)
+{}
+
+CommandLineDialog::AtomCommandLineQuery::~AtomCommandLineQuery() {}
+
+bool CommandLineDialog::AtomCommandLineQuery::handle() {
+  int IdxOfAtom = -1;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    tmp = World::getInstance().getAtom(AtomById(IdxOfAtom));
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing atom for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,52 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomsCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "World.hpp"
+
+CommandLineDialog::AtomsCommandLineQuery::AtomsCommandLineQuery(string title, string _description) :
+    Dialog::AtomsQuery(title, _description)
+{}
+
+CommandLineDialog::AtomsCommandLineQuery::~AtomsCommandLineQuery() {}
+
+bool CommandLineDialog::AtomsCommandLineQuery::handle() {
+  std::vector<int> IdxOfAtom;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
+    for (std::vector<int>::iterator iter = IdxOfAtom.begin(); iter != IdxOfAtom.end(); ++iter) {
+      temp = World::getInstance().getAtom(AtomById(*iter));
+      if (temp)
+        tmp.push_back(temp);
+    }
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing atoms for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,43 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * BooleanCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(string title, string _description) :
+    Dialog::BooleanQuery(title, _description)
+{}
+
+CommandLineDialog::BooleanCommandLineQuery::~BooleanCommandLineQuery() {}
+
+bool CommandLineDialog::BooleanCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<bool>();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing boolean for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,58 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * BoxCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Actions/Values.hpp"
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Matrix.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(string title, string _description) :
+    Dialog::BoxQuery(title, _description)
+{}
+
+CommandLineDialog::BoxCommandLineQuery::~BoxCommandLineQuery()
+{}
+
+bool CommandLineDialog::BoxCommandLineQuery::handle() {
+  BoxValue temp;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    temp = CommandLineParser::getInstance().vm[getTitle()].as< BoxValue >();
+    Matrix M;
+    M.set(0,0, temp.xx);
+    M.set(0,1, temp.yx);
+    M.set(0,2, temp.zx);
+    M.set(1,0, temp.yx);
+    M.set(1,1, temp.yy);
+    M.set(1,2, temp.zy);
+    M.set(2,0, temp.zx);
+    M.set(2,1, temp.zy);
+    M.set(2,2, temp.zz);
+    tmp.setM(M);
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing symmetric box matrix for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,44 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * DoubleCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+
+CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(string title, string _description) :
+    Dialog::DoubleQuery(title, _description)
+{}
+
+CommandLineDialog::DoubleCommandLineQuery::~DoubleCommandLineQuery() {}
+
+bool CommandLineDialog::DoubleCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<double>();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing double for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,43 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * DoublesCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::DoublesCommandLineQuery::DoublesCommandLineQuery(string title, string _description) :
+    Dialog::DoublesQuery(title, _description)
+{}
+
+CommandLineDialog::DoublesCommandLineQuery::~DoublesCommandLineQuery() {}
+
+bool CommandLineDialog::DoublesCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing doubles for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,51 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ElementCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(string title, string _description) :
+    Dialog::ElementQuery(title, _description)
+{}
+
+CommandLineDialog::ElementCommandLineQuery::~ElementCommandLineQuery()
+{}
+
+bool CommandLineDialog::ElementCommandLineQuery::handle() {
+  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
+  periodentafel *periode = World::getInstance().getPeriode();
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    int Z = CommandLineParser::getInstance().vm[getTitle()].as< int >();
+    tmp = periode->FindElement(Z);
+    ASSERT(tmp != NULL, "Invalid element specified in ElementCommandLineQuery");
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing element for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,54 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ElementsCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+CommandLineDialog::ElementsCommandLineQuery::ElementsCommandLineQuery(string title, string _description) :
+    Dialog::ElementsQuery(title, _description)
+{}
+
+CommandLineDialog::ElementsCommandLineQuery::~ElementsCommandLineQuery()
+{}
+
+bool CommandLineDialog::ElementsCommandLineQuery::handle() {
+  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
+  periodentafel *periode = World::getInstance().getPeriode();
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    vector<int> AllElements = CommandLineParser::getInstance().vm[getTitle()].as< vector<int> >();
+    for (vector<int>::iterator ZRunner = AllElements.begin(); ZRunner != AllElements.end(); ++ZRunner) {
+      temp = periode->FindElement(*ZRunner);
+      ASSERT(temp != NULL, "Invalid element specified in ElementCommandLineQuery");
+      tmp.push_back(temp);
+    }
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing elements for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,40 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * EmptyCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::EmptyCommandLineQuery::EmptyCommandLineQuery(string title, string _description) :
+    Dialog::EmptyQuery(title, _description)
+{}
+
+CommandLineDialog::EmptyCommandLineQuery::~EmptyCommandLineQuery() {}
+
+bool CommandLineDialog::EmptyCommandLineQuery::handle() {
+  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
+  return true;
+}
+
Index: src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,43 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * FileCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::FileCommandLineQuery::FileCommandLineQuery(string title, string _description) :
+    Dialog::FileQuery(title, _description)
+{}
+
+CommandLineDialog::FileCommandLineQuery::~FileCommandLineQuery() {}
+
+bool CommandLineDialog::FileCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as< boost::filesystem::path >();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing string for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,43 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IntCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(string title, string _description) :
+    Dialog::IntQuery(title, _description)
+{}
+
+CommandLineDialog::IntCommandLineQuery::~IntCommandLineQuery() {}
+
+bool CommandLineDialog::IntCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integer for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,43 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IntsCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::IntsCommandLineQuery::IntsCommandLineQuery(string title, string _description) :
+    Dialog::IntsQuery(title, _description)
+{}
+
+CommandLineDialog::IntsCommandLineQuery::~IntsCommandLineQuery() {}
+
+bool CommandLineDialog::IntsCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integers for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,47 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MoleculeCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, string _description) :
+    Dialog::MoleculeQuery(title, _description)
+{}
+
+CommandLineDialog::MoleculeCommandLineQuery::~MoleculeCommandLineQuery() {}
+
+bool CommandLineDialog::MoleculeCommandLineQuery::handle() {
+  int IdxOfMol = -1;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    tmp = World::getInstance().getMolecule(MoleculeById(IdxOfMol));
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing molecule for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,52 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MoleculesCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "World.hpp"
+
+CommandLineDialog::MoleculesCommandLineQuery::MoleculesCommandLineQuery(string title, string _description) :
+    Dialog::MoleculesQuery(title, _description)
+{}
+
+CommandLineDialog::MoleculesCommandLineQuery::~MoleculesCommandLineQuery() {}
+
+bool CommandLineDialog::MoleculesCommandLineQuery::handle() {
+  std::vector<int> IdxOfMol;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
+    for (std::vector<int>::iterator iter = IdxOfMol.begin(); iter != IdxOfMol.end(); ++iter) {
+      temp = World::getInstance().getMolecule(MoleculeById(*iter));
+      if (temp)
+        tmp.push_back(temp);
+    }
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing molecules for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,43 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * StringCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title, string _description) :
+    Dialog::StringQuery(title, _description)
+{}
+
+CommandLineDialog::StringCommandLineQuery::~StringCommandLineQuery() {}
+
+bool CommandLineDialog::StringCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<string>();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing string for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,43 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * StringsCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::StringsCommandLineQuery::StringsCommandLineQuery(string title, string _description) :
+    Dialog::StringsQuery(title, _description)
+{}
+
+CommandLineDialog::StringsCommandLineQuery::~StringsCommandLineQuery() {}
+
+bool CommandLineDialog::StringsCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as< vector<string> >();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing strings for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,56 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * VectorCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Actions/Values.hpp"
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "Box.hpp"
+#include "World.hpp"
+
+CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(string title, bool _check, string _description) :
+    Dialog::VectorQuery(title,_check, _description)
+{}
+
+CommandLineDialog::VectorCommandLineQuery::~VectorCommandLineQuery()
+{}
+
+bool CommandLineDialog::VectorCommandLineQuery::handle() {
+  VectorValue temp;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >();
+    tmp[0] = temp.x;
+    tmp[1] = temp.y;
+    tmp[2] = temp.z;
+    if ((check) && (!World::getInstance().getDomain().isInside(tmp))) {
+      DoeLog(1) && (eLog() << Verbose(1) << "Vector " << tmp << " would be outside of box domain." << endl);
+      return false;
+    }
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing vector for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,58 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * VectorsCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <vector>
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Actions/Values.hpp"
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "World.hpp"
+
+CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(string title, bool _check, string _description) :
+    Dialog::VectorsQuery(title,_check, _description)
+{}
+
+CommandLineDialog::VectorsCommandLineQuery::~VectorsCommandLineQuery()
+{}
+
+bool CommandLineDialog::VectorsCommandLineQuery::handle() {
+  std::vector<VectorValue> temporary;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    temporary = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<VectorValue> >();
+    for(std::vector<VectorValue>::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) {
+      temp[0] = (*iter).x;
+      temp[1] = (*iter).y;
+      temp[2] = (*iter).z;
+      if ((!check) || (World::getInstance().getDomain().isInside(temp)))
+        tmp.push_back(temp);
+      else
+        DoeLog(1) && (eLog() << Verbose(1) << "Vector " << temp << " would be outside of box domain." << endl);
+    }
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing vectors for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/Dialog.cpp
===================================================================
--- src/UIElements/Dialog.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/UIElements/Dialog.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -23,12 +23,13 @@
 #include "Actions/ValueStorage.hpp"
 
+#include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "atom.hpp"
-#include "Box.hpp"
-#include "element.hpp"
-#include "molecule.hpp"
-#include "LinearAlgebra/BoxVector.hpp"
-#include "LinearAlgebra/Vector.hpp"
-#include "LinearAlgebra/Matrix.hpp"
+
+class Atom;
+class Box;
+class element;
+class Matrix;
+class molecule;
+class Vector;
 
 using namespace std;
@@ -180,229 +181,10 @@
 }
 
-/****************** Query types Infrastructure **************************/
-
-// Base class
-Dialog::Query::Query(string _title, string _description) :
-    title(_title),
-    description(_description)
-{}
-
-Dialog::Query::~Query() {}
-
-const std::string Dialog::Query::getTitle() const{
-  return title;
+template <> void Dialog::query< boost::filesystem::path >(const char *token, std::string description)
+{
+  queryFile(token, description);
 }
 
-const std::string Dialog::Query::getDescription() const{
-  return description;
-}
-// empty Queries
-
-Dialog::EmptyQuery::EmptyQuery(string title, std::string description) :
-    Query(title, description)
-{}
-
-Dialog::EmptyQuery::~EmptyQuery() {}
-
-void Dialog::EmptyQuery::setResult() {
-}
-
-// Int Queries
-
-Dialog::IntQuery::IntQuery(string title, std::string description) :
-    Query(title, description)
-{}
-
-Dialog::IntQuery::~IntQuery() {}
-
-void Dialog::IntQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Ints Queries
-
-Dialog::IntsQuery::IntsQuery(string title, std::string description) :
-    Query(title, description)
-{}
-
-Dialog::IntsQuery::~IntsQuery() {}
-
-void Dialog::IntsQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Bool Queries
-
-Dialog::BooleanQuery::BooleanQuery(string title,std::string description) :
-    Query(title, description)
-{}
-
-Dialog::BooleanQuery::~BooleanQuery() {}
-
-void Dialog::BooleanQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// String Queries
-
-Dialog::StringQuery::StringQuery(string title,std::string _description) :
-    Query(title, _description)
-{}
-
-Dialog::StringQuery::~StringQuery() {};
-
-void Dialog::StringQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Strings Queries
-
-Dialog::StringsQuery::StringsQuery(string title,std::string _description) :
-    Query(title, _description)
-{}
-
-Dialog::StringsQuery::~StringsQuery() {};
-
-void Dialog::StringsQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Double Queries
-
-Dialog::DoubleQuery::DoubleQuery(string title, std::string _description) :
-    Query(title, _description)
-{}
-
-Dialog::DoubleQuery::~DoubleQuery() {};
-
-void Dialog::DoubleQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Doubles Queries
-
-Dialog::DoublesQuery::DoublesQuery(string title, std::string _description) :
-    Query(title, _description)
-{}
-
-Dialog::DoublesQuery::~DoublesQuery() {};
-
-void Dialog::DoublesQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-
-// Atom Queries
-
-Dialog::AtomQuery::AtomQuery(string title, std::string _description) :
-    Query(title, _description),
-    tmp(0)
-{}
-
-Dialog::AtomQuery::~AtomQuery() {}
-
-void Dialog::AtomQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Atoms Queries
-
-Dialog::AtomsQuery::AtomsQuery(string title, std::string _description) :
-    Query(title, _description),
-    tmp(0)
-{}
-
-Dialog::AtomsQuery::~AtomsQuery() {}
-
-void Dialog::AtomsQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Molecule Queries
-
-Dialog::MoleculeQuery::MoleculeQuery(string title, std::string _description) :
-    Query(title, _description),
-    tmp(0)
-{}
-
-Dialog::MoleculeQuery::~MoleculeQuery() {}
-
-void Dialog::MoleculeQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Molecules Queries
-
-Dialog::MoleculesQuery::MoleculesQuery(string title, std::string _description) :
-    Query(title, _description),
-    tmp(0)
-{}
-
-Dialog::MoleculesQuery::~MoleculesQuery() {}
-
-void Dialog::MoleculesQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Vector Queries
-
-Dialog::VectorQuery::VectorQuery(std::string title,bool _check, std::string _description) :
-  Query(title, _description),
-  check(_check)
-{}
-
-Dialog::VectorQuery::~VectorQuery()
-{}
-
-void Dialog::VectorQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Vectors Queries
-
-Dialog::VectorsQuery::VectorsQuery(std::string title,bool _check, std::string _description) :
-  Query(title, _description),
-  check(_check)
-{}
-
-Dialog::VectorsQuery::~VectorsQuery()
-{}
-
-void Dialog::VectorsQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Box Queries
-
-Dialog::BoxQuery::BoxQuery(std::string title, std::string _description) :
-  Query(title, _description)
-{}
-
-Dialog::BoxQuery::~BoxQuery()
-{}
-
-void Dialog::BoxQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Element Queries
-Dialog::ElementQuery::ElementQuery(std::string title, std::string _description) :
-  Query(title, _description)
-  {}
-
-Dialog::ElementQuery::~ElementQuery(){}
-
-void Dialog::ElementQuery::setResult(){
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Elements Queries
-Dialog::ElementsQuery::ElementsQuery(std::string title, std::string _description) :
-  Query(title, _description)
-  {}
-
-Dialog::ElementsQuery::~ElementsQuery(){}
-
-void Dialog::ElementsQuery::setResult(){
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
+/************************** Query Infrastructure ************************/
+/*       ---> shifted to folder Query                                   */
+/************************************************************************/
Index: src/UIElements/Dialog.hpp
===================================================================
--- src/UIElements/Dialog.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/UIElements/Dialog.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -13,4 +13,6 @@
 #include<vector>
 
+#include <boost/filesystem.hpp>
+
 #include "Box.hpp"
 #include "LinearAlgebra/Vector.hpp"
@@ -24,11 +26,11 @@
 /** Dialog is one of the two main classes of the UIFactory base class.
  *
- * The Dialog is meant for asking the user for information needed to perform actions he
- * desires, such as asking for a position in space or a length.
+ * The Dialog is meant for asking the user for information needed to perform
+ * actions he desires, such as asking for a position in space or a length.
  *
- * For this purpose there is the base class Query and numerous specializations for each
- * of the types to be asked. There are primitives integer, doubles and string, but also
- * advanced types such as element, molecule or Vector. There is also an empty query for
- * displaying text.
+ * For this purpose there is the base class Query and numerous specializations
+ * for each of the types to be asked. There are primitives integer, doubles and
+ * string, but also advanced types such as element, molecule or Vector. There
+ * is also an empty query for displaying text.
  */
 class Dialog
@@ -57,4 +59,5 @@
   virtual void queryElement(const char*, std::string = "")=0;
   virtual void queryElements(const char*, std::string = "")=0;
+  virtual void queryFile(const char*, std::string = "")=0;
 
   virtual bool display();
@@ -76,5 +79,30 @@
   //due to lack of common code for query types as well as GUI-Types (all subtypes differ a lot)
 
-  //base class for all queries
+  /** Base class for all queries.
+   *
+   *
+   * <h1>How to add another query?</h1>
+   *
+   * Let's say  we want to query for a type called \a Value.
+   *
+   * Then, we do the following:
+   *  -# Add a class ValueQuery inside class Dialog, the class contains
+   *    -# constructor/destructor (latter virtual! because of derived class)
+   *    -# virtual bool handle() and virtual void setResult()
+   *    -# a protected member tmp of type Value (NOTE: herein the result is stored)
+   *    -# if temporaries for conversion are needed put them in here
+   *  -# add a function queryValue
+   *  -# now, for each of the GUIs we basically have to repeat the above, i.e.
+   *     add the class and the function that implement the virtual ones above.
+   *    -# QT: an extra class called ValueQtQueryPipe that actually handles
+   *       showing dialogs to obtain the value and placing it into the \a tmp
+   *       variable (via a given pointer to it as reference). handle() will
+   *       simply return true. This is needed because of a restriction of Qt4:
+   *       its meta-object-compiler does not like nested classes.
+   *    -# CommandLine: nothing special, handle() imports value from \a
+   *       CommandLineParser and sets the tmp variable.
+   *    -# Text: nothing special, handle() queries the user and sets the tmp
+   *       variable
+   */
   class Query {
     friend class Dialog;
@@ -271,4 +299,14 @@
   };
 
+  class FileQuery : public Query {
+  public:
+    FileQuery(std::string title, std::string _description = "");
+    virtual ~FileQuery();
+    virtual bool handle()=0;
+    virtual void setResult();
+  protected:
+    boost::filesystem::path tmp;
+  };
+
 void registerQuery(Query* query);
 
Index: src/UIElements/Makefile.am
===================================================================
--- src/UIElements/Makefile.am	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/UIElements/Makefile.am	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -41,4 +41,23 @@
   ${TEXTUISOURCE} \
   ${VIEWSOURCE} \
+  Query/AtomQuery.cpp \
+  Query/AtomsQuery.cpp \
+  Query/BooleanQuery.cpp \
+  Query/BoxQuery.cpp \
+  Query/DoubleQuery.cpp \
+  Query/DoublesQuery.cpp \
+  Query/ElementQuery.cpp \
+  Query/ElementsQuery.cpp \
+  Query/EmptyQuery.cpp \
+  Query/FileQuery.cpp \
+  Query/IntQuery.cpp \
+  Query/IntsQuery.cpp \
+  Query/MoleculeQuery.cpp \
+  Query/MoleculesQuery.cpp \
+  Query/Query.cpp \
+  Query/StringQuery.cpp \
+  Query/StringsQuery.cpp \
+  Query/VectorQuery.cpp \
+  Query/VectorsQuery.cpp \
   Dialog.cpp \
   MainWindow.cpp
@@ -54,4 +73,22 @@
 
 TEXTUISOURCE = \
+  TextUI/Query/AtomsTextQuery.cpp \
+  TextUI/Query/AtomTextQuery.cpp \
+  TextUI/Query/BooleanTextQuery.cpp \
+  TextUI/Query/BoxTextQuery.cpp \
+  TextUI/Query/DoubleTextQuery.cpp \
+  TextUI/Query/DoublesTextQuery.cpp \
+  TextUI/Query/ElementTextQuery.cpp \
+  TextUI/Query/ElementsTextQuery.cpp \
+  TextUI/Query/EmptyTextQuery.cpp \
+  TextUI/Query/FileTextQuery.cpp \
+  TextUI/Query/IntTextQuery.cpp \
+  TextUI/Query/IntsTextQuery.cpp \
+  TextUI/Query/MoleculesTextQuery.cpp \
+  TextUI/Query/MoleculeTextQuery.cpp \
+  TextUI/Query/StringTextQuery.cpp \
+  TextUI/Query/StringsTextQuery.cpp \
+  TextUI/Query/VectorTextQuery.cpp \
+  TextUI/Query/VectorsTextQuery.cpp \
   TextUI/TextDialog.cpp \
   TextUI/TextStatusIndicator.cpp \
@@ -65,4 +102,22 @@
 
 COMMANDLINEUISOURCE = \
+  CommandLineUI/Query/AtomCommandLineQuery.cpp \
+  CommandLineUI/Query/AtomsCommandLineQuery.cpp \
+  CommandLineUI/Query/BooleanCommandLineQuery.cpp \
+  CommandLineUI/Query/BoxCommandLineQuery.cpp \
+  CommandLineUI/Query/DoubleCommandLineQuery.cpp \
+  CommandLineUI/Query/DoublesCommandLineQuery.cpp \
+  CommandLineUI/Query/ElementCommandLineQuery.cpp \
+  CommandLineUI/Query/ElementsCommandLineQuery.cpp \
+  CommandLineUI/Query/EmptyCommandLineQuery.cpp \
+  CommandLineUI/Query/FileCommandLineQuery.cpp \
+  CommandLineUI/Query/IntCommandLineQuery.cpp \
+  CommandLineUI/Query/IntsCommandLineQuery.cpp \
+  CommandLineUI/Query/MoleculeCommandLineQuery.cpp \
+  CommandLineUI/Query/MoleculesCommandLineQuery.cpp \
+  CommandLineUI/Query/StringCommandLineQuery.cpp \
+  CommandLineUI/Query/StringsCommandLineQuery.cpp \
+  CommandLineUI/Query/VectorCommandLineQuery.cpp \
+  CommandLineUI/Query/VectorsCommandLineQuery.cpp \
   CommandLineUI/CommandLineDialog.cpp \
   CommandLineUI/CommandLineStatusIndicator.cpp \
Index: c/UIElements/Menu/QT4/QTMenu.cpp
===================================================================
--- src/UIElements/Menu/QT4/QTMenu.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * QTMenu.cpp
- *
- *  Created on: Jan 15, 2010
- *      Author: crueger
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "Menu/QT4/QTMenu.hpp"
-
-#include <Qt/qaction.h>
-
-#include "Helpers/MemDebug.hpp"
-
-#include "Menu/MenuItem.hpp"
-
-QTMenu::QTMenu(const char * _title) :
-  QMenu(_title)
-{}
-
-QTMenu::~QTMenu()
-{
-  // yay... Just like Mario Bros.
-  for(list<QTMenuPipe*>::iterator it=plumbing.begin(); it != plumbing.end(); it++)
-    delete (*it);
-}
-
-void QTMenu::addItem(MenuItem* item) {
-  const string description = item->getDescription();
-  QAction *action = addAction(QString(description.c_str()));
-  QTMenuPipe *pipe = new QTMenuPipe(item,action);
-  QObject::connect(action, SIGNAL(triggered()),pipe,SLOT(called()));
-  plumbing.push_back(pipe);
-}
-
-void QTMenu::removeItem(MenuItem* item) {
-  list<QTMenuPipe*>::iterator iter;
-  for(iter=plumbing.begin(); iter!=plumbing.end(); iter++){
-    delete (*iter);
-  }
-}
-
-void QTMenu::display() {
-
-}
-
-QTMenuPipe::QTMenuPipe(MenuItem *_item, QAction *_action) :
-    theItem(_item), theAction(_action)
-{}
-
-QTMenuPipe::~QTMenuPipe() {
-  delete theAction;
-  delete theItem;
-}
-
-void QTMenuPipe::called() {
-  theItem->doTrigger();
-}
Index: c/UIElements/Menu/QT4/QTMenu.hpp
===================================================================
--- src/UIElements/Menu/QT4/QTMenu.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/*
- * QTMenu.hpp
- *
- *  Created on: Jan 15, 2010
- *      Author: crueger
- */
-
-#ifndef QTMENU_HPP_
-#define QTMENU_HPP_
-
-#include <list>
-
-#include <QtGui/QMenu>
-#include <QtCore/QObject>
-
-#include "Menu/Menu.hpp"
-
-class QTMenuPipe;
-
-class QTMenu : public QMenu, public Menu
-{
-  Q_OBJECT
-
-public:
-  QTMenu(const char *);
-  virtual ~QTMenu();
-
-  virtual void addItem(MenuItem*);
-  virtual void removeItem(MenuItem*);
-  virtual void display();
-private:
-  list<QTMenuPipe*> plumbing;
-};
-
-// This handles the plumbing from QT to internal Items
-// Slots from QT are redirected to internal methods.
-// This way methods can be used where no QT is available
-class QTMenuPipe : public QObject {
-  Q_OBJECT
-public:
-  QTMenuPipe(MenuItem*,QAction*);
-  virtual ~QTMenuPipe();
-public slots:
-  void called();
-private:
-  MenuItem *theItem;
-  QAction *theAction;
-};
-
-#endif /* QTMENU_HPP_ */
Index: src/UIElements/Menu/Qt4/QtMenu.cpp
===================================================================
--- src/UIElements/Menu/Qt4/QtMenu.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Menu/Qt4/QtMenu.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,69 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * QtMenu.cpp
+ *
+ *  Created on: Jan 15, 2010
+ *      Author: crueger
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Menu/Qt4/QtMenu.hpp"
+
+#include <Qt/qaction.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Menu/MenuItem.hpp"
+
+QtMenu::QtMenu(const char * _title) :
+  QMenu(_title)
+{}
+
+QtMenu::~QtMenu()
+{
+  // yay... Just like Mario Bros.
+  for(list<QtMenuPipe*>::iterator it=plumbing.begin(); it != plumbing.end(); it++)
+    delete (*it);
+}
+
+void QtMenu::addItem(MenuItem* item) {
+  const string description = item->getDescription();
+  QAction *action = addAction(QString(description.c_str()));
+  QtMenuPipe *pipe = new QtMenuPipe(item,action);
+  QObject::connect(action, SIGNAL(triggered()),pipe,SLOT(called()));
+  plumbing.push_back(pipe);
+}
+
+void QtMenu::removeItem(MenuItem* item) {
+  list<QtMenuPipe*>::iterator iter;
+  for(iter=plumbing.begin(); iter!=plumbing.end(); iter++){
+    delete (*iter);
+  }
+}
+
+void QtMenu::display() {
+
+}
+
+QtMenuPipe::QtMenuPipe(MenuItem *_item, QAction *_action) :
+    theItem(_item), theAction(_action)
+{}
+
+QtMenuPipe::~QtMenuPipe() {
+  delete theAction;
+  delete theItem;
+}
+
+void QtMenuPipe::called() {
+  theItem->doTrigger();
+}
Index: src/UIElements/Menu/Qt4/QtMenu.hpp
===================================================================
--- src/UIElements/Menu/Qt4/QtMenu.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Menu/Qt4/QtMenu.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,50 @@
+/*
+ * QtMenu.hpp
+ *
+ *  Created on: Jan 15, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTMENU_HPP_
+#define QTMENU_HPP_
+
+#include <list>
+
+#include <QtGui/QMenu>
+#include <QtCore/QObject>
+
+#include "Menu/Menu.hpp"
+
+class QtMenuPipe;
+
+class QtMenu : public QMenu, public Menu
+{
+  Q_OBJECT
+
+public:
+  QtMenu(const char *);
+  virtual ~QtMenu();
+
+  virtual void addItem(MenuItem*);
+  virtual void removeItem(MenuItem*);
+  virtual void display();
+private:
+  list<QtMenuPipe*> plumbing;
+};
+
+// This handles the plumbing from QT to internal Items
+// Slots from QT are redirected to internal methods.
+// This way methods can be used where no QT is available
+class QtMenuPipe : public QObject {
+  Q_OBJECT
+public:
+  QtMenuPipe(MenuItem*,QAction*);
+  virtual ~QtMenuPipe();
+public slots:
+  void called();
+private:
+  MenuItem *theItem;
+  QAction *theAction;
+};
+
+#endif /* QTMENU_HPP_ */
Index: c/UIElements/QT4/IntQTQuery.ui
===================================================================
--- src/UIElements/QT4/IntQTQuery.ui	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,68 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Form</class>
- <widget class="QWidget" name="Form">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <widget class="QLabel" name="label">
-   <property name="geometry">
-    <rect>
-     <x>20</x>
-     <y>30</y>
-     <width>59</width>
-     <height>17</height>
-    </rect>
-   </property>
-   <property name="text">
-    <string>TextLabel</string>
-   </property>
-  </widget>
-  <widget class="QLineEdit" name="lineEdit">
-   <property name="geometry">
-    <rect>
-     <x>100</x>
-     <y>20</y>
-     <width>113</width>
-     <height>27</height>
-    </rect>
-   </property>
-  </widget>
-  <widget class="QPushButton" name="pushButton">
-   <property name="geometry">
-    <rect>
-     <x>20</x>
-     <y>70</y>
-     <width>92</width>
-     <height>27</height>
-    </rect>
-   </property>
-   <property name="text">
-    <string>OK</string>
-   </property>
-  </widget>
-  <widget class="QPushButton" name="pushButton_2">
-   <property name="geometry">
-    <rect>
-     <x>140</x>
-     <y>70</y>
-     <width>92</width>
-     <height>27</height>
-    </rect>
-   </property>
-   <property name="text">
-    <string>Cancel</string>
-   </property>
-  </widget>
- </widget>
- <resources/>
- <connections/>
-</ui>
Index: c/UIElements/QT4/IntsQTQuery.ui
===================================================================
--- src/UIElements/QT4/IntsQTQuery.ui	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,151 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Form</class>
- <widget class="QWidget" name="Form">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>740</width>
-    <height>444</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <widget class="QWidget" name="horizontalLayoutWidget">
-   <property name="geometry">
-    <rect>
-     <x>10</x>
-     <y>240</y>
-     <width>421</width>
-     <height>51</height>
-    </rect>
-   </property>
-   <layout class="QHBoxLayout" name="horizontalLayout">
-    <item>
-     <spacer name="horizontalSpacer">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>40</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item>
-     <widget class="QPushButton" name="pushButton">
-      <property name="text">
-       <string>OK</string>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <widget class="QPushButton" name="pushButton_2">
-      <property name="text">
-       <string>Cancel</string>
-      </property>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QWidget" name="verticalLayoutWidget">
-   <property name="geometry">
-    <rect>
-     <x>280</x>
-     <y>0</y>
-     <width>160</width>
-     <height>221</height>
-    </rect>
-   </property>
-   <layout class="QVBoxLayout" name="verticalLayout">
-    <item>
-     <widget class="QLabel" name="label">
-      <property name="text">
-       <string>Enter Integer:</string>
-      </property>
-      <property name="buddy">
-       <cstring>lineEdit</cstring>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <widget class="QLineEdit" name="lineEdit">
-      <property name="minimumSize">
-       <size>
-        <width>100</width>
-        <height>20</height>
-       </size>
-      </property>
-      <property name="toolTip">
-       <string>Enter an integer and press Add.</string>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <widget class="QPushButton" name="pushButton_3">
-      <property name="enabled">
-       <bool>false</bool>
-      </property>
-      <property name="text">
-       <string>Add</string>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <widget class="QPushButton" name="pushButton_4">
-      <property name="enabled">
-       <bool>false</bool>
-      </property>
-      <property name="text">
-       <string>Remove</string>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <spacer name="verticalSpacer">
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <property name="sizeHint" stdset="0">
-       <size>
-        <width>20</width>
-        <height>40</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QWidget" name="verticalLayoutWidget_2">
-   <property name="geometry">
-    <rect>
-     <x>10</x>
-     <y>0</y>
-     <width>261</width>
-     <height>221</height>
-    </rect>
-   </property>
-   <layout class="QVBoxLayout" name="verticalLayout_2">
-    <item>
-     <widget class="QLabel" name="label_2">
-      <property name="text">
-       <string>Current List of Integers:</string>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <widget class="QListWidget" name="listWidget"/>
-    </item>
-   </layout>
-  </widget>
- </widget>
- <tabstops>
-  <tabstop>pushButton</tabstop>
- </tabstops>
- <resources/>
- <connections/>
-</ui>
Index: c/UIElements/QT4/QTDialog.cpp
===================================================================
--- src/UIElements/QT4/QTDialog.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,864 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * QTDialog.cpp
- *
- *  Created on: Jan 18, 2010
- *      Author: crueger
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "UIElements/QT4/QTDialog.hpp"
-
-#include <boost/lexical_cast.hpp>
-
-#include <string>
-#include <sstream>
-#include <limits>
-
-#include <Qt/qboxlayout.h>
-#include <Qt/qlabel.h>
-#include <Qt/qspinbox.h>
-#include <QtGui/QDoubleSpinBox>
-#include <Qt/qlineedit.h>
-#include <Qt/qlistwidget.h>
-#include <Qt/qdialogbuttonbox.h>
-#include <Qt/qpushbutton.h>
-#include <Qt/qcombobox.h>
-
-#include <boost/lexical_cast.hpp>
-
-#include "Helpers/MemDebug.hpp"
-
-#include "World.hpp"
-#include "periodentafel.hpp"
-#include "atom.hpp"
-#include "element.hpp"
-#include "molecule.hpp"
-#include "Descriptors/AtomIdDescriptor.hpp"
-#include "Descriptors/MoleculeIdDescriptor.hpp"
-#include "LinearAlgebra/Matrix.hpp"
-#include "Box.hpp"
-
-
-using namespace std;
-
-QTDialog::QTDialog() :
-    QDialog(0)
-{
-  // creating and filling of the Dialog window
-  mainLayout = new QVBoxLayout();
-  inputLayout = new QVBoxLayout();
-  buttonLayout = new QVBoxLayout();
-  setLayout(mainLayout);
-  mainLayout->addLayout(inputLayout);
-  mainLayout->addLayout(buttonLayout);
-  buttons = new QDialogButtonBox(QDialogButtonBox::Ok| QDialogButtonBox::Cancel);
-  buttonLayout->addWidget(buttons);
-
-  // Disable the ok button until something was entered
-  buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
-
-  // connect the buttons to their appropriate slots
-  connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
-  connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
-}
-
-QTDialog::~QTDialog()
-{
-}
-
-bool QTDialog::display(){
-  // Button state might have changed by some update that
-  // was done during query construction. To make sure
-  // the state is correct, we just call update one more time.
-  update();
-  if(exec()) {
-    setAll();
-    return true;
-  }
-  else {
-    return false;
-  }
-}
-
-void QTDialog::update(){
-  buttons->button(QDialogButtonBox::Ok)->setEnabled(checkAll());
-}
-
-/************************** Query Infrastructure ************************/
-
-void QTDialog::queryEmpty(const char*, std::string){
-  // TODO
-  ASSERT(false, "Not implemented yet");
-}
-
-void QTDialog::queryBoolean(const char*,string){
-  // TODO
-  ASSERT(false, "Not implemented yet");
-}
-
-void QTDialog::queryAtom(const char*, std::string){
-  // TODO
-  ASSERT(false, "Not implemented yet");
-}
-
-void QTDialog::queryAtoms(const char*, std::string){
-  // TODO
-  ASSERT(false, "Not implemented yet");
-}
-
-void QTDialog::queryBox(const char*, std::string){
-  // TODO
-  ASSERT(false, "Not implemented yet");
-}
-
-
-void QTDialog::queryInt(const char *title,string)
-{
-  registerQuery(new IntQTQuery(title,inputLayout,this));
-}
-
-void QTDialog::queryInts(const char *title,string)
-{
-  registerQuery(new IntsQTQuery(title,inputLayout,this));
-}
-
-void QTDialog::queryDouble(const char* title,string){
-  registerQuery(new DoubleQTQuery(title,inputLayout,this));
-}
-
-void QTDialog::queryDoubles(const char* title,string){
-  registerQuery(new DoublesQTQuery(title,inputLayout,this));
-}
-
-void QTDialog::queryString(const char* title,string)
-{
-  registerQuery(new StringQTQuery(title,inputLayout,this));
-}
-
-void QTDialog::queryStrings(const char* title,string)
-{
-  registerQuery(new StringsQTQuery(title,inputLayout,this));
-}
-
-void QTDialog::queryMolecule(const char *title,string)
-{
-  registerQuery(new MoleculeQTQuery(title,inputLayout,this));
-}
-
-void QTDialog::queryMolecules(const char *title,string)
-{
-  // TODO
-  ASSERT(false, "Not implemented yet");
-}
-
-void QTDialog::queryVector(const char* title, bool check,string) {
-  registerQuery(new VectorQTQuery(title,check,inputLayout,this));
-}
-
-void QTDialog::queryVectors(const char* title, bool check,string) {
-  // TODO
-  ASSERT(false, "Not implemented yet");
-}
-
-void QTDialog::queryElement(const char* title, std::string){
-  registerQuery(new ElementQTQuery(title,inputLayout,this));
-}
-
-void QTDialog::queryElements(const char* title, std::string){
-  // TODO
-  ASSERT(false, "Not implemented yet");
-}
-
-/************************** Query Objects *******************************/
-
-QTDialog::IntQTQuery::IntQTQuery(string _title,QBoxLayout *_parent,QTDialog *_dialog) :
-    Dialog::IntQuery(_title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QSpinBox();
-  inputBox->setValue(0);
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new IntQTQueryPipe(&tmp,_dialog);
-  pipe->update(inputBox->value());
-  connect(inputBox,SIGNAL(valueChanged(int)),pipe,SLOT(update(int)));
-}
-
-QTDialog::IntQTQuery::~IntQTQuery()
-{
-  delete pipe;
-}
-
-bool QTDialog::IntQTQuery::handle() {
-  return true;
-}
-
-
-QTDialog::IntsQTQuery::IntsQTQuery(string _title,QBoxLayout *_parent,QTDialog *_dialog) :
-    Dialog::IntsQuery(_title),
-    parent(_parent)
-{
-  QHBoxLayout * thisHLayout = new QHBoxLayout();
-  QVBoxLayout * thisV1Layout = new QVBoxLayout();
-  QVBoxLayout * thisV2Layout = new QVBoxLayout();
-
-  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
-  QLabel *inputLabel = new QLabel("Enter to add");
-  QListWidget* inputList = new QListWidget();
-  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
-  QLineEdit* inputBox = new QLineEdit();
-  inputLabel->setBuddy(inputBox);
-  titleLabel->setBuddy(inputList);
-  QPushButton* AddButton = new QPushButton("Add");
-  AddButton->setEnabled(false);
-  QPushButton* RemoveButton = new QPushButton("Remove");
-  RemoveButton->setEnabled(false);
-
-  thisV1Layout->addWidget(titleLabel);
-  thisV1Layout->addWidget(inputList);
-  thisV2Layout->addWidget(inputLabel);
-  thisV2Layout->addWidget(inputBox);
-  thisV2Layout->addWidget(AddButton);
-  thisV2Layout->addWidget(RemoveButton);
-  parent->addLayout(thisHLayout);
-  thisHLayout->addLayout(thisV1Layout);
-  thisHLayout->addLayout(thisV2Layout);
-
-  pipe = new QTQueryListPipe<int>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
-  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
-  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
-  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
-  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));
-}
-
-QTDialog::IntsQTQuery::~IntsQTQuery()
-{
-  delete pipe;
-}
-
-bool QTDialog::IntsQTQuery::handle() {
-  return true;
-}
-
-
-QTDialog::DoubleQTQuery::DoubleQTQuery(string title,QBoxLayout *_parent,QTDialog *_dialog) :
-    Dialog::DoubleQuery(title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QDoubleSpinBox();
-  inputBox->setValue(0);
-  inputBox->setRange(-numeric_limits<double>::max(),numeric_limits<double>::max());
-  inputBox->setDecimals(3);
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new DoubleQTQueryPipe(&tmp,_dialog);
-  pipe->update(inputBox->value());
-  connect(inputBox,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
-}
-
-QTDialog::DoubleQTQuery::~DoubleQTQuery()
-{
-  delete pipe;
-}
-
-bool QTDialog::DoubleQTQuery::handle() {
-  return true;
-}
-
-
-QTDialog::DoublesQTQuery::DoublesQTQuery(string title,QBoxLayout *_parent,QTDialog *_dialog) :
-    Dialog::DoublesQuery(title),
-    parent(_parent)
-{
-  QHBoxLayout * thisHLayout = new QHBoxLayout();
-  QVBoxLayout * thisV1Layout = new QVBoxLayout();
-  QVBoxLayout * thisV2Layout = new QVBoxLayout();
-
-  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
-  QLabel *inputLabel = new QLabel("Enter to add");
-  QListWidget* inputList = new QListWidget();
-  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
-  QLineEdit* inputBox = new QLineEdit();
-  inputLabel->setBuddy(inputBox);
-  titleLabel->setBuddy(inputList);
-  QPushButton* AddButton = new QPushButton("Add");
-  AddButton->setEnabled(false);
-  QPushButton* RemoveButton = new QPushButton("Remove");
-  RemoveButton->setEnabled(false);
-
-  thisV1Layout->addWidget(titleLabel);
-  thisV1Layout->addWidget(inputList);
-  thisV2Layout->addWidget(inputLabel);
-  thisV2Layout->addWidget(inputBox);
-  thisV2Layout->addWidget(AddButton);
-  thisV2Layout->addWidget(RemoveButton);
-  parent->addLayout(thisHLayout);
-  thisHLayout->addLayout(thisV1Layout);
-  thisHLayout->addLayout(thisV2Layout);
-
-  pipe = new QTQueryListPipe<double>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
-  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
-  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
-  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
-  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));}
-
-QTDialog::DoublesQTQuery::~DoublesQTQuery()
-{
-  delete pipe;
-}
-
-bool QTDialog::DoublesQTQuery::handle() {
-  return true;
-}
-
-
-QTDialog::StringQTQuery::StringQTQuery(string _title,QBoxLayout *_parent,QTDialog *_dialog) :
-    Dialog::StringQuery(_title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QLineEdit();
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new StringQTQueryPipe(&tmp,_dialog);
-  pipe->update(inputBox->text());
-  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(update(const QString&)));
-}
-
-QTDialog::StringQTQuery::~StringQTQuery()
-{
-  delete pipe;
-}
-
-// All values besides the empty std::string are valid
-bool QTDialog::StringQTQuery::handle()
-{
-  return tmp!="";
-}
-
-QTDialog::StringsQTQuery::StringsQTQuery(string _title,QBoxLayout *_parent,QTDialog *_dialog) :
-    Dialog::StringsQuery(_title),
-    parent(_parent)
-{
-  QHBoxLayout * thisHLayout = new QHBoxLayout();
-  QVBoxLayout * thisV1Layout = new QVBoxLayout();
-  QVBoxLayout * thisV2Layout = new QVBoxLayout();
-
-  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
-  QLabel *inputLabel = new QLabel("Enter to add");
-  QListWidget* inputList = new QListWidget();
-  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
-  QLineEdit* inputBox = new QLineEdit();
-  inputLabel->setBuddy(inputBox);
-  titleLabel->setBuddy(inputList);
-  QPushButton* AddButton = new QPushButton("Add");
-  AddButton->setEnabled(false);
-  QPushButton* RemoveButton = new QPushButton("Remove");
-  RemoveButton->setEnabled(false);
-
-  thisV1Layout->addWidget(titleLabel);
-  thisV1Layout->addWidget(inputList);
-  thisV2Layout->addWidget(inputLabel);
-  thisV2Layout->addWidget(inputBox);
-  thisV2Layout->addWidget(AddButton);
-  thisV2Layout->addWidget(RemoveButton);
-  parent->addLayout(thisHLayout);
-  thisHLayout->addLayout(thisV1Layout);
-  thisHLayout->addLayout(thisV2Layout);
-
-  pipe = new QTQueryListPipe<std::string>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
-  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
-  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
-  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
-  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));}
-
-QTDialog::StringsQTQuery::~StringsQTQuery()
-{
-  delete pipe;
-}
-
-// All values besides the empty std::string are valid
-bool QTDialog::StringsQTQuery::handle()
-{
-  // dissect by ","
-  std::string::iterator olditer = temp.begin();
-  for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) {
-    if (*iter == ' ') {
-      tmp.push_back(string(iter, olditer));
-      olditer = iter;
-    }
-  }
-  if (olditer != temp.begin())  // insert last part also
-    tmp.push_back(string(olditer, temp.end()));
-
-  return temp!="";
-}
-
-QTDialog::MoleculeQTQuery::MoleculeQTQuery(string _title, QBoxLayout *_parent,QTDialog *_dialog) :
-    Dialog::MoleculeQuery(_title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QComboBox();
-  // add all molecules to the combo box
-  vector<molecule*> molecules = World::getInstance().getAllMolecules();
-  for(vector<molecule*>::iterator iter  = molecules.begin();
-      iter != molecules.end();
-      ++iter) {
-    std::stringstream sstr;
-    sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
-    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
-  }
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new MoleculeQTQueryPipe(&tmp,_dialog,inputBox);
-  pipe->update(inputBox->currentIndex());
-  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
-}
-
-QTDialog::MoleculeQTQuery::~MoleculeQTQuery()
-{
-  delete pipe;
-}
-
-// Handling is easy, since the GUI makes it impossible to select invalid values
-bool QTDialog::MoleculeQTQuery::handle()
-{
-  return true;
-}
-
-QTDialog::MoleculesQTQuery::MoleculesQTQuery(string _title, QBoxLayout *_parent,QTDialog *_dialog) :
-    Dialog::MoleculesQuery(_title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QComboBox();
-  // add all molecules to the combo box
-  vector<molecule*> molecules = World::getInstance().getAllMolecules();
-  for(vector<molecule*>::iterator iter  = molecules.begin();
-      iter != molecules.end();
-      ++iter) {
-    std::stringstream sstr;
-    sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
-    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
-  }
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new MoleculesQTQueryPipe(&tmp,_dialog,inputBox);
-  pipe->update(inputBox->currentIndex());
-  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
-}
-
-QTDialog::MoleculesQTQuery::~MoleculesQTQuery()
-{
-  delete pipe;
-}
-
-// Handling is easy, since the GUI makes it impossible to select invalid values
-bool QTDialog::MoleculesQTQuery::handle()
-{
-  return true;
-}
-
-QTDialog::VectorQTQuery::VectorQTQuery(std::string title, bool _check,QBoxLayout *_parent,QTDialog *_dialog) :
-    Dialog::VectorQuery(title,_check),
-    parent(_parent)
-{
-  mainLayout= new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  mainLayout->addWidget(titleLabel);
-  subLayout = new QVBoxLayout();
-  mainLayout->addLayout(subLayout);
-  QComboBox* inputBox = new QComboBox();
-  coordLayout = new QHBoxLayout();
-  subLayout->addLayout(coordLayout);
-  coordLabel = new QLabel(QString("x,y,z"));
-  coordLayout->addWidget(coordLabel);
-  coordInput = new QDoubleSpinBox();
-//  coordInput->setRange(0,M.at(i,i));
-  coordInput->setDecimals(3);
-  coordLayout->addWidget(coordInput);
-  pipe = new VectorQTQueryPipe(&(tmp),_dialog,inputBox);
-  //pipe->update(coordInput->value());
-  connect(coordInput,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
-  parent->addLayout(mainLayout);
-}
-
-QTDialog::VectorQTQuery::~VectorQTQuery()
-{}
-
-bool QTDialog::VectorQTQuery::handle() {
-  return true;
-}
-
-
-QTDialog::VectorsQTQuery::VectorsQTQuery(std::string title, bool _check,QBoxLayout *_parent,QTDialog *_dialog) :
-    Dialog::VectorsQuery(title,_check),
-    parent(_parent)
-{
-  mainLayout= new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  mainLayout->addWidget(titleLabel);
-  subLayout = new QVBoxLayout();
-  mainLayout->addLayout(subLayout);
-  QComboBox* inputBox = new QComboBox();
-  coordLayout = new QHBoxLayout();
-  subLayout->addLayout(coordLayout);
-  coordLabel = new QLabel(QString("x,y,z"));
-  coordLayout->addWidget(coordLabel);
-  coordInput = new QDoubleSpinBox();
-//  coordInput->setRange(0,M.at(i,i));
-  coordInput->setDecimals(3);
-  coordLayout->addWidget(coordInput);
-  pipe = new VectorsQTQueryPipe(&(tmp),_dialog,inputBox);
-  //pipe->update(coordInput->value());
-  connect(coordInput,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
-  parent->addLayout(mainLayout);
-}
-
-QTDialog::VectorsQTQuery::~VectorsQTQuery()
-{}
-
-bool QTDialog::VectorsQTQuery::handle() {
-  return true;
-}
-
-
-QTDialog::ElementQTQuery::ElementQTQuery(std::string _title, QBoxLayout *_parent, QTDialog *_dialog) :
-    Dialog::ElementQuery(_title),
-    parent(_parent)
-{
-  periodentafel *periode = World::getInstance().getPeriode();
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QComboBox();
-  for(periodentafel::const_iterator iter = periode->begin();
-      iter!=periode->end();
-      ++iter)
-  {
-    std::stringstream sstr;
-    sstr << (*iter).first << "\t" << (*iter).second->getName();
-    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
-  }
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new ElementQTQueryPipe(&tmp,_dialog,inputBox);
-  pipe->update(inputBox->currentIndex());
-  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
-}
-
-QTDialog::ElementQTQuery::~ElementQTQuery()
-{
-  delete pipe;
-}
-
-bool QTDialog::ElementQTQuery::handle(){
-  return true;
-}
-
-
-QTDialog::ElementsQTQuery::ElementsQTQuery(std::string _title, QBoxLayout *_parent, QTDialog *_dialog) :
-    Dialog::ElementsQuery(_title),
-    parent(_parent)
-{
-  periodentafel *periode = World::getInstance().getPeriode();
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QComboBox();
-  for(periodentafel::const_iterator iter = periode->begin();
-      iter!=periode->end();
-      ++iter)
-  {
-    std::stringstream sstr;
-    sstr << (*iter).first << "\t" << (*iter).second->getName();
-    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
-  }
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new ElementsQTQueryPipe(&tmp,_dialog,inputBox);
-  pipe->update(inputBox->currentIndex());
-  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
-}
-
-QTDialog::ElementsQTQuery::~ElementsQTQuery()
-{
-  delete pipe;
-}
-
-bool QTDialog::ElementsQTQuery::handle(){
-  return true;
-}
-
-/*************************** Plumbing *******************************/
-
-
-template<typename T> QTQueryListPipe<T>::QTQueryListPipe(std::vector<T> *_content, QTDialog *_dialog, QLineEdit *_inputBox, QListWidget *_inputList, QPushButton *_AddButton, QPushButton *_RemoveButton) :
-  content(_content),
-  dialog(_dialog),
-  inputBox(_inputBox),
-  inputList(_inputList),
-  AddButton(_AddButton),
-  RemoveButton(_RemoveButton)
-{}
-
-template<typename T> QTQueryListPipe<T>::~QTQueryListPipe()
-{}
-
-template<typename T> void QTQueryListPipe<T>::IntegerEntered(const QString&)
-{
-  AddButton->setEnabled(true);
-}
-
-template<typename T> void QTQueryListPipe<T>::IntegerSelected()
-{
-  if (inputList->selectedItems().empty())
-    RemoveButton->setEnabled(false);
-  else
-    RemoveButton->setEnabled(true);
-}
-
-template<typename T> void QTQueryListPipe<T>::AddInteger() {
-  // type-check
-  std::string text = inputBox->text().toStdString();
-  int number = 0;
-  try {
-    number = boost::lexical_cast<int>(text);
-  } catch (boost::bad_lexical_cast&) {
-    return;
-  };
-  // add item to both
-  inputList->addItem(QString(number));
-  AddValue(number);
-}
-
-template<typename T> void QTQueryListPipe<T>::AddValue(T item) {
-  content->push_back(item);
-
-  dialog->update();
-}
-
-template<typename T> void QTQueryListPipe<T>::RemoveInteger() {
-  QList<QListWidgetItem *> items = inputList->selectedItems();
-  for (QList<QListWidgetItem *>::iterator iter = items.begin(); !items.empty(); iter = items.begin()) {
-    // obtain which position item has (by making it current item)
-    inputList->setCurrentItem(*iter);
-    // remove
-    QTQueryListPipe<T>::RemoteRow(inputList->currentRow()); // template parameters needs to be known, such that compiler knows which to call
-    inputList->removeItemWidget(*iter);
-  }
-}
-
-template<typename T> void QTQueryListPipe<T>::RemoveRow(int row) {
-  int counter = 0;
-  typename std::vector<T>::iterator iter = content->begin();
-  for (; iter != content->end(); ++iter)
-    if (counter++ == row)
-      break;
-  if (iter != content->end())
-      content->erase(iter);
-}
-
-
-StringQTQueryPipe::StringQTQueryPipe(string *_content, QTDialog *_dialog) :
-  content(_content),
-  dialog(_dialog)
-{}
-
-StringQTQueryPipe::~StringQTQueryPipe()
-{}
-
-void StringQTQueryPipe::update(const QString& newText) {
-  content->assign(newText.toStdString());
-  dialog->update();
-}
-
-IntQTQueryPipe::IntQTQueryPipe(int *_content, QTDialog *_dialog) :
-  content(_content),
-  dialog(_dialog)
-{}
-
-IntQTQueryPipe::~IntQTQueryPipe()
-{}
-
-void IntQTQueryPipe::update(int newInt) {
-  (*content) = newInt;
-  dialog->update();
-}
-
-DoubleQTQueryPipe::DoubleQTQueryPipe(double *_content, QTDialog *_dialog) :
-  content(_content),
-  dialog(_dialog)
-{}
-
-DoubleQTQueryPipe::~DoubleQTQueryPipe()
-{}
-
-void DoubleQTQueryPipe::update(double newDbl) {
-  (*content) = newDbl;
-  dialog->update();
-}
-
-VectorQTQueryPipe::VectorQTQueryPipe(Vector *_content, QTDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-VectorQTQueryPipe::~VectorQTQueryPipe()
-{}
-
-void VectorQTQueryPipe::update() {
-  dialog->update();
-}
-
-VectorsQTQueryPipe::VectorsQTQueryPipe(std::vector<Vector> *_content, QTDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-VectorsQTQueryPipe::~VectorsQTQueryPipe()
-{}
-
-void VectorsQTQueryPipe::update() {
-  dialog->update();
-}
-
-AtomQTQueryPipe::AtomQTQueryPipe(atom **_content, QTDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-AtomQTQueryPipe::~AtomQTQueryPipe()
-{}
-
-void AtomQTQueryPipe::update(int newIndex) {
-  QVariant data = theBox->itemData(newIndex);
-  int idx = data.toInt();
-  (*content) = World::getInstance().getAtom(AtomById(idx));
-  dialog->update();
-}
-
-
-AtomsQTQueryPipe::AtomsQTQueryPipe(std::vector<atom *>*_content, QTDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-AtomsQTQueryPipe::~AtomsQTQueryPipe()
-{}
-
-void AtomsQTQueryPipe::update(int newIndex) {
-  QVariant data = theBox->itemData(newIndex);
-  int idx = data.toInt();
-  atom *Walker = World::getInstance().getAtom(AtomById(idx));
-  if (Walker)
-    (*content).push_back(Walker) ;
-  dialog->update();
-}
-
-
-MoleculeQTQueryPipe::MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-MoleculeQTQueryPipe::~MoleculeQTQueryPipe()
-{}
-
-void MoleculeQTQueryPipe::update(int newIndex) {
-  QVariant data = theBox->itemData(newIndex);
-  int idx = data.toInt();
-  (*content) = World::getInstance().getMolecule(MoleculeById(idx));
-  dialog->update();
-}
-
-
-MoleculesQTQueryPipe::MoleculesQTQueryPipe(std::vector<molecule *>*_content, QTDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-MoleculesQTQueryPipe::~MoleculesQTQueryPipe()
-{}
-
-void MoleculesQTQueryPipe::update(int newIndex) {
-  QVariant data = theBox->itemData(newIndex);
-  int idx = data.toInt();
-  molecule *mol = World::getInstance().getMolecule(MoleculeById(idx));
-  if (mol)
-    (*content).push_back(mol);
-  dialog->update();
-}
-
-ElementQTQueryPipe::ElementQTQueryPipe(const element **_content, QTDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-ElementQTQueryPipe::~ElementQTQueryPipe()
-{}
-
-void ElementQTQueryPipe::update(int newIndex) {
-  QVariant data = theBox->itemData(newIndex);
-  int idx = data.toInt();
-  *content = World::getInstance().getPeriode()->FindElement(idx);
-  dialog->update();
-}
-
-ElementsQTQueryPipe::ElementsQTQueryPipe(std::vector<const element *>*_content, QTDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-ElementsQTQueryPipe::~ElementsQTQueryPipe()
-{}
-
-void ElementsQTQueryPipe::update(int newIndex) {
-  QVariant data = theBox->itemData(newIndex);
-  int idx = data.toInt();
-  const element *elemental = World::getInstance().getPeriode()->FindElement(idx);
-  if(elemental)
-    (*content).push_back(elemental);
-  dialog->update();
-}
-
-
Index: c/UIElements/QT4/QTDialog.hpp
===================================================================
--- src/UIElements/QT4/QTDialog.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,479 +1,0 @@
-/*
- * QTDialog.hpp
- *
- *  Created on: Jan 18, 2010
- *      Author: crueger
- */
-
-#ifndef QTDIALOG_HPP_
-#define QTDIALOG_HPP_
-
-#include "UIElements/Dialog.hpp"
-#include <QtGui/QDialog>
-
-class QBoxLayout;
-class QLabel;
-class QSpinBox;
-class QDoubleSpinBox;
-class QLineEdit;
-class QListWidget;
-class QComboBox;
-class QDialogButtonBox;
-
-
-// Forward declarations for plumbing
-template<typename T> class QTQueryListPipe;
-class StringQTQueryPipe;
-class StringsQTQueryPipe;
-class IntQTQueryPipe;
-class DoubleQTQueryPipe;
-class DoublesQTQueryPipe;
-class AtomQTQueryPipe;
-class AtomsQTQueryPipe;
-class MoleculeQTQueryPipe;
-class MoleculesQTQueryPipe;
-class ElementQTQueryPipe;
-class ElementsQTQueryPipe;
-class VectorQTQueryPipe;
-class VectorsQTQueryPipe;
-
-class QTDialog : public QDialog, public Dialog
-{
-  Q_OBJECT
-public:
-  QTDialog();
-  virtual ~QTDialog();
-
-  virtual void queryEmpty(const char*, std::string);
-  virtual void queryBoolean(const char *, std::string = "");
-  virtual void queryInt(const char *,std::string = "");
-  virtual void queryInts(const char *,std::string = "");
-  virtual void queryDouble(const char*,std::string = "");
-  virtual void queryDoubles(const char*,std::string = "");
-  virtual void queryString(const char*,std::string = "");
-  virtual void queryStrings(const char*,std::string = "");
-  virtual void queryAtom(const char*,std::string = "");
-  virtual void queryAtoms(const char*,std::string = "");
-  virtual void queryMolecule(const char*,std::string = "");
-  virtual void queryMolecules(const char*,std::string = "");
-  virtual void queryVector(const char*,bool,std::string = "");
-  virtual void queryVectors(const char*,bool,std::string = "");
-  virtual void queryBox(const char*, std::string = "");
-  virtual void queryElement(const char*,std::string = "");
-  virtual void queryElements(const char*,std::string = "");
-
-  virtual bool display();
-
-  virtual void update();
-
-protected:
-  class IntQTQuery : public Dialog::IntQuery {
-    public:
-      IntQTQuery(std::string _title,QBoxLayout *_parent,QTDialog *_dialog);
-      virtual ~IntQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-      QSpinBox *inputBox;
-
-      IntQTQueryPipe *pipe;
-    };
-
-  class IntsQTQuery : public Dialog::IntsQuery {
-    public:
-      IntsQTQuery(std::string _title,QBoxLayout *_parent,QTDialog *_dialog);
-      virtual ~IntsQTQuery();
-      virtual bool handle();
-      void IntegerEntered(const QString&);
-      void IntegerSelected();
-      void AddInteger();
-      void RemoveInteger();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-
-      QTQueryListPipe<int> *pipe;
-    };
-
-    class DoubleQTQuery : public Dialog::DoubleQuery {
-    public:
-      DoubleQTQuery(std::string title,QBoxLayout *_parent,QTDialog *_dialog);
-      virtual ~DoubleQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-      QDoubleSpinBox *inputBox;
-
-      DoubleQTQueryPipe *pipe;
-    };
-
-    class DoublesQTQuery : public Dialog::DoublesQuery {
-    public:
-      DoublesQTQuery(std::string title,QBoxLayout *_parent,QTDialog *_dialog);
-      virtual ~DoublesQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-      QDoubleSpinBox *inputBox;
-
-      QTQueryListPipe<double> *pipe;
-    };
-
-    class StringQTQuery : public Dialog::StringQuery {
-    public:
-      StringQTQuery(std::string _title, QBoxLayout *_parent,QTDialog *_dialog);
-      virtual ~StringQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-      QLineEdit *inputBox;
-
-      StringQTQueryPipe *pipe;
-    };
-
-    class StringsQTQuery : public Dialog::StringsQuery {
-    public:
-      StringsQTQuery(std::string _title, QBoxLayout *_parent,QTDialog *_dialog);
-      virtual ~StringsQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-      QLineEdit *inputBox;
-
-      QTQueryListPipe<std::string> *pipe;
-    };
-
-    class AtomQTQuery : public Dialog::AtomQuery {
-    public:
-      AtomQTQuery(std::string _title, QBoxLayout *_parent,QTDialog *_dialog);
-      virtual ~AtomQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-      QComboBox *inputBox;
-
-      AtomQTQueryPipe *pipe;
-    };
-
-    class AtomsQTQuery : public Dialog::AtomsQuery {
-    public:
-      AtomsQTQuery(std::string _title, QBoxLayout *_parent,QTDialog *_dialog);
-      virtual ~AtomsQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-      QComboBox *inputBox;
-
-      AtomsQTQueryPipe *pipe;
-    };
-
-    class MoleculeQTQuery : public Dialog::MoleculeQuery {
-    public:
-      MoleculeQTQuery(std::string _title, QBoxLayout *_parent,QTDialog *_dialog);
-      virtual ~MoleculeQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-      QComboBox *inputBox;
-
-      MoleculeQTQueryPipe *pipe;
-    };
-
-    class MoleculesQTQuery : public Dialog::MoleculesQuery {
-    public:
-      MoleculesQTQuery(std::string _title, QBoxLayout *_parent,QTDialog *_dialog);
-      virtual ~MoleculesQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-      QComboBox *inputBox;
-
-      MoleculesQTQueryPipe *pipe;
-    };
-
-    class VectorQTQuery : public Dialog::VectorQuery {
-    public:
-      VectorQTQuery(std::string title,bool _check,QBoxLayout *,QTDialog *);
-      virtual ~VectorQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *mainLayout;
-      QLabel *titleLabel;
-      QBoxLayout *subLayout;
-      QBoxLayout *coordLayout;
-      QLabel *coordLabel;
-      QDoubleSpinBox *coordInput;
-
-      VectorQTQueryPipe *pipe;
-    };
-
-    class VectorsQTQuery : public Dialog::VectorsQuery {
-    public:
-      VectorsQTQuery(std::string title,bool _check,QBoxLayout *,QTDialog *);
-      virtual ~VectorsQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *mainLayout;
-      QLabel *titleLabel;
-      QBoxLayout *subLayout;
-      QBoxLayout *coordLayout;
-      QLabel *coordLabel;
-      QDoubleSpinBox *coordInput;
-
-      VectorsQTQueryPipe *pipe;
-    };
-
-    class ElementQTQuery : public Dialog::ElementQuery {
-    public:
-      ElementQTQuery(std::string _title, QBoxLayout *_parent, QTDialog *_dialog);
-      virtual ~ElementQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-      QComboBox *inputBox;
-
-      ElementQTQueryPipe *pipe;
-    };
-
-    class ElementsQTQuery : public Dialog::ElementsQuery {
-    public:
-      ElementsQTQuery(std::string _title, QBoxLayout *_parent, QTDialog *_dialog);
-      virtual ~ElementsQTQuery();
-      virtual bool handle();
-    private:
-      QBoxLayout *parent;
-      QBoxLayout *thisLayout;
-      QLabel *titleLabel;
-      QComboBox *inputBox;
-
-      ElementsQTQueryPipe *pipe;
-    };
-
-private:
-  QBoxLayout *mainLayout;
-  QBoxLayout *inputLayout;
-  QBoxLayout *buttonLayout;
-  QDialogButtonBox *buttons;
-};
-
-// All kinds of plumbing for Queries
-// Plumbing needs to be outside of the class where it is needed,
-// since MOC doesn't like nested classes
-
-
-template<typename T> class QTQueryListPipe : public QWidget {
-  public:
-    QTQueryListPipe(std::vector<T> *_content, QTDialog *_dialog, QLineEdit *_inputBox, QListWidget *_inputList, QPushButton *_AddButton, QPushButton *_RemoveButton);
-    virtual ~QTQueryListPipe();
-    void AddInteger();
-    void RemoveInteger();
-    void IntegerSelected();
-    void IntegerEntered(const QString&);
-
-  private:
-    void AddValue(T item);
-    void RemoveRow(int row);
-
-    std::vector<T> *content;
-    QTDialog *dialog;
-    QLineEdit *inputBox;
-    QListWidget *inputList;
-    QPushButton *AddButton;
-    QPushButton *RemoveButton;
-};
-
-
-class StringQTQueryPipe : public QWidget {
-  Q_OBJECT
-public:
-  StringQTQueryPipe(std::string *_content, QTDialog *_dialog);
-  virtual ~StringQTQueryPipe();
-
-public slots:
-  void update(const QString&);
-
-private:
-  std::string *content;
-  QTDialog *dialog;
-
-};
-
-class IntQTQueryPipe : public QWidget {
-  Q_OBJECT
-public:
-  IntQTQueryPipe(int *_content, QTDialog *_dialog);
-  virtual ~IntQTQueryPipe();
-
-public slots:
-  void update(int);
-
-private:
-  int *content;
-  QTDialog *dialog;
-
-};
-
-
-class DoubleQTQueryPipe : public QWidget {
-  Q_OBJECT
-public:
-  DoubleQTQueryPipe(double *_content, QTDialog *_dialog);
-  virtual ~DoubleQTQueryPipe();
-
-public slots:
-  void update(double);
-
-private:
-  double *content;
-  QTDialog *dialog;
-
-};
-
-class AtomQTQueryPipe : public QWidget {
-  Q_OBJECT
-public:
-  AtomQTQueryPipe(atom **_content, QTDialog *_dialog, QComboBox *_theBox);
-  virtual ~AtomQTQueryPipe();
-
-public slots:
-  void update(int);
-
-private:
-  atom **content;
-  QTDialog *dialog;
-  QComboBox *theBox;
-
-};
-
-
-class AtomsQTQueryPipe : public QWidget {
-  Q_OBJECT
-public:
-  AtomsQTQueryPipe(std::vector<atom *>*_content, QTDialog *_dialog, QComboBox *_theBox);
-  virtual ~AtomsQTQueryPipe();
-
-public slots:
-  void update(int);
-
-private:
-  std::vector<atom *>*content;
-  QTDialog *dialog;
-  QComboBox *theBox;
-
-};
-
-class MoleculeQTQueryPipe : public QWidget {
-  Q_OBJECT
-public:
-  MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox);
-  virtual ~MoleculeQTQueryPipe();
-
-public slots:
-  void update(int);
-
-private:
-  molecule **content;
-  QTDialog *dialog;
-  QComboBox *theBox;
-
-};
-
-class MoleculesQTQueryPipe : public QWidget {
-  Q_OBJECT
-public:
-  MoleculesQTQueryPipe(std::vector<molecule *>*_content, QTDialog *_dialog, QComboBox *_theBox);
-  virtual ~MoleculesQTQueryPipe();
-
-public slots:
-  void update(int);
-
-private:
-  std::vector<molecule *>*content;
-  QTDialog *dialog;
-  QComboBox *theBox;
-
-};
-
-class VectorQTQueryPipe : public QWidget {
-  Q_OBJECT
-public:
-  VectorQTQueryPipe(Vector *_content, QTDialog *_dialog, QComboBox *_theBox);
-  virtual ~VectorQTQueryPipe();
-
-public slots:
-  void update();
-
-private:
-  Vector *content;
-  QTDialog *dialog;
-  QComboBox *theBox;
-};
-
-class VectorsQTQueryPipe : public QWidget {
-  Q_OBJECT
-public:
-  VectorsQTQueryPipe(std::vector<Vector>*_content, QTDialog *_dialog, QComboBox *_theBox);
-  virtual ~VectorsQTQueryPipe();
-
-public slots:
-  void update();
-
-private:
-  std::vector<Vector> *content;
-  QTDialog *dialog;
-  QComboBox *theBox;
-};
-
-class ElementQTQueryPipe : public QWidget {
-  Q_OBJECT
-public:
-  ElementQTQueryPipe(const element **_content, QTDialog *_dialog, QComboBox *_theBox);
-  virtual ~ElementQTQueryPipe();
-
-public slots:
-  void update(int);
-
-private:
-  const element **content;
-  QTDialog *dialog;
-  QComboBox *theBox;
-};
-
-class ElementsQTQueryPipe : public QWidget {
-  Q_OBJECT
-public:
-  ElementsQTQueryPipe(std::vector<const element *>*_content, QTDialog *_dialog, QComboBox *_theBox);
-  virtual ~ElementsQTQueryPipe();
-
-public slots:
-  void update(int);
-
-private:
-  std::vector<const element *>*content;
-  QTDialog *dialog;
-  QComboBox *theBox;
-};
-#endif /* QTDIALOG_HPP_ */
Index: c/UIElements/QT4/QTMainWindow.cpp
===================================================================
--- src/UIElements/QT4/QTMainWindow.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,133 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * QTMainWindow.cpp
- *
- *  Created on: Jan 14, 2010
- *      Author: crueger
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "QTMainWindow.hpp"
-
-#include<Qt/qapplication.h>
-#include<Qt/qlabel.h>
-#include<Qt/qstring.h>
-#include<Qt/qmenubar.h>
-#include<Qt/qsplitter.h>
-
-#include<iostream>
-#include<map>
-
-#include<boost/bind.hpp>
-
-#include "Helpers/MemDebug.hpp"
-
-#include "atom.hpp"
-#include "molecule.hpp"
-#include "Helpers/Verbose.hpp"
-#include "Actions/Action.hpp"
-#include "Actions/ActionRegistry.hpp"
-#include "Actions/MapOfActions.hpp"
-#include "Menu/Menu.hpp"
-#include "Menu/QT4/QTMenu.hpp"
-#include "Menu/ActionMenuItem.hpp"
-#include "Views/QT4/QTWorldView.hpp"
-#include "Views/QT4/GLMoleculeView.hpp"
-#include "Views/QT4/QTMoleculeView.hpp"
-#include "Views/QT4/QTStatusBar.hpp"
-
-using namespace std;
-
-QTMainWindow::QTMainWindow(QApplication *_theApp) :
-    theApp(_theApp)
-{
-  QSplitter *splitter1 = new QSplitter (Qt::Horizontal, this );
-  QSplitter *splitter2 = new QSplitter (Qt::Vertical, splitter1 );
-
-  worldDisplay = new QTWorldView(splitter2);
-
-  moleculeDisplay = new QTMoleculeView();
-  molecule3dDisplay = new GLMoleculeView();
-
-  MenuBar = menuBar();
-
-  std::map <std::string, QTMenu *> NametoTextMenuMap;
-  // go through all menus and create them
-  QTMenu *Menu = NULL;
-  for(std::map<std::string, std::pair<std::string,std::string> >::iterator iter = MapOfActions::getInstance().MenuDescription.begin(); iter != MapOfActions::getInstance().MenuDescription.end(); ++iter) {
-    cout << "Creating menu " << iter->first << endl;
-    Menu = new QTMenu(iter->first.c_str());
-    MenuBar->addMenu(Menu);
-    NametoTextMenuMap.insert( pair <std::string, QTMenu *> (iter->first, Menu) );
-    //new SubMenuItem(getSuitableShortForm(iter->first),iter->second.first,main_menu,Menu);
-  }
-
-  // populate all actions
-  MapOfActions::getInstance().populateActions();
-
-  // go through all actions and add them to its menu
-  for (std::map <std::string, QTMenu *>::iterator MenuRunner = NametoTextMenuMap.begin(); MenuRunner != NametoTextMenuMap.end(); ++MenuRunner) {
-    cout << "Creating Action " << MenuRunner->first << " in menu " << MenuRunner->second << endl;
-    populateMenu(MenuRunner->second, MenuRunner->first);
-  }
-
-  setCentralWidget(splitter1);
-  splitter1->addWidget(splitter2);
-  splitter1->addWidget(moleculeDisplay);
-  splitter2->addWidget(molecule3dDisplay);
-  splitter2->addWidget(worldDisplay);
-
-  statusBar = new QTStatusBar(this);
-  setStatusBar(statusBar);
-
-  connect(worldDisplay,SIGNAL(moleculeSelected(molecule*)),moleculeDisplay,SLOT(moleculeSelected(molecule*)));
-  connect(worldDisplay,SIGNAL(moleculeUnSelected(molecule*)),moleculeDisplay,SLOT(moleculeUnSelected(molecule*)));
-}
-
-QTMainWindow::~QTMainWindow()
-{
-  menuBar()->clear();
-  delete editMoleculesMenu;
-}
-
-void QTMainWindow::display() {
-  this->show();
-  theApp->exec();
-}
-
-char QTMainWindow::getSuitableShortForm(set <char> &ShortcutList, const std::string name) const
-{
-  for (std::string::const_iterator CharRunner = name.begin(); CharRunner != name.end(); ++CharRunner) {
-    if (ShortcutList.find(*CharRunner) == ShortcutList.end())
-      return *CharRunner;
-  }
-  DoeLog(1) && (eLog() << Verbose(1) << "Could not find a suitable shortform for TextWindow::getSuitableShortForm()." << endl);
-  return ((char)(ShortcutList.size() % 10) + '0');
-}
-
-void QTMainWindow::populateMenu(QTMenu* Menu, const  std::string &MenuName)
-{
-  Action *ActionItem = NULL;
-  set <char> ShortcutList;
-  // through all actions for this menu
-  std::pair < std::multimap <std::string, std::string>::iterator, std::multimap <std::string, std::string>::iterator > MenuActions = MapOfActions::getInstance().MenuContainsActionMap.equal_range(MenuName);
-  for (std::multimap <std::string, std::string>::const_iterator MenuRunner = MenuActions.first; MenuRunner != MenuActions.second; ++MenuRunner) {
-    cout << " Adding " << MenuRunner->second << " to submenu " << MenuName << endl;
-    ActionItem = ActionRegistry::getInstance().getActionByName(MenuRunner->second);
-    new ActionMenuItem(getSuitableShortForm(ShortcutList, MenuRunner->second),MapOfActions::getInstance().getDescription(MenuRunner->second).c_str(),Menu,ActionItem);
-  }
-  // finally add default quit item
-  //Action *returnFromAction = new TextMenu::LeaveAction(Menu);
-  //MenuItem *returnFromItem = new ActionMenuItem('q',"return to Main menu",Menu,returnFromAction);
-  //Menu->addDefault(returnFromItem);
-}
Index: c/UIElements/QT4/QTMainWindow.hpp
===================================================================
--- src/UIElements/QT4/QTMainWindow.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * QTMainWindow.hpp
- *
- *  Created on: Jan 14, 2010
- *      Author: crueger
- */
-
-#ifndef QTMAINWINDOW_HPP_
-#define QTMAINWINDOW_HPP_
-
-#include "UIElements/MainWindow.hpp"
-#include <QtGui/QMainWindow>
-
-#include <set>
-
-class QTWorldView;
-class StringView;
-class QTMenu;
-class GLMoleculeView;
-class QTMoleculeView;
-class QTStatusBar;
-
-class QTMainWindow : public QMainWindow, public MainWindow
-{
-  Q_OBJECT
-
-public:
-  QTMainWindow(QApplication *_theApp);
-  virtual ~QTMainWindow();
-
-  virtual void display();
-
-  char getSuitableShortForm(std::set <char> &ShortcutList, const std::string name) const;
-  void populateMenu(QTMenu* Menu, const  std::string &MenuName);
-
-private:
-  // All kinds of QTStuff used in this window
-  QApplication *theApp;
-  QTWorldView *worldDisplay;
-  QTMenu *editMoleculesMenu;
-  GLMoleculeView *molecule3dDisplay;
-  QTMoleculeView *moleculeDisplay;
-  QTStatusBar *statusBar;
-  QMenuBar *MenuBar;
-
-};
-
-#endif /* QTMAINWINDOW_HPP_ */
Index: c/UIElements/QT4/QTUIFactory.cpp
===================================================================
--- src/UIElements/QT4/QTUIFactory.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * QTUIFactory.cpp
- *
- *  Created on: Jan 14, 2010
- *      Author: crueger
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <iostream>
-#include <cassert>
-
-#include <qapplication.h>
-
-
-#include "UIElements/QT4/QTUIFactory.hpp"
-#include "UIElements/QT4/QTMainWindow.hpp"
-#include "UIElements/QT4/QTDialog.hpp"
-
-#include "Helpers/MemDebug.hpp"
-
-#include "version.h"
-#include "defs.hpp"
-
-using namespace std;
-
-QTUIFactory::QTUIFactory() :
-  argc(1)
-{
-  // For now we just fake the command line parameters to make QT happy
-  argv = new char*[1];
-  argv[0] = new char[256];
-  strcpy(argv[0],MOLECUILDERVERSION);
-  app = new QApplication(argc,argv);
-}
-
-QTUIFactory::~QTUIFactory()
-{
-  delete app;
-  delete [] argv[0];
-  delete [] argv;
-}
-
-Dialog* QTUIFactory::makeDialog() {
-  return new QTDialog();
-}
-
-MainWindow* QTUIFactory::makeMainWindow() {
-  return new QTMainWindow(app);
-}
-
-QTUIFactory::description::description() :
-    UIFactory::factoryDescription("QT4")
-{}
-
-QTUIFactory::description::~description()
-{}
-
-UIFactory* QTUIFactory::description::makeFactory(){
-  return new QTUIFactory();
-}
Index: c/UIElements/QT4/QTUIFactory.hpp
===================================================================
--- src/UIElements/QT4/QTUIFactory.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/*
- * QTUIFactory.hpp
- *
- *  Created on: Jan 14, 2010
- *      Author: crueger
- */
-
-#ifndef QTUIFACTORY_HPP_
-#define QTUIFACTORY_HPP_
-
-#include "UIElements/UIFactory.hpp"
-
-class QApplication;
-
-class QTUIFactory : public UIFactory
-{
-  friend class UIFactory;
-
-public:
-  virtual ~QTUIFactory();
-
-  virtual Dialog* makeDialog();
-  virtual MainWindow* makeMainWindow();
-
-  struct description : public UIFactory::factoryDescription {
-    description();
-    virtual ~description();
-
-    virtual UIFactory* makeFactory();
-  };
-
-protected:
-  QTUIFactory();
-
-private:
-  // faked command line arguments
-  int argc;
-  char **argv;
-  QApplication *app;
-};
-
-#endif /* QTUIFACTORY_HPP_ */
Index: src/UIElements/Qt4/IntQtQuery.ui
===================================================================
--- src/UIElements/Qt4/IntQtQuery.ui	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/IntQtQuery.ui	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>20</x>
+     <y>30</y>
+     <width>59</width>
+     <height>17</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>TextLabel</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="lineEdit">
+   <property name="geometry">
+    <rect>
+     <x>100</x>
+     <y>20</y>
+     <width>113</width>
+     <height>27</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton">
+   <property name="geometry">
+    <rect>
+     <x>20</x>
+     <y>70</y>
+     <width>92</width>
+     <height>27</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>OK</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="pushButton_2">
+   <property name="geometry">
+    <rect>
+     <x>140</x>
+     <y>70</y>
+     <width>92</width>
+     <height>27</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>Cancel</string>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: src/UIElements/Qt4/IntsQtQuery.ui
===================================================================
--- src/UIElements/Qt4/IntsQtQuery.ui	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/IntsQtQuery.ui	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>740</width>
+    <height>444</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <widget class="QWidget" name="horizontalLayoutWidget">
+   <property name="geometry">
+    <rect>
+     <x>10</x>
+     <y>240</y>
+     <width>421</width>
+     <height>51</height>
+    </rect>
+   </property>
+   <layout class="QHBoxLayout" name="horizontalLayout">
+    <item>
+     <spacer name="horizontalSpacer">
+      <property name="orientation">
+       <enum>Qt::Horizontal</enum>
+      </property>
+      <property name="sizeHint" stdset="0">
+       <size>
+        <width>40</width>
+        <height>20</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButton">
+      <property name="text">
+       <string>OK</string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButton_2">
+      <property name="text">
+       <string>Cancel</string>
+      </property>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QWidget" name="verticalLayoutWidget">
+   <property name="geometry">
+    <rect>
+     <x>280</x>
+     <y>0</y>
+     <width>160</width>
+     <height>221</height>
+    </rect>
+   </property>
+   <layout class="QVBoxLayout" name="verticalLayout">
+    <item>
+     <widget class="QLabel" name="label">
+      <property name="text">
+       <string>Enter Integer:</string>
+      </property>
+      <property name="buddy">
+       <cstring>lineEdit</cstring>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QLineEdit" name="lineEdit">
+      <property name="minimumSize">
+       <size>
+        <width>100</width>
+        <height>20</height>
+       </size>
+      </property>
+      <property name="toolTip">
+       <string>Enter an integer and press Add.</string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButton_3">
+      <property name="enabled">
+       <bool>false</bool>
+      </property>
+      <property name="text">
+       <string>Add</string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButton_4">
+      <property name="enabled">
+       <bool>false</bool>
+      </property>
+      <property name="text">
+       <string>Remove</string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <spacer name="verticalSpacer">
+      <property name="orientation">
+       <enum>Qt::Vertical</enum>
+      </property>
+      <property name="sizeHint" stdset="0">
+       <size>
+        <width>20</width>
+        <height>40</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QWidget" name="verticalLayoutWidget_2">
+   <property name="geometry">
+    <rect>
+     <x>10</x>
+     <y>0</y>
+     <width>261</width>
+     <height>221</height>
+    </rect>
+   </property>
+   <layout class="QVBoxLayout" name="verticalLayout_2">
+    <item>
+     <widget class="QLabel" name="label_2">
+      <property name="text">
+       <string>Current List of Integers:</string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QListWidget" name="listWidget"/>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <tabstops>
+  <tabstop>pushButton</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
Index: src/UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,45 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include "Helpers/MemDebug.hpp"
+#include "World.hpp"
+
+
+AtomQtQueryPipe::AtomQtQueryPipe(atom **_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+AtomQtQueryPipe::~AtomQtQueryPipe()
+{}
+
+void AtomQtQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  (*content) = World::getInstance().getAtom(AtomById(idx));
+  dialog->update();
+}
+
+
Index: src/UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,75 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomsQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <vector>
+
+#include <Qt/qlistwidget.h>
+
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include "Helpers/MemDebug.hpp"
+#include "World.hpp"
+
+
+AtomsQtQueryPipe::AtomsQtQueryPipe(std::vector<atom *>*_content, QtDialog *_dialog, QListWidget *_theList) :
+  content(_content),
+  dialog(_dialog),
+  theList(_theList)
+{}
+
+AtomsQtQueryPipe::~AtomsQtQueryPipe()
+{}
+
+void AtomsQtQueryPipe::update() {
+  // clear target and put all atoms therein
+  (*content).clear();
+  for (std::set<atom *>::iterator iter = currentList.begin(); iter != currentList.end(); ++iter)
+    (*content).push_back(*iter);
+  dialog->update();
+}
+
+void AtomsQtQueryPipe::add() {
+  QList<QListWidgetItem *> items = theList->selectedItems();
+  for (QList<QListWidgetItem *>::iterator iter = items.begin();iter != items.end();++iter) {
+    const int index = (*iter)->text().toInt();
+    atom *Walker = World::getInstance().getAtom(AtomById(index));
+    if (Walker) {
+      (*content).push_back(Walker);
+      currentList.insert(Walker);
+      if (lookup.find(index) != lookup.end())
+        lookup.insert(pair<int, atom*>(index, Walker));
+    }
+  }
+  update();
+}
+
+void AtomsQtQueryPipe::remove() {
+  QList<QListWidgetItem *> items = theList->selectedItems();
+  for (QList<QListWidgetItem *>::iterator iter = items.begin();iter != items.end();++iter) {
+    const int index = (*iter)->text().toInt();
+    atom *Walker = World::getInstance().getAtom(AtomById(index));
+    if (Walker) {
+      currentList.erase(Walker);
+    }
+  }
+  update();
+}
+
+
Index: src/UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,37 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * BooleanQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+
+BooleanQtQueryPipe::BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox) :
+  content(_content),
+  dialog(_dialog),
+  booleanComboBox(_booleanComboBox)
+{}
+
+BooleanQtQueryPipe::~BooleanQtQueryPipe()
+{}
+
+void BooleanQtQueryPipe::update() {
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,49 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * BoxQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+#include <Qt/qtablewidget.h>
+
+#include "LinearAlgebra/Matrix.hpp"
+#include "Box.hpp"
+
+BoxQtQueryPipe::BoxQtQueryPipe(Box &_content, QtDialog *_dialog, QTableWidget *_inputTable) :
+  content(_content),
+  dialog(_dialog),
+  inputTable(_inputTable)
+{
+  tmpM = new Matrix();
+  tmpM->zero();
+}
+
+BoxQtQueryPipe::~BoxQtQueryPipe()
+{
+  delete tmpM;
+}
+
+void BoxQtQueryPipe::update(int row, int column)
+{
+  tmpM->at(row, column) = inputTable->item(row, column)->text().toDouble();
+  content.setM(*tmpM);
+  dialog->update();
+}
+
+
Index: src/UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,37 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * DoubleQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+
+DoubleQtQueryPipe::DoubleQtQueryPipe(double *_content, QtDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+DoubleQtQueryPipe::~DoubleQtQueryPipe()
+{}
+
+void DoubleQtQueryPipe::update(double newDbl) {
+  (*content) = newDbl;
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,44 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ElementQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+
+ElementQtQueryPipe::ElementQtQueryPipe(const element **_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+ElementQtQueryPipe::~ElementQtQueryPipe()
+{}
+
+void ElementQtQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  *content = World::getInstance().getPeriode()->FindElement(idx);
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,48 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ElementsQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <vector>
+
+#include <Qt/qcombobox.h>
+
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+
+ElementsQtQueryPipe::ElementsQtQueryPipe(std::vector<const element *>*_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+ElementsQtQueryPipe::~ElementsQtQueryPipe()
+{}
+
+void ElementsQtQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  const element *elemental = World::getInstance().getPeriode()->FindElement(idx);
+  if(elemental)
+    (*content).push_back(elemental);
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,36 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * EmptyQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+
+EmptyQtQueryPipe::EmptyQtQueryPipe(QtDialog *_dialog, QLabel *_textLabel) :
+  dialog(_dialog),
+  textLabel(_textLabel)
+{}
+
+EmptyQtQueryPipe::~EmptyQtQueryPipe()
+{}
+
+void EmptyQtQueryPipe::update() {
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/FileQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/FileQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/FileQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,67 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * FileQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <iostream>
+#include <boost/filesystem.hpp>
+
+#include <Qt/qcombobox.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qpushbutton.h>
+
+
+FileQtQueryPipe::FileQtQueryPipe(boost::filesystem::path *_content, QtDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) :
+  content(_content),
+  dialog(_dialog),
+  filenameLineEdit(_filenameLineEdit),
+  filedialogButton(_filedialogButton)
+{
+  theFileDialog = NULL;
+}
+
+FileQtQueryPipe::~FileQtQueryPipe()
+{
+  if (theFileDialog != NULL)
+    delete theFileDialog;
+}
+
+void FileQtQueryPipe::update() {
+  QStringList ListOfFilenames = theFileDialog->selectedFiles();
+  std::cout << "Selected File is " << ListOfFilenames.at(0).toStdString() << std::endl;
+  (*content) = ListOfFilenames.at(0).toStdString();
+  filenameLineEdit->setText(QString::fromStdString((*content).string()));
+  dialog->update();
+}
+
+void FileQtQueryPipe::showFileDialog() {
+  filedialogButton->setFlat(true);
+  if (theFileDialog == NULL) {
+    theFileDialog = new QFileDialog(NULL, tr("Open input file"), QString(), tr("ParallelCarParrinello (*.conf);;MassivelyParallelQuantumChemistry (*.mpqc);;ParticleDataBase (*.pdb);;XYZ (*.xyz)"));
+    theFileDialog->setAcceptMode(QFileDialog::AcceptOpen);
+    theFileDialog->setFileMode(QFileDialog::ExistingFile);
+    theFileDialog->setViewMode(QFileDialog::List);
+  }
+  theFileDialog->exec();
+
+  update();
+  filedialogButton->setFlat(false);
+}
+
+
Index: src/UIElements/Qt4/Pipe/IntQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/IntQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/IntQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,37 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IntQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+
+IntQtQueryPipe::IntQtQueryPipe(int *_content, QtDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+IntQtQueryPipe::~IntQtQueryPipe()
+{}
+
+void IntQtQueryPipe::update(int newInt) {
+  (*content) = newInt;
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,44 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MoleculeQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+#include "Descriptors/MoleculeIdDescriptor.hpp"
+#include "World.hpp"
+
+
+MoleculeQtQueryPipe::MoleculeQtQueryPipe(molecule **_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+MoleculeQtQueryPipe::~MoleculeQtQueryPipe()
+{}
+
+void MoleculeQtQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  (*content) = World::getInstance().getMolecule(MoleculeById(idx));
+  dialog->update();
+}
+
+
Index: src/UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,47 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MoleculesQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <vector>
+
+#include <Qt/qcombobox.h>
+
+#include "Descriptors/MoleculeIdDescriptor.hpp"
+#include "World.hpp"
+
+
+MoleculesQtQueryPipe::MoleculesQtQueryPipe(std::vector<molecule *>*_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+MoleculesQtQueryPipe::~MoleculesQtQueryPipe()
+{}
+
+void MoleculesQtQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  molecule *mol = World::getInstance().getMolecule(MoleculeById(idx));
+  if (mol)
+    (*content).push_back(mol);
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/QtQueryListPipe.hpp
===================================================================
--- src/UIElements/Qt4/Pipe/QtQueryListPipe.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/QtQueryListPipe.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,78 @@
+/*
+ * QtQueryListPipe.hpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifndef QTQUERYLISTPIPE_HPP_
+#define QTQUERYLISTPIPE_HPP_
+
+template<typename T> QtQueryListPipe<T>::QtQueryListPipe(std::vector<T> *_content, QtDialog *_dialog, QLineEdit *_inputBox, QListWidget *_inputList, QPushButton *_AddButton, QPushButton *_RemoveButton) :
+  content(_content),
+  dialog(_dialog),
+  inputBox(_inputBox),
+  inputList(_inputList),
+  AddButton(_AddButton),
+  RemoveButton(_RemoveButton)
+{}
+
+template<typename T> QtQueryListPipe<T>::~QtQueryListPipe()
+{}
+
+template<typename T> void QtQueryListPipe<T>::IntegerEntered(const QString&)
+{
+  AddButton->setEnabled(true);
+}
+
+template<typename T> void QtQueryListPipe<T>::IntegerSelected()
+{
+  if (inputList->selectedItems().empty())
+    RemoveButton->setEnabled(false);
+  else
+    RemoveButton->setEnabled(true);
+}
+
+template<typename T> void QtQueryListPipe<T>::AddInteger() {
+  // type-check
+  std::string text = inputBox->text().toStdString();
+  int number = 0;
+  try {
+    number = boost::lexical_cast<int>(text);
+  } catch (boost::bad_lexical_cast&) {
+    return;
+  };
+  // add item to both
+  inputList->addItem(QString(number));
+  AddValue(number);
+}
+
+template<typename T> void QtQueryListPipe<T>::AddValue(T item) {
+  content->push_back(item);
+
+  dialog->update();
+}
+
+template<typename T> void QtQueryListPipe<T>::RemoveInteger() {
+  QList<QListWidgetItem *> items = inputList->selectedItems();
+  for (QList<QListWidgetItem *>::iterator iter = items.begin(); !items.empty(); iter = items.begin()) {
+    // obtain which position item has (by making it current item)
+    inputList->setCurrentItem(*iter);
+    // remove
+    QtQueryListPipe<T>::RemoteRow(inputList->currentRow()); // template parameters needs to be known, such that compiler knows which to call
+    inputList->removeItemWidget(*iter);
+  }
+}
+
+template<typename T> void QtQueryListPipe<T>::RemoveRow(int row) {
+  int counter = 0;
+  typename std::vector<T>::iterator iter = content->begin();
+  for (; iter != content->end(); ++iter)
+    if (counter++ == row)
+      break;
+  if (iter != content->end())
+      content->erase(iter);
+}
+
+
+#endif /*  QTQUERYLISTPIPE_HPP_  */
Index: src/UIElements/Qt4/Pipe/StringQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/StringQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/StringQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,39 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * StringQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <string>
+
+#include <Qt/qcombobox.h>
+
+
+StringQtQueryPipe::StringQtQueryPipe(string *_content, QtDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+StringQtQueryPipe::~StringQtQueryPipe()
+{}
+
+void StringQtQueryPipe::update(const QString& newText) {
+  content->assign(newText.toStdString());
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,37 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * VectorQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+
+VectorQtQueryPipe::VectorQtQueryPipe(Vector *_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+VectorQtQueryPipe::~VectorQtQueryPipe()
+{}
+
+void VectorQtQueryPipe::update() {
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,39 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * VectorsQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <vector>
+
+#include <Qt/qcombobox.h>
+
+
+VectorsQtQueryPipe::VectorsQtQueryPipe(std::vector<Vector> *_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+VectorsQtQueryPipe::~VectorsQtQueryPipe()
+{}
+
+void VectorsQtQueryPipe::update() {
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/QtDialog.cpp
===================================================================
--- src/UIElements/Qt4/QtDialog.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/QtDialog.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,172 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * QtDialog.cpp
+ *
+ *  Created on: Jan 18, 2010
+ *      Author: crueger
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <QtGui/QDialogButtonBox>
+#include <Qt/qpushbutton.h>
+#include <Qt/qboxlayout.h>
+
+#include "Helpers/MemDebug.hpp"
+
+
+using namespace std;
+
+QtDialog::QtDialog() :
+    QDialog(0)
+{
+  // creating and filling of the Dialog window
+  mainLayout = new QVBoxLayout();
+  inputLayout = new QVBoxLayout();
+  buttonLayout = new QVBoxLayout();
+  setLayout(mainLayout);
+  mainLayout->addLayout(inputLayout);
+  mainLayout->addLayout(buttonLayout);
+  buttons = new QDialogButtonBox(QDialogButtonBox::Ok| QDialogButtonBox::Cancel);
+  buttonLayout->addWidget(buttons);
+
+  // Disable the ok button until something was entered
+  buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
+
+  // connect the buttons to their appropriate slots
+  connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
+  connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
+}
+
+QtDialog::~QtDialog()
+{
+}
+
+bool QtDialog::display(){
+  // Button state might have changed by some update that
+  // was done during query construction. To make sure
+  // the state is correct, we just call update one more time.
+  update();
+  if(exec()) {
+    setAll();
+    return true;
+  }
+  else {
+    return false;
+  }
+}
+
+void QtDialog::update(){
+  buttons->button(QDialogButtonBox::Ok)->setEnabled(checkAll());
+}
+
+/************************** Query Infrastructure ************************/
+
+void QtDialog::queryEmpty(const char* title, std::string)
+{
+  registerQuery(new EmptyQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryBoolean(const char* title,string)
+{
+  registerQuery(new BooleanQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryAtom(const char* title, std::string)
+{
+  registerQuery(new AtomQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryAtoms(const char* title, std::string)
+{
+  registerQuery(new AtomsQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryBox(const char* title, std::string)
+{
+  registerQuery(new BoxQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryInt(const char *title,string)
+{
+  registerQuery(new IntQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryInts(const char *title,string)
+{
+  registerQuery(new IntsQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryDouble(const char* title,string)
+{
+  registerQuery(new DoubleQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryDoubles(const char* title,string)
+{
+  registerQuery(new DoublesQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryString(const char* title,string)
+{
+  registerQuery(new StringQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryStrings(const char* title,string)
+{
+  registerQuery(new StringsQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryMolecule(const char *title,string)
+{
+  registerQuery(new MoleculeQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryMolecules(const char *title,string)
+{
+  registerQuery(new MoleculesQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryVector(const char* title, bool check,string)
+{
+  registerQuery(new VectorQtQuery(title,check,inputLayout,this));
+}
+
+void QtDialog::queryVectors(const char* title, bool check,string)
+{
+  registerQuery(new VectorsQtQuery(title,check,inputLayout,this));
+}
+
+void QtDialog::queryElement(const char* title, std::string)
+{
+  registerQuery(new ElementQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryElements(const char* title, std::string)
+{
+  registerQuery(new ElementsQtQuery(title,inputLayout,this));
+}
+
+void QtDialog::queryFile(const char* title, std::string)
+{
+  registerQuery(new FileQtQuery(title,inputLayout,this));
+}
+
+/************************** Query Infrastructure ************************/
+/*       ---> shifted to folder Query                                   */
+/************************************************************************/
+
+/*************************** Pipe Infrastructure ************************/
+/*       ---> shifted to folder Pipe                                    */
+/************************************************************************/
Index: src/UIElements/Qt4/QtDialog.hpp
===================================================================
--- src/UIElements/Qt4/QtDialog.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/QtDialog.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,620 @@
+/*
+ * QtDialog.hpp
+ *
+ *  Created on: Jan 18, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTDIALOG_HPP_
+#define QTDIALOG_HPP_
+
+#include "UIElements/Dialog.hpp"
+#include <QtGui/QDialog>
+#include <QtGui/QFileDialog>
+
+#include <boost/filesystem.hpp>
+
+#include <map>
+#include <set>
+#include <vector>
+
+class QBoxLayout;
+class QLabel;
+class QSpinBox;
+class QDoubleSpinBox;
+class QLineEdit;
+class QListWidget;
+class QTableWidget;
+class QComboBox;
+class QDialogButtonBox;
+
+class Matrix;
+
+// Forward declarations for plumbing
+template<typename T> class QtQueryListPipe;
+class BooleanQtQueryPipe;
+class BoxQtQueryPipe;
+class StringQtQueryPipe;
+class StringsQtQueryPipe;
+class IntQtQueryPipe;
+class DoubleQtQueryPipe;
+class DoublesQtQueryPipe;
+class AtomQtQueryPipe;
+class AtomsQtQueryPipe;
+class MoleculeQtQueryPipe;
+class MoleculesQtQueryPipe;
+class EmptyQtQueryPipe;
+class ElementQtQueryPipe;
+class ElementsQtQueryPipe;
+class VectorQtQueryPipe;
+class VectorsQtQueryPipe;
+class FileQtQueryPipe;
+
+class QtDialog : public QDialog, public Dialog
+{
+  Q_OBJECT
+public:
+  QtDialog();
+  virtual ~QtDialog();
+
+  virtual void queryEmpty(const char*, std::string);
+  virtual void queryBoolean(const char *, std::string = "");
+  virtual void queryInt(const char *,std::string = "");
+  virtual void queryInts(const char *,std::string = "");
+  virtual void queryDouble(const char*,std::string = "");
+  virtual void queryDoubles(const char*,std::string = "");
+  virtual void queryString(const char*,std::string = "");
+  virtual void queryStrings(const char*,std::string = "");
+  virtual void queryAtom(const char*,std::string = "");
+  virtual void queryAtoms(const char*,std::string = "");
+  virtual void queryMolecule(const char*,std::string = "");
+  virtual void queryMolecules(const char*,std::string = "");
+  virtual void queryVector(const char*,bool,std::string = "");
+  virtual void queryVectors(const char*,bool,std::string = "");
+  virtual void queryBox(const char*, std::string = "");
+  virtual void queryElement(const char*,std::string = "");
+  virtual void queryElements(const char*,std::string = "");
+  virtual void queryFile(const char*,std::string = "");
+
+  virtual bool display();
+
+  virtual void update();
+
+protected:
+  class IntQtQuery : public Dialog::IntQuery {
+    public:
+      IntQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
+      virtual ~IntQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QSpinBox *inputBox;
+
+      IntQtQueryPipe *pipe;
+    };
+
+  class IntsQtQuery : public Dialog::IntsQuery {
+    public:
+      IntsQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
+      virtual ~IntsQtQuery();
+      virtual bool handle();
+      void IntegerEntered(const QString&);
+      void IntegerSelected();
+      void AddInteger();
+      void RemoveInteger();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+
+      QtQueryListPipe<int> *pipe;
+    };
+
+    class DoubleQtQuery : public Dialog::DoubleQuery {
+    public:
+      DoubleQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog);
+      virtual ~DoubleQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QDoubleSpinBox *inputBox;
+
+      DoubleQtQueryPipe *pipe;
+    };
+
+    class DoublesQtQuery : public Dialog::DoublesQuery {
+    public:
+      DoublesQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog);
+      virtual ~DoublesQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QDoubleSpinBox *inputBox;
+
+      QtQueryListPipe<double> *pipe;
+    };
+
+    class StringQtQuery : public Dialog::StringQuery {
+    public:
+      StringQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
+      virtual ~StringQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QLineEdit *inputBox;
+
+      StringQtQueryPipe *pipe;
+    };
+
+    class StringsQtQuery : public Dialog::StringsQuery {
+    public:
+      StringsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
+      virtual ~StringsQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QLineEdit *inputBox;
+
+      QtQueryListPipe<std::string> *pipe;
+    };
+
+    class BoxQtQuery : public Dialog::BoxQuery {
+    public:
+      BoxQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
+      virtual ~BoxQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QTableWidget *inputTable;
+
+      BoxQtQueryPipe *pipe;
+    };
+
+    class AtomQtQuery : public Dialog::AtomQuery {
+    public:
+      AtomQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
+      virtual ~AtomQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QComboBox *inputBox;
+
+      AtomQtQueryPipe *pipe;
+    };
+
+    class AtomsQtQuery : public Dialog::AtomsQuery {
+    public:
+      AtomsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
+      virtual ~AtomsQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QLabel *inputLabel;
+      QListWidget *inputList;
+
+      AtomsQtQueryPipe *pipe;
+    };
+
+    class MoleculeQtQuery : public Dialog::MoleculeQuery {
+    public:
+      MoleculeQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
+      virtual ~MoleculeQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QComboBox *inputBox;
+
+      MoleculeQtQueryPipe *pipe;
+    };
+
+    class MoleculesQtQuery : public Dialog::MoleculesQuery {
+    public:
+      MoleculesQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
+      virtual ~MoleculesQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QComboBox *inputBox;
+
+      MoleculesQtQueryPipe *pipe;
+    };
+
+    class VectorQtQuery : public Dialog::VectorQuery {
+    public:
+      VectorQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *);
+      virtual ~VectorQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *mainLayout;
+      QLabel *titleLabel;
+      QBoxLayout *subLayout;
+      QBoxLayout *coordLayout;
+      QLabel *coordLabel;
+      QDoubleSpinBox *coordInput;
+
+      VectorQtQueryPipe *pipe;
+    };
+
+    class VectorsQtQuery : public Dialog::VectorsQuery {
+    public:
+      VectorsQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *);
+      virtual ~VectorsQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *mainLayout;
+      QLabel *titleLabel;
+      QBoxLayout *subLayout;
+      QBoxLayout *coordLayout;
+      QLabel *coordLabel;
+      QDoubleSpinBox *coordInput;
+
+      VectorsQtQueryPipe *pipe;
+    };
+
+    class EmptyQtQuery : public Dialog::EmptyQuery {
+    public:
+      EmptyQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
+      virtual ~EmptyQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+
+      EmptyQtQueryPipe *pipe;
+    };
+
+    class BooleanQtQuery : public Dialog::BooleanQuery {
+    public:
+      BooleanQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
+      virtual ~BooleanQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QComboBox *booleanComboBox;
+
+      BooleanQtQueryPipe *pipe;
+    };
+
+    class ElementQtQuery : public Dialog::ElementQuery {
+    public:
+      ElementQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
+      virtual ~ElementQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QComboBox *inputBox;
+
+      ElementQtQueryPipe *pipe;
+    };
+
+    class ElementsQtQuery : public Dialog::ElementsQuery {
+    public:
+      ElementsQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
+      virtual ~ElementsQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *titleLabel;
+      QComboBox *inputBox;
+
+      ElementsQtQueryPipe *pipe;
+    };
+
+    class FileQtQuery : public Dialog::FileQuery {
+    public:
+      FileQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
+      virtual ~FileQtQuery();
+      virtual bool handle();
+    private:
+      QBoxLayout *parent;
+      QBoxLayout *thisLayout;
+      QLabel *filenameLabel;
+      QLineEdit *filenameLineEdit;
+      QPushButton *filedialogButton;
+
+      FileQtQueryPipe *pipe;
+    };
+
+private:
+  QBoxLayout *mainLayout;
+  QBoxLayout *inputLayout;
+  QBoxLayout *buttonLayout;
+  QDialogButtonBox *buttons;
+};
+
+// All kinds of plumbing for Queries
+// Plumbing needs to be outside of the class where it is needed,
+// since MOC doesn't like nested classes
+
+
+template<typename T> class QtQueryListPipe : public QWidget {
+  public:
+    QtQueryListPipe(std::vector<T> *_content, QtDialog *_dialog, QLineEdit *_inputBox, QListWidget *_inputList, QPushButton *_AddButton, QPushButton *_RemoveButton);
+    virtual ~QtQueryListPipe();
+    void AddInteger();
+    void RemoveInteger();
+    void IntegerSelected();
+    void IntegerEntered(const QString&);
+
+  private:
+    void AddValue(T item);
+    void RemoveRow(int row);
+
+    std::vector<T> *content;
+    QtDialog *dialog;
+    QLineEdit *inputBox;
+    QListWidget *inputList;
+    QPushButton *AddButton;
+    QPushButton *RemoveButton;
+};
+
+
+class StringQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  StringQtQueryPipe(std::string *_content, QtDialog *_dialog);
+  virtual ~StringQtQueryPipe();
+
+public slots:
+  void update(const QString&);
+
+private:
+  std::string *content;
+  QtDialog *dialog;
+
+};
+
+class IntQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  IntQtQueryPipe(int *_content, QtDialog *_dialog);
+  virtual ~IntQtQueryPipe();
+
+public slots:
+  void update(int);
+
+private:
+  int *content;
+  QtDialog *dialog;
+
+};
+
+
+class DoubleQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  DoubleQtQueryPipe(double *_content, QtDialog *_dialog);
+  virtual ~DoubleQtQueryPipe();
+
+public slots:
+  void update(double);
+
+private:
+  double *content;
+  QtDialog *dialog;
+
+};
+
+class BoxQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  BoxQtQueryPipe(Box &_content, QtDialog *_dialog, QTableWidget *_inputTable);
+  virtual ~BoxQtQueryPipe();
+
+public slots:
+  void update(int,int);
+
+private:
+  Box &content;
+  QtDialog *dialog;
+  QTableWidget *inputTable;
+
+  Matrix *tmpM;
+};
+
+
+class AtomQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  AtomQtQueryPipe(atom **_content, QtDialog *_dialog, QComboBox *_theBox);
+  virtual ~AtomQtQueryPipe();
+
+public slots:
+  void update(int);
+
+private:
+  atom **content;
+  QtDialog *dialog;
+  QComboBox *theBox;
+
+};
+
+
+class AtomsQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  AtomsQtQueryPipe(std::vector<atom *>*_content, QtDialog *_dialog, QListWidget *_theList);
+  virtual ~AtomsQtQueryPipe();
+
+public slots:
+  void update();
+  void add();
+  void remove();
+
+private:
+  std::vector<atom *>*content;
+  std::map<int, atom *> lookup;
+  std::set<atom *> currentList;
+  QtDialog *dialog;
+  QListWidget *theList;
+
+};
+
+class MoleculeQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  MoleculeQtQueryPipe(molecule **_content, QtDialog *_dialog, QComboBox *_theBox);
+  virtual ~MoleculeQtQueryPipe();
+
+public slots:
+  void update(int);
+
+private:
+  molecule **content;
+  QtDialog *dialog;
+  QComboBox *theBox;
+
+};
+
+class MoleculesQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  MoleculesQtQueryPipe(std::vector<molecule *>*_content, QtDialog *_dialog, QComboBox *_theBox);
+  virtual ~MoleculesQtQueryPipe();
+
+public slots:
+  void update(int);
+
+private:
+  std::vector<molecule *>*content;
+  QtDialog *dialog;
+  QComboBox *theBox;
+
+};
+
+class VectorQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  VectorQtQueryPipe(Vector *_content, QtDialog *_dialog, QComboBox *_theBox);
+  virtual ~VectorQtQueryPipe();
+
+public slots:
+  void update();
+
+private:
+  Vector *content;
+  QtDialog *dialog;
+  QComboBox *theBox;
+};
+
+class VectorsQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  VectorsQtQueryPipe(std::vector<Vector>*_content, QtDialog *_dialog, QComboBox *_theBox);
+  virtual ~VectorsQtQueryPipe();
+
+public slots:
+  void update();
+
+private:
+  std::vector<Vector> *content;
+  QtDialog *dialog;
+  QComboBox *theBox;
+};
+
+class EmptyQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  EmptyQtQueryPipe(QtDialog *_dialog, QLabel *_textLabel);
+  virtual ~EmptyQtQueryPipe();
+
+public slots:
+  void update();
+
+private:
+  QtDialog *dialog;
+  QLabel *textLabel;
+};
+
+class BooleanQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox);
+  virtual ~BooleanQtQueryPipe();
+
+public slots:
+  void update();
+
+private:
+  const bool *content;
+  QtDialog *dialog;
+  QComboBox *booleanComboBox;
+};
+
+class ElementQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  ElementQtQueryPipe(const element **_content, QtDialog *_dialog, QComboBox *_theBox);
+  virtual ~ElementQtQueryPipe();
+
+public slots:
+  void update(int);
+
+private:
+  const element **content;
+  QtDialog *dialog;
+  QComboBox *theBox;
+};
+
+class ElementsQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  ElementsQtQueryPipe(std::vector<const element *>*_content, QtDialog *_dialog, QComboBox *_theBox);
+  virtual ~ElementsQtQueryPipe();
+
+public slots:
+  void update(int);
+
+private:
+  std::vector<const element *>*content;
+  QtDialog *dialog;
+  QComboBox *theBox;
+};
+
+class FileQtQueryPipe : public QWidget {
+  Q_OBJECT
+public:
+  FileQtQueryPipe(boost::filesystem::path *_content, QtDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton);
+  virtual ~FileQtQueryPipe();
+
+public slots:
+  void update();
+  void showFileDialog();
+
+private:
+  boost::filesystem::path *content;
+  QtDialog *dialog;
+  QLineEdit *filenameLineEdit;
+  QPushButton *filedialogButton;
+  QFileDialog *theFileDialog;
+};
+
+#endif /* QTDIALOG_HPP_ */
Index: src/UIElements/Qt4/QtMainWindow.cpp
===================================================================
--- src/UIElements/Qt4/QtMainWindow.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/QtMainWindow.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,133 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * QtMainWindow.cpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "QtMainWindow.hpp"
+
+#include<Qt/qapplication.h>
+#include<Qt/qlabel.h>
+#include<Qt/qstring.h>
+#include<Qt/qmenubar.h>
+#include<Qt/qsplitter.h>
+
+#include<iostream>
+#include<map>
+
+#include<boost/bind.hpp>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "atom.hpp"
+#include "molecule.hpp"
+#include "Helpers/Verbose.hpp"
+#include "Actions/Action.hpp"
+#include "Actions/ActionRegistry.hpp"
+#include "Actions/MapOfActions.hpp"
+#include "Menu/Menu.hpp"
+#include "Menu/Qt4/QtMenu.hpp"
+#include "Menu/ActionMenuItem.hpp"
+#include "Views/Qt4/QtWorldView.hpp"
+#include "Views/Qt4/GLMoleculeView.hpp"
+#include "Views/Qt4/QtMoleculeView.hpp"
+#include "Views/Qt4/QtStatusBar.hpp"
+
+using namespace std;
+
+QtMainWindow::QtMainWindow(QApplication *_theApp) :
+    theApp(_theApp)
+{
+  QSplitter *splitter1 = new QSplitter (Qt::Horizontal, this );
+  QSplitter *splitter2 = new QSplitter (Qt::Vertical, splitter1 );
+
+  worldDisplay = new QtWorldView(splitter2);
+
+  moleculeDisplay = new QtMoleculeView();
+  molecule3dDisplay = new GLMoleculeView();
+
+  MenuBar = menuBar();
+
+  std::map <std::string, QtMenu *> NametoTextMenuMap;
+  // go through all menus and create them
+  QtMenu *Menu = NULL;
+  for(std::map<std::string, std::pair<std::string,std::string> >::iterator iter = MapOfActions::getInstance().MenuDescription.begin(); iter != MapOfActions::getInstance().MenuDescription.end(); ++iter) {
+    cout << "Creating menu " << iter->first << endl;
+    Menu = new QtMenu(iter->first.c_str());
+    MenuBar->addMenu(Menu);
+    NametoTextMenuMap.insert( pair <std::string, QtMenu *> (iter->first, Menu) );
+    //new SubMenuItem(getSuitableShortForm(iter->first),iter->second.first,main_menu,Menu);
+  }
+
+  // populate all actions
+  MapOfActions::getInstance().populateActions();
+
+  // go through all actions and add them to its menu
+  for (std::map <std::string, QtMenu *>::iterator MenuRunner = NametoTextMenuMap.begin(); MenuRunner != NametoTextMenuMap.end(); ++MenuRunner) {
+    cout << "Creating Action " << MenuRunner->first << " in menu " << MenuRunner->second << endl;
+    populateMenu(MenuRunner->second, MenuRunner->first);
+  }
+
+  setCentralWidget(splitter1);
+  splitter1->addWidget(splitter2);
+  splitter1->addWidget(moleculeDisplay);
+  splitter2->addWidget(molecule3dDisplay);
+  splitter2->addWidget(worldDisplay);
+
+  statusBar = new QtStatusBar(this);
+  setStatusBar(statusBar);
+
+  connect(worldDisplay,SIGNAL(moleculeSelected(molecule*)),moleculeDisplay,SLOT(moleculeSelected(molecule*)));
+  connect(worldDisplay,SIGNAL(moleculeUnSelected(molecule*)),moleculeDisplay,SLOT(moleculeUnSelected(molecule*)));
+}
+
+QtMainWindow::~QtMainWindow()
+{
+  menuBar()->clear();
+  delete editMoleculesMenu;
+}
+
+void QtMainWindow::display() {
+  this->show();
+  theApp->exec();
+}
+
+char QtMainWindow::getSuitableShortForm(set <char> &ShortcutList, const std::string name) const
+{
+  for (std::string::const_iterator CharRunner = name.begin(); CharRunner != name.end(); ++CharRunner) {
+    if (ShortcutList.find(*CharRunner) == ShortcutList.end())
+      return *CharRunner;
+  }
+  DoeLog(1) && (eLog() << Verbose(1) << "Could not find a suitable shortform for TextWindow::getSuitableShortForm()." << endl);
+  return ((char)(ShortcutList.size() % 10) + '0');
+}
+
+void QtMainWindow::populateMenu(QtMenu* Menu, const  std::string &MenuName)
+{
+  Action *ActionItem = NULL;
+  set <char> ShortcutList;
+  // through all actions for this menu
+  std::pair < std::multimap <std::string, std::string>::iterator, std::multimap <std::string, std::string>::iterator > MenuActions = MapOfActions::getInstance().MenuContainsActionMap.equal_range(MenuName);
+  for (std::multimap <std::string, std::string>::const_iterator MenuRunner = MenuActions.first; MenuRunner != MenuActions.second; ++MenuRunner) {
+    cout << " Adding " << MenuRunner->second << " to submenu " << MenuName << endl;
+    ActionItem = ActionRegistry::getInstance().getActionByName(MenuRunner->second);
+    new ActionMenuItem(getSuitableShortForm(ShortcutList, MenuRunner->second),MapOfActions::getInstance().getDescription(MenuRunner->second).c_str(),Menu,ActionItem);
+  }
+  // finally add default quit item
+  //Action *returnFromAction = new TextMenu::LeaveAction(Menu);
+  //MenuItem *returnFromItem = new ActionMenuItem('q',"return to Main menu",Menu,returnFromAction);
+  //Menu->addDefault(returnFromItem);
+}
Index: src/UIElements/Qt4/QtMainWindow.hpp
===================================================================
--- src/UIElements/Qt4/QtMainWindow.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/QtMainWindow.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,48 @@
+/*
+ * QtMainWindow.hpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTMAINWINDOW_HPP_
+#define QTMAINWINDOW_HPP_
+
+#include "UIElements/MainWindow.hpp"
+#include <QtGui/QMainWindow>
+
+#include <set>
+
+class QtWorldView;
+class StringView;
+class QtMenu;
+class GLMoleculeView;
+class QtMoleculeView;
+class QtStatusBar;
+
+class QtMainWindow : public QMainWindow, public MainWindow
+{
+  Q_OBJECT
+
+public:
+  QtMainWindow(QApplication *_theApp);
+  virtual ~QtMainWindow();
+
+  virtual void display();
+
+  char getSuitableShortForm(std::set <char> &ShortcutList, const std::string name) const;
+  void populateMenu(QtMenu* Menu, const  std::string &MenuName);
+
+private:
+  // All kinds of QTStuff used in this window
+  QApplication *theApp;
+  QtWorldView *worldDisplay;
+  QtMenu *editMoleculesMenu;
+  GLMoleculeView *molecule3dDisplay;
+  QtMoleculeView *moleculeDisplay;
+  QtStatusBar *statusBar;
+  QMenuBar *MenuBar;
+
+};
+
+#endif /* QTMAINWINDOW_HPP_ */
Index: src/UIElements/Qt4/QtUIFactory.cpp
===================================================================
--- src/UIElements/Qt4/QtUIFactory.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/QtUIFactory.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,71 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * QtUIFactory.cpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <iostream>
+#include <cassert>
+
+#include <qapplication.h>
+
+
+#include "UIElements/Qt4/QtUIFactory.hpp"
+#include "UIElements/Qt4/QtMainWindow.hpp"
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "Helpers/MemDebug.hpp"
+
+#include "version.h"
+#include "defs.hpp"
+
+using namespace std;
+
+QtUIFactory::QtUIFactory() :
+  argc(1)
+{
+  // For now we just fake the command line parameters to make QT happy
+  argv = new char*[1];
+  argv[0] = new char[256];
+  strcpy(argv[0],MOLECUILDERVERSION);
+  app = new QApplication(argc,argv);
+}
+
+QtUIFactory::~QtUIFactory()
+{
+  delete app;
+  delete [] argv[0];
+  delete [] argv;
+}
+
+Dialog* QtUIFactory::makeDialog() {
+  return new QtDialog();
+}
+
+MainWindow* QtUIFactory::makeMainWindow() {
+  return new QtMainWindow(app);
+}
+
+QtUIFactory::description::description() :
+    UIFactory::factoryDescription("Qt4")
+{}
+
+QtUIFactory::description::~description()
+{}
+
+UIFactory* QtUIFactory::description::makeFactory(){
+  return new QtUIFactory();
+}
Index: src/UIElements/Qt4/QtUIFactory.hpp
===================================================================
--- src/UIElements/Qt4/QtUIFactory.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/QtUIFactory.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,42 @@
+/*
+ * QtUIFactory.hpp
+ *
+ *  Created on: Jan 14, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTUIFACTORY_HPP_
+#define QTUIFACTORY_HPP_
+
+#include "UIElements/UIFactory.hpp"
+
+class QApplication;
+
+class QtUIFactory : public UIFactory
+{
+  friend class UIFactory;
+
+public:
+  virtual ~QtUIFactory();
+
+  virtual Dialog* makeDialog();
+  virtual MainWindow* makeMainWindow();
+
+  struct description : public UIFactory::factoryDescription {
+    description();
+    virtual ~description();
+
+    virtual UIFactory* makeFactory();
+  };
+
+protected:
+  QtUIFactory();
+
+private:
+  // faked command line arguments
+  int argc;
+  char **argv;
+  QApplication *app;
+};
+
+#endif /* QTUIFACTORY_HPP_ */
Index: src/UIElements/Qt4/Query/AtomQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/AtomQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/AtomQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,61 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "atom.hpp"
+#include "World.hpp"
+
+QtDialog::AtomQtQuery::AtomQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::AtomQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  inputBox->insertItem(-1, QString("no atom"));
+  std::vector<atom *> atoms = World::getInstance().getAllAtoms();
+  for (std::vector<atom *>::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter)
+    inputBox->insertItem((*iter)->getNr(),QString::fromStdString((*iter)->getName()));
+
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new AtomQtQueryPipe(&tmp,_dialog, inputBox);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::AtomQtQuery::~AtomQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::AtomQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/AtomsQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/AtomsQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/AtomsQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,82 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomsQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qlistwidget.h>
+#include <Qt/qpushbutton.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "atom.hpp"
+#include "World.hpp"
+
+
+QtDialog::AtomsQtQuery::AtomsQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::AtomsQuery(_title),
+    parent(_parent)
+{
+  QHBoxLayout * thisHLayout = new QHBoxLayout();
+  QVBoxLayout * thisV1Layout = new QVBoxLayout();
+  QVBoxLayout * thisV2Layout = new QVBoxLayout();
+
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputLabel = new QLabel("Enter to add");
+  inputList = new QListWidget();
+  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  std::vector<atom *> atoms = World::getInstance().getAllAtoms();
+  for (std::vector<atom *>::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter)
+    inputList->insertItem((*iter)->getNr(),QString((*iter)->getNr()));
+
+  QLineEdit* inputBox = new QLineEdit();
+  inputLabel->setBuddy(inputBox);
+  titleLabel->setBuddy(inputList);
+  QPushButton* AddButton = new QPushButton("Add");
+  AddButton->setEnabled(false);
+  QPushButton* RemoveButton = new QPushButton("Remove");
+  RemoveButton->setEnabled(false);
+
+  thisV1Layout->addWidget(titleLabel);
+  thisV1Layout->addWidget(inputList);
+  thisV2Layout->addWidget(inputLabel);
+  thisV2Layout->addWidget(inputBox);
+  thisV2Layout->addWidget(AddButton);
+  thisV2Layout->addWidget(RemoveButton);
+  parent->addLayout(thisHLayout);
+  thisHLayout->addLayout(thisV1Layout);
+  thisHLayout->addLayout(thisV2Layout);
+
+  pipe = new AtomsQtQueryPipe(&tmp,_dialog,inputList);
+  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
+  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(add()));
+  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(remove()));
+}
+
+QtDialog::AtomsQtQuery::~AtomsQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::AtomsQtQuery::handle() {
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/BooleanQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/BooleanQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/BooleanQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,55 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * BooleanQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::BooleanQtQuery::BooleanQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
+    Dialog::BooleanQuery(_title),
+    parent(_parent)
+{
+  titleLabel = new QLabel(QString(getTitle().c_str()),_dialog);
+  booleanComboBox = new QComboBox(_dialog);
+  booleanComboBox->insertItem(1, QString("true"));
+  booleanComboBox->insertItem(0, QString("false"));
+
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(booleanComboBox);
+
+  pipe = new BooleanQtQueryPipe(&tmp,_dialog,booleanComboBox);
+  connect(booleanComboBox, SIGNAL(currentIndexChanged()), pipe, SLOT(update()));
+}
+
+QtDialog::BooleanQtQuery::~BooleanQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::BooleanQtQuery::handle(){
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/BoxQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/BoxQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/BoxQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,72 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * BoxQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qtablewidget.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "LinearAlgebra/Matrix.hpp"
+#include "World.hpp"
+
+QtDialog::BoxQtQuery::BoxQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::BoxQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+
+  // init input table
+  inputTable = new QTableWidget(3,3, _dialog);
+  QStringList CoordinateList;
+  CoordinateList << "x" << "y" << "z";
+  inputTable->setHorizontalHeaderLabels(CoordinateList);
+  inputTable->setVerticalHeaderLabels(CoordinateList);
+
+  pipe = new BoxQtQueryPipe(tmp,_dialog, inputTable);
+
+  // fill the box with current matrix
+  const Matrix &domain = World::getInstance().getDomain().getM();
+  for (int i=0;i<3;i++)
+    for (int j=0;j<3;j++) {
+      QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg(domain.at(i,j)));
+      inputTable->setItem(i,j,newItem);
+      pipe->update(i,j);
+    }
+
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputTable);
+
+  connect(inputTable,SIGNAL(cellChanged(int,int)),pipe,SLOT(update(int,int)));
+}
+
+QtDialog::BoxQtQuery::~BoxQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::BoxQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/DoubleQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/DoubleQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/DoubleQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,57 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * DoubleQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <QtGui/QDoubleSpinBox>
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::DoubleQtQuery::DoubleQtQuery(string title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::DoubleQuery(title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QDoubleSpinBox();
+  inputBox->setValue(0);
+  inputBox->setRange(-numeric_limits<double>::max(),numeric_limits<double>::max());
+  inputBox->setDecimals(3);
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new DoubleQtQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->value());
+  connect(inputBox,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
+}
+
+QtDialog::DoubleQtQuery::~DoubleQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::DoubleQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/DoublesQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/DoublesQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/DoublesQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,77 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * DoublesQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qlistwidget.h>
+#include <Qt/qpushbutton.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+#include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp"
+
+
+QtDialog::DoublesQtQuery::DoublesQtQuery(string title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::DoublesQuery(title),
+    parent(_parent)
+{
+  QHBoxLayout * thisHLayout = new QHBoxLayout();
+  QVBoxLayout * thisV1Layout = new QVBoxLayout();
+  QVBoxLayout * thisV2Layout = new QVBoxLayout();
+
+  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
+  QLabel *inputLabel = new QLabel("Enter to add");
+  QListWidget* inputList = new QListWidget();
+  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  QLineEdit* inputBox = new QLineEdit();
+  inputLabel->setBuddy(inputBox);
+  titleLabel->setBuddy(inputList);
+  QPushButton* AddButton = new QPushButton("Add");
+  AddButton->setEnabled(false);
+  QPushButton* RemoveButton = new QPushButton("Remove");
+  RemoveButton->setEnabled(false);
+
+  thisV1Layout->addWidget(titleLabel);
+  thisV1Layout->addWidget(inputList);
+  thisV2Layout->addWidget(inputLabel);
+  thisV2Layout->addWidget(inputBox);
+  thisV2Layout->addWidget(AddButton);
+  thisV2Layout->addWidget(RemoveButton);
+  parent->addLayout(thisHLayout);
+  thisHLayout->addLayout(thisV1Layout);
+  thisHLayout->addLayout(thisV2Layout);
+
+  pipe = new QtQueryListPipe<double>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
+  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
+  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
+  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
+  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));}
+
+QtDialog::DoublesQtQuery::~DoublesQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::DoublesQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/ElementQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/ElementQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/ElementQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,66 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ElementQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+QtDialog::ElementQtQuery::ElementQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
+    Dialog::ElementQuery(_title),
+    parent(_parent)
+{
+  periodentafel *periode = World::getInstance().getPeriode();
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  for(periodentafel::const_iterator iter = periode->begin();
+      iter!=periode->end();
+      ++iter)
+  {
+    std::stringstream sstr;
+    sstr << (*iter).first << "\t" << (*iter).second->getName();
+    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
+  }
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new ElementQtQueryPipe(&tmp,_dialog,inputBox);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::ElementQtQuery::~ElementQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::ElementQtQuery::handle(){
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/ElementsQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/ElementsQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/ElementsQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,66 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ElementsQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+
+QtDialog::ElementsQtQuery::ElementsQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
+    Dialog::ElementsQuery(_title),
+    parent(_parent)
+{
+  periodentafel *periode = World::getInstance().getPeriode();
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  for(periodentafel::const_iterator iter = periode->begin();
+      iter!=periode->end();
+      ++iter)
+  {
+    std::stringstream sstr;
+    sstr << (*iter).first << "\t" << (*iter).second->getName();
+    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
+  }
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new ElementsQtQueryPipe(&tmp,_dialog,inputBox);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::ElementsQtQuery::~ElementsQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::ElementsQtQuery::handle(){
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/EmptyQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/EmptyQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/EmptyQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,49 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * EmptyQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::EmptyQtQuery::EmptyQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
+    Dialog::EmptyQuery(_title),
+    parent(_parent)
+{
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+
+  pipe = new EmptyQtQueryPipe(_dialog,titleLabel);
+}
+
+QtDialog::EmptyQtQuery::~EmptyQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::EmptyQtQuery::handle(){
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/FileQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/FileQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/FileQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,63 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * FileQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qpushbutton.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::FileQtQuery::FileQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
+    Dialog::FileQuery(_title),
+    parent(_parent)
+{
+
+  filenameLineEdit = new QLineEdit(_dialog);
+  filenameLineEdit->setText(QString());
+  filenameLineEdit->setReadOnly(true);
+
+  filenameLabel = new QLabel(QString("Input file:"));
+  filenameLabel->setBuddy(filenameLineEdit);
+
+  filedialogButton = new QPushButton("&Choose", _dialog);
+
+  pipe = new FileQtQueryPipe(&tmp,_dialog,filenameLineEdit,filedialogButton);
+
+  thisLayout = new QHBoxLayout();
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(filenameLabel);
+  thisLayout->addWidget(filenameLineEdit);
+  thisLayout->addWidget(filedialogButton);
+
+  QObject::connect(filedialogButton,SIGNAL(clicked()),pipe,SLOT(showFileDialog()));
+}
+
+QtDialog::FileQtQuery::~FileQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::FileQtQuery::handle(){
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/IntQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/IntQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/IntQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,54 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IntQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qspinbox.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::IntQtQuery::IntQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::IntQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QSpinBox();
+  inputBox->setValue(0);
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new IntQtQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->value());
+  connect(inputBox,SIGNAL(valueChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::IntQtQuery::~IntQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::IntQtQuery::handle() {
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/IntsQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/IntsQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/IntsQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,78 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IntsQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qlistwidget.h>
+#include <Qt/qpushbutton.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+#include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp"
+
+
+QtDialog::IntsQtQuery::IntsQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::IntsQuery(_title),
+    parent(_parent)
+{
+  QHBoxLayout * thisHLayout = new QHBoxLayout();
+  QVBoxLayout * thisV1Layout = new QVBoxLayout();
+  QVBoxLayout * thisV2Layout = new QVBoxLayout();
+
+  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
+  QLabel *inputLabel = new QLabel("Enter to add");
+  QListWidget* inputList = new QListWidget();
+  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  QLineEdit* inputBox = new QLineEdit();
+  inputLabel->setBuddy(inputBox);
+  titleLabel->setBuddy(inputList);
+  QPushButton* AddButton = new QPushButton("Add");
+  AddButton->setEnabled(false);
+  QPushButton* RemoveButton = new QPushButton("Remove");
+  RemoveButton->setEnabled(false);
+
+  thisV1Layout->addWidget(titleLabel);
+  thisV1Layout->addWidget(inputList);
+  thisV2Layout->addWidget(inputLabel);
+  thisV2Layout->addWidget(inputBox);
+  thisV2Layout->addWidget(AddButton);
+  thisV2Layout->addWidget(RemoveButton);
+  parent->addLayout(thisHLayout);
+  thisHLayout->addLayout(thisV1Layout);
+  thisHLayout->addLayout(thisV2Layout);
+
+  pipe = new QtQueryListPipe<int>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
+  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
+  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
+  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
+  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));
+}
+
+QtDialog::IntsQtQuery::~IntsQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::IntsQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/MoleculeQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/MoleculeQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/MoleculeQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,67 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MoleculeQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "molecule.hpp"
+#include "World.hpp"
+
+
+QtDialog::MoleculeQtQuery::MoleculeQtQuery(string _title, QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::MoleculeQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  // add all molecules to the combo box
+  vector<molecule*> molecules = World::getInstance().getAllMolecules();
+  for(vector<molecule*>::iterator iter  = molecules.begin();
+      iter != molecules.end();
+      ++iter) {
+    std::stringstream sstr;
+    sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
+    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
+  }
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new MoleculeQtQueryPipe(&tmp,_dialog,inputBox);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::MoleculeQtQuery::~MoleculeQtQuery()
+{
+  delete pipe;
+}
+
+// Handling is easy, since the GUI makes it impossible to select invalid values
+bool QtDialog::MoleculeQtQuery::handle()
+{
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/MoleculesQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/MoleculesQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/MoleculesQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,67 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MoleculesQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "molecule.hpp"
+#include "World.hpp"
+
+
+QtDialog::MoleculesQtQuery::MoleculesQtQuery(string _title, QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::MoleculesQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  // add all molecules to the combo box
+  vector<molecule*> molecules = World::getInstance().getAllMolecules();
+  for(vector<molecule*>::iterator iter  = molecules.begin();
+      iter != molecules.end();
+      ++iter) {
+    std::stringstream sstr;
+    sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
+    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
+  }
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new MoleculesQtQueryPipe(&tmp,_dialog,inputBox);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::MoleculesQtQuery::~MoleculesQtQuery()
+{
+  delete pipe;
+}
+
+// Handling is easy, since the GUI makes it impossible to select invalid values
+bool QtDialog::MoleculesQtQuery::handle()
+{
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/StringQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/StringQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/StringQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,55 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * StringQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::StringQtQuery::StringQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::StringQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QLineEdit();
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new StringQtQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->text());
+  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(update(const QString&)));
+}
+
+QtDialog::StringQtQuery::~StringQtQuery()
+{
+  delete pipe;
+}
+
+// All values besides the empty std::string are valid
+bool QtDialog::StringQtQuery::handle()
+{
+  return tmp!="";
+}
+
Index: src/UIElements/Qt4/Query/StringsQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/StringsQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/StringsQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,89 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * StringsQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qlistwidget.h>
+#include <Qt/qpushbutton.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+#include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp"
+
+
+QtDialog::StringsQtQuery::StringsQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::StringsQuery(_title),
+    parent(_parent)
+{
+  QHBoxLayout * thisHLayout = new QHBoxLayout();
+  QVBoxLayout * thisV1Layout = new QVBoxLayout();
+  QVBoxLayout * thisV2Layout = new QVBoxLayout();
+
+  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
+  QLabel *inputLabel = new QLabel("Enter to add");
+  QListWidget* inputList = new QListWidget();
+  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  QLineEdit* inputBox = new QLineEdit();
+  inputLabel->setBuddy(inputBox);
+  titleLabel->setBuddy(inputList);
+  QPushButton* AddButton = new QPushButton("Add");
+  AddButton->setEnabled(false);
+  QPushButton* RemoveButton = new QPushButton("Remove");
+  RemoveButton->setEnabled(false);
+
+  thisV1Layout->addWidget(titleLabel);
+  thisV1Layout->addWidget(inputList);
+  thisV2Layout->addWidget(inputLabel);
+  thisV2Layout->addWidget(inputBox);
+  thisV2Layout->addWidget(AddButton);
+  thisV2Layout->addWidget(RemoveButton);
+  parent->addLayout(thisHLayout);
+  thisHLayout->addLayout(thisV1Layout);
+  thisHLayout->addLayout(thisV2Layout);
+
+  pipe = new QtQueryListPipe<std::string>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
+  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
+  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
+  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
+  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));}
+
+QtDialog::StringsQtQuery::~StringsQtQuery()
+{
+  delete pipe;
+}
+
+// All values besides the empty std::string are valid
+bool QtDialog::StringsQtQuery::handle()
+{
+  // dissect by ","
+  std::string::iterator olditer = temp.begin();
+  for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) {
+    if (*iter == ' ') {
+      tmp.push_back(string(iter, olditer));
+      olditer = iter;
+    }
+  }
+  if (olditer != temp.begin())  // insert last part also
+    tmp.push_back(string(olditer, temp.end()));
+
+  return temp!="";
+}
+
Index: src/UIElements/Qt4/Query/VectorQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/VectorQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/VectorQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,61 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * VectorQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <QtGui/QDoubleSpinBox>
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::VectorQtQuery::VectorQtQuery(std::string title, bool _check,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::VectorQuery(title,_check),
+    parent(_parent)
+{
+  mainLayout= new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  mainLayout->addWidget(titleLabel);
+  subLayout = new QVBoxLayout();
+  mainLayout->addLayout(subLayout);
+  QComboBox* inputBox = new QComboBox();
+  coordLayout = new QHBoxLayout();
+  subLayout->addLayout(coordLayout);
+  coordLabel = new QLabel(QString("x,y,z"));
+  coordLayout->addWidget(coordLabel);
+  coordInput = new QDoubleSpinBox();
+//  coordInput->setRange(0,M.at(i,i));
+  coordInput->setDecimals(3);
+  coordLayout->addWidget(coordInput);
+  pipe = new VectorQtQueryPipe(&(tmp),_dialog,inputBox);
+  //pipe->update(coordInput->value());
+  connect(coordInput,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
+  parent->addLayout(mainLayout);
+}
+
+QtDialog::VectorQtQuery::~VectorQtQuery()
+{}
+
+bool QtDialog::VectorQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/VectorsQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/VectorsQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Qt4/Query/VectorsQtQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,61 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * VectorsQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <QtGui/QDoubleSpinBox>
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::VectorsQtQuery::VectorsQtQuery(std::string title, bool _check,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::VectorsQuery(title,_check),
+    parent(_parent)
+{
+  mainLayout= new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  mainLayout->addWidget(titleLabel);
+  subLayout = new QVBoxLayout();
+  mainLayout->addLayout(subLayout);
+  QComboBox* inputBox = new QComboBox();
+  coordLayout = new QHBoxLayout();
+  subLayout->addLayout(coordLayout);
+  coordLabel = new QLabel(QString("x,y,z"));
+  coordLayout->addWidget(coordLabel);
+  coordInput = new QDoubleSpinBox();
+//  coordInput->setRange(0,M.at(i,i));
+  coordInput->setDecimals(3);
+  coordLayout->addWidget(coordInput);
+  pipe = new VectorsQtQueryPipe(&(tmp),_dialog,inputBox);
+  //pipe->update(coordInput->value());
+  connect(coordInput,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
+  parent->addLayout(mainLayout);
+}
+
+QtDialog::VectorsQtQuery::~VectorsQtQuery()
+{}
+
+bool QtDialog::VectorsQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Query/AtomQuery.cpp
===================================================================
--- src/UIElements/Query/AtomQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/AtomQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,35 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+// Atom Queries
+Dialog::AtomQuery::AtomQuery(string title, std::string _description) :
+    Query(title, _description),
+    tmp(0)
+{}
+
+Dialog::AtomQuery::~AtomQuery() {}
+
+void Dialog::AtomQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/AtomsQuery.cpp
===================================================================
--- src/UIElements/Query/AtomsQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/AtomsQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,36 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomsQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Atoms Queries
+Dialog::AtomsQuery::AtomsQuery(string title, std::string _description) :
+    Query(title, _description),
+    tmp(0)
+{}
+
+Dialog::AtomsQuery::~AtomsQuery() {}
+
+void Dialog::AtomsQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/BooleanQuery.cpp
===================================================================
--- src/UIElements/Query/BooleanQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/BooleanQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,35 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * BooleanQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Bool Queries
+Dialog::BooleanQuery::BooleanQuery(string title,std::string description) :
+    Query(title, description)
+{}
+
+Dialog::BooleanQuery::~BooleanQuery() {}
+
+void Dialog::BooleanQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/BoxQuery.cpp
===================================================================
--- src/UIElements/Query/BoxQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/BoxQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,36 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * BoxQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Box Queries
+Dialog::BoxQuery::BoxQuery(std::string title, std::string _description) :
+  Query(title, _description)
+{}
+
+Dialog::BoxQuery::~BoxQuery()
+{}
+
+void Dialog::BoxQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/DoubleQuery.cpp
===================================================================
--- src/UIElements/Query/DoubleQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/DoubleQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,35 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * DoubleQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Double Queries
+Dialog::DoubleQuery::DoubleQuery(string title, std::string _description) :
+    Query(title, _description)
+{}
+
+Dialog::DoubleQuery::~DoubleQuery() {};
+
+void Dialog::DoubleQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/DoublesQuery.cpp
===================================================================
--- src/UIElements/Query/DoublesQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/DoublesQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,35 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * DoublesQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Doubles Queries
+Dialog::DoublesQuery::DoublesQuery(string title, std::string _description) :
+    Query(title, _description)
+{}
+
+Dialog::DoublesQuery::~DoublesQuery() {};
+
+void Dialog::DoublesQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/ElementQuery.cpp
===================================================================
--- src/UIElements/Query/ElementQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/ElementQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,35 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ElementQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Element Queries
+Dialog::ElementQuery::ElementQuery(std::string title, std::string _description) :
+  Query(title, _description)
+  {}
+
+Dialog::ElementQuery::~ElementQuery(){}
+
+void Dialog::ElementQuery::setResult(){
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/ElementsQuery.cpp
===================================================================
--- src/UIElements/Query/ElementsQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/ElementsQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,35 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ElementsQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Elements Queries
+Dialog::ElementsQuery::ElementsQuery(std::string title, std::string _description) :
+  Query(title, _description)
+  {}
+
+Dialog::ElementsQuery::~ElementsQuery(){}
+
+void Dialog::ElementsQuery::setResult(){
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/EmptyQuery.cpp
===================================================================
--- src/UIElements/Query/EmptyQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/EmptyQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,34 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * EmptyQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// empty Queries
+Dialog::EmptyQuery::EmptyQuery(string title, std::string description) :
+    Query(title, description)
+{}
+
+Dialog::EmptyQuery::~EmptyQuery() {}
+
+void Dialog::EmptyQuery::setResult() {
+}
+
Index: src/UIElements/Query/FileQuery.cpp
===================================================================
--- src/UIElements/Query/FileQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/FileQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,35 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * FileQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// File Queries
+Dialog::FileQuery::FileQuery(std::string title, std::string _description) :
+  Query(title, _description)
+  {}
+
+Dialog::FileQuery::~FileQuery(){}
+
+void Dialog::FileQuery::setResult(){
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/IntQuery.cpp
===================================================================
--- src/UIElements/Query/IntQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/IntQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,35 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IntQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Int Queries
+Dialog::IntQuery::IntQuery(string title, std::string description) :
+    Query(title, description)
+{}
+
+Dialog::IntQuery::~IntQuery() {}
+
+void Dialog::IntQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/IntsQuery.cpp
===================================================================
--- src/UIElements/Query/IntsQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/IntsQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,35 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IntsQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Ints Queries
+Dialog::IntsQuery::IntsQuery(string title, std::string description) :
+    Query(title, description)
+{}
+
+Dialog::IntsQuery::~IntsQuery() {}
+
+void Dialog::IntsQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/MoleculeQuery.cpp
===================================================================
--- src/UIElements/Query/MoleculeQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/MoleculeQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,36 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MoleculeQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Molecule Queries
+Dialog::MoleculeQuery::MoleculeQuery(string title, std::string _description) :
+    Query(title, _description),
+    tmp(0)
+{}
+
+Dialog::MoleculeQuery::~MoleculeQuery() {}
+
+void Dialog::MoleculeQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/MoleculesQuery.cpp
===================================================================
--- src/UIElements/Query/MoleculesQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/MoleculesQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,36 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MoleculesQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Molecules Queries
+Dialog::MoleculesQuery::MoleculesQuery(string title, std::string _description) :
+    Query(title, _description),
+    tmp(0)
+{}
+
+Dialog::MoleculesQuery::~MoleculesQuery() {}
+
+void Dialog::MoleculesQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/Query.cpp
===================================================================
--- src/UIElements/Query/Query.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/Query.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,38 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * Query.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+
+
+// Base class
+Dialog::Query::Query(string _title, string _description) :
+    title(_title),
+    description(_description)
+{}
+
+Dialog::Query::~Query() {}
+
+const std::string Dialog::Query::getTitle() const{
+  return title;
+}
+
+const std::string Dialog::Query::getDescription() const{
+  return description;
+}
Index: src/UIElements/Query/StringQuery.cpp
===================================================================
--- src/UIElements/Query/StringQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/StringQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,35 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * StringQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// String Queries
+Dialog::StringQuery::StringQuery(string title,std::string _description) :
+    Query(title, _description)
+{}
+
+Dialog::StringQuery::~StringQuery() {};
+
+void Dialog::StringQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/StringsQuery.cpp
===================================================================
--- src/UIElements/Query/StringsQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/StringsQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,35 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * StringsQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Strings Queries
+Dialog::StringsQuery::StringsQuery(string title,std::string _description) :
+    Query(title, _description)
+{}
+
+Dialog::StringsQuery::~StringsQuery() {};
+
+void Dialog::StringsQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/VectorQuery.cpp
===================================================================
--- src/UIElements/Query/VectorQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/VectorQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,37 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * VectorQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Vector Queries
+Dialog::VectorQuery::VectorQuery(std::string title,bool _check, std::string _description) :
+  Query(title, _description),
+  check(_check)
+{}
+
+Dialog::VectorQuery::~VectorQuery()
+{}
+
+void Dialog::VectorQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/VectorsQuery.cpp
===================================================================
--- src/UIElements/Query/VectorsQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Query/VectorsQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,37 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * VectorsQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Vectors Queries
+Dialog::VectorsQuery::VectorsQuery(std::string title,bool _check, std::string _description) :
+  Query(title, _description),
+  check(_check)
+{}
+
+Dialog::VectorsQuery::~VectorsQuery()
+{}
+
+void Dialog::VectorsQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/TextUI/Query/AtomTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/AtomTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/AtomTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,64 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "World.hpp"
+
+TextDialog::AtomTextQuery::AtomTextQuery(string title, std::string _description) :
+    Dialog::AtomQuery(title,_description)
+{}
+
+TextDialog::AtomTextQuery::~AtomTextQuery() {}
+
+bool TextDialog::AtomTextQuery::handle() {
+  int idxOfAtom=-1;
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> idxOfAtom;
+    if(cin.fail()){
+      badInput = true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+      continue;
+    }
+
+    tmp = World::getInstance().getAtom(AtomById(idxOfAtom));
+    if(!tmp && idxOfAtom!=-1){
+      Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
+      badInput = true;
+    }
+
+  } while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return (idxOfAtom!=-1);
+}
+
+
Index: src/UIElements/TextUI/Query/AtomsTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/AtomsTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/AtomsTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,71 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomsTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+#include "atom.hpp"
+#include "World.hpp"
+
+
+TextDialog::AtomsTextQuery::AtomsTextQuery(string title, std::string _description) :
+    Dialog::AtomsQuery(title,_description)
+{}
+
+TextDialog::AtomsTextQuery::~AtomsTextQuery() {}
+
+bool TextDialog::AtomsTextQuery::handle() {
+  int idxOfAtom=-1;
+  Log() << Verbose(0) << getTitle();
+  std::string line;
+  getline(cin,line);
+  // dissect by " "
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
+    if (*iter == ' ') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> idxOfAtom;
+      temp = World::getInstance().getAtom(AtomById(idxOfAtom));
+      if(!temp && idxOfAtom!=-1){
+        Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
+        break;
+      }
+      tmp.push_back(temp);
+      olditer = iter;
+    }
+  }
+  if (olditer != line.begin()) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> idxOfAtom;
+    temp = World::getInstance().getAtom(AtomById(idxOfAtom));
+    if(!temp && idxOfAtom!=-1) {
+      Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
+      tmp.push_back(temp);
+    }
+  }
+
+  return (idxOfAtom!=-1);
+}
+
Index: src/UIElements/TextUI/Query/BooleanTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/BooleanTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/BooleanTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,58 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * BooleanTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::BooleanTextQuery::BooleanTextQuery(string title, std::string _description) :
+    Dialog::BooleanQuery(title,_description)
+{}
+
+TextDialog::BooleanTextQuery::~BooleanTextQuery() {}
+
+bool TextDialog::BooleanTextQuery::handle() {
+  bool badInput = false;
+  char input = ' ';
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> input;
+    if ((input == 'y' ) || (input == 'Y')) {
+      tmp = true;
+    } else if ((input == 'n' ) || (input == 'N')) {
+      tmp = false;
+    } else {
+      badInput=true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
+    }
+  } while(badInput);
+  // clear the input buffer of anything still in the line
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/BoxTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/BoxTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/BoxTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,60 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * BoxTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Matrix.hpp"
+
+
+TextDialog::BoxTextQuery::BoxTextQuery(std::string title, std::string _description) :
+    Dialog::BoxQuery(title,_description)
+{}
+
+TextDialog::BoxTextQuery::~BoxTextQuery()
+{}
+
+bool TextDialog::BoxTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+
+  double temp[6];
+  std::string coords[6] = {"xx","yx","yy", "zx", "zy", "zz"};
+  for (int i=0;i<6;i++) {
+    Log() << Verbose(0) << coords[i] << ": ";
+    cin >> temp[i];
+  }
+  Matrix M;
+  M.set(0,0, temp[0]);
+  M.set(0,1, temp[1]);
+  M.set(0,2, temp[2]);
+  M.set(1,0, temp[1]);
+  M.set(1,1, temp[3]);
+  M.set(1,2, temp[4]);
+  M.set(2,0, temp[2]);
+  M.set(2,1, temp[4]);
+  M.set(2,2, temp[5]);
+  tmp.setM(M);
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/DoubleTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/DoubleTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/DoubleTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,53 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * DoubleTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::DoubleTextQuery::DoubleTextQuery(string title, std::string _description) :
+    Dialog::DoubleQuery(title,_description)
+{}
+
+TextDialog::DoubleTextQuery::~DoubleTextQuery() {}
+
+bool TextDialog::DoubleTextQuery::handle() {
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> tmp;
+    if(cin.fail()){
+      badInput = true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+    }
+  }while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
+
Index: src/UIElements/TextUI/Query/DoublesTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/DoublesTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/DoublesTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,58 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * DoublesTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::DoublesTextQuery::DoublesTextQuery(string title, std::string _description) :
+    Dialog::DoublesQuery(title,_description)
+{}
+
+TextDialog::DoublesTextQuery::~DoublesTextQuery() {}
+
+bool TextDialog::DoublesTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+  std::string line;
+  getline(cin,line);
+  // dissect by " "
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
+    if (*iter == ' ') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> temp;
+      tmp.push_back(temp);
+      olditer = iter;
+    }
+  }
+  if (olditer != line.begin()) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> temp;
+    tmp.push_back(temp);
+  }
+
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/ElementTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/ElementTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/ElementTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,96 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ElementTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+
+TextDialog::ElementTextQuery::ElementTextQuery(std::string title, std::string _description) :
+    Dialog::ElementQuery(title,_description)
+{}
+
+TextDialog::ElementTextQuery::~ElementTextQuery()
+{}
+
+bool TextDialog::ElementTextQuery::handle() {
+  bool badInput=false;
+  bool aborted = false;
+  const element * temp = NULL;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+
+    // try to read as Atomic number
+    int Z;
+    cin >> Z;
+    if(!cin.fail()){
+      if(Z==-1){
+        aborted = true;
+      }
+      else{
+        temp = World::getInstance().getPeriode()->FindElement(Z);
+        if(!temp){
+          Log() << Verbose(0) << "No element with this atomic number!" << endl;
+          badInput = true;
+        }
+      }
+      continue;
+    }
+    else{
+      cin.clear();
+    }
+
+    // Try to read as shorthand
+    // the last buffer content was not removed, so we read the
+    // same thing again, this time as a std::string
+    std::string shorthand;
+    cin >> shorthand;
+    if(!cin.fail()){
+      if(shorthand.empty()){
+        aborted = true;
+      }
+      else{
+        temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
+        if(!temp){
+          Log() << Verbose(0) << "No element with this shorthand!" << endl;
+          badInput = true;
+        }
+      }
+    }
+    else{
+      Log() << Verbose(0) << "Could not read input. Try Again." << endl;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      badInput = true;
+    }
+
+  }while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return !aborted;
+}
+
Index: src/UIElements/TextUI/Query/ElementsTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/ElementsTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/ElementsTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,87 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ElementsTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+#include <boost/lexical_cast.hpp>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+using boost::lexical_cast;
+using boost::bad_lexical_cast;
+
+
+TextDialog::ElementsTextQuery::ElementsTextQuery(std::string title, std::string _description) :
+    Dialog::ElementsQuery(title,_description)
+{}
+
+TextDialog::ElementsTextQuery::~ElementsTextQuery()
+{}
+
+bool TextDialog::ElementsTextQuery::handle() {
+  std::string shorthand;
+  int Z=-1;
+  Log() << Verbose(0) << getTitle();
+  std::string line;
+  getline(cin,line);
+  // dissect by " "
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
+    if (*iter == ' ') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> shorthand;
+      try {
+        Z = lexical_cast<int>(shorthand);
+        temp = World::getInstance().getPeriode()->FindElement(Z);
+      } catch (bad_lexical_cast) {
+        temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
+      };
+      if(!temp && Z!=-1){
+        Log() << Verbose(0) << "Invalid Element" << shorthand << endl;
+        break;
+      }
+      tmp.push_back(temp);
+      olditer = iter;
+    }
+  }
+  if (olditer != line.begin()) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> shorthand;
+    try {
+      Z = lexical_cast<int>(shorthand);
+      temp = World::getInstance().getPeriode()->FindElement(Z);
+    } catch (bad_lexical_cast) {
+      temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
+    };
+    if(!temp && Z!=-1) {
+      Log() << Verbose(0) << "Invalid Element" << shorthand << endl;
+      tmp.push_back(temp);
+    }
+  }
+
+  return (Z!=-1);
+}
+
Index: src/UIElements/TextUI/Query/EmptyTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/EmptyTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/EmptyTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,40 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * EmptyTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::EmptyTextQuery::EmptyTextQuery(string title, std::string _description) :
+    Dialog::EmptyQuery(title,_description)
+{}
+
+TextDialog::EmptyTextQuery::~EmptyTextQuery() {}
+
+bool TextDialog::EmptyTextQuery::handle() {
+  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/FileTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/FileTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/FileTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,45 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * FileTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include <boost/filesystem.hpp>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::FileTextQuery::FileTextQuery(string title, std::string _description) :
+    Dialog::FileQuery(title,_description)
+{}
+
+TextDialog::FileTextQuery::~FileTextQuery() {}
+
+bool TextDialog::FileTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+  std::string tempstring;
+  getline(cin,tempstring);
+  tmp = tempstring;
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/IntTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/IntTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/IntTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,53 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IntTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::IntTextQuery::IntTextQuery(string title, std::string _description) :
+    Dialog::IntQuery(title,_description)
+{}
+
+TextDialog::IntTextQuery::~IntTextQuery() {}
+
+bool TextDialog::IntTextQuery::handle() {
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> tmp;
+    if(cin.fail()){
+      badInput=true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+    }
+  } while(badInput);
+  // clear the input buffer of anything still in the line
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/IntsTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/IntsTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/IntsTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,58 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IntsTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::IntsTextQuery::IntsTextQuery(string title, std::string _description) :
+    Dialog::IntsQuery(title,_description)
+{}
+
+TextDialog::IntsTextQuery::~IntsTextQuery() {}
+
+bool TextDialog::IntsTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+  std::string line;
+  getline(cin,line);
+  // dissect by " "
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
+    if (*iter == ' ') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> temp;
+      tmp.push_back(temp);
+      olditer = iter;
+    }
+  }
+  if (olditer != line.begin()) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> temp;
+    tmp.push_back(temp);
+  }
+
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/MoleculeTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/MoleculeTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/MoleculeTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,65 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MoleculeTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "World.hpp"
+
+
+TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, std::string _description) :
+    Dialog::MoleculeQuery(title,_description)
+{}
+
+TextDialog::MoleculeTextQuery::~MoleculeTextQuery() {}
+
+bool TextDialog::MoleculeTextQuery::handle() {
+  int idxOfMol=0;
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> idxOfMol;
+    if(cin.fail()){
+      badInput = true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+      continue;
+    }
+
+    tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
+    if(!tmp && idxOfMol!=-1){
+      Log() << Verbose(0) << "Invalid Molecule Index" << endl;
+      badInput = true;
+    }
+
+  } while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return (idxOfMol!=-1);
+}
+
+
Index: src/UIElements/TextUI/Query/MoleculesTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/MoleculesTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/MoleculesTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,71 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * MoleculesTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "World.hpp"
+
+
+TextDialog::MoleculesTextQuery::MoleculesTextQuery(string title, std::string _description) :
+    Dialog::MoleculesQuery(title,_description)
+{}
+
+TextDialog::MoleculesTextQuery::~MoleculesTextQuery() {}
+
+bool TextDialog::MoleculesTextQuery::handle() {
+  int idxOfMol=-1;
+  Log() << Verbose(0) << getTitle();
+  std::string line;
+  getline(cin,line);
+  // dissect by " "
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
+    if (*iter == ' ') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> idxOfMol;
+      temp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
+      if(!temp && idxOfMol!=-1){
+        Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl;
+        break;
+      }
+      tmp.push_back(temp);
+      olditer = iter;
+    }
+  }
+  if (olditer != line.begin()) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> idxOfMol;
+    temp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
+    if(!temp && idxOfMol!=-1){
+      Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl;
+      tmp.push_back(temp);
+    }
+  }
+
+  return (idxOfMol!=-1);
+}
+
Index: src/UIElements/TextUI/Query/StringTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/StringTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/StringTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,41 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * StringTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::StringTextQuery::StringTextQuery(string title, std::string _description) :
+    Dialog::StringQuery(title,_description)
+{}
+
+TextDialog::StringTextQuery::~StringTextQuery() {}
+
+bool TextDialog::StringTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+  getline(cin,tmp);
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/StringsTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/StringsTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/StringsTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,52 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * StringsTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::StringsTextQuery::StringsTextQuery(string title, std::string _description) :
+    Dialog::StringsQuery(title,_description)
+{}
+
+TextDialog::StringsTextQuery::~StringsTextQuery() {}
+
+bool TextDialog::StringsTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+  getline(cin,temp);
+  // dissect by " "
+  std::string::iterator olditer = temp.begin();
+  for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) {
+    if (*iter == ' ') {
+      tmp.push_back(string(iter, olditer));
+      olditer = iter;
+    }
+  }
+  if (olditer != temp.begin())  // insert last part also
+    tmp.push_back(string(olditer, temp.end()));
+
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/VectorTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/VectorTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/VectorTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,71 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * VectorTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "LinearAlgebra/Matrix.hpp"
+#include "World.hpp"
+
+
+TextDialog::VectorTextQuery::VectorTextQuery(std::string title, bool _check, std::string _description) :
+    Dialog::VectorQuery(title,_check,_description)
+{}
+
+TextDialog::VectorTextQuery::~VectorTextQuery()
+{}
+
+bool TextDialog::VectorTextQuery::handle() {
+  std::cout << getTitle();
+  const Matrix &M = World::getInstance().getDomain().getM();
+  char coords[3] = {'x', 'y', 'z'};
+  for (int i=0;i<3;i++)
+    std::cout << coords[i] << "[0.." << M.at(i,i) << ( (i!=2) ? "], " : "]: ");
+
+  std::string line;
+  getline(cin,line);
+
+  // dissect by ","
+  double coord = 0.;
+  int counter = 0;
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); (iter != line.end()) && (counter != 3); ++iter) {
+    if (*iter == ',') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> coord;
+      tmp[counter++] = coord;
+      olditer = iter;
+    }
+  }
+  if ((olditer != line.begin()) && (counter != 3)) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> coord;
+    tmp[counter++] = coord;
+  }
+
+  // check vector
+  return World::getInstance().getDomain().isInside(tmp);
+}
+
Index: src/UIElements/TextUI/Query/VectorsTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/VectorsTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/TextUI/Query/VectorsTextQuery.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,81 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * VectorsTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "LinearAlgebra/Matrix.hpp"
+#include "World.hpp"
+
+
+TextDialog::VectorsTextQuery::VectorsTextQuery(std::string title, bool _check, std::string _description) :
+    Dialog::VectorsQuery(title,_check,_description)
+{}
+
+TextDialog::VectorsTextQuery::~VectorsTextQuery()
+{}
+
+bool TextDialog::VectorsTextQuery::handle() {
+  std::cout << getTitle();
+  char coords[3] = {'x', 'y', 'z'};
+  const Matrix &M = World::getInstance().getDomain().getM();
+  for (int i=0;i<3;i++)
+    std::cout << coords[i] << "[0.." << M.at(i,i) << ( (i!=2) ? "], " : "]: ");
+
+  std::string line;
+  getline(cin,line);
+
+  // dissect by ","
+  double coord = 0.;
+  std::string::iterator olditerspace = line.begin();
+  std::string::iterator olditercomma = line.begin();
+  int counter = 0;
+  for(string::iterator vectoriter = line.begin(); vectoriter != line.end(); ++vectoriter) {
+    if (*vectoriter == ',')
+      counter++;
+    if ((*vectoriter == ' ') && (counter == 2)) {
+      counter = 0;
+      for(string::iterator componentiter = olditerspace; (componentiter != vectoriter) && (counter !=3); ++componentiter) {
+        if (*componentiter == ',') {
+          std::istringstream stream(string(componentiter, olditercomma));
+          stream >> coord;
+          temp[counter++] = coord;
+          olditercomma = componentiter;
+        }
+      }
+      if ((olditercomma != line.begin()) && (counter != 3)) { // insert last part also
+        std::istringstream stream(string(olditercomma, vectoriter));
+        stream >> coord;
+        temp[counter++] = coord;
+      }
+      if (World::getInstance().getDomain().isInside(temp))
+        tmp.push_back(temp);
+      olditerspace = vectoriter;
+    }
+  }
+
+  return true;
+}
+
Index: src/UIElements/TextUI/TextDialog.cpp
===================================================================
--- src/UIElements/TextUI/TextDialog.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/UIElements/TextUI/TextDialog.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -20,26 +20,5 @@
 #include "Helpers/MemDebug.hpp"
 
-#include <iostream>
-
-#include <Descriptors/AtomDescriptor.hpp>
-#include <Descriptors/AtomIdDescriptor.hpp>
-#include <Descriptors/MoleculeDescriptor.hpp>
-#include <Descriptors/MoleculeIdDescriptor.hpp>
-#include <boost/lexical_cast.hpp>
 #include "TextUI/TextDialog.hpp"
-
-#include "World.hpp"
-#include "periodentafel.hpp"
-#include "Helpers/Log.hpp"
-#include "Helpers/Verbose.hpp"
-
-#include "atom.hpp"
-#include "element.hpp"
-#include "molecule.hpp"
-#include "LinearAlgebra/Vector.hpp"
-#include "LinearAlgebra/Matrix.hpp"
-#include "Box.hpp"
-
-#include <boost/lexical_cast.hpp>
 
 using namespace std;
@@ -125,561 +104,10 @@
 }
 
-/************************** Query Infrastructure ************************/
-
-TextDialog::EmptyTextQuery::EmptyTextQuery(string title, std::string _description) :
-    Dialog::EmptyQuery(title,_description)
-{}
-
-TextDialog::EmptyTextQuery::~EmptyTextQuery() {}
-
-bool TextDialog::EmptyTextQuery::handle() {
-  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
-  return true;
+void TextDialog::queryFile(const char* title, std::string description){
+  registerQuery(new FileTextQuery(title,description));
 }
 
-TextDialog::IntTextQuery::IntTextQuery(string title, std::string _description) :
-    Dialog::IntQuery(title,_description)
-{}
+/************************** Query Infrastructure ************************/
+/*       ---> shifted to folder Query                                   */
+/************************************************************************/
 
-TextDialog::IntTextQuery::~IntTextQuery() {}
-
-bool TextDialog::IntTextQuery::handle() {
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> tmp;
-    if(cin.fail()){
-      badInput=true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-    }
-  } while(badInput);
-  // clear the input buffer of anything still in the line
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return true;
-}
-
-TextDialog::IntsTextQuery::IntsTextQuery(string title, std::string _description) :
-    Dialog::IntsQuery(title,_description)
-{}
-
-TextDialog::IntsTextQuery::~IntsTextQuery() {}
-
-bool TextDialog::IntsTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-  std::string line;
-  getline(cin,line);
-  // dissect by " "
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
-    if (*iter == ' ') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> temp;
-      tmp.push_back(temp);
-      olditer = iter;
-    }
-  }
-  if (olditer != line.begin()) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> temp;
-    tmp.push_back(temp);
-  }
-
-  return true;
-}
-
-TextDialog::BooleanTextQuery::BooleanTextQuery(string title, std::string _description) :
-    Dialog::BooleanQuery(title,_description)
-{}
-
-TextDialog::BooleanTextQuery::~BooleanTextQuery() {}
-
-bool TextDialog::BooleanTextQuery::handle() {
-  bool badInput = false;
-  char input = ' ';
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> input;
-    if ((input == 'y' ) || (input == 'Y')) {
-      tmp = true;
-    } else if ((input == 'n' ) || (input == 'N')) {
-      tmp = false;
-    } else {
-      badInput=true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
-    }
-  } while(badInput);
-  // clear the input buffer of anything still in the line
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return true;
-}
-
-TextDialog::StringTextQuery::StringTextQuery(string title, std::string _description) :
-    Dialog::StringQuery(title,_description)
-{}
-
-TextDialog::StringTextQuery::~StringTextQuery() {}
-
-bool TextDialog::StringTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-  getline(cin,tmp);
-  return true;
-}
-
-TextDialog::StringsTextQuery::StringsTextQuery(string title, std::string _description) :
-    Dialog::StringsQuery(title,_description)
-{}
-
-TextDialog::StringsTextQuery::~StringsTextQuery() {}
-
-bool TextDialog::StringsTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-  getline(cin,temp);
-  // dissect by " "
-  std::string::iterator olditer = temp.begin();
-  for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) {
-    if (*iter == ' ') {
-      tmp.push_back(string(iter, olditer));
-      olditer = iter;
-    }
-  }
-  if (olditer != temp.begin())  // insert last part also
-    tmp.push_back(string(olditer, temp.end()));
-
-  return true;
-}
-
-TextDialog::DoubleTextQuery::DoubleTextQuery(string title, std::string _description) :
-    Dialog::DoubleQuery(title,_description)
-{}
-
-TextDialog::DoubleTextQuery::~DoubleTextQuery() {}
-
-bool TextDialog::DoubleTextQuery::handle() {
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> tmp;
-    if(cin.fail()){
-      badInput = true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-    }
-  }while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return true;
-}
-
-
-TextDialog::DoublesTextQuery::DoublesTextQuery(string title, std::string _description) :
-    Dialog::DoublesQuery(title,_description)
-{}
-
-TextDialog::DoublesTextQuery::~DoublesTextQuery() {}
-
-bool TextDialog::DoublesTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-  std::string line;
-  getline(cin,line);
-  // dissect by " "
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
-    if (*iter == ' ') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> temp;
-      tmp.push_back(temp);
-      olditer = iter;
-    }
-  }
-  if (olditer != line.begin()) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> temp;
-    tmp.push_back(temp);
-  }
-
-  return true;
-}
-
-TextDialog::AtomTextQuery::AtomTextQuery(string title, std::string _description) :
-    Dialog::AtomQuery(title,_description)
-{}
-
-TextDialog::AtomTextQuery::~AtomTextQuery() {}
-
-bool TextDialog::AtomTextQuery::handle() {
-  int idxOfAtom=-1;
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> idxOfAtom;
-    if(cin.fail()){
-      badInput = true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-      continue;
-    }
-
-    tmp = World::getInstance().getAtom(AtomById(idxOfAtom));
-    if(!tmp && idxOfAtom!=-1){
-      Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
-      badInput = true;
-    }
-
-  } while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return (idxOfAtom!=-1);
-}
-
-
-TextDialog::AtomsTextQuery::AtomsTextQuery(string title, std::string _description) :
-    Dialog::AtomsQuery(title,_description)
-{}
-
-TextDialog::AtomsTextQuery::~AtomsTextQuery() {}
-
-bool TextDialog::AtomsTextQuery::handle() {
-  int idxOfAtom=-1;
-  Log() << Verbose(0) << getTitle();
-  std::string line;
-  getline(cin,line);
-  // dissect by " "
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
-    if (*iter == ' ') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> idxOfAtom;
-      temp = World::getInstance().getAtom(AtomById(idxOfAtom));
-      if(!temp && idxOfAtom!=-1){
-        Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
-        break;
-      }
-      tmp.push_back(temp);
-      olditer = iter;
-    }
-  }
-  if (olditer != line.begin()) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> idxOfAtom;
-    temp = World::getInstance().getAtom(AtomById(idxOfAtom));
-    if(!temp && idxOfAtom!=-1) {
-      Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
-      tmp.push_back(temp);
-    }
-  }
-
-  return (idxOfAtom!=-1);
-}
-
-TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, std::string _description) :
-    Dialog::MoleculeQuery(title,_description)
-{}
-
-TextDialog::MoleculeTextQuery::~MoleculeTextQuery() {}
-
-bool TextDialog::MoleculeTextQuery::handle() {
-  int idxOfMol=0;
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> idxOfMol;
-    if(cin.fail()){
-      badInput = true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-      continue;
-    }
-
-    tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
-    if(!tmp && idxOfMol!=-1){
-      Log() << Verbose(0) << "Invalid Molecule Index" << endl;
-      badInput = true;
-    }
-
-  } while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return (idxOfMol!=-1);
-}
-
-
-TextDialog::MoleculesTextQuery::MoleculesTextQuery(string title, std::string _description) :
-    Dialog::MoleculesQuery(title,_description)
-{}
-
-TextDialog::MoleculesTextQuery::~MoleculesTextQuery() {}
-
-bool TextDialog::MoleculesTextQuery::handle() {
-  int idxOfMol=-1;
-  Log() << Verbose(0) << getTitle();
-  std::string line;
-  getline(cin,line);
-  // dissect by " "
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
-    if (*iter == ' ') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> idxOfMol;
-      temp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
-      if(!temp && idxOfMol!=-1){
-        Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl;
-        break;
-      }
-      tmp.push_back(temp);
-      olditer = iter;
-    }
-  }
-  if (olditer != line.begin()) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> idxOfMol;
-    temp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
-    if(!temp && idxOfMol!=-1){
-      Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl;
-      tmp.push_back(temp);
-    }
-  }
-
-  return (idxOfMol!=-1);
-}
-
-TextDialog::VectorTextQuery::VectorTextQuery(std::string title, bool _check, std::string _description) :
-    Dialog::VectorQuery(title,_check,_description)
-{}
-
-TextDialog::VectorTextQuery::~VectorTextQuery()
-{}
-
-bool TextDialog::VectorTextQuery::handle() {
-  std::cout << getTitle();
-  const Matrix &M = World::getInstance().getDomain().getM();
-  char coords[3] = {'x', 'y', 'z'};
-  for (int i=0;i<3;i++)
-    std::cout << coords[i] << "[0.." << M.at(i,i) << ( (i!=2) ? "], " : "]: ");
-
-  std::string line;
-  getline(cin,line);
-
-  // dissect by ","
-  double coord = 0.;
-  int counter = 0;
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); (iter != line.end()) && (counter != 3); ++iter) {
-    if (*iter == ',') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> coord;
-      tmp[counter++] = coord;
-      olditer = iter;
-    }
-  }
-  if ((olditer != line.begin()) && (counter != 3)) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> coord;
-    tmp[counter++] = coord;
-  }
-
-  // check vector
-  return World::getInstance().getDomain().isInside(tmp);
-}
-
-TextDialog::VectorsTextQuery::VectorsTextQuery(std::string title, bool _check, std::string _description) :
-    Dialog::VectorsQuery(title,_check,_description)
-{}
-
-TextDialog::VectorsTextQuery::~VectorsTextQuery()
-{}
-
-bool TextDialog::VectorsTextQuery::handle() {
-  std::cout << getTitle();
-  char coords[3] = {'x', 'y', 'z'};
-  const Matrix &M = World::getInstance().getDomain().getM();
-  for (int i=0;i<3;i++)
-    std::cout << coords[i] << "[0.." << M.at(i,i) << ( (i!=2) ? "], " : "]: ");
-
-  std::string line;
-  getline(cin,line);
-
-  // dissect by ","
-  double coord = 0.;
-  std::string::iterator olditerspace = line.begin();
-  std::string::iterator olditercomma = line.begin();
-  int counter = 0;
-  for(string::iterator vectoriter = line.begin(); vectoriter != line.end(); ++vectoriter) {
-    if (*vectoriter == ',')
-      counter++;
-    if ((*vectoriter == ' ') && (counter == 2)) {
-      counter = 0;
-      for(string::iterator componentiter = olditerspace; (componentiter != vectoriter) && (counter !=3); ++componentiter) {
-        if (*componentiter == ',') {
-          std::istringstream stream(string(componentiter, olditercomma));
-          stream >> coord;
-          temp[counter++] = coord;
-          olditercomma = componentiter;
-        }
-      }
-      if ((olditercomma != line.begin()) && (counter != 3)) { // insert last part also
-        std::istringstream stream(string(olditercomma, vectoriter));
-        stream >> coord;
-        temp[counter++] = coord;
-      }
-      if (World::getInstance().getDomain().isInside(temp))
-        tmp.push_back(temp);
-      olditerspace = vectoriter;
-    }
-  }
-
-  return true;
-}
-
-TextDialog::BoxTextQuery::BoxTextQuery(std::string title, std::string _description) :
-    Dialog::BoxQuery(title,_description)
-{}
-
-TextDialog::BoxTextQuery::~BoxTextQuery()
-{}
-
-bool TextDialog::BoxTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-
-  double temp[6];
-  std::string coords[6] = {"xx","yx","yy", "zx", "zy", "zz"};
-  for (int i=0;i<6;i++) {
-    Log() << Verbose(0) << coords[i] << ": ";
-    cin >> temp[i];
-  }
-  Matrix M;
-  M.set(0,0, temp[0]);
-  M.set(0,1, temp[1]);
-  M.set(0,2, temp[2]);
-  M.set(1,0, temp[1]);
-  M.set(1,1, temp[3]);
-  M.set(1,2, temp[4]);
-  M.set(2,0, temp[2]);
-  M.set(2,1, temp[4]);
-  M.set(2,2, temp[5]);
-  tmp.setM(M);
-  return true;
-}
-
-TextDialog::ElementTextQuery::ElementTextQuery(std::string title, std::string _description) :
-    Dialog::ElementQuery(title,_description)
-{}
-
-TextDialog::ElementTextQuery::~ElementTextQuery()
-{}
-
-bool TextDialog::ElementTextQuery::handle() {
-  bool badInput=false;
-  bool aborted = false;
-  const element * temp = NULL;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-
-    // try to read as Atomic number
-    int Z;
-    cin >> Z;
-    if(!cin.fail()){
-      if(Z==-1){
-        aborted = true;
-      }
-      else{
-        temp = World::getInstance().getPeriode()->FindElement(Z);
-        if(!temp){
-          Log() << Verbose(0) << "No element with this atomic number!" << endl;
-          badInput = true;
-        }
-      }
-      continue;
-    }
-    else{
-      cin.clear();
-    }
-
-    // Try to read as shorthand
-    // the last buffer content was not removed, so we read the
-    // same thing again, this time as a std::string
-    std::string shorthand;
-    cin >> shorthand;
-    if(!cin.fail()){
-      if(shorthand.empty()){
-        aborted = true;
-      }
-      else{
-        temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
-        if(!temp){
-          Log() << Verbose(0) << "No element with this shorthand!" << endl;
-          badInput = true;
-        }
-      }
-    }
-    else{
-      Log() << Verbose(0) << "Could not read input. Try Again." << endl;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      badInput = true;
-    }
-
-  }while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return !aborted;
-}
-
-TextDialog::ElementsTextQuery::ElementsTextQuery(std::string title, std::string _description) :
-    Dialog::ElementsQuery(title,_description)
-{}
-
-TextDialog::ElementsTextQuery::~ElementsTextQuery()
-{}
-
-bool TextDialog::ElementsTextQuery::handle() {
-  std::string shorthand;
-  int Z=-1;
-  Log() << Verbose(0) << getTitle();
-  std::string line;
-  getline(cin,line);
-  // dissect by " "
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
-    if (*iter == ' ') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> shorthand;
-      try {
-        Z = lexical_cast<int>(shorthand);
-        temp = World::getInstance().getPeriode()->FindElement(Z);
-      } catch (bad_lexical_cast) {
-        temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
-      };
-      if(!temp && Z!=-1){
-        Log() << Verbose(0) << "Invalid Element" << shorthand << endl;
-        break;
-      }
-      tmp.push_back(temp);
-      olditer = iter;
-    }
-  }
-  if (olditer != line.begin()) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> shorthand;
-    try {
-      Z = lexical_cast<int>(shorthand);
-      temp = World::getInstance().getPeriode()->FindElement(Z);
-    } catch (bad_lexical_cast) {
-      temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
-    };
-    if(!temp && Z!=-1) {
-      Log() << Verbose(0) << "Invalid Element" << shorthand << endl;
-      tmp.push_back(temp);
-    }
-  }
-
-  return (Z!=-1);
-}
Index: src/UIElements/TextUI/TextDialog.hpp
===================================================================
--- src/UIElements/TextUI/TextDialog.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/UIElements/TextUI/TextDialog.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -41,4 +41,5 @@
   virtual void queryElement(const char*, std::string = "");
   virtual void queryElements(const char*, std::string = "");
+  virtual void queryFile(const char*, std::string = "");
 
 protected:
@@ -162,4 +163,11 @@
     virtual bool handle();
   };
+
+  class FileTextQuery : public Dialog::FileQuery {
+  public:
+    FileTextQuery(std::string title, std::string _description = NULL);
+    virtual ~FileTextQuery();
+    virtual bool handle();
+  };
 };
 
Index: c/UIElements/Views/QT4/GLMoleculeView.cpp
===================================================================
--- src/UIElements/Views/QT4/GLMoleculeView.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,29 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * GLMoleculeView.cpp
- *
- *  Created on: Jan 26, 2010
- *      Author: crueger
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "GLMoleculeView.hpp"
-
-#include "Helpers/MemDebug.hpp"
-
-GLMoleculeView::GLMoleculeView(QWidget *parent) :
-  QGLWidget(parent)
-{}
-
-GLMoleculeView::~GLMoleculeView()
-{}
Index: c/UIElements/Views/QT4/GLMoleculeView.hpp
===================================================================
--- src/UIElements/Views/QT4/GLMoleculeView.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,21 +1,0 @@
-/*
- * GLMoleculeView.hpp
- *
- *  Created on: Jan 26, 2010
- *      Author: crueger
- */
-
-#ifndef GLMOLECULEVIEW_HPP_
-#define GLMOLECULEVIEW_HPP_
-
-#include <QtOpenGL/QGLWidget>
-
-class GLMoleculeView :  public QGLWidget
-{
-  Q_OBJECT
-public:
-  GLMoleculeView(QWidget *parent=0);
-  virtual ~GLMoleculeView();
-};
-
-#endif /* GLMOLECULEVIEW_HPP_ */
Index: c/UIElements/Views/QT4/QTMoleculeView.cpp
===================================================================
--- src/UIElements/Views/QT4/QTMoleculeView.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,106 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * QTMoleculeView.cpp
- *
- *  Created on: Mar 4, 2010
- *      Author: crueger
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "Views/QT4/QTMoleculeView.hpp"
-
-#include <iostream>
-
-#include "Helpers/MemDebug.hpp"
-
-#include "molecule.hpp"
-
-using namespace std;
-
-/***************** Basic structure for tab layout ***********/
-
-QTMoleculeView::QTMoleculeView() :
-    QTabWidget()
-{
-  allPage = new QTAllMoleculePage();
-  addTab(allPage,QString("All Molecules"));
-
-  connect(this,SIGNAL(addMolecule(molecule*)),allPage,SLOT(addMolecule(molecule*)));
-  connect(this,SIGNAL(removeMolecule(molecule*)),allPage,SLOT(removeMolecule(molecule*)));
-}
-
-QTMoleculeView::~QTMoleculeView()
-{}
-
-void QTMoleculeView::moleculeSelected(molecule *mol){
-  if(!pages.count(mol)){
-    string molName = mol->GetName();
-    QTMoleculePage *molPage = new QTMoleculePage(mol,molName);
-    addTab(molPage,QString(molName.c_str()));
-    pages[mol] = molPage;
-
-    connect(molPage,SIGNAL(nameChanged(QTMoleculePage*,std::string)),this,SLOT(nameChanged(QTMoleculePage*,std::string)));
-
-    emit addMolecule(mol);
-  }
-}
-
-void QTMoleculeView::moleculeUnSelected(molecule *mol){
-  if(pages.count(mol)){
-    QTMoleculePage *molPage = pages[mol];
-    removeTab(indexOf(molPage));
-    pages.erase(mol);
-    delete molPage;
-    emit removeMolecule(mol);
-  }
-}
-
-void QTMoleculeView::nameChanged(QTMoleculePage *page, std::string name){
-  setTabText(indexOf(page),QString(name.c_str()));
-}
-
-/************************ Tab for all Molecules ********************/
-
-QTAllMoleculePage::QTAllMoleculePage() :
-  Observer("QTAllMoleculePage")
-{}
-
-void QTAllMoleculePage::addMolecule(molecule *mol){}
-
-void QTAllMoleculePage::removeMolecule(molecule *mol){}
-
-void QTAllMoleculePage::update(Observable *subject){}
-
-void QTAllMoleculePage::subjectKilled(Observable *subject){}
-
-/************************ Tab for single Molecules *****************/
-
-QTMoleculePage::QTMoleculePage(molecule *_mol, string _name) :
-    Observer("QTMoleculePage"),
-    mol(_mol), name(_name)
-{
-  mol->signOn(this);
-}
-
-QTMoleculePage::~QTMoleculePage(){
-  mol->signOff(this);
-}
-
-void QTMoleculePage::update(Observable *subject){
-  if(name != mol->GetName()){
-    name = mol->GetName();
-    emit nameChanged(this,name);
-  }
-}
-
-void QTMoleculePage::subjectKilled(Observable *subject){}
Index: c/UIElements/Views/QT4/QTMoleculeView.hpp
===================================================================
--- src/UIElements/Views/QT4/QTMoleculeView.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,77 +1,0 @@
-/*
- * MoleculeView.hpp
- *
- *  Created on: Mar 4, 2010
- *      Author: crueger
- */
-
-#ifndef MOLECULEVIEW_HPP_
-#define MOLECULEVIEW_HPP_
-
-#include <string>
-#include <QtGui/QTabWidget>
-#include "Patterns/Observer.hpp"
-
-class molecule;
-
-// Forwarding of the Tab-Pages
-class QTAllMoleculePage;
-class QTMoleculePage;
-
-class QTMoleculeView : public QTabWidget
-{
-  Q_OBJECT
-public:
-  QTMoleculeView();
-  virtual ~QTMoleculeView();
-
-public slots:
-  void moleculeSelected(molecule *);
-  void moleculeUnSelected(molecule *);
-
-  void nameChanged(QTMoleculePage *page, std::string name);
-
-signals:
-  void addMolecule(molecule *);
-  void removeMolecule(molecule *);
-
-
-private:
-  QTAllMoleculePage *allPage; //!< contained widget to cary information of all selected molecules
-  std::map<molecule*,QTMoleculePage *> pages;//!< contained widget to cary information on a specific molecule
-};
-
-/**
- * Widget to display the tab page for all selected molecules
- */
-class QTAllMoleculePage : public QWidget, public Observer {
-  Q_OBJECT
-public:
-  QTAllMoleculePage();
-  void update(Observable *subject);
-  void subjectKilled(Observable *subject);
-public slots:
-  void addMolecule(molecule *mol);
-  void removeMolecule(molecule *mol);
-};
-
-/**
- * Widget to display the tab page for a single molecule
- */
-class QTMoleculePage : public QWidget,  public Observer {
-  Q_OBJECT
-public:
-  QTMoleculePage(molecule *_mol,std::string _name);
-  virtual ~QTMoleculePage();
-
-  void update(Observable *subject);
-  void subjectKilled(Observable *subject);
-
-signals:
-  void nameChanged(QTMoleculePage*,std::string);
-
-private:
-  molecule *mol;
-  std::string name;
-};
-#endif /* MOLECULEVIEW_HPP_ */
Index: c/UIElements/Views/QT4/QTStatusBar.cpp
===================================================================
--- src/UIElements/Views/QT4/QTStatusBar.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,128 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * QTStatusBar.cpp
- *
- *  Created on: Feb 17, 2010
- *      Author: crueger
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sstream>
-
-#include <QtGui/QLabel>
-#include <QtGui/QBoxLayout>
-#include <QtGui/QProgressBar>
-
-#include "QTStatusBar.hpp"
-
-#include "Helpers/MemDebug.hpp"
-
-#include "World.hpp"
-#include "Helpers/helpers.hpp"
-#include "Actions/Process.hpp"
-
-
-QTStatusBar::QTStatusBar(QWidget *_parent) :
-  QStatusBar(_parent),
-  Observer("QTStatusBar"),
-  atomCount(World::getInstance().numAtoms()),
-  moleculeCount(World::getInstance().numMolecules()),
-  parent(_parent)
-{
-  World::getInstance().signOn(this);
-  Process::AddObserver(this);
-  statusLabel = new QLabel(this);
-  statusLabel->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
-  addPermanentWidget(statusLabel);
-  redrawStatus();
-}
-
-QTStatusBar::~QTStatusBar()
-{
-  Process::RemoveObserver(this);
-  World::getInstance().signOff(this);
-}
-
-void QTStatusBar::update(Observable *subject){
-  if (subject==World::getPointer()){
-    atomCount = World::getInstance().numAtoms();
-    moleculeCount = World::getInstance().numMolecules();
-    redrawStatus();
-  }
-  else {
-    // we probably have some process
-    Process *proc;
-    if((proc=dynamic_cast<Process*>(subject))){
-      redrawProcess(proc);
-    }
-  }
-}
-
-void QTStatusBar::subjectKilled(Observable *subject){
-  // Processes don't notify when they are killed
-  atomCount = World::getInstance().numAtoms();
-  moleculeCount = World::getInstance().numMolecules();
-  World::getInstance().signOn(this);
-  redrawStatus();
-}
-
-void QTStatusBar::redrawStatus(){
-  stringstream sstr;
-  sstr << "You have " << atomCount << " atom" << PLURAL_S(atomCount)
-       <<" in " << moleculeCount << " molecule" << PLURAL_S(moleculeCount);
-  statusLabel->setText(QString(sstr.str().c_str()));
-}
-
-void QTStatusBar::redrawProcess(Process *proc){
-  progressIndicator *ind=0;
-  // see what we have to do with the process
-  if(proc->doesStart()){
-    ind = new progressIndicator(proc->getName());
-    ind->bar->setMaximum(proc->getMaxSteps());
-    progressBars.insert(pair<Process*,progressIndicator*>(proc,ind));
-  }
-  else {
-    ind = progressBars[proc];
-  }
-  if(activeProcess!=proc){
-    addWidget(ind->container);
-    activeProcess = proc;
-  }
-  ind->bar->setValue(proc->getCurrStep());
-  parent->repaint();
-  if(proc->doesStop()){
-    removeWidget(ind->container);
-    activeProcess = 0;
-    progressBars.erase(proc);
-    delete ind;
-  }
-}
-
-
-
-QTStatusBar::progressIndicator::progressIndicator(string name){
-  stringstream sstr;
-  sstr << "Busy (" << name << ")";
-  container = new QWidget();
-  layout = new QHBoxLayout(container);
-  label = new QLabel(QString(sstr.str().c_str()));
-  bar = new QProgressBar();
-
-  layout->addWidget(label);
-  layout->addWidget(bar);
-  container->setLayout(layout);
-}
-
-QTStatusBar::progressIndicator::~progressIndicator(){
-  delete container;
-}
Index: c/UIElements/Views/QT4/QTStatusBar.hpp
===================================================================
--- src/UIElements/Views/QT4/QTStatusBar.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/*
- * QTStatusBar.hpp
- *
- *  Created on: Feb 17, 2010
- *      Author: crueger
- */
-
-#ifndef QTSTATUSBAR_HPP_
-#define QTSTATUSBAR_HPP_
-
-#include <map>
-#include <utility>
-#include <string>
-#include <QtGui/QStatusBar>
-
-#include "Patterns/Observer.hpp"
-
-class QLabel;
-class QProgressBar;
-class Process;
-class QBoxLayout;
-
-class QTStatusBar : public QStatusBar, public Observer
-{
-  Q_OBJECT
-
-  struct progressIndicator{
-    progressIndicator(std::string);
-    ~progressIndicator();
-    QLabel *label;
-    QProgressBar *bar;
-    QBoxLayout *layout;
-    QWidget *container;
-  };
-public:
-  QTStatusBar(QWidget *parent=0);
-  virtual ~QTStatusBar();
-
-  void update(Observable *subject);
-  void subjectKilled(Observable *subject);
-
-private:
-  void redrawStatus();
-  void redrawProcess(Process *proc);
-
-  int atomCount;
-  int moleculeCount;
-
-  QLabel *statusLabel;
-  QWidget *parent;
-  std::map<Process*,progressIndicator*> progressBars;
-  Process* activeProcess;
-};
-
-#endif /* QTSTATUSBAR_HPP_ */
Index: c/UIElements/Views/QT4/QTWorldView.cpp
===================================================================
--- src/UIElements/Views/QT4/QTWorldView.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,139 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2010 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * QTWorldView.cpp
- *
- *  Created on: Jan 21, 2010
- *      Author: crueger
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "Views/QT4/QTWorldView.hpp"
-
-#include <iostream>
-
-#include "Helpers/MemDebug.hpp"
-
-#include "atom.hpp"
-#include "Formula.hpp"
-#include "molecule.hpp"
-
-using namespace std;
-
-// maybe this should go with the definition of molecules
-
-// some attributes need to be easier to find for molecules
-// these attributes are skiped so far
-const int QTWorldView::COLUMNCOUNT = COLUMNTYPES_MAX;
-const char *QTWorldView::COLUMNNAMES[QTWorldView::COLUMNCOUNT]={"Name","Atoms","Formula"/*,"Size"*/};
-
-QTWorldView::QTWorldView(QWidget * _parent) :
-  QTableWidget (_parent),
-  Observer("QTWorldView")
-{
-  setRowCount(0);
-  setColumnCount(COLUMNCOUNT);
-
-  for(int i=0; i<COLUMNCOUNT;++i) {
-    QTableWidgetItem *heading = new QTableWidgetItem();
-    heading->setText(QString(COLUMNNAMES[i]));
-    setHorizontalHeaderItem(i,heading);
-  }
-
-  molecules = World::getInstance().getMolecules();
-  molecules->signOn(this);
-  update(molecules);
-
-  connect(this,SIGNAL(cellChanged(int,int)),this,SLOT(moleculeChanged(int,int)));
-  connect(this,SIGNAL(cellClicked(int,int)),this,SLOT(cellSelected(int,int)));
-
-}
-
-QTWorldView::~QTWorldView()
-{
-  molecules->signOff(this);
-}
-
-void QTWorldView::update(Observable *publisher) {
-  int numMolecules = molecules->ListOfMolecules.size();
-  setRowCount(numMolecules);
-  molSelection.resize(numMolecules);
-  int i;
-  MoleculeList::iterator iter;
-  for(iter = molecules->ListOfMolecules.begin(),i=0;
-      iter != molecules->ListOfMolecules.end();
-      ++i,++iter) {
-
-    const int index = (*iter)->IndexNr;
-    QTableWidgetItem *indexWidget = new QTableWidgetItem();
-    indexWidget->setText(QString::number(index));
-    indexWidget->setData(Qt::UserRole,QVariant(index));
-    setVerticalHeaderItem(i,indexWidget);
-
-    const string name = (*iter)->getName();
-    QTableWidgetItem *nameWidget = new QTableWidgetItem();
-    nameWidget->setText(QString(name.c_str()));
-    setItem(i,NAME,nameWidget);
-
-    const int atomCount = (*iter)->getAtomCount();
-    QTableWidgetItem *countWidget= new QTableWidgetItem();
-    countWidget->setText(QString::number(atomCount));
-    countWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
-    setItem(i,ATOMS,countWidget);
-
-    const Formula formula = (*iter)->getFormula();
-    QTableWidgetItem *formulaWidget= new QTableWidgetItem();
-    formulaWidget->setText(QString(formula.toString().c_str()));
-    formulaWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
-    setItem(i,ATOMS,formulaWidget);
-
-    molSelection[i]=nameWidget->isSelected();
-  }
-}
-
-void QTWorldView::subjectKilled(Observable *publisher) {
-}
-
-void QTWorldView::moleculeChanged(int row, int column) {
-  int idx = verticalHeaderItem(row)->data(Qt::UserRole).toInt();
-  molecule *mol = molecules->ReturnIndex(idx);
-  string cellValue = item(row,NAME)->text().toStdString();
-  if(mol->getName() != cellValue && cellValue !="") {
-    mol->setName(cellValue);
-  }
-  else if(cellValue==""){
-    item(row,NAME)->setText(QString(mol->getName().c_str()));
-  }
-}
-
-
-void QTWorldView::cellSelected(int row, int column){
-  bool state = item(row,column)->isSelected();
-  for(int i = 0; i<COLUMNCOUNT; i++){
-    item(row,i)->setSelected(state);
-  }
-  // figure out which rows have changed
-  for(int i=0; i<rowCount();++i){
-    state = item(i,0)->isSelected();
-    if(molSelection[i]!=state){
-      int idx = verticalHeaderItem(i)->data(Qt::UserRole).toInt();
-      molecule *mol = molecules->ReturnIndex(idx);
-      if(state){
-        emit moleculeSelected(mol);
-      }
-      else{
-        emit moleculeUnSelected(mol);
-      }
-      molSelection[i]=state;
-    }
-  }
-}
Index: c/UIElements/Views/QT4/QTWorldView.hpp
===================================================================
--- src/UIElements/Views/QT4/QTWorldView.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * QTWorldView.hpp
- *
- *  Created on: Jan 21, 2010
- *      Author: crueger
- */
-
-#ifndef QTMOLECULESVIEW_HPP_
-#define QTMOLECULESVIEW_HPP_
-
-#include <QtGui/QTableWidget>
-#include "Patterns/Observer.hpp"
-
-class molecule;
-class MoleculeListClass;
-
-class QTWorldView : public QTableWidget, public Observer
-{
-  Q_OBJECT
-
-public:
-  QTWorldView(QWidget * _parent=0);
-  virtual ~QTWorldView();
-
-protected:
-  virtual void update(Observable *publisher);
-  virtual void subjectKilled(Observable *publisher);
-
-  static const int COLUMNCOUNT;
-  enum {NAME,ATOMS,FORMULA,COLUMNTYPES_MAX} COLUMNTYPES;
-  static const char *COLUMNNAMES[];
-
-private slots:
-  void moleculeChanged(int row, int column);
-
-  void cellSelected(int row, int column);
-
-signals:
-  void moleculeSelected(molecule*);
-  void moleculeUnSelected(molecule*);
-
-private:
-  std::vector<bool> molSelection; //!< needed to determine when a selection changes
-  MoleculeListClass *molecules;
-};
-
-#endif /* QTMOLECULESVIEW_HPP_ */
Index: src/UIElements/Views/Qt4/GLMoleculeView.cpp
===================================================================
--- src/UIElements/Views/Qt4/GLMoleculeView.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Views/Qt4/GLMoleculeView.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,29 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * GLMoleculeView.cpp
+ *
+ *  Created on: Jan 26, 2010
+ *      Author: crueger
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "GLMoleculeView.hpp"
+
+#include "Helpers/MemDebug.hpp"
+
+GLMoleculeView::GLMoleculeView(QWidget *parent) :
+  QGLWidget(parent)
+{}
+
+GLMoleculeView::~GLMoleculeView()
+{}
Index: src/UIElements/Views/Qt4/GLMoleculeView.hpp
===================================================================
--- src/UIElements/Views/Qt4/GLMoleculeView.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Views/Qt4/GLMoleculeView.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,21 @@
+/*
+ * GLMoleculeView.hpp
+ *
+ *  Created on: Jan 26, 2010
+ *      Author: crueger
+ */
+
+#ifndef GLMOLECULEVIEW_HPP_
+#define GLMOLECULEVIEW_HPP_
+
+#include <QtOpenGL/QGLWidget>
+
+class GLMoleculeView :  public QGLWidget
+{
+  Q_OBJECT
+public:
+  GLMoleculeView(QWidget *parent=0);
+  virtual ~GLMoleculeView();
+};
+
+#endif /* GLMOLECULEVIEW_HPP_ */
Index: src/UIElements/Views/Qt4/QtMoleculeView.cpp
===================================================================
--- src/UIElements/Views/Qt4/QtMoleculeView.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Views/Qt4/QtMoleculeView.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,106 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * QtMoleculeView.cpp
+ *
+ *  Created on: Mar 4, 2010
+ *      Author: crueger
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Views/Qt4/QtMoleculeView.hpp"
+
+#include <iostream>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "molecule.hpp"
+
+using namespace std;
+
+/***************** Basic structure for tab layout ***********/
+
+QtMoleculeView::QtMoleculeView() :
+    QTabWidget()
+{
+  allPage = new QTAllMoleculePage();
+  addTab(allPage,QString("All Molecules"));
+
+  connect(this,SIGNAL(addMolecule(molecule*)),allPage,SLOT(addMolecule(molecule*)));
+  connect(this,SIGNAL(removeMolecule(molecule*)),allPage,SLOT(removeMolecule(molecule*)));
+}
+
+QtMoleculeView::~QtMoleculeView()
+{}
+
+void QtMoleculeView::moleculeSelected(molecule *mol){
+  if(!pages.count(mol)){
+    string molName = mol->GetName();
+    QTMoleculePage *molPage = new QTMoleculePage(mol,molName);
+    addTab(molPage,QString(molName.c_str()));
+    pages[mol] = molPage;
+
+    connect(molPage,SIGNAL(nameChanged(QTMoleculePage*,std::string)),this,SLOT(nameChanged(QTMoleculePage*,std::string)));
+
+    emit addMolecule(mol);
+  }
+}
+
+void QtMoleculeView::moleculeUnSelected(molecule *mol){
+  if(pages.count(mol)){
+    QTMoleculePage *molPage = pages[mol];
+    removeTab(indexOf(molPage));
+    pages.erase(mol);
+    delete molPage;
+    emit removeMolecule(mol);
+  }
+}
+
+void QtMoleculeView::nameChanged(QTMoleculePage *page, std::string name){
+  setTabText(indexOf(page),QString(name.c_str()));
+}
+
+/************************ Tab for all Molecules ********************/
+
+QTAllMoleculePage::QTAllMoleculePage() :
+  Observer("QTAllMoleculePage")
+{}
+
+void QTAllMoleculePage::addMolecule(molecule *mol){}
+
+void QTAllMoleculePage::removeMolecule(molecule *mol){}
+
+void QTAllMoleculePage::update(Observable *subject){}
+
+void QTAllMoleculePage::subjectKilled(Observable *subject){}
+
+/************************ Tab for single Molecules *****************/
+
+QTMoleculePage::QTMoleculePage(molecule *_mol, string _name) :
+    Observer("QTMoleculePage"),
+    mol(_mol), name(_name)
+{
+  mol->signOn(this);
+}
+
+QTMoleculePage::~QTMoleculePage(){
+  mol->signOff(this);
+}
+
+void QTMoleculePage::update(Observable *subject){
+  if(name != mol->GetName()){
+    name = mol->GetName();
+    emit nameChanged(this,name);
+  }
+}
+
+void QTMoleculePage::subjectKilled(Observable *subject){}
Index: src/UIElements/Views/Qt4/QtMoleculeView.hpp
===================================================================
--- src/UIElements/Views/Qt4/QtMoleculeView.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Views/Qt4/QtMoleculeView.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,77 @@
+/*
+ * MoleculeView.hpp
+ *
+ *  Created on: Mar 4, 2010
+ *      Author: crueger
+ */
+
+#ifndef MOLECULEVIEW_HPP_
+#define MOLECULEVIEW_HPP_
+
+#include <string>
+#include <QtGui/QTabWidget>
+#include "Patterns/Observer.hpp"
+
+class molecule;
+
+// Forwarding of the Tab-Pages
+class QTAllMoleculePage;
+class QTMoleculePage;
+
+class QtMoleculeView : public QTabWidget
+{
+  Q_OBJECT
+public:
+  QtMoleculeView();
+  virtual ~QtMoleculeView();
+
+public slots:
+  void moleculeSelected(molecule *);
+  void moleculeUnSelected(molecule *);
+
+  void nameChanged(QTMoleculePage *page, std::string name);
+
+signals:
+  void addMolecule(molecule *);
+  void removeMolecule(molecule *);
+
+
+private:
+  QTAllMoleculePage *allPage; //!< contained widget to cary information of all selected molecules
+  std::map<molecule*,QTMoleculePage *> pages;//!< contained widget to cary information on a specific molecule
+};
+
+/**
+ * Widget to display the tab page for all selected molecules
+ */
+class QTAllMoleculePage : public QWidget, public Observer {
+  Q_OBJECT
+public:
+  QTAllMoleculePage();
+  void update(Observable *subject);
+  void subjectKilled(Observable *subject);
+public slots:
+  void addMolecule(molecule *mol);
+  void removeMolecule(molecule *mol);
+};
+
+/**
+ * Widget to display the tab page for a single molecule
+ */
+class QTMoleculePage : public QWidget,  public Observer {
+  Q_OBJECT
+public:
+  QTMoleculePage(molecule *_mol,std::string _name);
+  virtual ~QTMoleculePage();
+
+  void update(Observable *subject);
+  void subjectKilled(Observable *subject);
+
+signals:
+  void nameChanged(QTMoleculePage*,std::string);
+
+private:
+  molecule *mol;
+  std::string name;
+};
+#endif /* MOLECULEVIEW_HPP_ */
Index: src/UIElements/Views/Qt4/QtStatusBar.cpp
===================================================================
--- src/UIElements/Views/Qt4/QtStatusBar.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Views/Qt4/QtStatusBar.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,128 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * QtStatusBar.cpp
+ *
+ *  Created on: Feb 17, 2010
+ *      Author: crueger
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <sstream>
+
+#include <QtGui/QLabel>
+#include <QtGui/QBoxLayout>
+#include <QtGui/QProgressBar>
+
+#include "QtStatusBar.hpp"
+
+#include "Helpers/MemDebug.hpp"
+
+#include "World.hpp"
+#include "Helpers/helpers.hpp"
+#include "Actions/Process.hpp"
+
+
+QtStatusBar::QtStatusBar(QWidget *_parent) :
+  QStatusBar(_parent),
+  Observer("QtStatusBar"),
+  atomCount(World::getInstance().numAtoms()),
+  moleculeCount(World::getInstance().numMolecules()),
+  parent(_parent)
+{
+  World::getInstance().signOn(this);
+  Process::AddObserver(this);
+  statusLabel = new QLabel(this);
+  statusLabel->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
+  addPermanentWidget(statusLabel);
+  redrawStatus();
+}
+
+QtStatusBar::~QtStatusBar()
+{
+  Process::RemoveObserver(this);
+  World::getInstance().signOff(this);
+}
+
+void QtStatusBar::update(Observable *subject){
+  if (subject==World::getPointer()){
+    atomCount = World::getInstance().numAtoms();
+    moleculeCount = World::getInstance().numMolecules();
+    redrawStatus();
+  }
+  else {
+    // we probably have some process
+    Process *proc;
+    if((proc=dynamic_cast<Process*>(subject))){
+      redrawProcess(proc);
+    }
+  }
+}
+
+void QtStatusBar::subjectKilled(Observable *subject){
+  // Processes don't notify when they are killed
+  atomCount = World::getInstance().numAtoms();
+  moleculeCount = World::getInstance().numMolecules();
+  World::getInstance().signOn(this);
+  redrawStatus();
+}
+
+void QtStatusBar::redrawStatus(){
+  stringstream sstr;
+  sstr << "You have " << atomCount << " atom" << PLURAL_S(atomCount)
+       <<" in " << moleculeCount << " molecule" << PLURAL_S(moleculeCount);
+  statusLabel->setText(QString(sstr.str().c_str()));
+}
+
+void QtStatusBar::redrawProcess(Process *proc){
+  progressIndicator *ind=0;
+  // see what we have to do with the process
+  if(proc->doesStart()){
+    ind = new progressIndicator(proc->getName());
+    ind->bar->setMaximum(proc->getMaxSteps());
+    progressBars.insert(pair<Process*,progressIndicator*>(proc,ind));
+  }
+  else {
+    ind = progressBars[proc];
+  }
+  if(activeProcess!=proc){
+    addWidget(ind->container);
+    activeProcess = proc;
+  }
+  ind->bar->setValue(proc->getCurrStep());
+  parent->repaint();
+  if(proc->doesStop()){
+    removeWidget(ind->container);
+    activeProcess = 0;
+    progressBars.erase(proc);
+    delete ind;
+  }
+}
+
+
+
+QtStatusBar::progressIndicator::progressIndicator(string name){
+  stringstream sstr;
+  sstr << "Busy (" << name << ")";
+  container = new QWidget();
+  layout = new QHBoxLayout(container);
+  label = new QLabel(QString(sstr.str().c_str()));
+  bar = new QProgressBar();
+
+  layout->addWidget(label);
+  layout->addWidget(bar);
+  container->setLayout(layout);
+}
+
+QtStatusBar::progressIndicator::~progressIndicator(){
+  delete container;
+}
Index: src/UIElements/Views/Qt4/QtStatusBar.hpp
===================================================================
--- src/UIElements/Views/Qt4/QtStatusBar.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Views/Qt4/QtStatusBar.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,55 @@
+/*
+ * QtStatusBar.hpp
+ *
+ *  Created on: Feb 17, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTSTATUSBAR_HPP_
+#define QTSTATUSBAR_HPP_
+
+#include <map>
+#include <utility>
+#include <string>
+#include <QtGui/QStatusBar>
+
+#include "Patterns/Observer.hpp"
+
+class QLabel;
+class QProgressBar;
+class Process;
+class QBoxLayout;
+
+class QtStatusBar : public QStatusBar, public Observer
+{
+  Q_OBJECT
+
+  struct progressIndicator{
+    progressIndicator(std::string);
+    ~progressIndicator();
+    QLabel *label;
+    QProgressBar *bar;
+    QBoxLayout *layout;
+    QWidget *container;
+  };
+public:
+  QtStatusBar(QWidget *parent=0);
+  virtual ~QtStatusBar();
+
+  void update(Observable *subject);
+  void subjectKilled(Observable *subject);
+
+private:
+  void redrawStatus();
+  void redrawProcess(Process *proc);
+
+  int atomCount;
+  int moleculeCount;
+
+  QLabel *statusLabel;
+  QWidget *parent;
+  std::map<Process*,progressIndicator*> progressBars;
+  Process* activeProcess;
+};
+
+#endif /* QTSTATUSBAR_HPP_ */
Index: src/UIElements/Views/Qt4/QtWorldView.cpp
===================================================================
--- src/UIElements/Views/Qt4/QtWorldView.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Views/Qt4/QtWorldView.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,139 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * QtWorldView.cpp
+ *
+ *  Created on: Jan 21, 2010
+ *      Author: crueger
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Views/Qt4/QtWorldView.hpp"
+
+#include <iostream>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "atom.hpp"
+#include "Formula.hpp"
+#include "molecule.hpp"
+
+using namespace std;
+
+// maybe this should go with the definition of molecules
+
+// some attributes need to be easier to find for molecules
+// these attributes are skiped so far
+const int QtWorldView::COLUMNCOUNT = COLUMNTYPES_MAX;
+const char *QtWorldView::COLUMNNAMES[QtWorldView::COLUMNCOUNT]={"Name","Atoms","Formula"/*,"Size"*/};
+
+QtWorldView::QtWorldView(QWidget * _parent) :
+  QTableWidget (_parent),
+  Observer("QtWorldView")
+{
+  setRowCount(0);
+  setColumnCount(COLUMNCOUNT);
+
+  for(int i=0; i<COLUMNCOUNT;++i) {
+    QTableWidgetItem *heading = new QTableWidgetItem();
+    heading->setText(QString(COLUMNNAMES[i]));
+    setHorizontalHeaderItem(i,heading);
+  }
+
+  molecules = World::getInstance().getMolecules();
+  molecules->signOn(this);
+  update(molecules);
+
+  connect(this,SIGNAL(cellChanged(int,int)),this,SLOT(moleculeChanged(int,int)));
+  connect(this,SIGNAL(cellClicked(int,int)),this,SLOT(cellSelected(int,int)));
+
+}
+
+QtWorldView::~QtWorldView()
+{
+  molecules->signOff(this);
+}
+
+void QtWorldView::update(Observable *publisher) {
+  int numMolecules = molecules->ListOfMolecules.size();
+  setRowCount(numMolecules);
+  molSelection.resize(numMolecules);
+  int i;
+  MoleculeList::iterator iter;
+  for(iter = molecules->ListOfMolecules.begin(),i=0;
+      iter != molecules->ListOfMolecules.end();
+      ++i,++iter) {
+
+    const int index = (*iter)->IndexNr;
+    QTableWidgetItem *indexWidget = new QTableWidgetItem();
+    indexWidget->setText(QString::number(index));
+    indexWidget->setData(Qt::UserRole,QVariant(index));
+    setVerticalHeaderItem(i,indexWidget);
+
+    const string name = (*iter)->getName();
+    QTableWidgetItem *nameWidget = new QTableWidgetItem();
+    nameWidget->setText(QString(name.c_str()));
+    setItem(i,NAME,nameWidget);
+
+    const int atomCount = (*iter)->getAtomCount();
+    QTableWidgetItem *countWidget= new QTableWidgetItem();
+    countWidget->setText(QString::number(atomCount));
+    countWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+    setItem(i,ATOMS,countWidget);
+
+    const Formula formula = (*iter)->getFormula();
+    QTableWidgetItem *formulaWidget= new QTableWidgetItem();
+    formulaWidget->setText(QString(formula.toString().c_str()));
+    formulaWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+    setItem(i,ATOMS,formulaWidget);
+
+    molSelection[i]=nameWidget->isSelected();
+  }
+}
+
+void QtWorldView::subjectKilled(Observable *publisher) {
+}
+
+void QtWorldView::moleculeChanged(int row, int column) {
+  int idx = verticalHeaderItem(row)->data(Qt::UserRole).toInt();
+  molecule *mol = molecules->ReturnIndex(idx);
+  string cellValue = item(row,NAME)->text().toStdString();
+  if(mol->getName() != cellValue && cellValue !="") {
+    mol->setName(cellValue);
+  }
+  else if(cellValue==""){
+    item(row,NAME)->setText(QString(mol->getName().c_str()));
+  }
+}
+
+
+void QtWorldView::cellSelected(int row, int column){
+  bool state = item(row,column)->isSelected();
+  for(int i = 0; i<COLUMNCOUNT; i++){
+    item(row,i)->setSelected(state);
+  }
+  // figure out which rows have changed
+  for(int i=0; i<rowCount();++i){
+    state = item(i,0)->isSelected();
+    if(molSelection[i]!=state){
+      int idx = verticalHeaderItem(i)->data(Qt::UserRole).toInt();
+      molecule *mol = molecules->ReturnIndex(idx);
+      if(state){
+        emit moleculeSelected(mol);
+      }
+      else{
+        emit moleculeUnSelected(mol);
+      }
+      molSelection[i]=state;
+    }
+  }
+}
Index: src/UIElements/Views/Qt4/QtWorldView.hpp
===================================================================
--- src/UIElements/Views/Qt4/QtWorldView.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
+++ src/UIElements/Views/Qt4/QtWorldView.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -0,0 +1,47 @@
+/*
+ * QtWorldView.hpp
+ *
+ *  Created on: Jan 21, 2010
+ *      Author: crueger
+ */
+
+#ifndef QTMOLECULESVIEW_HPP_
+#define QTMOLECULESVIEW_HPP_
+
+#include <QtGui/QTableWidget>
+#include "Patterns/Observer.hpp"
+
+class molecule;
+class MoleculeListClass;
+
+class QtWorldView : public QTableWidget, public Observer
+{
+  Q_OBJECT
+
+public:
+  QtWorldView(QWidget * _parent=0);
+  virtual ~QtWorldView();
+
+protected:
+  virtual void update(Observable *publisher);
+  virtual void subjectKilled(Observable *publisher);
+
+  static const int COLUMNCOUNT;
+  enum {NAME,ATOMS,FORMULA,COLUMNTYPES_MAX} COLUMNTYPES;
+  static const char *COLUMNNAMES[];
+
+private slots:
+  void moleculeChanged(int row, int column);
+
+  void cellSelected(int row, int column);
+
+signals:
+  void moleculeSelected(molecule*);
+  void moleculeUnSelected(molecule*);
+
+private:
+  std::vector<bool> molSelection; //!< needed to determine when a selection changes
+  MoleculeListClass *molecules;
+};
+
+#endif /* QTMOLECULESVIEW_HPP_ */
Index: src/builder.cpp
===================================================================
--- src/builder.cpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/builder.cpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -86,5 +86,5 @@
 #include "UIElements/CommandLineUI/CommandLineUIFactory.hpp"
 #ifdef USE_GUI_QT
-#include "UIElements/QT4/QTUIFactory.hpp"
+#include "UIElements/Qt4/QtUIFactory.hpp"
 #endif
 #include "UIElements/MainWindow.hpp"
@@ -184,7 +184,7 @@
       ASSERT_DO(Assert::Ask);
       #ifdef USE_GUI_QT
-        DoLog(0) && (Log() << Verbose(0) << "Setting UI to QT4." << endl);
-        UIFactory::registerFactory(new QTUIFactory::description());
-        UIFactory::makeUserInterface("QT4");
+        DoLog(0) && (Log() << Verbose(0) << "Setting UI to Qt4." << endl);
+        UIFactory::registerFactory(new QtUIFactory::description());
+        UIFactory::makeUserInterface("Qt4");
       #else
         DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl);
Index: src/unittests/DummyUI.hpp
===================================================================
--- src/unittests/DummyUI.hpp	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/unittests/DummyUI.hpp	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -35,4 +35,5 @@
   virtual void queryElement(const char*, std::string = ""){}
   virtual void queryElements(const char*, std::string = ""){}
+  virtual void queryFile(const char*, std::string = ""){}
 };
 
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ src/unittests/Makefile.am	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -49,10 +49,10 @@
 noinst_PROGRAMS = $(TESTS) TestRunner
 
+BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_THREAD_LIB)
 GSLLIBS = \
 	../LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \
 	../Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
 	../Helpers/libMolecuilderHelpers-@MOLECUILDER_API_VERSION@.la \
-	$(BOOST_LIB) \
-	${BOOST_THREAD_LIB}
+	$(BOOST_LIB)
 ALLLIBS = \
 	../UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la \
@@ -60,6 +60,6 @@
 	${PARSERLIBS} \
 	../libMolecuilder-@MOLECUILDER_API_VERSION@.la \
-	${GSLLIBS} \
-	${BOOST_PROGRAM_OPTIONS_LIB}
+	${GSLLIBS}
+
 PARSERLIBS = ../Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la
 UILIBS = ../UIElements/libMolecuilderUI-@MOLECUILDER_API_VERSION@.la  
Index: tests/regression/Simple_configuration/2/post/test.pdb
===================================================================
--- tests/regression/Simple_configuration/2/post/test.pdb	(revision 6940bb556236165ebf89b8495b117042efebb708)
+++ tests/regression/Simple_configuration/2/post/test.pdb	(revision 573ca5fad13d63566ba36dd8f4507d519d51fa15)
@@ -1,3 +1,3 @@
 REMARK created by molecuilder on Fri Aug 27 12:18:33 2010
-ATOM      1  H01 non b   1        10.0    10.0    10.0   1.0   1.0         0 H 0
+ATOM      1  H01 non b   0        10.0    10.0    10.0   1.0   1.0         0 H 0
 END
