Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision e212ff44099f167003b8536a5d60337d9b9100be)
+++ src/Actions/Makefile.am	(revision 2218d94da90f7417d65be48472c11c4a30562458)
@@ -121,4 +121,5 @@
 	SelectionAction/AtomByIdAction.cpp \
 	SelectionAction/ClearAllAtomsAction.cpp \
+	SelectionAction/ClearAllMoleculesAction.cpp \
 	SelectionAction/MoleculeByIdAction.cpp \
 	SelectionAction/NotAllAtomsAction.cpp \
@@ -131,4 +132,5 @@
 	SelectionAction/AtomByIdAction.hpp \
 	SelectionAction/ClearAllAtomsAction.hpp \
+	SelectionAction/ClearAllMoleculesAction.hpp \
 	SelectionAction/MoleculeByIdAction.hpp \
 	SelectionAction/NotAllAtomsAction.hpp \
Index: src/Actions/MapOfActions.cpp
===================================================================
--- src/Actions/MapOfActions.cpp	(revision e212ff44099f167003b8536a5d60337d9b9100be)
+++ src/Actions/MapOfActions.cpp	(revision 2218d94da90f7417d65be48472c11c4a30562458)
@@ -70,4 +70,5 @@
 #include "Actions/SelectionAction/AtomByIdAction.hpp"
 #include "Actions/SelectionAction/ClearAllAtomsAction.hpp"
+#include "Actions/SelectionAction/ClearAllMoleculesAction.hpp"
 #include "Actions/SelectionAction/MoleculeByIdAction.hpp"
 #include "Actions/SelectionAction/NotAllAtomsAction.hpp"
@@ -186,4 +187,5 @@
   DescriptionMap["change-molname"] = "change the name of a molecule";
   DescriptionMap["clear-atom-selection"] = "clear the atom selection";
+  DescriptionMap["clear-molecule-selection"] = "clear the molecule selection";
   DescriptionMap["convex-envelope"] = "create the convex envelope for a molecule";
   DescriptionMap["default-molname"] = "set the default name of new molecules";
@@ -307,4 +309,5 @@
   TypeMap["change-molname"] = &typeid(std::string);
   TypeMap["clear-atom-selection"] = &typeid(void);
+  TypeMap["clear-molecule-selection"] = &typeid(void);
   TypeMap["convex-envelope"] = &typeid(void);
   TypeMap["default-molname"] = &typeid(std::string);
@@ -446,4 +449,5 @@
 
   MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "clear-atom-selection") );
+  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "clear-molecule-selection") );
   MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-all-atoms") );
   MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-all-molecules") );
@@ -484,4 +488,5 @@
   generic.insert("change-element");
   generic.insert("clear-atom-selection");
+  generic.insert("clear-molecule-selection");
   generic.insert("convex-envelope");
 	generic.insert("default-molname");
@@ -840,4 +845,5 @@
 
   new SelectionClearAllAtomsAction();
+  new SelectionClearAllMoleculesAction();
   new SelectionAllAtomsAction();
   new SelectionAllMoleculesAction();
