Index: trunk/lib/FlairCore/src/ListWidget.cpp
===================================================================
--- trunk/lib/FlairCore/src/ListWidget.cpp	(revision 88)
+++ trunk/lib/FlairCore/src/ListWidget.cpp	(revision 88)
@@ -0,0 +1,85 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/07/26
+//  filename:   ListWidget.cpp
+//
+//  author:     Thomas Fuhrmann
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QListWidget on the ground station
+//
+//
+/*********************************************************************/
+#include "ListWidget.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+#include <sstream>
+
+using std::string;
+
+namespace flair {
+namespace gui {
+
+ListWidget::ListWidget(const LayoutPosition *position, string name)
+    : Widget(position->getLayout(), name, string("ListWidget")),
+    selectedItemRow(-1), selectedItemChanged(false) {
+  // load the items in the xml file and send them to the ground station
+  size_t count = 0;
+  while (1) {
+    string item;
+    std::ostringstream item_prop;
+    item_prop << "item" << count;
+    if (GetPersistentXmlProp(item_prop.str(), item)) {
+      SetVolatileXmlProp(item_prop.str(), item);
+      items.push_back(item);
+    } else {
+      break;
+    }
+    count++;
+  }
+  SetVolatileXmlProp("row", position->Row());
+  SetVolatileXmlProp("col", position->Col());
+  delete position;
+  SendXml();
+}
+
+ListWidget::~ListWidget() { core::Object::ObjectName(); }
+
+void ListWidget::AddItem(string name) {
+  items.push_back(name);
+  SetVolatileXmlProp("item", name);
+  SendXml();
+}
+
+void ListWidget::RemoveItem(void) {
+  if (selectedItemChanged) {
+    // Delete the the last item, the xml file will automatically be updated by the GUI
+    // TODO diff when the apply all xml file is received to avoid clear here
+    std::ostringstream item_prop;
+    item_prop << "item" << (items.size() - 1);
+    UnsetPersistentXmlProp(item_prop.str());
+    // Delete the item from the internal list and ask the GUI to delete it
+    selectedItemChanged = false;
+    items.erase(items.cbegin() + selectedItemRow);
+    SetVolatileXmlProp("delete", selectedItemRow);
+    SendXml();
+  }
+}
+
+void ListWidget::XmlEvent(void) {
+  if (GetPersistentXmlProp("value", selectedItemRow)) {
+    selectedItemChanged = true;
+  }
+}
+
+const std::vector<std::string> &ListWidget::GetItemList() const {
+  return items;
+}
+
+} // end namespace gui
+} // end namespace flair
Index: trunk/lib/FlairCore/src/ListWidget.h
===================================================================
--- trunk/lib/FlairCore/src/ListWidget.h	(revision 88)
+++ trunk/lib/FlairCore/src/ListWidget.h	(revision 88)
@@ -0,0 +1,97 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ListWidget.h
+ * \brief Class displaying a QListWidget on the ground station
+ * \author Thomas Fuhrmann, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/07/26
+ * \version 1.0
+ */
+
+#ifndef LISTWIDGET_H
+#define LISTWIDGET_H
+
+#include <Widget.h>
+
+namespace flair {
+namespace gui {
+
+class LayoutPosition;
+
+/*! \class ListWidget
+ *
+ * \brief Class displaying a QListWidget on the ground station
+ *  
+ *  The internal list (called items) contains the same elements
+ *  as the list of the QListWidget on the ground station.
+ *  To do that, each action done on the ground station has to
+ *  applied thanks to a click on the "apply" button.
+ *
+ */
+class ListWidget : public Widget {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a QListWidget at given position.
+  *
+  * \param position position to display the QListWidget
+  * \param name name
+  */
+  ListWidget(const LayoutPosition *position, std::string name);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~ListWidget();
+
+  /*!
+ * \brief Add an item
+ *
+ * Add an item to the end of the list.
+ *
+ * \param name item nam
+ */
+  void AddItem(std::string name);
+
+  /*!
+  * \brief Remove an item
+  *
+  * Remove the currently selected item.
+  * The item is not removed from the internal xml file,
+  * because the xml is override by the GUI.
+  */
+  void RemoveItem(void);
+
+  const std::vector<std::string> &GetItemList() const;
+
+private:
+  /*!
+  * \brief XmlEvent from ground station
+  *
+  * Reimplemented from Widget.
+  *
+  */
+  void XmlEvent(void);
+
+  /**
+   * List of items displayed in the ground station.
+   */
+  std::vector<std::string> items;
+  /**
+   * Row of the item currently selected in the list.
+   */
+  uint16_t selectedItemRow;
+  /**
+   * Flag to know if the selected item has changed.
+   */
+  bool selectedItemChanged;
+};
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // LISTWIDGET_H