Index: src/Actions/SelectionAction/ClearAllMoleculesAction.cpp
===================================================================
--- src/Actions/SelectionAction/ClearAllMoleculesAction.cpp	(revision 2218d94da90f7417d65be48472c11c4a30562458)
+++ src/Actions/SelectionAction/ClearAllMoleculesAction.cpp	(revision 2218d94da90f7417d65be48472c11c4a30562458)
@@ -0,0 +1,94 @@
+/*
+ * ClearAllMoleculesAction.cpp
+ *
+ *  Created on: Aug 09, 2010
+ *      Author: heber
+ */
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Actions/SelectionAction/ClearAllMoleculesAction.hpp"
+#include "Actions/ActionRegistry.hpp"
+#include "Descriptors/MoleculeDescriptor.hpp"
+#include "atom.hpp"
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// memento to remember the state when undoing
+
+class SelectionClearAllMoleculesState : public ActionState {
+public:
+  SelectionClearAllMoleculesState(std::vector<molecule*> selectedMolecules) :
+    selectedMolecules(selectedMolecules)
+  {}
+  std::vector<molecule*> selectedMolecules;
+};
+
+const char SelectionClearAllMoleculesAction::NAME[] = "clear-molecule-selection";
+
+SelectionClearAllMoleculesAction::SelectionClearAllMoleculesAction() :
+  Action(NAME)
+{}
+
+SelectionClearAllMoleculesAction::~SelectionClearAllMoleculesAction()
+{}
+
+void SelectionClearAllMolecules() {
+  ActionRegistry::getInstance().getActionByName(SelectionClearAllMoleculesAction::NAME)->call(Action::NonInteractive);
+};
+
+Dialog* SelectionClearAllMoleculesAction::fillDialog(Dialog *dialog) {
+  ASSERT(dialog,"No Dialog given when filling action dialog");
+
+  dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME));
+
+  return dialog;
+}
+
+Action::state_ptr SelectionClearAllMoleculesAction::performCall() {
+  std::vector<molecule *> selectedMolecules = World::getInstance().getSelectedMolecules();
+  DoLog(1) && (Log() << Verbose(1) << "Clearing molecule selection." << endl);
+  World::getInstance().clearMoleculeSelection();
+  return Action::state_ptr(new SelectionClearAllMoleculesState(selectedMolecules));
+}
+
+Action::state_ptr SelectionClearAllMoleculesAction::performUndo(Action::state_ptr _state) {
+  SelectionClearAllMoleculesState *state = assert_cast<SelectionClearAllMoleculesState*>(_state.get());
+
+  World::getInstance().clearMoleculeSelection();
+  for(std::vector<molecule *>::iterator iter = state->selectedMolecules.begin(); iter != state->selectedMolecules.end(); ++iter)
+    World::getInstance().selectMolecule(*iter);
+
+  return Action::state_ptr(new SelectionClearAllMoleculesState(state->selectedMolecules));
+}
+
+Action::state_ptr SelectionClearAllMoleculesAction::performRedo(Action::state_ptr _state){
+  SelectionClearAllMoleculesState *state = assert_cast<SelectionClearAllMoleculesState*>(_state.get());
+
+  World::getInstance().clearMoleculeSelection();
+
+  return Action::state_ptr(new SelectionClearAllMoleculesState(state->selectedMolecules));
+}
+
+bool SelectionClearAllMoleculesAction::canUndo() {
+  return true;
+}
+
+bool SelectionClearAllMoleculesAction::shouldUndo() {
+  return true;
+}
+
+const string SelectionClearAllMoleculesAction::getName() {
+  return NAME;
+}
Index: src/Actions/SelectionAction/ClearAllMoleculesAction.hpp
===================================================================
--- src/Actions/SelectionAction/ClearAllMoleculesAction.hpp	(revision 2218d94da90f7417d65be48472c11c4a30562458)
+++ src/Actions/SelectionAction/ClearAllMoleculesAction.hpp	(revision 2218d94da90f7417d65be48472c11c4a30562458)
@@ -0,0 +1,36 @@
+/*
+ * ClearAllMoleculesAction.hpp
+ *
+ *  Created on: Aug 09, 2010
+ *      Author: heber
+ */
+
+#ifndef CLEARALLMOLECULESSACTION_HPP_
+#define CLEARALLMOLECULESSACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+void SelectionClearAllMolecules();
+
+class SelectionClearAllMoleculesAction : public Action {
+  friend void SelectionClearAllMolecules();
+
+public:
+  SelectionClearAllMoleculesAction();
+  virtual ~SelectionClearAllMoleculesAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+protected:
+  virtual Dialog * fillDialog(Dialog *dialog);
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+#endif /* CLEARALLMOLECULESSACTION_HPP_ */
