Added createpc.sh to the repos.

ranzbak [2011-05-03 17:40]
Added createpc.sh to the repos.

git-svn-id: https://old.setv.nl/svn/swarmtv@308 88541080-9ad6-de11-9093-5254007c1f44
Filename
branches/qtswarmtv-downloader/downloadedtablecontrol.cpp
branches/qtswarmtv-downloader/downloadedtablecontrol.hpp
branches/qtswarmtv-downloader/episodeinfowidget.cpp
branches/qtswarmtv-downloader/episodeinfowidget.hpp
branches/qtswarmtv-downloader/getbannertask.cpp
branches/qtswarmtv-downloader/getbannertask.hpp
branches/qtswarmtv-downloader/getseriesinfotask.cpp
branches/qtswarmtv-downloader/getseriesinfotask.hpp
branches/qtswarmtv-downloader/getseriestask.cpp
branches/qtswarmtv-downloader/getseriestask.hpp
branches/qtswarmtv-downloader/helpdialog.cpp
branches/qtswarmtv-downloader/helpdialog.hpp
branches/qtswarmtv-downloader/helpdialog.ui
branches/qtswarmtv-downloader/main.cpp
branches/qtswarmtv-downloader/mainwindow.cpp
branches/qtswarmtv-downloader/mainwindow.h
branches/qtswarmtv-downloader/mainwindow.ui
branches/qtswarmtv-downloader/newtorrentfullinfodialog.cpp
branches/qtswarmtv-downloader/newtorrentfullinfodialog.hpp
branches/qtswarmtv-downloader/newtorrentfullinfodialog.ui
branches/qtswarmtv-downloader/qtswarmtv.pro
branches/qtswarmtv-downloader/readablesize.cpp
branches/qtswarmtv-downloader/readablesize.hpp
branches/qtswarmtv-downloader/resources/gplv3.png
branches/qtswarmtv-downloader/resources/processing.gif
branches/qtswarmtv-downloader/resources/swarmtv_logo.png
branches/qtswarmtv-downloader/searchcontrol.cpp
branches/qtswarmtv-downloader/searchcontrol.hpp
branches/qtswarmtv-downloader/seasonepisodewidget.cpp
branches/qtswarmtv-downloader/seasonepisodewidget.hpp
branches/qtswarmtv-downloader/seasonepisodewidget.ui
branches/qtswarmtv-downloader/serieslistcontrol.cpp
branches/qtswarmtv-downloader/serieslistcontrol.hpp
branches/qtswarmtv-downloader/serieswidget.cpp
branches/qtswarmtv-downloader/serieswidget.hpp
branches/qtswarmtv-downloader/settingsdialog.cpp
branches/qtswarmtv-downloader/settingsdialog.hpp
branches/qtswarmtv-downloader/settingsdialog.ui
branches/qtswarmtv-downloader/settingsnames.hpp
branches/qtswarmtv-downloader/simplecell.cpp
branches/qtswarmtv-downloader/simplecell.hpp
branches/qtswarmtv-downloader/simpleeditdialog.cpp
branches/qtswarmtv-downloader/simpleeditdialog.hpp
branches/qtswarmtv-downloader/simpleeditdialog.ui
branches/qtswarmtv-downloader/simpletablecontrol.cpp
branches/qtswarmtv-downloader/simpletablecontrol.hpp
branches/qtswarmtv-downloader/singleapplication.cpp
branches/qtswarmtv-downloader/singleapplication.h
branches/qtswarmtv-downloader/singleton.h
branches/qtswarmtv-downloader/sourceeditdialog.cpp
branches/qtswarmtv-downloader/sourceeditdialog.hpp
branches/qtswarmtv-downloader/sourceeditdialog.ui
branches/qtswarmtv-downloader/sourcetablecontrol.cpp
branches/qtswarmtv-downloader/sourcetablecontrol.hpp
branches/qtswarmtv-downloader/sourcetablecontroller.cpp
branches/qtswarmtv-downloader/sourcetablecontroller.hpp
branches/qtswarmtv-downloader/swarmtv.cpp
branches/qtswarmtv-downloader/swarmtv.hpp
branches/qtswarmtv-downloader/swarmtvqtresources.qrc
branches/qtswarmtv-downloader/swarmtvstats.cpp
branches/qtswarmtv-downloader/swarmtvstats.hpp
branches/qtswarmtv-downloader/swarmtvtrayicon.cpp
branches/qtswarmtv-downloader/swarmtvtrayicon.h
branches/qtswarmtv-downloader/taskinterface.hpp
branches/qtswarmtv-downloader/taskqueue.cpp
branches/qtswarmtv-downloader/taskqueue.hpp
branches/qtswarmtv-downloader/testfilterdialog.cpp
branches/qtswarmtv-downloader/testfilterdialog.hpp
branches/qtswarmtv-downloader/testfilterdialog.ui
branches/qtswarmtv-downloader/thetvdb.cpp
branches/qtswarmtv-downloader/thetvdb.hpp
branches/qtswarmtv-episodes/settingsdialog.cpp
branches/qtswarmtv-episodes/settingsname.hpp
tags/swarmtv-0.9.1/libswarmtv/createpc.sh
trunk/qtswarmtv/getbannertask.cpp
trunk/qtswarmtv/serieslistcontrol.cpp
trunk/swarmtv/libswarmtv/createpc.sh
diff --git a/branches/qtswarmtv-downloader/downloadedtablecontrol.cpp b/branches/qtswarmtv-downloader/downloadedtablecontrol.cpp
new file mode 100644
index 0000000..ed83aaa
--- /dev/null
+++ b/branches/qtswarmtv-downloader/downloadedtablecontrol.cpp
@@ -0,0 +1,156 @@
+#include <QTableWidget>
+#include <QLabel>
+#include <QHeaderView>
+#include <QMessageBox>
+
+#include <sqlite3.h>
+#include <stdlib.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include <iostream>
+
+#include "swarmtv.hpp"
+#include "singleton.h"
+#include "downloadedtablecontrol.hpp"
+#include "simplecell.hpp"
+
+
+#define DOWNLOADED_LIMIT 150
+
+downloadedTableControl::downloadedTableControl(QWidget *parent) :
+    QWidget(parent)
+{
+}
+
+void downloadedTableControl::setTable(QTableWidget *downtable)
+{
+  this->downtable = downtable;
+
+  initHeaders();
+}
+
+
+int downloadedTableControl::getRowSelected()
+{
+  int row=0;
+
+  // Get line that is currently selected
+  QList<QTableWidgetSelectionRange> items = downtable->selectedRanges();
+  if(items.count() == 0) {
+    QMessageBox::warning(this, tr("SwarmTv"),
+                         tr("Please select a downloaded item to delete."),
+                         QMessageBox::Ok);
+    return -1;
+  }
+  row = items.first().topRow();
+
+  return row;
+}
+
+
+void downloadedTableControl::fillTable()
+{
+  int rc=0;
+  int count=0;
+  downloaded_container *downed=NULL;
+  QLabel *cell=NULL;
+  simpleCell *scell=NULL;
+  char *text=NULL;
+  int id=0;
+
+  // Get Swarmtv handle
+  swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  // Fill cells
+  rc = rsstgetdownloaded(swarm->getHandle(), &downed, DOWNLOADED_LIMIT, 0);
+  if(rc == 0) {
+
+    // Set rows in table
+    downtable->setRowCount(downed->nr);
+
+    while(count < downed->nr){
+      id=downed->downloaded[count].id;
+      text=downed->downloaded[count].title;
+      scell = new simpleCell(text);
+      scell->setSimpleId(id);
+      downtable->setCellWidget(count, 0, scell);
+
+      text = downed->downloaded[count].downdate;
+      cell = new QLabel(text);
+      downtable->setCellWidget(count, 1, cell);
+
+      text = downed->downloaded[count].metatype;
+      cell = new QLabel(text);
+      downtable->setCellWidget(count, 2, cell);
+
+      count++;
+    }
+
+    // clean up
+    rsstfreedownloadedcontainer(downed);
+  }
+}
+
+void downloadedTableControl::initHeaders()
+{
+  // Set title as filling
+  downtable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
+
+  // Set Size static
+  downtable->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents);
+
+  // Set source static
+  downtable->horizontalHeader()->setResizeMode(2, QHeaderView::ResizeToContents);
+}
+
+void downloadedTableControl::delClicked()
+{
+  simpleCell *scell=NULL;
+  int id=0;
+  int row=0;
+  int rc=0;
+
+  // Get Swarmtv handle
+  swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  /*
+   * Get the row selected row.
+   * When nothing selected do nothing
+   */
+  row = getRowSelected();
+  if(row == -1){
+    return;
+  }
+  scell = static_cast<simpleCell*>(downtable->cellWidget(row, 0));
+  id = scell->getSimpleId();
+
+  /*
+   * Delete the entry from the downloaded table.
+   */
+  rc = rsstdeldownloaded(swarm->getHandle(), id);
+
+  /*
+   * Update table contents
+   */
+  this->fillTable();
+}
+
+void downloadedTableControl::cellDoubleClicked(int,int)
+{
+  int ret=0;
+
+  // Ask for comformation
+  ret = QMessageBox::warning(this, tr("SwarmTv"),
+                                 tr("Delete this entry from the downloaded record?"),
+                                 QMessageBox::Ok | QMessageBox::Cancel);
+
+  if(ret == QMessageBox::Ok){
+    // Update the view
+    this->delClicked();
+  }
+
+
+}
diff --git a/branches/qtswarmtv-downloader/downloadedtablecontrol.hpp b/branches/qtswarmtv-downloader/downloadedtablecontrol.hpp
new file mode 100644
index 0000000..1e01c3e
--- /dev/null
+++ b/branches/qtswarmtv-downloader/downloadedtablecontrol.hpp
@@ -0,0 +1,28 @@
+#ifndef DOWNLOADEDTABLECONTROL_HPP
+#define DOWNLOADEDTABLECONTROL_HPP
+
+#include <QTableWidget>
+
+#include <QWidget>
+
+class downloadedTableControl : public QWidget
+{
+  Q_OBJECT
+public:
+  explicit downloadedTableControl(QWidget *parent = 0);
+  void setTable(QTableWidget *downtable);
+
+signals:
+
+public slots:
+  void delClicked();
+  void cellDoubleClicked(int,int);
+  void fillTable();
+
+private:
+  void initHeaders();
+  QTableWidget *downtable;
+  int getRowSelected();
+};
+
+#endif // DOWNLOADEDTABLECONTROL_HPP
diff --git a/branches/qtswarmtv-downloader/episodeinfowidget.cpp b/branches/qtswarmtv-downloader/episodeinfowidget.cpp
new file mode 100644
index 0000000..959ee66
--- /dev/null
+++ b/branches/qtswarmtv-downloader/episodeinfowidget.cpp
@@ -0,0 +1,121 @@
+#include "episodeinfowidget.hpp"
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QString>
+#include <QDebug>
+#include <QTreeView>
+#include <QSize>
+#include <QFrame>
+#include <QTextCodec>
+
+episodeInfoWidget::episodeInfoWidget(QWidget *parent) :
+    QFrame(parent)
+{
+  init();
+}
+
+episodeInfoWidget::episodeInfoWidget(tvdb_series_info_t *seriesInfo, QTreeWidgetItem *treeItem, QString &seriesName, QWidget *parent) :
+    QFrame(parent)
+{
+  QTextCodec *codec = QTextCodec::codecForName("utf-8");
+  QString overview;
+
+  init();
+
+  // Convert overview and seriesName
+  overview = codec->toUnicode(seriesInfo->overview);
+  story->setText(overview);
+
+  bannerName = seriesInfo->filename;
+  this->treeItem = treeItem;
+  this->seriesName = seriesName;
+  season = seriesInfo->season_number;
+  episode = seriesInfo->episode_number;
+}
+
+void episodeInfoWidget::init()
+{
+  // Configure containing frame
+  this->setFrameStyle(QFrame::Box);
+  this->setMinimumHeight(250);
+
+  // Create layout inside QFrame
+  QHBoxLayout *layer = new QHBoxLayout(this);
+
+  // Insert and initialize the image-label
+  bannerImage = new QLabel("<font color='grey'>Downloading Image</font>");
+  bannerImage->setFrameStyle(QFrame::Box);
+  bannerImage->setMaximumWidth(320);
+  bannerImage->setMaximumHeight(240);
+  bannerImage->setAlignment(Qt::AlignCenter);
+
+  // Set the episode story/spoiler
+  story = new QLabel("");
+  story->setWordWrap(true);
+
+  // Add widgets to layout.
+  layer->addWidget(bannerImage);
+  layer->addWidget(story);
+}
+
+void episodeInfoWidget::setStory(QString &story)
+{
+  this->story->setText(story);
+}
+
+void episodeInfoWidget::setImageText(const QString &imageTest)
+{
+  bannerImage->setText(imageTest);
+}
+
+void episodeInfoWidget::bannerReady(tvdb_buffer_t *tvdb)
+{
+  QPixmap *bannerPixmap = new QPixmap(); // Image to show as banner
+
+  // set banner information to the Image
+  bannerPixmap->loadFromData((uchar*) tvdb->memory, (int) tvdb->size);
+  if(bannerPixmap->width() != 0){
+    bannerImage->setPixmap(*bannerPixmap);
+  } else {
+    bannerImage->setText(tr("No Image available."));
+  }
+}
+
+void episodeInfoWidget::bannerFailed()
+{
+  bannerImage->setText(tr("No banner"));
+}
+
+QString &episodeInfoWidget::getBannerName()
+{
+  return bannerName;
+}
+
+bool episodeInfoWidget::imageSet()
+{
+  if(bannerImage->pixmap() == NULL) {
+    return false;
+  } else {
+    return true;
+  }
+}
+
+void episodeInfoWidget::setTreeItem(QTreeWidgetItem &treeItem)
+{
+  this->treeItem=&treeItem;
+}
+
+QString &episodeInfoWidget::getSeriesName()
+{
+  return seriesName;
+}
+
+int episodeInfoWidget::getSeason()
+{
+  return season;
+}
+
+int episodeInfoWidget::getEpisode()
+{
+  return episode;
+}
diff --git a/branches/qtswarmtv-downloader/episodeinfowidget.hpp b/branches/qtswarmtv-downloader/episodeinfowidget.hpp
new file mode 100644
index 0000000..9605b94
--- /dev/null
+++ b/branches/qtswarmtv-downloader/episodeinfowidget.hpp
@@ -0,0 +1,50 @@
+#ifndef EPISODEINFOWIDGET_HPP
+#define EPISODEINFOWIDGET_HPP
+
+#include <QWidget>
+#include <QFrame>
+#include <QLabel>
+#include <QString>
+#include <QTreeWidget>
+
+extern "C" {
+  #include "tvdb.h"
+}
+
+class episodeInfoWidget : public QFrame
+{
+  Q_OBJECT
+public:
+  explicit episodeInfoWidget(QWidget *parent = 0);
+  explicit episodeInfoWidget(tvdb_series_info_t *seriesInfo, QTreeWidgetItem *treeItem, QString &seriesName, QWidget *parent = 0);
+
+  void setImageText(const QString &imageTest);
+  void setStory(QString &story);
+  void setTreeItem(QTreeWidgetItem &treeItem);
+
+  QString &getSeriesName();
+  int getSeason();
+  int getEpisode();
+
+  QString &getBannerName();
+  bool 		imageSet();
+
+signals:
+
+public slots:
+  void bannerReady(tvdb_buffer_t *tvdb);
+  void bannerFailed();
+
+private:
+  void init();
+
+  QLabel *bannerImage;
+  QLabel *story;
+  QTreeWidgetItem *treeItem;
+  QString bannerName;
+  QString seriesName;
+  int season;
+  int episode;
+};
+
+#endif // EPISODEINFOWIDGET_HPP
diff --git a/branches/qtswarmtv-downloader/getbannertask.cpp b/branches/qtswarmtv-downloader/getbannertask.cpp
new file mode 100644
index 0000000..f9bd7e9
--- /dev/null
+++ b/branches/qtswarmtv-downloader/getbannertask.cpp
@@ -0,0 +1,80 @@
+#include <iostream>
+#include <stdlib.h>
+
+extern "C" {
+#include <tvdb.h>
+}
+
+#include "singleton.h"
+#include "getbannertask.hpp"
+#include "thetvdb.hpp"
+
+getBannerTask::getBannerTask(QObject *parent) :
+    QObject(parent)
+{
+  theTvdb *htvdb=NULL;
+  htvdb = &Singleton<theTvdb>::Instance();
+  this->tvdb = htvdb->getTvdb();
+
+  this->filename=NULL;
+  memset(&bannerData, 0, sizeof(tvdb_buffer_t));
+}
+
+getBannerTask::getBannerTask(char *filename, QObject *parent) :
+    QObject(parent)
+{
+  theTvdb *htvdb=NULL;
+  this->tvdb = htvdb->getTvdb();
+
+  this->filename=strdup(filename);
+  memset(&bannerData, 0, sizeof(tvdb_buffer_t));
+}
+
+getBannerTask::getBannerTask(char *filename, theTvdb *htvdb, QObject *parent) :
+    QObject(parent)
+{
+  this->tvdb=htvdb->getTvdb();
+  this->filename=strdup(filename);
+  memset(&bannerData, 0, sizeof(tvdb_buffer_t));
+}
+
+getBannerTask::getBannerTask(char* filename, htvdb_t tvdb, QObject *parent) :
+    QObject(parent)
+{
+  this->tvdb=tvdb;
+  this->filename=strdup(filename);
+  memset(&bannerData, 0, sizeof(tvdb_buffer_t));
+}
+
+getBannerTask::~getBannerTask()
+{
+  free(filename);
+  tvdb_free_buffer(&bannerData);
+}
+
+void getBannerTask::setFilename(char *filename)
+{
+  if(this->filename != NULL) {
+    free(this->filename);
+  }
+
+  this->filename = strdup(filename);
+}
+
+void getBannerTask::setTvdbHandle(theTvdb *htvdb)
+{
+  this->tvdb = htvdb->getTvdb();
+}
+
+void getBannerTask::start(void)
+{
+  int rc=NULL;
+
+  rc = tvdb_banners(tvdb, filename, &bannerData);
+  if(rc == TVDB_OK) {
+    emit bannerReady(&bannerData);
+  } else {
+    emit bannerFailed();
+  }
+}
+
diff --git a/branches/qtswarmtv-downloader/getbannertask.hpp b/branches/qtswarmtv-downloader/getbannertask.hpp
new file mode 100644
index 0000000..b7fa82e
--- /dev/null
+++ b/branches/qtswarmtv-downloader/getbannertask.hpp
@@ -0,0 +1,38 @@
+#ifndef GETBANNERTASK_HPP
+#define GETBANNERTASK_HPP
+
+#include <QObject>
+#include "taskinterface.hpp"
+
+extern "C" {
+#include "tvdb.h"
+}
+
+class theTvdb;
+
+class getBannerTask : public QObject, public taskInterface
+{
+  Q_OBJECT
+public:
+  explicit getBannerTask(QObject *parent = 0);
+  explicit getBannerTask(char* filename, QObject *parent = 0);
+  explicit getBannerTask(char* filename, theTvdb *htvdb, QObject *parent = 0);
+  explicit getBannerTask(char* filename, htvdb_t tvdb, QObject *parent = 0);
+  ~getBannerTask();
+
+  void start(void);
+  void setFilename(char *filename);
+  void setTvdbHandle(theTvdb *htvdb);
+signals:
+  void bannerReady(tvdb_buffer_t *tvdb);
+  void bannerFailed();
+
+public slots:
+
+private:
+  char *filename;
+  tvdb_buffer_t bannerData;
+  htvdb_t tvdb;
+};
+
+#endif // GETBANNERTASK_HPP
diff --git a/branches/qtswarmtv-downloader/getseriesinfotask.cpp b/branches/qtswarmtv-downloader/getseriesinfotask.cpp
new file mode 100644
index 0000000..670df4f
--- /dev/null
+++ b/branches/qtswarmtv-downloader/getseriesinfotask.cpp
@@ -0,0 +1,38 @@
+#include "getseriesinfotask.hpp"
+#include <stdlib.h>
+extern "C" {
+  #include <tvdb.h>
+}
+
+getSeriesInfoTask::getSeriesInfoTask(htvdb_t handle, int seriesId, QObject *parent) :
+    QObject(parent)
+{
+  // Set the tvdb handle
+  this->handle = handle;
+
+  // Set the url that is to be retrieved
+  this->seriesId = seriesId;
+
+  // Initialize structs
+  memset(&series_xml, 0, sizeof(series_xml));
+}
+
+getSeriesInfoTask::~getSeriesInfoTask()
+{
+  tvdb_free_buffer(&series_xml);
+}
+
+
+void getSeriesInfoTask::start()
+{
+  int rc=0;
+
+  // retrieve data from libtvdb
+  rc = tvdb_series_info(handle, seriesId, "en", &series_xml);
+  if(rc != TVDB_OK){
+    emit  failed();
+  } else {
+    // emit signal holding results
+    emit results(&series_xml);
+  }
+}
diff --git a/branches/qtswarmtv-downloader/getseriesinfotask.hpp b/branches/qtswarmtv-downloader/getseriesinfotask.hpp
new file mode 100644
index 0000000..d102a39
--- /dev/null
+++ b/branches/qtswarmtv-downloader/getseriesinfotask.hpp
@@ -0,0 +1,30 @@
+#ifndef GETSERIESINFOTASK_H
+#define GETSERIESINFOTASK_H
+
+#include <QObject>
+#include "taskinterface.hpp"
+extern "C" {
+  #include <tvdb.h>
+}
+
+class getSeriesInfoTask : public QObject, public taskInterface
+{
+    Q_OBJECT
+public:
+  explicit getSeriesInfoTask(htvdb_t handle, int seriesId, QObject *parent = 0);
+  ~getSeriesInfoTask();
+  void start();
+
+signals:
+  void results(tvdb_buffer_t *series_xml);
+  void failed();
+
+public slots:
+
+private:
+  htvdb_t handle;
+  tvdb_buffer_t series_xml;
+  int seriesId;
+};
+
+#endif // GETSERIESINFOTASK_H
diff --git a/branches/qtswarmtv-downloader/getseriestask.cpp b/branches/qtswarmtv-downloader/getseriestask.cpp
new file mode 100644
index 0000000..1f0d873
--- /dev/null
+++ b/branches/qtswarmtv-downloader/getseriestask.cpp
@@ -0,0 +1,37 @@
+#include "getseriestask.hpp"
+#include <stdlib.h>
+
+extern "C" {
+  #include <tvdb.h>
+}
+
+#include "thetvdb.hpp"
+#include "singleton.h"
+
+getSeriesTask::getSeriesTask(char *query, QObject *parent) :
+    QObject(parent)
+{
+  // xml buffer
+  memset(&series_xml, 0, sizeof(tvdb_buffer_t));
+
+  // store query
+  this->query = strdup(query);
+}
+
+getSeriesTask::~getSeriesTask()
+{
+  // Cleanup
+  tvdb_free_buffer(&series_xml);
+  free(query);
+}
+
+void getSeriesTask::start()
+{
+  theTvdb *tvdb = &Singleton<theTvdb>::Instance();
+
+  // Get XML results
+  tvdb_series(tvdb->getTvdb(), query, "en", &series_xml);
+
+  // emit signal holding results
+  emit results(&series_xml);
+}
diff --git a/branches/qtswarmtv-downloader/getseriestask.hpp b/branches/qtswarmtv-downloader/getseriestask.hpp
new file mode 100644
index 0000000..c93fcfe
--- /dev/null
+++ b/branches/qtswarmtv-downloader/getseriestask.hpp
@@ -0,0 +1,28 @@
+#ifndef GETSERIESTASK_HPP
+#define GETSERIESTASK_HPP
+
+#include <QObject>
+#include "taskinterface.hpp"
+extern "C" {
+  #include <tvdb.h>
+}
+
+class getSeriesTask : public QObject, public taskInterface
+{
+    Q_OBJECT
+public:
+    explicit getSeriesTask(char *query, QObject *parent = 0);
+    ~getSeriesTask();
+    void start();
+
+signals:
+    void results(tvdb_buffer_t *series_xml);
+
+public slots:
+
+private:
+  tvdb_buffer_t series_xml;
+  char *query;
+};
+
+#endif // GETSERIESTASK_HPP
diff --git a/branches/qtswarmtv-downloader/helpdialog.cpp b/branches/qtswarmtv-downloader/helpdialog.cpp
new file mode 100644
index 0000000..7c3e471
--- /dev/null
+++ b/branches/qtswarmtv-downloader/helpdialog.cpp
@@ -0,0 +1,17 @@
+#include "helpdialog.hpp"
+#include "ui_helpdialog.h"
+
+helpDialog::helpDialog(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::helpDialog)
+{
+    ui->setupUi(this);
+    // open links in 'real' browser
+    ui->about->setOpenExternalLinks(true);
+    ui->license->setOpenExternalLinks(true);
+}
+
+helpDialog::~helpDialog()
+{
+    delete ui;
+}
diff --git a/branches/qtswarmtv-downloader/helpdialog.hpp b/branches/qtswarmtv-downloader/helpdialog.hpp
new file mode 100644
index 0000000..2a1e5e5
--- /dev/null
+++ b/branches/qtswarmtv-downloader/helpdialog.hpp
@@ -0,0 +1,22 @@
+#ifndef HELPDIALOG_HPP
+#define HELPDIALOG_HPP
+
+#include <QDialog>
+
+namespace Ui {
+    class helpDialog;
+}
+
+class helpDialog : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit helpDialog(QWidget *parent = 0);
+    ~helpDialog();
+
+private:
+    Ui::helpDialog *ui;
+};
+
+#endif // HELPDIALOG_HPP
diff --git a/branches/qtswarmtv-downloader/helpdialog.ui b/branches/qtswarmtv-downloader/helpdialog.ui
new file mode 100644
index 0000000..65e64f3
--- /dev/null
+++ b/branches/qtswarmtv-downloader/helpdialog.ui
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>helpDialog</class>
+ <widget class="QDialog" name="helpDialog">
+  <property name="windowModality">
+   <enum>Qt::ApplicationModal</enum>
+  </property>
+  <property name="enabled">
+   <bool>true</bool>
+  </property>
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>480</width>
+    <height>360</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>SwarmTv About</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="swarmtvqtresources.qrc">
+    <normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</iconset>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tab">
+      <attribute name="title">
+       <string>About</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <item>
+        <widget class="QTextBrowser" name="about">
+         <property name="html">
+          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p align=&quot;center&quot; style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
+&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:18pt; font-weight:600;&quot;&gt;SwarmTV Qt GUI&lt;/span&gt;&lt;/p&gt;
+&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;img src=&quot;:/swarmtv/mainlogo/resources/swarmtv_logo.png&quot; width=&quot;100&quot; height=&quot;100&quot; /&gt;&lt;/p&gt;
+&lt;p align=&quot;center&quot; style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
+&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;(C) Ranzbak 2010-2011&lt;/p&gt;
+&lt;p align=&quot;center&quot; style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
+&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://swarmtv.nl/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;swarmtv.nl&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <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="closePushButton">
+             <property name="text">
+              <string>Close</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_2">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_2">
+      <attribute name="title">
+       <string>License</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <widget class="QTextBrowser" name="license">
+         <property name="html">
+          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:large; font-weight:600;&quot;&gt;GNU GENERAL PUBLIC LICENSE&lt;/span&gt;&lt;img src=&quot;:/swarmtv/mainlogo/resources/gplv3.png&quot; style=&quot;float: right;&quot; /&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Version 3, 29 June 2007  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright © 2007 Free Software Foundation, Inc. &amp;lt;&lt;a href=&quot;http://fsf.org/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://fsf.org/&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;preamble&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:large; font-weight:600;&quot;&gt;P&lt;/span&gt;&lt;span style=&quot; font-size:large; font-weight:600;&quot;&gt;reamble&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The GNU General Public License is a free, copyleft license forsoftware and other kinds of works.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The licenses for most software and other practical works are designedto take away your freedom to share and change the works.  By contrast,the GNU General Public License is intended to guarantee your freedom toshare and change all versions of a program--to make sure it remains freesoftware for all its users.  We, the Free Software Foundation, use theGNU General Public License for most of our software; it applies also toany other work released this way by its authors.  You can apply it toyour programs, too.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When we speak of free software, we are referring to freedom, notprice.  Our General Public Licenses are designed to make sure that youhave the freedom to distribute copies of free software (and charge forthem if you wish), that you receive source code or can get it if youwant it, that you can change the software or use pieces of it in newfree programs, and that you know you can do these things.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;To protect your rights, we need to prevent others from denying youthese rights or asking you to surrender the rights.  Therefore, you havecertain responsibilities if you distribute copies of the software, or ifyou modify it: responsibilities to respect the freedom of others.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;For example, if you distribute copies of such a program, whethergratis or for a fee, you must pass on to the recipients the samefreedoms that you received.  You must make sure that they, too, receiveor can get the source code.  And you must show them these terms so theyknow their rights.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Developers that use the GNU GPL protect your rights with two steps:(1) assert copyright on the software, and (2) offer you this Licensegiving you legal permission to copy, distribute and/or modify it.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;For the developers' and authors' protection, the GPL clearly explainsthat there is no warranty for this free software.  For both users' andauthors' sake, the GPL requires that modified versions be marked aschanged, so that their problems will not be attributed erroneously toauthors of previous versions.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Some devices are designed to deny users access to install or runmodified versions of the software inside them, although the manufacturercan do so.  This is fundamentally incompatible with the aim ofprotecting users' freedom to change the software.  The systematicpattern of such abuse occurs in the area of products for individuals touse, which is precisely where it is most unacceptable.  Therefore, wehave designed this version of the GPL to prohibit the practice for thoseproducts.  If such problems arise substantially in other domains, westand ready to extend this provision to those domains in future versionsof the GPL, as needed to protect the freedom of users.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Finally, every program is threatened constantly by software patents.States should not allow patents to restrict development and use ofsoftware on general-purpose computers, but in those that do, we wish toavoid the special danger that patents applied to a free program couldmake it effectively proprietary.  To prevent this, the GPL assures thatpatents cannot be used to render the program non-free.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The precise terms and conditions for copying, distribution andmodification follow.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;terms&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:large; font-weight:600;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot; font-size:large; font-weight:600;&quot;&gt;ERMS AND CONDITIONS&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section0&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;. Definitions.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;“This License” refers to version 3 of the GNU General Public License.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;“Copyright” also means copyright-like laws that apply to other kinds ofworks, such as semiconductor masks.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;“The Program” refers to any copyrightable work licensed under thisLicense.  Each licensee is addressed as “you”.  “Licensees” and“recipients” may be individuals or organizations.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;To “modify” a work means to copy from or adapt all or part of the workin a fashion requiring copyright permission, other than the making of anexact copy.  The resulting work is called a “modified version” of theearlier work or a work “based on” the earlier work.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A “covered work” means either the unmodified Program or a work basedon the Program.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;To “propagate” a work means to do anything with it that, withoutpermission, would make you directly or secondarily liable forinfringement under applicable copyright law, except executing it on acomputer or modifying a private copy.  Propagation includes copying,distribution (with or without modification), making available to thepublic, and in some countries other activities as well.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;To “convey” a work means any kind of propagation that enables otherparties to make or receive copies.  Mere interaction with a user througha computer network, with no transfer of a copy, is not conveying.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;An interactive user interface displays “Appropriate Legal Notices”to the extent that it includes a convenient and prominently visiblefeature that (1) displays an appropriate copyright notice, and (2)tells the user that there is no warranty for the work (except to theextent that warranties are provided), that licensees may convey thework under this License, and how to view a copy of this License.  Ifthe interface presents a list of user commands or options, such as amenu, a prominent item in the list meets this criterion.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section1&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;. Source Code.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The “source code” for a work means the preferred form of the workfor making modifications to it.  “Object code” means any non-sourceform of a work.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A “Standard Interface” means an interface that either is an officialstandard defined by a recognized standards body, or, in the case ofinterfaces specified for a particular programming language, one thatis widely used among developers working in that language.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The “System Libraries” of an executable work include anything, otherthan the work as a whole, that (a) is included in the normal form ofpackaging a Major Component, but which is not part of that MajorComponent, and (b) serves only to enable use of the work with thatMajor Component, or to implement a Standard Interface for which animplementation is available to the public in source code form.  A“Major Component”, in this context, means a major essential component(kernel, window system, and so on) of the specific operating system(if any) on which the executable work runs, or a compiler used toproduce the work, or an object code interpreter used to run it.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The “Corresponding Source” for a work in object code form means allthe source code needed to generate, install, and (for an executablework) run the object code and to modify the work, including scripts tocontrol those activities.  However, it does not include the work'sSystem Libraries, or general-purpose tools or generally available freeprograms which are used unmodified in performing those activities butwhich are not part of the work.  For example, Corresponding Sourceincludes interface definition files associated with source files forthe work, and the source code for shared libraries and dynamicallylinked subprograms that the work is specifically designed to require,such as by intimate data communication or control flow between thosesubprograms and other parts of the work.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The Corresponding Source need not include anything that userscan regenerate automatically from other parts of the CorrespondingSource.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The Corresponding Source for a work in source code form is thatsame work.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section2&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;. Basic Permissions.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;All rights granted under this License are granted for the term ofcopyright on the Program, and are irrevocable provided the statedconditions are met.  This License explicitly affirms your unlimitedpermission to run the unmodified Program.  The output from running acovered work is covered by this License only if the output, given itscontent, constitutes a covered work.  This License acknowledges yourrights of fair use or other equivalent, as provided by copyright law.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;You may make, run and propagate covered works that you do notconvey, without conditions so long as your license otherwise remainsin force.  You may convey covered works to others for the sole purposeof having them make modifications exclusively for you, or provide youwith facilities for running those works, provided that you comply withthe terms of this License in conveying all material for which you donot control copyright.  Those thus making or running the covered worksfor you must do so exclusively on your behalf, under your directionand control, on terms that prohibit them from making any copies ofyour copyrighted material outside their relationship with you.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Conveying under any other circumstances is permitted solely underthe conditions stated below.  Sublicensing is not allowed; section 10makes it unnecessary.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section3&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;. Protecting Users' Legal Rights From Anti-Circumvention Law.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;No covered work shall be deemed part of an effective technologicalmeasure under any applicable law fulfilling obligations under article11 of the WIPO copyright treaty adopted on 20 December 1996, orsimilar laws prohibiting or restricting circumvention of suchmeasures.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When you convey a covered work, you waive any legal power to forbidcircumvention of technological measures to the extent such circumventionis effected by exercising rights under this License with respect tothe covered work, and you disclaim any intention to limit operation ormodification of the work as a means of enforcing, against the work'susers, your or third parties' legal rights to forbid circumvention oftechnological measures.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section4&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;. Conveying Verbatim Copies.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;You may convey verbatim copies of the Program's source code as youreceive it, in any medium, provided that you conspicuously andappropriately publish on each copy an appropriate copyright notice;keep intact all notices stating that this License and anynon-permissive terms added in accord with section 7 apply to the code;keep intact all notices of the absence of any warranty; and give allrecipients a copy of this License along with the Program.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;You may charge any price or no price for each copy that you convey,and you may offer support or warranty protection for a fee.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section5&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;. Conveying Modified Source Versions.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;You may convey a work based on the Program, or the modifications toproduce it from the Program, in the form of source code under theterms of section 4, provided that you also meet all of these conditions:  &lt;/p&gt;
+&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;a) The work must carry prominent notices stating that you modified    it, and giving a relevant date.  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;b) The work must carry prominent notices stating that it is    released under this License and any conditions added under section    7.  This requirement modifies the requirement in section 4 to    “keep intact all notices”.  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;c) You must license the entire work, as a whole, under this    License to anyone who comes into possession of a copy.  This    License will therefore apply, along with any applicable section 7    additional terms, to the whole of the work, and all its parts,    regardless of how they are packaged.  This License gives no    permission to license the work in any other way, but it does not    invalidate such permission if you have separately received it.  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;d) If the work has interactive user interfaces, each must display    Appropriate Legal Notices; however, if the Program has interactive    interfaces that do not display Appropriate Legal Notices, your    work need not make them do so.   &lt;/li&gt;&lt;/ul&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A compilation of a covered work with other separate and independentworks, which are not by their nature extensions of the covered work,and which are not combined with it such as to form a larger program,in or on a volume of a storage or distribution medium, is called an“aggregate” if the compilation and its resulting copyright are notused to limit the access or legal rights of the compilation's usersbeyond what the individual works permit.  Inclusion of a covered workin an aggregate does not cause this License to apply to the otherparts of the aggregate.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section6&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;. Conveying Non-Source Forms.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;You may convey a covered work in object code form under the termsof sections 4 and 5, provided that you also convey themachine-readable Corresponding Source under the terms of this License,in one of these ways:  &lt;/p&gt;
+&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;a) Convey the object code in, or embodied in, a physical product    (including a physical distribution medium), accompanied by the    Corresponding Source fixed on a durable physical medium    customarily used for software interchange.  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;b) Convey the object code in, or embodied in, a physical product    (including a physical distribution medium), accompanied by a    written offer, valid for at least three years and valid for as    long as you offer spare parts or customer support for that product    model, to give anyone who possesses the object code either (1) a    copy of the Corresponding Source for all the software in the    product that is covered by this License, on a durable physical    medium customarily used for software interchange, for a price no    more than your reasonable cost of physically performing this    conveying of source, or (2) access to copy the    Corresponding Source from a network server at no charge.  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;c) Convey individual copies of the object code with a copy of the    written offer to provide the Corresponding Source.  This    alternative is allowed only occasionally and noncommercially, and    only if you received the object code with such an offer, in accord    with subsection 6b.  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;d) Convey the object code by offering access from a designated    place (gratis or for a charge), and offer equivalent access to the    Corresponding Source in the same way through the same place at no    further charge.  You need not require recipients to copy the    Corresponding Source along with the object code.  If the place to    copy the object code is a network server, the Corresponding Source    may be on a different server (operated by you or a third party)    that supports equivalent copying facilities, provided you maintain    clear directions next to the object code saying where to find the    Corresponding Source.  Regardless of what server hosts the    Corresponding Source, you remain obligated to ensure that it is    available for as long as needed to satisfy these requirements.  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;e) Convey the object code using peer-to-peer transmission, provided    you inform other peers where the object code and Corresponding    Source of the work are being offered to the general public at no    charge under subsection 6d.   &lt;/li&gt;&lt;/ul&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A separable portion of the object code, whose source code is excludedfrom the Corresponding Source as a System Library, need not beincluded in conveying the object code work.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A “User Product” is either (1) a “consumer product”, which means anytangible personal property which is normally used for personal, family,or household purposes, or (2) anything designed or sold for incorporationinto a dwelling.  In determining whether a product is a consumer product,doubtful cases shall be resolved in favor of coverage.  For a particularproduct received by a particular user, “normally used” refers to atypical or common use of that class of product, regardless of the statusof the particular user or of the way in which the particular useractually uses, or expects or is expected to use, the product.  A productis a consumer product regardless of whether the product has substantialcommercial, industrial or non-consumer uses, unless such uses representthe only significant mode of use of the product.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;“Installation Information” for a User Product means any methods,procedures, authorization keys, or other information required to installand execute modified versions of a covered work in that User Product froma modified version of its Corresponding Source.  The information mustsuffice to ensure that the continued functioning of the modified objectcode is in no case prevented or interfered with solely becausemodification has been made.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If you convey an object code work under this section in, or with, orspecifically for use in, a User Product, and the conveying occurs aspart of a transaction in which the right of possession and use of theUser Product is transferred to the recipient in perpetuity or for afixed term (regardless of how the transaction is characterized), theCorresponding Source conveyed under this section must be accompaniedby the Installation Information.  But this requirement does not applyif neither you nor any third party retains the ability to installmodified object code on the User Product (for example, the work hasbeen installed in ROM).  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The requirement to provide Installation Information does not include arequirement to continue to provide support service, warranty, or updatesfor a work that has been modified or installed by the recipient, or forthe User Product in which it has been modified or installed.  Access to anetwork may be denied when the modification itself materially andadversely affects the operation of the network or violates the rules andprotocols for communication across the network.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Corresponding Source conveyed, and Installation Information provided,in accord with this section must be in a format that is publiclydocumented (and with an implementation available to the public insource code form), and must require no special password or key forunpacking, reading or copying.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section7&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;7&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;. Additional Terms.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;“Additional permissions” are terms that supplement the terms of thisLicense by making exceptions from one or more of its conditions.Additional permissions that are applicable to the entire Program shallbe treated as though they were included in this License, to the extentthat they are valid under applicable law.  If additional permissionsapply only to part of the Program, that part may be used separatelyunder those permissions, but the entire Program remains governed bythis License without regard to the additional permissions.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When you convey a copy of a covered work, you may at your optionremove any additional permissions from that copy, or from any part ofit.  (Additional permissions may be written to require their ownremoval in certain cases when you modify the work.)  You may placeadditional permissions on material, added by you to a covered work,for which you have or can give appropriate copyright permission.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Notwithstanding any other provision of this License, for material youadd to a covered work, you may (if authorized by the copyright holders ofthat material) supplement the terms of this License with terms:  &lt;/p&gt;
+&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;a) Disclaiming warranty or limiting liability differently from the    terms of sections 15 and 16 of this License; or  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;b) Requiring preservation of specified reasonable legal notices or    author attributions in that material or in the Appropriate Legal    Notices displayed by works containing it; or  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;c) Prohibiting misrepresentation of the origin of that material, or    requiring that modified versions of such material be marked in    reasonable ways as different from the original version; or  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;d) Limiting the use for publicity purposes of names of licensors or    authors of the material; or  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;e) Declining to grant rights under trademark law for use of some    trade names, trademarks, or service marks; or  &lt;/li&gt;
+&lt;li style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;f) Requiring indemnification of licensors and authors of that    material by anyone who conveys the material (or modified versions of    it) with contractual assumptions of liability to the recipient, for    any liability that these contractual assumptions directly impose on    those licensors and authors.   &lt;/li&gt;&lt;/ul&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;All other non-permissive additional terms are considered “furtherrestrictions” within the meaning of section 10.  If the Program as youreceived it, or any part of it, contains a notice stating that it isgoverned by this License along with a term that is a furtherrestriction, you may remove that term.  If a license document containsa further restriction but permits relicensing or conveying under thisLicense, you may add to a covered work material governed by the termsof that license document, provided that the further restriction doesnot survive such relicensing or conveying.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If you add terms to a covered work in accord with this section, youmust place, in the relevant source files, a statement of theadditional terms that apply to those files, or a notice indicatingwhere to find the applicable terms.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Additional terms, permissive or non-permissive, may be stated in theform of a separately written license, or stated as exceptions;the above requirements apply either way.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section8&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;8&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;. Termination.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;You may not propagate or modify a covered work except as expresslyprovided under this License.  Any attempt otherwise to propagate ormodify it is void, and will automatically terminate your rights underthis License (including any patent licenses granted under the thirdparagraph of section 11).  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;However, if you cease all violation of this License, then yourlicense from a particular copyright holder is reinstated (a)provisionally, unless and until the copyright holder explicitly andfinally terminates your license, and (b) permanently, if the copyrightholder fails to notify you of the violation by some reasonable meansprior to 60 days after the cessation.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Moreover, your license from a particular copyright holder isreinstated permanently if the copyright holder notifies you of theviolation by some reasonable means, this is the first time you havereceived notice of violation of this License (for any work) from thatcopyright holder, and you cure the violation prior to 30 days afteryour receipt of the notice.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Termination of your rights under this section does not terminate thelicenses of parties who have received copies or rights from you underthis License.  If your rights have been terminated and not permanentlyreinstated, you do not qualify to receive new licenses for the samematerial under section 10.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section9&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;9&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;. Acceptance Not Required for Having Copies.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;You are not required to accept this License in order to receive orrun a copy of the Program.  Ancillary propagation of a covered workoccurring solely as a consequence of using peer-to-peer transmissionto receive a copy likewise does not require acceptance.  However,nothing other than this License grants you permission to propagate ormodify any covered work.  These actions infringe copyright if you donot accept this License.  Therefore, by modifying or propagating acovered work, you indicate your acceptance of this License to do so.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section10&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;0. Automatic Licensing of Downstream Recipients.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Each time you convey a covered work, the recipient automaticallyreceives a license from the original licensors, to run, modify andpropagate that work, subject to this License.  You are not responsiblefor enforcing compliance by third parties with this License.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;An “entity transaction” is a transaction transferring control of anorganization, or substantially all assets of one, or subdividing anorganization, or merging organizations.  If propagation of a coveredwork results from an entity transaction, each party to thattransaction who receives a copy of the work also receives whateverlicenses to the work the party's predecessor in interest had or couldgive under the previous paragraph, plus a right to possession of theCorresponding Source of the work from the predecessor in interest, ifthe predecessor has it or can get it with reasonable efforts.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;You may not impose any further restrictions on the exercise of therights granted or affirmed under this License.  For example, you maynot impose a license fee, royalty, or other charge for exercise ofrights granted under this License, and you may not initiate litigation(including a cross-claim or counterclaim in a lawsuit) alleging thatany patent claim is infringed by making, using, selling, offering forsale, or importing the Program or any portion of it.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section11&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;1. Patents.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A “contributor” is a copyright holder who authorizes use under thisLicense of the Program or a work on which the Program is based.  Thework thus licensed is called the contributor's “contributor version”.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A contributor's “essential patent claims” are all patent claimsowned or controlled by the contributor, whether already acquired orhereafter acquired, that would be infringed by some manner, permittedby this License, of making, using, or selling its contributor version,but do not include claims that would be infringed only as aconsequence of further modification of the contributor version.  Forpurposes of this definition, “control” includes the right to grantpatent sublicenses in a manner consistent with the requirements ofthis License.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Each contributor grants you a non-exclusive, worldwide, royalty-freepatent license under the contributor's essential patent claims, tomake, use, sell, offer for sale, import and otherwise run, modify andpropagate the contents of its contributor version.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;In the following three paragraphs, a “patent license” is any expressagreement or commitment, however denominated, not to enforce a patent(such as an express permission to practice a patent or covenant not tosue for patent infringement).  To “grant” such a patent license to aparty means to make such an agreement or commitment not to enforce apatent against the party.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If you convey a covered work, knowingly relying on a patent license,and the Corresponding Source of the work is not available for anyoneto copy, free of charge and under the terms of this License, through apublicly available network server or other readily accessible means,then you must either (1) cause the Corresponding Source to be soavailable, or (2) arrange to deprive yourself of the benefit of thepatent license for this particular work, or (3) arrange, in a mannerconsistent with the requirements of this License, to extend the patentlicense to downstream recipients.  “Knowingly relying” means you haveactual knowledge that, but for the patent license, your conveying thecovered work in a country, or your recipient's use of the covered workin a country, would infringe one or more identifiable patents in thatcountry that you have reason to believe are valid.   &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If, pursuant to or in connection with a single transaction orarrangement, you convey, or propagate by procuring conveyance of, acovered work, and grant a patent license to some of the partiesreceiving the covered work authorizing them to use, propagate, modifyor convey a specific copy of the covered work, then the patent licenseyou grant is automatically extended to all recipients of the coveredwork and works based on it.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;A patent license is “discriminatory” if it does not include withinthe scope of its coverage, prohibits the exercise of, or isconditioned on the non-exercise of one or more of the rights that arespecifically granted under this License.  You may not convey a coveredwork if you are a party to an arrangement with a third party that isin the business of distributing software, under which you make paymentto the third party based on the extent of your activity of conveyingthe work, and under which the third party grants, to any of theparties who would receive the covered work from you, a discriminatorypatent license (a) in connection with copies of the covered workconveyed by you (or copies made from those copies), or (b) primarilyfor and in connection with specific products or compilations thatcontain the covered work, unless you entered into that arrangement,or that patent license was granted, prior to 28 March 2007.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Nothing in this License shall be construed as excluding or limitingany implied license or other defenses to infringement that mayotherwise be available to you under applicable patent law.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section12&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;2. No Surrender of Others' Freedom.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If conditions are imposed on you (whether by court order, agreement orotherwise) that contradict the conditions of this License, they do notexcuse you from the conditions of this License.  If you cannot convey acovered work so as to satisfy simultaneously your obligations under thisLicense and any other pertinent obligations, then as a consequence you maynot convey it at all.  For example, if you agree to terms that obligate youto collect a royalty for further conveying from those to whom you conveythe Program, the only way you could satisfy both those terms and thisLicense would be to refrain entirely from conveying the Program.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section13&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;3. Use with the GNU Affero General Public License.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Notwithstanding any other provision of this License, you havepermission to link or combine any covered work with a work licensedunder version 3 of the GNU Affero General Public License into a singlecombined work, and to convey the resulting work.  The terms of thisLicense will continue to apply to the part which is the covered work,but the special requirements of the GNU Affero General Public License,section 13, concerning interaction through a network will apply to thecombination as such.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section14&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;4. Revised Versions of this License.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The Free Software Foundation may publish revised and/or new versions ofthe GNU General Public License from time to time.  Such new versions willbe similar in spirit to the present version, but may differ in detail toaddress new problems or concerns.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Each version is given a distinguishing version number.  If theProgram specifies that a certain numbered version of the GNU GeneralPublic License “or any later version” applies to it, you have theoption of following the terms and conditions either of that numberedversion or of any later version published by the Free SoftwareFoundation.  If the Program does not specify a version number of theGNU General Public License, you may choose any version ever publishedby the Free Software Foundation.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If the Program specifies that a proxy can decide which futureversions of the GNU General Public License can be used, that proxy'spublic statement of acceptance of a version permanently authorizes youto choose that version for the Program.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Later license versions may give you additional or differentpermissions.  However, no additional obligations are imposed on anyauthor or copyright holder as a result of your choosing to follow alater version.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section15&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;5. Disclaimer of Warranty.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BYAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHTHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTYOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULARPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAMIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OFALL NECESSARY SERVICING, REPAIR OR CORRECTION.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section16&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;6. Limitation of Liability.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITINGWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYSTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANYGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THEUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OFDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRDPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OFSUCH DAMAGES.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;section17&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot; font-size:medium; font-weight:600;&quot;&gt;7. Interpretation of Sections 15 and 16.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If the disclaimer of warranty and limitation of liability providedabove cannot be given local legal effect according to their terms,reviewing courts shall apply local law that most closely approximatesan absolute waiver of all civil liability in connection with theProgram, unless a warranty or assumption of liability accompanies acopy of the Program in return for a fee.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;END OF TERMS AND CONDITIONS  &lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;howto&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-size:large; font-weight:600;&quot;&gt;H&lt;/span&gt;&lt;span style=&quot; font-size:large; font-weight:600;&quot;&gt;ow to Apply These Terms to Your New Programs&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If you develop a new program, and you want it to be of the greatestpossible use to the public, the best way to achieve this is to make itfree software which everyone can redistribute and change under these terms.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;To do so, attach the following notices to the program.  It is safestto attach them to the start of each source file to most effectivelystate the exclusion of warranty; and each file should have at leastthe “copyright” line and a pointer to where the full notice is found.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Courier New,courier';&quot;&gt;    &amp;lt;one line to give the program's name and a brief idea of what it does.&amp;gt;    Copyright (C) &amp;lt;year&amp;gt;  &amp;lt;name of author&amp;gt;     This program is free software: you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation, either version 3 of the License, or    (at your option) any later version.     This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.     You should have received a copy of the GNU General Public License    along with this program.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Also add information on how to contact you by electronic and paper mail.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If the program does terminal interaction, make it output a shortnotice like this when it starts in an interactive mode:  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Courier New,courier';&quot;&gt;    &amp;lt;program&amp;gt;  Copyright (C) &amp;lt;year&amp;gt;  &amp;lt;name of author&amp;gt;    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.    This is free software, and you are welcome to redistribute it    under certain conditions; type `show c' for details.&lt;/span&gt;  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The hypothetical commands `show w' and `show c' should show the appropriateparts of the General Public License.  Of course, your program's commandsmight be different; for a GUI interface, you would use an “about box”.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;You should also get your employer (if you work as a programmer) or school,if any, to sign a “copyright disclaimer” for the program, if necessary.For more information on this, and how to apply and follow the GNU GPL, see&amp;lt;&lt;a href=&quot;http://www.gnu.org/licenses/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.gnu.org/licenses/&lt;/span&gt;&lt;/a&gt;&amp;gt;.  &lt;/p&gt;
+&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;The GNU General Public License does not permit incorporating your programinto proprietary programs.  If your program is a subroutine library, youmay consider it more useful to permit linking proprietary applications withthe library.  If this is what you want to do, use the GNU Lesser GeneralPublic License instead of this License.  But first, please read&amp;lt;&lt;a href=&quot;http://www.gnu.org/philosophy/why-not-lgpl.html&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.gnu.org/philosophy/why-not-lgpl.html&lt;/span&gt;&lt;/a&gt;&amp;gt;. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="swarmtvqtresources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>closePushButton</sender>
+   <signal>clicked()</signal>
+   <receiver>helpDialog</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>200</x>
+     <y>275</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>199</x>
+     <y>149</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/branches/qtswarmtv-downloader/main.cpp b/branches/qtswarmtv-downloader/main.cpp
new file mode 100644
index 0000000..1ceeab7
--- /dev/null
+++ b/branches/qtswarmtv-downloader/main.cpp
@@ -0,0 +1,44 @@
+#include <QtDBus>
+#include <QtGui/QApplication>
+#include <QSplashScreen>
+#include <QSettings>
+#include "singleapplication.h"
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+    SingleApplication a(argc, argv, "QtSwarmTv");
+    if (a.isRunning()) {
+        return 0;
+    }
+
+    // Setup the config object
+    QCoreApplication::setOrganizationName("ETV");
+    QCoreApplication::setOrganizationDomain("swarmtv.nl");
+    QCoreApplication::setApplicationName("Swarmtv");
+
+    MainWindow w;
+
+    QSplashScreen *splash = new QSplashScreen;
+    splash->setPixmap(QPixmap(":/swarmtv/mainlogo/resources/swarmtv_logo.png"));
+    splash->show();
+
+    w.show();
+
+    splash->showMessage( "Setting up DBus", Qt::AlignBottom );
+    a.processEvents();
+
+    // Connect DBus
+    QDBusConnection connection = QDBusConnection::sessionBus();
+    connection.connect("", "", "nl.swarmtv.dbus", "start", &w, SLOT(dbusStartReceived(QString)));
+    connection.connect("", "", "nl.swarmtv.dbus", "end", &w, SLOT(dbusEndReceived(QString)));
+    connection.connect("", "", "nl.swarmtv.dbus", "rss", &w, SLOT(dbusRssReceived(QString)));
+    connection.connect("", "", "nl.swarmtv.dbus", "simple", &w, SLOT(dbusSimpleReceived(QString)));
+    connection.connect("", "", "nl.swarmtv.dbus", "sql", &w, SLOT(dbusSqlReceived(QString)));
+    connection.connect("", "", "nl.swarmtv.dbus", "downed", &w, SLOT(dbusDownedReceived(QString)));
+
+    splash->finish(&w);
+    delete splash;
+
+    return a.exec();
+}
diff --git a/branches/qtswarmtv-downloader/mainwindow.cpp b/branches/qtswarmtv-downloader/mainwindow.cpp
new file mode 100644
index 0000000..0142f55
--- /dev/null
+++ b/branches/qtswarmtv-downloader/mainwindow.cpp
@@ -0,0 +1,200 @@
+#include <QtGui>
+#include <QtXml>
+#include <sqlite3.h>
+#include <QSettings>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+#include "singleton.h"
+#include "swarmtv.hpp"
+#include "swarmtvstats.hpp"
+#include "simpletablecontrol.hpp"
+#include "sourcetablecontrol.hpp"
+#include "readablesize.hpp"
+#include "settingsdialog.hpp"
+#include "helpdialog.hpp"
+#include "searchcontrol.hpp"
+#include "downloadedtablecontrol.hpp"
+#include "serieslistcontrol.hpp"
+#include "taskqueue.hpp"
+#include "thetvdb.hpp"
+#include "settingsnames.hpp"
+
+//const char* api_key = "<API_KEY>";
+//static const QString TVDB_API_CONFIG("config/tvdbapiconfig");
+
+MainWindow::MainWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindow)
+{
+    QSettings settings;
+    ui->setupUi(this);
+
+    // Init tray icon
+    initTrayIcon();
+
+    // Initialize the table singleton
+    simpleTableControl *stc = &Singleton<simpleTableControl>::Instance();
+    sourceTableControl *srctc = &Singleton<sourceTableControl>::Instance();
+    searchControl *sc = &Singleton<searchControl>::Instance();
+    settingsDialog *sd = &Singleton<settingsDialog>::Instance();
+    helpDialog *hd = &Singleton<helpDialog>::Instance();
+    seriesListControl *slc = &Singleton<seriesListControl>::Instance();
+    downloadedTableControl *dtc = &Singleton<downloadedTableControl>::Instance();
+    theTvdb *tvdb = &Singleton<theTvdb>::Instance();
+    stc->setTable(ui->simpleTableWidget);
+    srctc->setTable(ui->sourceTableWidget);
+    sc->setUi(ui);
+
+    // Set API Key The TVDB here for now
+    tvdb->initKey(settings.value(TVDB_API_CONFIG).toString().toUtf8().data());
+
+    // Set statistics first time
+    this->statsUpdateClicked();
+
+    // Set initial table content
+    stc->updateTable();
+    srctc->updateTable();
+
+    // Set table size policies
+    sc->initHeaders();
+
+    // Initialize Downloaded table
+    dtc->setTable(ui->downloadedTableWidget);
+    dtc->fillTable();
+
+    // Set the LineEdit and List to put results in
+    slc->setSeriesTableWidget(ui->seriesTableWidget);
+    slc->setSeriesSearchLine(ui->seriesSearchLineEdit);
+
+    // Connect signals
+    QObject::connect(ui->statsUpdatePushButton, SIGNAL(clicked()), this, SLOT(statsUpdateClicked()));
+    QObject::connect(ui->simpleTableWidget, SIGNAL(cellDoubleClicked(int,int)), stc, SLOT(cellDoubleClicked(int,int)));
+    QObject::connect(ui->sourceTableWidget, SIGNAL(cellDoubleClicked(int,int)), srctc, SLOT(cellDoubleClicked(int,int)));
+    QObject::connect(ui->sourceAddButton, SIGNAL(clicked()), srctc, SLOT(addButtonClicked()));
+    QObject::connect(ui->sourceDelButton, SIGNAL(clicked()), srctc, SLOT(delButtonClicked()));
+    QObject::connect(ui->simpleAddButton, SIGNAL(clicked()), stc, SLOT(addSimpleButtonClicked()));
+    QObject::connect(ui->simpleDelButton, SIGNAL(clicked()), stc, SLOT(delSimpleButtonClicked()));
+    QObject::connect(ui->SimpleEditButton, SIGNAL(clicked()), stc, SLOT(editSimpleButtonClicked()));
+    QObject::connect(ui->actionSettings, SIGNAL(triggered()), sd, SLOT(show()));
+    QObject::connect(ui->actionAbout, SIGNAL(triggered()), hd, SLOT(show()));
+    QObject::connect(ui->searchPushButton, SIGNAL(clicked()), sc, SLOT(searchClicked()));
+    QObject::connect(ui->SearchLineEdit, SIGNAL(returnPressed()), sc, SLOT(searchClicked()));
+    QObject::connect(ui->searchTableWidget, SIGNAL(cellDoubleClicked(int,int)), sc, SLOT(tableDownload(int,int)));
+    QObject::connect(ui->delDownedPushButton, SIGNAL(clicked()), dtc, SLOT(delClicked()));
+    QObject::connect(ui->updateDownedPushButton, SIGNAL(clicked()), dtc, SLOT(fillTable()));
+    QObject::connect(ui->downloadedTableWidget, SIGNAL(cellDoubleClicked(int,int)), dtc, SLOT(cellDoubleClicked(int,int)));
+    QObject::connect(ui->seriesFindPushButton, SIGNAL(clicked()), slc, SLOT(findSeries()));
+    QObject::connect(ui->seriesSearchLineEdit, SIGNAL(returnPressed()), slc, SLOT(findSeries()));
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}
+
+void MainWindow::initTrayIcon()
+{
+  if(QSystemTrayIcon::isSystemTrayAvailable() == true) {
+    // Setup tray icon
+    this->tray = new swarmtvTrayIcon(this);
+    if(tray == NULL){
+      qDebug() << "Allocating tray icon failed.";
+      exit(1);
+    }
+  }
+}
+
+void MainWindow::statsUpdateClicked()
+{
+    swarmTvStats stats;
+    QString 	*statsstr;
+
+    statsstr=stats.getStatsString();
+    ui->statsTextEdit->setText(*statsstr);
+
+    delete(statsstr);
+}
+
+void MainWindow::fancyMessage(QString msg, bool showInTray)
+{
+    if (this->isVisible()) {
+        ui->statusBar->showMessage(msg, 3000);
+    } else if(showInTray == true) {
+        tray->showMessage("SwarmTv", msg, 3000);
+    }
+}
+
+void MainWindow::dbusStartReceived(QString msg)
+{
+  QSettings settings;
+
+  if (msg.isEmpty()) {
+    msg = msg.fromUtf8("Swarmtv run started");
+  }
+  fancyMessage(msg, settings.value(TRAY_SHOW_DBUSSTART).toBool());
+}
+
+void MainWindow::dbusEndReceived(QString msg)
+{
+  QSettings settings;
+
+  if (msg.isEmpty()) {
+    msg = msg.fromUtf8("Swarmtv run ended");
+  }
+  statsUpdateClicked();
+  downloadedTableControl *dtc = &Singleton<downloadedTableControl>::Instance();
+  dtc->fillTable();
+  simpleTableControl *stc = &Singleton<simpleTableControl>::Instance();
+  stc->updateTable();
+  fancyMessage(msg, settings.value(TRAY_SHOW_DBUSSTOP).toBool());
+}
+
+void MainWindow::dbusRssReceived(QString msg)
+{
+  QSettings settings;
+  QDomDocument xml;
+  if (xml.setContent(msg)) {
+    fancyMessage(tr("RSS retrieved from: %1").
+                 arg(xml.elementsByTagName("name").item(0).toElement().text()),
+                 settings.value(TRAY_SHOW_RSS).toBool());
+  }
+}
+
+void MainWindow::dbusSimpleReceived(QString msg)
+{
+  QSettings settings;
+  QDomDocument xml;
+  if (xml.setContent(msg)) {
+    fancyMessage(tr("Simple filter ran: %1").
+                 arg(xml.elementsByTagName("name").item(0).toElement().text())
+                 , settings.value(TRAY_SHOW_SIMPLE).toBool());
+  }
+}
+
+void MainWindow::dbusSqlReceived(QString msg)
+{
+  QSettings settings;
+  if (msg.isEmpty()) {
+    msg = msg.fromUtf8("Swarmtv sql notification");
+  }
+  fancyMessage(msg, settings.value(TRAY_SHOW_SQL).toBool());
+}
+
+void MainWindow::dbusDownedReceived(QString msg)
+{
+  QDomDocument xml;
+  QSettings settings;
+
+  if (xml.setContent(msg)) {
+    QString cleantitle = tr("Downloaded torrent for: %1 season %2 episode %3").arg(
+        xml.elementsByTagName("baretitle").item(0).toElement().text(),
+        xml.elementsByTagName("season").item(0).toElement().text(),
+        xml.elementsByTagName("episode").item(0).toElement().text());
+    fancyMessage(cleantitle, settings.value(TRAY_SHOW_DOWNED).toBool());
+  }
+}
diff --git a/branches/qtswarmtv-downloader/mainwindow.h b/branches/qtswarmtv-downloader/mainwindow.h
new file mode 100644
index 0000000..aa04aff
--- /dev/null
+++ b/branches/qtswarmtv-downloader/mainwindow.h
@@ -0,0 +1,35 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+#include "swarmtvtrayicon.h"
+
+namespace Ui {
+    class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+public slots:
+    void statsUpdateClicked();
+    void initTrayIcon();
+    void dbusStartReceived(QString);
+    void dbusEndReceived(QString);
+    void dbusRssReceived(QString);
+    void dbusSimpleReceived(QString);
+    void dbusSqlReceived(QString);
+    void dbusDownedReceived(QString);
+
+private:
+    Ui::MainWindow *ui;
+    swarmtvTrayIcon *tray;
+    void fancyMessage(QString, bool);
+};
+
+#endif // MAINWINDOW_H
diff --git a/branches/qtswarmtv-downloader/mainwindow.ui b/branches/qtswarmtv-downloader/mainwindow.ui
new file mode 100644
index 0000000..f36e177
--- /dev/null
+++ b/branches/qtswarmtv-downloader/mainwindow.ui
@@ -0,0 +1,675 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>700</width>
+    <height>385</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>SwarmTv</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="swarmtvqtresources.qrc">
+    <normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</iconset>
+  </property>
+  <property name="tabShape">
+   <enum>QTabWidget::Triangular</enum>
+  </property>
+  <widget class="QWidget" name="centralWidget">
+   <layout class="QGridLayout" name="gridLayout">
+    <item row="0" column="1">
+     <widget class="QTabWidget" name="mainTab">
+      <property name="toolTip">
+       <string/>
+      </property>
+      <property name="tabShape">
+       <enum>QTabWidget::Rounded</enum>
+      </property>
+      <property name="currentIndex">
+       <number>5</number>
+      </property>
+      <widget class="QWidget" name="tab">
+       <attribute name="title">
+        <string>Series</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_7">
+        <item row="0" column="0">
+         <layout class="QVBoxLayout" name="verticalLayout_6">
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_6">
+            <item>
+             <widget class="QLineEdit" name="seriesSearchLineEdit">
+              <property name="toolTip">
+               <string>Find series by name on thetvdb.com.</string>
+              </property>
+              <property name="placeholderText">
+               <string>&lt;Series Name&gt;</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="seriesFindPushButton">
+              <property name="text">
+               <string>Find</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+        <item row="1" column="0">
+         <widget class="QTableWidget" name="seriesTableWidget">
+          <property name="contextMenuPolicy">
+           <enum>Qt::CustomContextMenu</enum>
+          </property>
+          <property name="lineWidth">
+           <number>1</number>
+          </property>
+          <property name="alternatingRowColors">
+           <bool>false</bool>
+          </property>
+          <attribute name="horizontalHeaderVisible">
+           <bool>false</bool>
+          </attribute>
+          <attribute name="horizontalHeaderStretchLastSection">
+           <bool>true</bool>
+          </attribute>
+          <attribute name="verticalHeaderVisible">
+           <bool>false</bool>
+          </attribute>
+          <column>
+           <property name="text">
+            <string>Do not show</string>
+           </property>
+          </column>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="SourcesTab">
+       <attribute name="title">
+        <string>Sources</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_3">
+        <item row="0" column="0">
+         <layout class="QVBoxLayout" name="verticalLayout_3">
+          <item>
+           <widget class="QTableWidget" name="sourceTableWidget">
+            <property name="alternatingRowColors">
+             <bool>true</bool>
+            </property>
+            <property name="selectionMode">
+             <enum>QAbstractItemView::SingleSelection</enum>
+            </property>
+            <property name="selectionBehavior">
+             <enum>QAbstractItemView::SelectRows</enum>
+            </property>
+            <attribute name="horizontalHeaderCascadingSectionResizes">
+             <bool>true</bool>
+            </attribute>
+            <attribute name="horizontalHeaderDefaultSectionSize">
+             <number>150</number>
+            </attribute>
+            <attribute name="horizontalHeaderMinimumSectionSize">
+             <number>100</number>
+            </attribute>
+            <attribute name="horizontalHeaderStretchLastSection">
+             <bool>true</bool>
+            </attribute>
+            <attribute name="verticalHeaderVisible">
+             <bool>false</bool>
+            </attribute>
+            <column>
+             <property name="text">
+              <string>Name</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Parser</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Meta type</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>URL</string>
+             </property>
+            </column>
+           </widget>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_3">
+            <item>
+             <widget class="QPushButton" name="sourceAddButton">
+              <property name="text">
+               <string>Add</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="sourceEditButton">
+              <property name="text">
+               <string>Edit</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="sourceDelButton">
+              <property name="text">
+               <string>Del</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer_3">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="filterTab">
+       <property name="accessibleName">
+        <string extracomment="lala"/>
+       </property>
+       <attribute name="title">
+        <string>Filters</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_2">
+        <item row="0" column="0">
+         <layout class="QVBoxLayout" name="verticalLayout_2">
+          <item>
+           <widget class="QTableWidget" name="simpleTableWidget">
+            <property name="alternatingRowColors">
+             <bool>true</bool>
+            </property>
+            <property name="selectionMode">
+             <enum>QAbstractItemView::SingleSelection</enum>
+            </property>
+            <property name="selectionBehavior">
+             <enum>QAbstractItemView::SelectRows</enum>
+            </property>
+            <property name="rowCount">
+             <number>0</number>
+            </property>
+            <property name="columnCount">
+             <number>3</number>
+            </property>
+            <attribute name="horizontalHeaderCascadingSectionResizes">
+             <bool>true</bool>
+            </attribute>
+            <attribute name="horizontalHeaderDefaultSectionSize">
+             <number>200</number>
+            </attribute>
+            <attribute name="horizontalHeaderMinimumSectionSize">
+             <number>150</number>
+            </attribute>
+            <attribute name="horizontalHeaderShowSortIndicator" stdset="0">
+             <bool>false</bool>
+            </attribute>
+            <attribute name="horizontalHeaderStretchLastSection">
+             <bool>true</bool>
+            </attribute>
+            <attribute name="verticalHeaderVisible">
+             <bool>false</bool>
+            </attribute>
+            <column>
+             <property name="text">
+              <string>Filter Name</string>
+             </property>
+             <property name="toolTip">
+              <string extracomment="Name of the simple filter"/>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Type</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Last Download</string>
+             </property>
+             <property name="whatsThis">
+              <string extracomment="Last content found by the filter."/>
+             </property>
+            </column>
+           </widget>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_2">
+            <item>
+             <widget class="QPushButton" name="simpleAddButton">
+              <property name="text">
+               <string>Add</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="SimpleEditButton">
+              <property name="text">
+               <string>Edit</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="simpleDelButton">
+              <property name="text">
+               <string>Del</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer_2">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="sourceTab">
+       <attribute name="title">
+        <string>Search</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_5">
+        <item row="0" column="0">
+         <layout class="QVBoxLayout" name="verticalLayout_5">
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_5">
+            <item>
+             <widget class="QLineEdit" name="SearchLineEdit">
+              <property name="toolTip">
+               <string>Search Swarmtv database for entries matching the title.</string>
+              </property>
+              <property name="placeholderText">
+               <string>&lt;regexp to find content in database&gt;</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="searchPushButton">
+              <property name="text">
+               <string>Search</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <widget class="QTableWidget" name="searchTableWidget">
+            <property name="alternatingRowColors">
+             <bool>true</bool>
+            </property>
+            <property name="selectionMode">
+             <enum>QAbstractItemView::SingleSelection</enum>
+            </property>
+            <property name="selectionBehavior">
+             <enum>QAbstractItemView::SelectRows</enum>
+            </property>
+            <attribute name="verticalHeaderVisible">
+             <bool>false</bool>
+            </attribute>
+            <column>
+             <property name="text">
+              <string>Title</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Size</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Source</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Meta type</string>
+             </property>
+            </column>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="Downloaded">
+       <property name="accessibleName">
+        <string/>
+       </property>
+       <attribute name="title">
+        <string>Downloaded</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_6">
+        <item row="0" column="0">
+         <layout class="QVBoxLayout" name="verticalLayout">
+          <item>
+           <widget class="QTableWidget" name="downloadedTableWidget">
+            <property name="selectionMode">
+             <enum>QAbstractItemView::SingleSelection</enum>
+            </property>
+            <property name="selectionBehavior">
+             <enum>QAbstractItemView::SelectRows</enum>
+            </property>
+            <attribute name="verticalHeaderVisible">
+             <bool>false</bool>
+            </attribute>
+            <column>
+             <property name="text">
+              <string>Title</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Date</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Meta type</string>
+             </property>
+            </column>
+           </widget>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout">
+            <item>
+             <widget class="QPushButton" name="delDownedPushButton">
+              <property name="text">
+               <string>Delete</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QPushButton" name="updateDownedPushButton">
+              <property name="text">
+               <string>Update</string>
+              </property>
+             </widget>
+            </item>
+            <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>
+           </layout>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="tab_2">
+       <attribute name="title">
+        <string>Downloading</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_8">
+        <item row="0" column="0">
+         <layout class="QVBoxLayout" name="verticalLayout_7">
+          <item>
+           <widget class="QTreeWidget" name="treeWidget">
+            <attribute name="headerVisible">
+             <bool>false</bool>
+            </attribute>
+            <column>
+             <property name="text">
+              <string>name</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Progress</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Size</string>
+             </property>
+            </column>
+            <column>
+             <property name="text">
+              <string>Status</string>
+             </property>
+            </column>
+            <item>
+             <property name="text">
+              <string>Torrents</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>NZB</string>
+             </property>
+            </item>
+           </widget>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_7">
+            <item>
+             <spacer name="horizontalSpacer_5">
+              <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>Pauze</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+      <widget class="QWidget" name="statsTab">
+       <attribute name="title">
+        <string>Statistics</string>
+       </attribute>
+       <layout class="QGridLayout" name="gridLayout_4">
+        <item row="0" column="0">
+         <layout class="QVBoxLayout" name="verticalLayout_4">
+          <item>
+           <widget class="QTextEdit" name="statsTextEdit">
+            <property name="font">
+             <font>
+              <family>Monospace</family>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>THE _GAME</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="frameShadow">
+             <enum>QFrame::Plain</enum>
+            </property>
+            <property name="verticalScrollBarPolicy">
+             <enum>Qt::ScrollBarAlwaysOff</enum>
+            </property>
+            <property name="horizontalScrollBarPolicy">
+             <enum>Qt::ScrollBarAlwaysOff</enum>
+            </property>
+            <property name="undoRedoEnabled">
+             <bool>false</bool>
+            </property>
+            <property name="readOnly">
+             <bool>true</bool>
+            </property>
+            <property name="acceptRichText">
+             <bool>false</bool>
+            </property>
+            <property name="textInteractionFlags">
+             <set>Qt::NoTextInteraction</set>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" name="horizontalLayout_4">
+            <item>
+             <widget class="QPushButton" name="statsUpdatePushButton">
+              <property name="text">
+               <string>Update</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer_4">
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menuBar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>700</width>
+     <height>25</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuTest123">
+    <property name="title">
+     <string>Help</string>
+    </property>
+    <addaction name="actionAbout"/>
+   </widget>
+   <widget class="QMenu" name="menuFile">
+    <property name="title">
+     <string>File</string>
+    </property>
+    <addaction name="separator"/>
+    <addaction name="actionClose"/>
+   </widget>
+   <widget class="QMenu" name="menuEdit">
+    <property name="title">
+     <string>Edit</string>
+    </property>
+    <addaction name="actionSettings"/>
+   </widget>
+   <addaction name="menuFile"/>
+   <addaction name="menuEdit"/>
+   <addaction name="menuTest123"/>
+  </widget>
+  <widget class="QStatusBar" name="statusBar"/>
+  <action name="actionAbout">
+   <property name="text">
+    <string>About</string>
+   </property>
+   <property name="shortcut">
+    <string>Alt+A</string>
+   </property>
+  </action>
+  <action name="actionClose">
+   <property name="text">
+    <string>Close</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Q, Ctrl+W</string>
+   </property>
+  </action>
+  <action name="actionSettings">
+   <property name="text">
+    <string>Settings</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+E</string>
+   </property>
+  </action>
+  <action name="actionEmail_Settings">
+   <property name="text">
+    <string>Email Settings</string>
+   </property>
+  </action>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources>
+  <include location="swarmtvqtresources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>actionClose</sender>
+   <signal>triggered()</signal>
+   <receiver>MainWindow</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>349</x>
+     <y>192</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/branches/qtswarmtv-downloader/newtorrentfullinfodialog.cpp b/branches/qtswarmtv-downloader/newtorrentfullinfodialog.cpp
new file mode 100644
index 0000000..dd740da
--- /dev/null
+++ b/branches/qtswarmtv-downloader/newtorrentfullinfodialog.cpp
@@ -0,0 +1,67 @@
+#include <sqlite3.h>
+#include <stdlib.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include <iostream>
+
+#include "swarmtv.hpp"
+#include "singleton.h"
+#include "readablesize.hpp"
+#include "newtorrentfullinfodialog.hpp"
+#include "ui_newtorrentfullinfodialog.h"
+
+newTorrentFullInfoDialog::newTorrentFullInfoDialog(int newtorid, QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::newTorrentFullInfoDialog)
+{
+    ui->setupUi(this);
+    this->newtorid = newtorid;
+
+    // Set delete on close()
+    setAttribute(Qt::WA_DeleteOnClose);
+
+    // Fill the Dialog
+    fillDialog();
+}
+
+newTorrentFullInfoDialog::~newTorrentFullInfoDialog()
+{
+    delete ui;
+}
+
+void newTorrentFullInfoDialog::fillDialog()
+{
+  int rc=0;
+  newtorrents_struct newtor;
+  readableSize readable;
+  std::string human;
+
+  // Get Swarmtv handle
+  swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  // Get object from SwarmTv
+  rc = rsstnewtorrentsbyid(swarm->getHandle(), this->newtorid, &newtor);
+  if(rc == 0) {
+    // Put value into the dialog fields.
+    ui->titleLineEdit->setText(newtor.title);
+    ui->LinkLineEdit->setText(newtor.link);
+    ui->pubDateLineEdit->setText(ctime(&(newtor.pubdate)));
+    ui->categoryLineEdit->setText(newtor.category);
+    ui->seasonSpinBox->setValue(newtor.season);
+    ui->episodeSpinBox->setValue(newtor.episode);
+    ui->seedsSpinBox->setValue(newtor.seeds);
+    ui->peersSpinBox->setValue(newtor.peers);
+    readable.setSize(newtor.size);
+    readable.getSize(human);
+    ui->sizeLineEdit->setText(human.c_str());
+    ui->sourceLineEdit->setText(newtor.source);
+    ui->metatypeLineEdit->setText(newtor.metatype);
+  }
+
+  // Free object
+  rsstfreenewtor(&newtor);
+
+}
diff --git a/branches/qtswarmtv-downloader/newtorrentfullinfodialog.hpp b/branches/qtswarmtv-downloader/newtorrentfullinfodialog.hpp
new file mode 100644
index 0000000..7f0f6e8
--- /dev/null
+++ b/branches/qtswarmtv-downloader/newtorrentfullinfodialog.hpp
@@ -0,0 +1,26 @@
+#ifndef NEWTORRENTFULLINFODIALOG_HPP
+#define NEWTORRENTFULLINFODIALOG_HPP
+
+#include <QDialog>
+
+namespace Ui {
+    class newTorrentFullInfoDialog;
+}
+
+class newTorrentFullInfoDialog : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit newTorrentFullInfoDialog(int newtorid, QWidget *parent = 0);
+    ~newTorrentFullInfoDialog();
+
+
+private:
+    void fillDialog();
+
+    Ui::newTorrentFullInfoDialog *ui;
+    int newtorid;
+};
+
+#endif // NEWTORRENTFULLINFODIALOG_HPP
diff --git a/branches/qtswarmtv-downloader/newtorrentfullinfodialog.ui b/branches/qtswarmtv-downloader/newtorrentfullinfodialog.ui
new file mode 100644
index 0000000..6924e72
--- /dev/null
+++ b/branches/qtswarmtv-downloader/newtorrentfullinfodialog.ui
@@ -0,0 +1,310 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>newTorrentFullInfoDialog</class>
+ <widget class="QDialog" name="newTorrentFullInfoDialog">
+  <property name="windowModality">
+   <enum>Qt::ApplicationModal</enum>
+  </property>
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>582</width>
+    <height>364</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Meta file info </string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="swarmtvqtresources.qrc">
+    <normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</iconset>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <layout class="QVBoxLayout" name="verticalLayout_8">
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout_7">
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_7">
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_4">
+           <item>
+            <widget class="QLabel" name="label">
+             <property name="text">
+              <string>Title</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_2">
+             <property name="text">
+              <string>Link</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_3">
+             <property name="text">
+              <string>Date of Publication</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_4">
+             <property name="text">
+              <string>Category</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_3">
+           <item>
+            <widget class="QLineEdit" name="titleLineEdit">
+             <property name="mouseTracking">
+              <bool>true</bool>
+             </property>
+             <property name="readOnly">
+              <bool>true</bool>
+             </property>
+             <property name="placeholderText">
+              <string/>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="LinkLineEdit">
+             <property name="readOnly">
+              <bool>true</bool>
+             </property>
+             <property name="placeholderText">
+              <string/>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="pubDateLineEdit">
+             <property name="readOnly">
+              <bool>true</bool>
+             </property>
+             <property name="placeholderText">
+              <string/>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="categoryLineEdit">
+             <property name="readOnly">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_6">
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout">
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_2">
+             <item>
+              <widget class="QLabel" name="label_5">
+               <property name="text">
+                <string>Season</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QSpinBox" name="seasonSpinBox">
+               <property name="readOnly">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_3">
+             <item>
+              <widget class="QLabel" name="label_7">
+               <property name="text">
+                <string>Seeds</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QSpinBox" name="seedsSpinBox">
+               <property name="readOnly">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_2">
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_4">
+             <item>
+              <widget class="QLabel" name="label_6">
+               <property name="text">
+                <string>Episode</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QSpinBox" name="episodeSpinBox">
+               <property name="readOnly">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_5">
+             <item>
+              <widget class="QLabel" name="label_8">
+               <property name="text">
+                <string>Peers</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QSpinBox" name="peersSpinBox">
+               <property name="readOnly">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_8">
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_5">
+           <item>
+            <widget class="QLabel" name="label_9">
+             <property name="text">
+              <string>size</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_10">
+             <property name="text">
+              <string>RSS source</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_11">
+             <property name="text">
+              <string>Meta type</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_6">
+           <item>
+            <widget class="QLineEdit" name="sizeLineEdit">
+             <property name="readOnly">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="sourceLineEdit">
+             <property name="readOnly">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="metatypeLineEdit">
+             <property name="readOnly">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <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="closePushButton">
+         <property name="text">
+          <string>Close</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="swarmtvqtresources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>closePushButton</sender>
+   <signal>clicked()</signal>
+   <receiver>newTorrentFullInfoDialog</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>291</x>
+     <y>339</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>290</x>
+     <y>181</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/branches/qtswarmtv-downloader/qtswarmtv.pro b/branches/qtswarmtv-downloader/qtswarmtv.pro
new file mode 100644
index 0000000..8f8fdfc
--- /dev/null
+++ b/branches/qtswarmtv-downloader/qtswarmtv.pro
@@ -0,0 +1,88 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-12-10T20:12:20
+#
+#-------------------------------------------------
+
+QT       += core gui dbus network xml
+
+TARGET = qtswarmtv
+TEMPLATE = app
+
+CONFIG += qt debug
+
+SOURCES += main.cpp\
+        mainwindow.cpp \
+    swarmtv.cpp \
+    swarmtvstats.cpp \
+    simpletablecontrol.cpp \
+    simplecell.cpp \
+    simpleeditdialog.cpp \
+    sourcetablecontrol.cpp \
+    sourceeditdialog.cpp \
+    readablesize.cpp \
+    settingsdialog.cpp \
+    helpdialog.cpp \
+    searchcontrol.cpp \
+    testfilterdialog.cpp \
+    newtorrentfullinfodialog.cpp \
+    downloadedtablecontrol.cpp \
+    swarmtvtrayicon.cpp \
+    serieslistcontrol.cpp \
+    serieswidget.cpp \
+    thetvdb.cpp \
+    taskqueue.cpp \
+    getbannertask.cpp \
+    getseriestask.cpp \
+    singleapplication.cpp \
+    seasonepisodewidget.cpp \
+    episodeinfowidget.cpp \
+    getseriesinfotask.cpp
+
+HEADERS  += mainwindow.h \
+    singleton.h \
+    swarmtv.hpp \
+    swarmtvstats.hpp \
+    simpletablecontrol.hpp \
+    simplecell.hpp \
+    simpleeditdialog.hpp \
+    sourcetablecontrol.hpp \
+    sourceeditdialog.hpp \
+    readablesize.hpp \
+    settingsdialog.hpp \
+    helpdialog.hpp \
+    searchcontrol.hpp \
+    testfilterdialog.hpp \
+    newtorrentfullinfodialog.hpp \
+    downloadedtablecontrol.hpp \
+    swarmtvtrayicon.h \
+    serieslistcontrol.hpp \
+    serieswidget.hpp \
+    thetvdb.hpp \
+    taskqueue.hpp \
+    taskinterface.hpp \
+    getbannertask.hpp \
+    getseriestask.hpp \
+    singleapplication.h \
+    seasonepisodewidget.hpp \
+    episodeinfowidget.hpp \
+    getseriesinfotask.hpp \
+    settingsnames.hpp
+
+FORMS    += mainwindow.ui \
+    simpleeditdialog.ui \
+    sourceeditdialog.ui \
+    settingsdialog.ui \
+    helpdialog.ui \
+    testfilterdialog.ui \
+    newtorrentfullinfodialog.ui \
+    seasonepisodewidget.ui
+
+LIBS 	 += -lswarmtv -ltvdb
+
+# install
+target.path = /usr/local/bin/
+INSTALLS += target
+
+RESOURCES += \
+    swarmtvqtresources.qrc
diff --git a/branches/qtswarmtv-downloader/readablesize.cpp b/branches/qtswarmtv-downloader/readablesize.cpp
new file mode 100644
index 0000000..4808da2
--- /dev/null
+++ b/branches/qtswarmtv-downloader/readablesize.cpp
@@ -0,0 +1,125 @@
+#include <string>
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+
+#include <math.h>
+#include <stdlib.h>
+
+#include "readablesize.hpp"
+
+readableSize::readableSize()
+{
+  this->mysize=0;
+}
+
+readableSize::readableSize(std::string &size)
+{
+  humantosize(size,this->mysize);
+}
+
+
+readableSize::readableSize(size_t size)
+{
+  this->mysize=size;
+}
+
+
+void readableSize::setSize(std::string &size)
+{
+  humantosize(size, mysize);
+}
+
+
+void readableSize::setSize(size_t size)
+{
+  mysize=size;
+}
+
+void readableSize::getSize(std::string &size)
+{
+  sizetohuman(mysize, size);
+}
+
+
+void readableSize::getSize(size_t &size)
+{
+  size=this->mysize;
+}
+
+
+/*
+ * buf must be a pre-allocated buffer with size BUFSIZE+1
+ * @Arguments
+ * size in bytes
+ * @Return
+ * returns the char * to the converted string.
+ */
+void readableSize::sizetohuman(size_t size, std::string &out)
+{
+  int i = 0;
+  double tempsize;
+  std::stringstream sizebuf;
+
+  // Sizes to choose from
+  static const char* units[]    = {"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"};
+
+  tempsize = size;
+
+  while (tempsize / 1024 > 1) {
+    tempsize /= 1024;
+    i++;
+  }
+
+  sizebuf << std::setprecision(1) << std::fixed << tempsize << units[i];
+  sizebuf >> out;
+  return;
+}
+
+
+/*
+ * buf must be a pre-allocated buffer with size BUFSIZE+1
+ * returns 0 and -1 on error
+ * size in bytes is returned in argument size
+ */
+int readableSize::humantosize(std::string &buf, size_t &size)
+{
+  char    *upcasenum;
+  char    *unit=NULL;
+  int     i=0;
+  long double  tempsize=0.0;
+  int     power=0;
+
+  // Conversion table
+  static const char* unitmatch  = "BKMGTPEZY";
+
+  // Initialize stuff
+  upcasenum = strdup(buf.c_str());
+
+  // transform the human readable string to a power of 1024
+  for( i = 0; upcasenum[ i ]; i++)
+  {
+    upcasenum[ i ] = toupper( upcasenum[ i ] );
+  }
+  // returns a pointer to the first occurrence in string s1 of any character from string s2, or a null pointer if no character from s2 exists in s1
+  unit = strpbrk(upcasenum, unitmatch);
+  tempsize = atof(upcasenum);
+
+  // when no unit is found use a power of 1024^0
+  // Otherwise calculate number of bytes
+  if(unit != NULL){
+    // Calculate the number of bytes out.
+    while(*(unitmatch + power) != '\0'){
+      if(*unit == *(unitmatch + power)) {
+        break;
+      }
+      power++;
+    }
+  }
+
+  // Calculate response
+  size = (double) tempsize * pow(1024, power);
+
+  free(upcasenum);
+  return 0;
+}
diff --git a/branches/qtswarmtv-downloader/readablesize.hpp b/branches/qtswarmtv-downloader/readablesize.hpp
new file mode 100644
index 0000000..d70e5cc
--- /dev/null
+++ b/branches/qtswarmtv-downloader/readablesize.hpp
@@ -0,0 +1,27 @@
+#ifndef READABLESIZE_HPP
+#define READABLESIZE_HPP
+
+#include <cstring>
+
+class readableSize
+{
+public:
+  readableSize();
+  readableSize(std::string &size);
+  readableSize(size_t size);
+
+  void setSize(std::string &size);
+  void setSize(size_t size);
+
+  void getSize(std::string &size);
+  void getSize(size_t &size);
+private:
+  // Conversion functions
+  void sizetohuman(size_t size, std::string &out);
+  int humantosize(std::string &buf, size_t &size);
+
+  // Store the size in bytes
+  size_t mysize;
+};
+
+#endif // READABLESIZE_HPP
diff --git a/branches/qtswarmtv-downloader/resources/gplv3.png b/branches/qtswarmtv-downloader/resources/gplv3.png
new file mode 100644
index 0000000..3e9136e
Binary files /dev/null and b/branches/qtswarmtv-downloader/resources/gplv3.png differ
diff --git a/branches/qtswarmtv-downloader/resources/processing.gif b/branches/qtswarmtv-downloader/resources/processing.gif
new file mode 100644
index 0000000..6e74a88
Binary files /dev/null and b/branches/qtswarmtv-downloader/resources/processing.gif differ
diff --git a/branches/qtswarmtv-downloader/resources/swarmtv_logo.png b/branches/qtswarmtv-downloader/resources/swarmtv_logo.png
new file mode 100644
index 0000000..40ceab3
Binary files /dev/null and b/branches/qtswarmtv-downloader/resources/swarmtv_logo.png differ
diff --git a/branches/qtswarmtv-downloader/searchcontrol.cpp b/branches/qtswarmtv-downloader/searchcontrol.cpp
new file mode 100644
index 0000000..b0249d0
--- /dev/null
+++ b/branches/qtswarmtv-downloader/searchcontrol.cpp
@@ -0,0 +1,210 @@
+#include <QMessageBox>
+#include <QTableWidget>
+#include <iostream>
+
+#include <stdio.h>
+#include <sqlite3.h>
+#include <stdlib.h>
+
+#define PAGE_LIMIT 500
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include "searchcontrol.hpp"
+#include "simplecell.hpp"
+#include "singleton.h"
+#include "swarmtv.hpp"
+#include "readablesize.hpp"
+#include "newtorrentfullinfodialog.hpp"
+
+searchControl::searchControl(QWidget *parent) :
+    QWidget(parent)
+{
+  this->ui = ui;
+
+
+  // Connect signals
+}
+
+void searchControl::setUi(Ui::MainWindow *ui)
+{
+  this->ui = ui;
+
+  // Add context menu
+  ui->searchTableWidget->setContextMenuPolicy(Qt::CustomContextMenu);
+  connect(ui->searchTableWidget, SIGNAL(customContextMenuRequested(const QPoint&)),
+      this, SLOT(showContextMenu(const QPoint&)));
+}
+
+void searchControl::fillTable(newtorrents_container *newtorrents)
+{
+  int count=0;
+  simpleCell *scell=NULL;
+  QLabel *cell=NULL;
+  QTableWidget *searchTable=0;
+  readableSize readable;
+  std::string humansize;
+
+  // Get table handle
+  searchTable = ui->searchTableWidget;
+
+  // Set number of lines in table
+  searchTable->setRowCount(newtorrents->nr);
+
+  // Set data to table
+  while(count < newtorrents->nr){
+    scell = new(simpleCell);
+    scell->setText(newtorrents->newtorrent[count].title);
+    scell->setSimpleId(newtorrents->newtorrent[count].id);
+    ui->searchTableWidget->setCellWidget(count, 0, scell);
+    cell = new(QLabel);
+    readable.setSize(newtorrents->newtorrent[count].size);
+    readable.getSize(humansize);
+    cell->setText(humansize.c_str());
+    ui->searchTableWidget->setCellWidget(count, 1, cell);
+    cell = new(QLabel);
+    cell->setText(newtorrents->newtorrent[count].source);
+    ui->searchTableWidget->setCellWidget(count, 2, cell);
+    cell = new(QLabel);
+    cell->setText(newtorrents->newtorrent[count].metatype);
+    ui->searchTableWidget->setCellWidget(count, 3, cell);
+    cell = new(QLabel);
+
+    count++;
+  }
+}
+
+void	searchControl::searchClicked()
+{
+  int rc=0;
+  //simplefilter_struct filter;
+  newtorrents_container *newtorrents=NULL;
+  char *searchValue=NULL;
+
+  // Get SwarmTv handle
+  swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  // Get value from
+  searchValue =strdup(ui->SearchLineEdit->text().toUtf8().data());
+
+  // Execute query
+  rc = rsstfindnewtorrentsbytitle(swarm->getHandle(), searchValue, &newtorrents, PAGE_LIMIT, 0);
+  if(rc != 0) {
+    return;
+  }
+
+  // @DEBUG
+  std::cout << "Search started: '" << newtorrents->nr << "' query: '" << searchValue << "'" <<  std::endl;
+
+  // Fill Table with search results
+  fillTable(newtorrents);
+
+  // Free stuff
+  rsstfreenewtorrentscontainer(newtorrents);
+  free(searchValue);
+}
+
+void searchControl::tableDownload(int row, int )
+{
+  simpleCell *scell=NULL;
+  int	id=0;
+
+  // Get SwarmTv handle
+  swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  // Get the id
+  scell = (simpleCell*) ui->searchTableWidget->cellWidget(row, 0);
+
+  // Initiate download
+  id=scell->getSimpleId();
+
+  int ret = QMessageBox::warning(this, tr("SwarmTv"),
+                                 tr("Okay to download?"),
+                                 QMessageBox::Ok | QMessageBox::Cancel);
+  if(ret == QMessageBox::Ok) {
+    std::cout << "Id to download: " << id << std::endl;
+    rsstdownloadbyid(swarm->getHandle(), id);
+  }
+}
+
+void searchControl::initHeaders()
+{
+  // Make sure ui is set
+  if(ui == NULL){
+    std::cerr << "Set ui before calling initHeaders " << __FILE__ << ":" << __LINE__ << std::endl;
+  }
+
+  // Set title as filling
+  ui->searchTableWidget->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
+
+  // Set Size static
+  ui->searchTableWidget->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents);
+
+  // Set source static
+  ui->searchTableWidget->horizontalHeader()->setResizeMode(2, QHeaderView::ResizeToContents);
+
+  // Set metatype static
+  ui->searchTableWidget->horizontalHeader()->setResizeMode(3, QHeaderView::ResizeToContents);
+}
+
+int searchControl::rowToId(int row)
+{
+  simpleCell *scell=NULL;
+  int	id=0;
+
+  // Get the id
+  scell = (simpleCell*) ui->searchTableWidget->cellWidget(row, 0);
+
+  // Initiate download
+  id=scell->getSimpleId();
+
+  return id;
+}
+
+void searchControl::showContextMenu(const QPoint& pos) // this is a slot
+{
+  int row=0;
+  newTorrentFullInfoDialog *ntfid = NULL;
+
+  // When nothing is selected do not show menu
+  if(ui->searchTableWidget->rowCount() == 0) {
+    return;
+  }
+
+  // for most widgets
+  QPoint globalPos = ui->searchTableWidget->mapToGlobal(pos);
+  // for QAbstractScrollArea and derived classes you would use:
+  // QPoint globalPos = myWidget->viewport()->mapToGlobal(pos);
+
+
+  QMenu myMenu;
+  myMenu.addAction(tr("Full Info"));
+  myMenu.addAction(tr("Download"));
+  // ...
+
+  QAction* selectedItem = myMenu.exec(globalPos);
+  if (selectedItem)
+  {
+    // Get the selected row from the table
+    row = ui->searchTableWidget->selectedRanges().first().topRow();
+
+    // Identify the different items clicked
+    if(selectedItem->text().compare("Full Info") == 0){
+      std::cout << "Full Info Clicked." << std::endl;
+      ntfid = new newTorrentFullInfoDialog(this->rowToId(row));
+      ntfid->show();
+    }
+    else if(selectedItem->text().compare("Download") == 0){
+      std::cout << "Download clicked." << std::endl;
+      this->tableDownload(row, 0);
+    }
+
+    // something was chosen, do stuff
+  }
+  else
+  {
+    // nothing was chosen
+    }
+}
diff --git a/branches/qtswarmtv-downloader/searchcontrol.hpp b/branches/qtswarmtv-downloader/searchcontrol.hpp
new file mode 100644
index 0000000..e019b5d
--- /dev/null
+++ b/branches/qtswarmtv-downloader/searchcontrol.hpp
@@ -0,0 +1,34 @@
+#ifndef SEARCHCONTROL_HPP
+#define SEARCHCONTROL_HPP
+
+#include <QTableWidget>
+#include <QWidget>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include "ui_mainwindow.h"
+
+class searchControl : public QWidget
+{
+  Q_OBJECT
+public:
+  searchControl(QWidget *parent = 0);
+  void setUi(Ui::MainWindow *ui);
+  void initHeaders();
+
+signals:
+
+public slots:
+  void searchClicked();
+  void tableDownload(int row, int column);
+  void showContextMenu(const QPoint&);
+
+private:
+  Ui::MainWindow *ui;
+  void fillTable(newtorrents_container *newtorrents);
+  int rowToId(int row);
+};
+
+#endif // SEARCHCONTROL_HPP
diff --git a/branches/qtswarmtv-downloader/seasonepisodewidget.cpp b/branches/qtswarmtv-downloader/seasonepisodewidget.cpp
new file mode 100644
index 0000000..7d1d075
--- /dev/null
+++ b/branches/qtswarmtv-downloader/seasonepisodewidget.cpp
@@ -0,0 +1,273 @@
+#include "seasonepisodewidget.hpp"
+#include "ui_seasonepisodewidget.h"
+
+extern "C" {
+  #include "tvdb.h"
+}
+
+#include <QSettings>
+#include <QDebug>
+#include <QTreeWidget>
+#include <QTextCodec>
+
+#include "episodeinfowidget.hpp"
+#include "getbannertask.hpp"
+#include "getseriesinfotask.hpp"
+
+static const QString TVDB_API_CONFIG("config/tvdbapiconfig");
+
+seasonEpisodeWidget::seasonEpisodeWidget(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::seasonEpisodeWidget)
+{
+  QString api_key;
+  QSettings settings;
+
+  ui->setupUi(this);
+
+  // Create the tvdb instance for this window
+  api_key = settings.value(TVDB_API_CONFIG).toString();
+  tvdb = tvdb_init((char *) api_key.toUtf8().data());
+}
+
+seasonEpisodeWidget::~seasonEpisodeWidget()
+{
+  tc.stopTasks();
+
+  tvdb_uninit(tvdb);
+  delete ui;
+}
+
+void seasonEpisodeWidget::setSeriesTitle(QString &name)
+{
+  seriesName=name;
+
+  // Set series name in window
+  ui->nameLabel->setText(seriesName);
+
+  // Connect the expand signal
+  QObject::connect(ui->treeWidget, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(itemExpanded(QTreeWidgetItem*)));
+  QObject::connect(ui->treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*,int)));
+}
+
+void seasonEpisodeWidget::setSeriesId(int id)
+{
+  seriesId=id;
+}
+
+void seasonEpisodeWidget::retrieveEpisodeData()
+{
+  //int rc=0;
+  //tvdb_buffer_t buf;
+  //tvdb_list_front_t seriesInfo;
+
+  // Disable the tree view to show we are searching
+  ui->treeWidget->setDisabled(true);
+
+  // Create task object
+  getSeriesInfoTask *search = new getSeriesInfoTask(tvdb, seriesId, this);
+
+  // connect signal
+  QObject::connect(search, SIGNAL(results(tvdb_buffer_t*)), this, SLOT(seriesResults(tvdb_buffer_t*)));
+  QObject::connect(search, SIGNAL(failed()), this, SLOT(seriesFailed()));
+
+  // Add task queue
+  tc.addTask(search);
+
+  // start taskqueue
+  tc.start();
+
+#if 0
+  // Initialize structs
+  memset(&buf, 0, sizeof(tvdb_buffer_t));
+
+
+  // Execute query
+  rc = tvdb_series_info(tvdb, seriesId, "en", &buf);
+  if(rc != TVDB_OK){
+    qDebug() << "tvdb_series_info returned not okay.";
+    return;
+  }
+
+  // Parse the XML data
+  rc = tvdb_parse_series_info(&buf, "", &seriesInfo);
+  if(rc != TVDB_OK){
+    qDebug() << "tvdb_parse_series_info returned not okay.";
+  }
+
+  // Add the data to the ListView
+  fillListView(&seriesInfo);
+
+  // Detroy the tvdb instance
+  tvdb_list_remove(&seriesInfo);
+#endif
+}
+
+void seasonEpisodeWidget::seriesResults(tvdb_buffer_t *series_xml)
+{
+  int rc=0;
+  tvdb_list_front_t seriesInfo;
+
+  // Initialize structs
+  memset(&seriesInfo, 0, sizeof(tvdb_list_front_t));
+
+  // Parse the XML data
+  rc = tvdb_parse_series_info(series_xml, "", &seriesInfo);
+  if(rc != TVDB_OK){
+    qDebug() << "tvdb_parse_series_info returned not okay.";
+  }
+
+  // Add the data to the ListView
+  fillListView(&seriesInfo);
+
+  // Detroy the tvdb instance
+  tvdb_list_remove(&seriesInfo);
+
+  // All is done, enable again
+  ui->treeWidget->setEnabled(true);
+}
+
+void seasonEpisodeWidget::seriesFailed()
+{
+  qDebug() << "Downloading of series info failed.";
+}
+
+void seasonEpisodeWidget::addTask(episodeInfoWidget *widget)
+{
+  getBannerTask *task = NULL;
+
+  // Get the filename
+  QString &filename = widget->getBannerName();
+
+  // Create the task
+  task = new getBannerTask(filename.toUtf8().data(), tvdb);
+
+  // Connect the widget to the task
+  QObject::connect(task, SIGNAL(bannerReady(tvdb_buffer_t*)), widget, SLOT(bannerReady(tvdb_buffer_t*)));
+  QObject::connect(task, SIGNAL(bannerFailed()), widget, SLOT(bannerFailed()));
+
+  // Add the task to the taskqueue
+  tc.addTask(task);
+
+  // Start the task
+  tc.start();
+}
+
+void seasonEpisodeWidget::itemExpanded(QTreeWidgetItem *item)
+{
+  episodeInfoWidget *episode =NULL;
+  QWidget *widget=NULL;
+  QTreeWidgetItem *child=NULL;
+
+  if(item->childCount() == 1) {
+    child = item->child(0);
+
+    widget = ui->treeWidget->itemWidget(child, 0);
+
+    // Check if the widget is an episodeInfoWidget.
+    episode = dynamic_cast<episodeInfoWidget*>(widget);
+
+    // When the picture is not downloaded, download it now.
+    if(episode != NULL && episode->imageSet() == false){
+      addTask(episode);
+    }
+  }
+}
+
+void seasonEpisodeWidget::itemDoubleClicked(QTreeWidgetItem *item, int column)
+{
+  episodeInfoWidget *episode =NULL;
+  QWidget *widget=NULL;
+
+  // make sure the click is valid.
+  if(column != 0) {
+    return;
+  }
+
+  // Get the item pointer.
+  widget = ui->treeWidget->itemWidget(item, 0);
+  episode = dynamic_cast<episodeInfoWidget*>(widget);
+
+  // When a widget handle episode, when season handle season.
+  if(episode != NULL){
+    // print episode title and season/episode
+    qDebug() << "Double clicked on series: " << episode->getSeriesName() << " S" << episode->getSeason() << "E" << episode->getEpisode();
+  } else {
+    // print series number and name
+    qDebug() << "Double clicked season";
+  }
+}
+
+QTreeWidgetItem *seasonEpisodeWidget::addSeasonEntry(int seasonNum)
+{
+  QString seasonName;
+  QTreeWidgetItem *seasonItem=NULL;
+
+  // Build season name
+  seasonName.sprintf("Season %d", seasonNum);
+
+  // Create new season entry
+  seasonItem = new QTreeWidgetItem();
+  seasonName.sprintf("Season %d", seasonNum);
+  seasonItem->setText(0, seasonName);
+  ui->treeWidget->addTopLevelItem(seasonItem);
+
+  return seasonItem;
+}
+
+void seasonEpisodeWidget::addEpisodeEntry(QTreeWidgetItem *seasonItem, tvdb_series_info_t *s)
+{
+  QString episodeStory;
+  QString episodeName;
+  QString bannerFilename;
+  QTreeWidgetItem *episodeItem = NULL;
+  QTreeWidgetItem *overviewItem = NULL;
+  episodeInfoWidget *overviewWidget = NULL;
+
+  // Add episode entry
+  episodeItem = new QTreeWidgetItem(*seasonItem);
+  episodeName.sprintf("%d - %s - %s", s->episode_number, s->episode_name, s->first_aired);
+  episodeItem->setText(0, episodeName);
+  seasonItem->addChild(episodeItem);
+  overviewItem = new QTreeWidgetItem(episodeItem);
+  episodeItem->addChild(overviewItem);
+  episodeStory = s->overview;
+  bannerFilename = s->filename;
+  overviewWidget = new episodeInfoWidget(s, overviewItem, seriesName, ui->treeWidget);
+  ui->treeWidget->setItemWidget(overviewItem, 0, overviewWidget);
+}
+
+void seasonEpisodeWidget::fillListView(tvdb_list_front_t *seriesInfo)
+{
+  tvdb_list_reset(seriesInfo);
+  const tvdb_list_node_t *n=NULL;
+  tvdb_series_info_t *s=NULL;
+  int widgetSeason=0;
+  int curSeason=0;
+  int curEpisode=0;
+  QString episodeName;
+  QTreeWidgetItem *seasonItem = NULL;
+
+  n = tvdb_list_next(seriesInfo);
+  while(n != NULL) {
+    s = (tvdb_series_info_t *)n->data;
+    curSeason=s->season_number;
+    curEpisode=s->episode_number;
+
+    if(curSeason != 0 && curEpisode != 0){
+      // Add season entry
+      if(curSeason > widgetSeason)
+      {
+        seasonItem = addSeasonEntry(curSeason);
+
+        // Set new season
+        widgetSeason=curSeason;
+      }
+      if(seasonItem != NULL) {
+        addEpisodeEntry(seasonItem, s);
+      }
+    }
+
+    n = tvdb_list_next(seriesInfo);
+  }
+}
diff --git a/branches/qtswarmtv-downloader/seasonepisodewidget.hpp b/branches/qtswarmtv-downloader/seasonepisodewidget.hpp
new file mode 100644
index 0000000..32b8be4
--- /dev/null
+++ b/branches/qtswarmtv-downloader/seasonepisodewidget.hpp
@@ -0,0 +1,51 @@
+#ifndef SEASONEPISODEWIDGET_HPP
+#define SEASONEPISODEWIDGET_HPP
+
+#include <QDialog>
+extern "C" {
+#include <tvdb.h>
+}
+#include <QTreeWidget>
+#include <taskqueue.hpp>
+
+class episodeInfoWidget;
+
+namespace Ui {
+    class seasonEpisodeWidget;
+}
+
+class seasonEpisodeWidget : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit seasonEpisodeWidget(QWidget *parent = 0);
+    ~seasonEpisodeWidget();
+    void setSeriesTitle(QString &name);
+    void setSeriesId(int id);
+    void setrieveEpisodeData();
+    void fillListView(tvdb_list_front_t *);
+    void retrieveEpisodeData();
+
+public slots:
+    // GUI signals
+    void itemExpanded(QTreeWidgetItem *item);
+    void itemDoubleClicked(QTreeWidgetItem *item, int column);
+
+    // Task signals
+    void seriesResults(tvdb_buffer_t *series_xml);
+    void seriesFailed();
+
+private:
+    void addTask(episodeInfoWidget *widget);
+    QTreeWidgetItem *addSeasonEntry(int seasonNum);
+    void addEpisodeEntry(QTreeWidgetItem *season, tvdb_series_info_t *s);
+
+    Ui::seasonEpisodeWidget *ui;
+    QString seriesName;
+    int seriesId;
+    taskQueue tc;
+    htvdb_t tvdb;
+};
+
+#endif // SEASONEPISODEWIDGET_HPP
diff --git a/branches/qtswarmtv-downloader/seasonepisodewidget.ui b/branches/qtswarmtv-downloader/seasonepisodewidget.ui
new file mode 100644
index 0000000..a4f50da
--- /dev/null
+++ b/branches/qtswarmtv-downloader/seasonepisodewidget.ui
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>seasonEpisodeWidget</class>
+ <widget class="QDialog" name="seasonEpisodeWidget">
+  <property name="windowModality">
+   <enum>Qt::NonModal</enum>
+  </property>
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>498</height>
+   </rect>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>800</width>
+    <height>480</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>Episode Guide</string>
+  </property>
+  <property name="sizeGripEnabled">
+   <bool>true</bool>
+  </property>
+  <layout class="QGridLayout" name="gridLayout_2">
+   <item row="0" column="0">
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="nameLabel">
+       <property name="text">
+        <string>Series name</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0">
+      <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="OkPushButton">
+         <property name="text">
+          <string>ok</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item row="1" column="0">
+      <widget class="QTreeWidget" name="treeWidget">
+       <property name="contextMenuPolicy">
+        <enum>Qt::CustomContextMenu</enum>
+       </property>
+       <property name="toolTip">
+        <string>Double click here to download seasons or episodes.</string>
+       </property>
+       <property name="iconSize">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="wordWrap">
+        <bool>true</bool>
+       </property>
+       <attribute name="headerVisible">
+        <bool>false</bool>
+       </attribute>
+       <attribute name="headerCascadingSectionResizes">
+        <bool>false</bool>
+       </attribute>
+       <column>
+        <property name="text">
+         <string notr="true">1</string>
+        </property>
+       </column>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>OkPushButton</sender>
+   <signal>clicked()</signal>
+   <receiver>seasonEpisodeWidget</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>587</x>
+     <y>473</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>320</x>
+     <y>248</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/branches/qtswarmtv-downloader/serieslistcontrol.cpp b/branches/qtswarmtv-downloader/serieslistcontrol.cpp
new file mode 100644
index 0000000..ada6cf9
--- /dev/null
+++ b/branches/qtswarmtv-downloader/serieslistcontrol.cpp
@@ -0,0 +1,242 @@
+#include <iostream>
+#include <stdlib.h>
+#include <QApplication>
+#include <QMenu>
+#include <QDebug>
+#include <QRegExp>
+extern "C" {
+#include <tvdb.h>
+}
+#include "singleton.h"
+#include "serieslistcontrol.hpp"
+#include "serieswidget.hpp"
+#include "singleton.h"
+#include "thetvdb.hpp"
+#include "simpleeditdialog.hpp"
+#include "getseriestask.hpp"
+#include "seasonepisodewidget.hpp"
+
+const QString max_string("700mb");
+const QString min_string("300MB");
+
+seriesListControl::seriesListControl(QWidget *parent) :
+    QWidget(parent)
+{
+  tasks = new taskQueue();
+}
+
+seriesListControl::seriesListControl(QWidget *parent, QLineEdit *searchLine, QTableWidget *table) :
+    QWidget(parent)
+{
+  this->table = table;
+  this->searchLine = searchLine;
+  table->setContextMenuPolicy(Qt::CustomContextMenu);
+  tasks = new taskQueue();
+
+  qDebug() << "Connected through constructor.";
+  QObject::connect(table, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
+                   this, SLOT(itemDoubleClicked(QListWidgetItem*)));
+  QObject::connect(table, SIGNAL(customContextMenuRequested(QPoint)),
+                   this, SLOT(showContextMenu(QPoint)));
+}
+
+seriesListControl::~seriesListControl()
+{
+  delete(tasks);
+}
+
+void seriesListControl::setSeriesSearchLine(QLineEdit *searchLine)
+{
+  this->searchLine = searchLine;
+}
+
+void seriesListControl::setSeriesTableWidget(QTableWidget *table)
+{
+  this->table = table;
+
+  qDebug() << "Connected through setList.";
+  QObject::connect(table, SIGNAL(doubleClicked(QModelIndex)),
+                   this, SLOT(itemDoubleClicked()));
+  QObject::connect(table, SIGNAL(customContextMenuRequested(QPoint)),
+                   this, SLOT(showContextMenu(QPoint)));
+}
+
+void seriesListControl::addWidget(int count, tvdb_series_t *series)
+{
+  QString title(series->name);
+  QString overview(series->overview);
+
+  seriesWidget *myItem = new seriesWidget(series, series->banner, tasks, series->series_id, table);
+  myItem->setMinimumHeight(180);
+  table->setCellWidget(count, 0, myItem);
+  table->setRowHeight(count, myItem->height()+25);
+  myItem->show();
+}
+
+void seriesListControl::handleSeries(tvdb_list_front_t *series)
+{
+  int count=0;
+  tvdb_list_node_t *n=NULL;
+  tvdb_series_t *m=NULL;
+
+  table->setRowCount(series->count);
+
+  tvdb_list_reset(series);
+
+  n=tvdb_list_next(series);
+  while(n != NULL) {
+    m = (tvdb_series_t *)n->data;
+    //this->list->addItem(m->overview);
+    addWidget(count, m);
+    n=tvdb_list_next(series);
+    count++;
+  }
+}
+
+void seriesListControl::findSeries()
+{
+  getSeriesTask *st=NULL;
+
+  // Disable line edit
+  searchLine->setEnabled(false);
+
+  // Wait for running task to finish then empty queue
+  tasks->clearTasks();
+  //list->clear();
+  table->clear();
+
+  // Create and initialize query task
+  st = new getSeriesTask(this->searchLine->text().toUtf8().begin(), this);
+  QObject::connect(st, SIGNAL(results(tvdb_buffer_t*)), this, SLOT(searchResults(tvdb_buffer_t*)));
+
+  // Start task
+  tasks->addTask(st);
+}
+
+void seriesListControl::searchResults(tvdb_buffer_t *series_xml)
+{
+  int rc=0;
+  tvdb_list_front_t series;
+
+  // Parse results
+  tvdb_list_init(&series);
+  rc = tvdb_parse_series(series_xml, 0, &series);
+  if(rc == TVDB_OK) {
+    // Insert text for now
+    handleSeries(&series);
+  }
+
+  // Set searchbar to editable again
+  searchLine->setEnabled(true);
+}
+
+void seriesListControl::itemDoubleClicked()
+{
+  createFilter();
+}
+
+void seriesListControl::nameToRegexp(const QString &name, QString &regexp)
+{
+  regexp = name;
+
+  // Do the replacements to make something resembling a regexp
+  regexp.replace(QRegExp("^"), "^"); 					// Fix Start
+  regexp.replace(QRegExp("[(\[].*$"), ""); 		// Remove any annotations
+  regexp.replace(QRegExp("[\"-',.]"), ".?"); 	// Replaco punctuation with a match
+}
+
+void seriesListControl::openSimpleEditDialog(seriesWidget *series)
+{
+  simpleEditDialog *dialog=NULL;
+  QString title;
+  QString name;
+
+  // Get series title
+  name = series->getTitle()->toUtf8();
+
+  // Generate Regexp
+  nameToRegexp(name, title);
+
+  // Open dialog, and disable the name field.
+  dialog = new simpleEditDialog(table);
+  dialog->setAttribute(Qt::WA_DeleteOnClose);
+  dialog->setTitle(&title);
+  dialog->setName(&name);
+  dialog->setMaxSize((QString*)&max_string);
+  dialog->setMinSize((QString*)&min_string);
+  dialog->enableNameEnable(true);
+  dialog->show();
+}
+
+void seriesListControl::showContextMenu(const QPoint& pos) // this is a slot
+{
+  int row=0;
+
+  //newTorrentFullInfoDialog *ntfid = NULL;
+  qDebug() << "Context menu called.";
+
+  // for most widgets
+  QPoint globalPos = table->mapToGlobal(pos);
+  // for QAbstractScrollArea and derived classes you would use:
+  // QPoint globalPos = myWidget->viewport()->mapToGlobal(pos);
+  if(table->selectedRanges().isEmpty() == true) {
+    return;
+  }
+
+  QMenu myMenu;
+  myMenu.addAction(tr("Create filter"));
+  myMenu.addAction(tr("Episode guide"));
+  // ...
+
+  QAction* selectedItem = myMenu.exec(globalPos);
+  if (selectedItem)
+  {
+    // Get the selected row from the table
+    row = table->selectedRanges().first().topRow();
+
+    // Identify the different items clicked
+    if(selectedItem->text().compare(tr("Create filter")) == 0){
+      qDebug() << "Create Filter Selected";
+      createFilter();
+      //ntfid = new newTorrentFullInfoDialog(this->rowToId(row));
+      //ntfid->show();
+    }
+    else if(selectedItem->text().compare(tr("Episode guide")) == 0){
+      qDebug() << "Get episode info clicked.";
+      showEpisodes();
+    }
+
+    // something was chosen, do stuff
+  }
+  else
+  {
+    // nothing was chosen
+  }
+}
+
+void seriesListControl::createFilter()
+{
+  seriesWidget *series=NULL;
+  int selectedRow=0;
+
+  selectedRow = table->selectedRanges().first().topRow();
+  series = dynamic_cast<seriesWidget*>(table->cellWidget(selectedRow, 0));
+
+  // Create new simple filter window
+  openSimpleEditDialog(series);
+}
+
+void seriesListControl::showEpisodes()
+{
+  seriesWidget *series=NULL;
+  int selectedRow=0;
+
+  selectedRow = table->selectedRanges().first().topRow();
+  series = dynamic_cast<seriesWidget*>(table->cellWidget(selectedRow, 0));
+
+  seasonEpisodeWidget *seasonEpisode = new seasonEpisodeWidget(table);
+  seasonEpisode->setSeriesTitle(*(series->getTitle()));
+  seasonEpisode->setSeriesId(series->getSeriesId());
+  seasonEpisode->retrieveEpisodeData();
+  seasonEpisode->show();
+}
diff --git a/branches/qtswarmtv-downloader/serieslistcontrol.hpp b/branches/qtswarmtv-downloader/serieslistcontrol.hpp
new file mode 100644
index 0000000..d647991
--- /dev/null
+++ b/branches/qtswarmtv-downloader/serieslistcontrol.hpp
@@ -0,0 +1,47 @@
+#ifndef SERIESLISTCONTROL_HPP
+#define SERIESLISTCONTROL_HPP
+
+#include <stdlib.h>
+
+#include <QWidget>
+#include <QTableWidget>
+#include <QLineEdit>
+extern "C" {
+#include <tvdb.h>
+}
+
+#include "taskqueue.hpp"
+
+class seriesWidget;
+
+class seriesListControl : public QWidget
+{
+    Q_OBJECT
+public:
+    explicit seriesListControl(QWidget *parent=0);
+    explicit seriesListControl(QWidget *parent, QLineEdit *searchLine, QTableWidget *table);
+    ~seriesListControl();
+    void setSeriesSearchLine(QLineEdit *searchLine);
+    void setSeriesTableWidget(QTableWidget *table);
+signals:
+
+public slots:
+    void findSeries();
+    void searchResults(tvdb_buffer_t *series_xml);
+    void itemDoubleClicked();
+    void showContextMenu(const QPoint&);
+
+private:
+    void handleSeries(tvdb_list_front_t *series);
+    void addWidget(int count, tvdb_series_t *series);
+    void openSimpleEditDialog(seriesWidget *series);
+    void createFilter();
+    void showEpisodes();
+    void nameToRegexp(const QString &name, QString &regexp);
+
+    QTableWidget *table;
+    QLineEdit *searchLine;
+    taskQueue *tasks;
+};
+
+#endif // SERIESLISTCONTROL_HPP
diff --git a/branches/qtswarmtv-downloader/serieswidget.cpp b/branches/qtswarmtv-downloader/serieswidget.cpp
new file mode 100644
index 0000000..2aedb65
--- /dev/null
+++ b/branches/qtswarmtv-downloader/serieswidget.cpp
@@ -0,0 +1,134 @@
+#include "serieswidget.hpp"
+//#include "singleton.h"
+#include "taskinterface.hpp"
+#include "taskqueue.hpp"
+#include "getbannertask.hpp"
+#include <iostream>
+#include <QTextCodec>
+
+extern "C" {
+#include <tvdb.h>
+}
+
+#include <QVBoxLayout>
+#include <QLabel>
+#include <QImage>
+
+// Add task to the queue in order to retrieve banner image.
+void seriesWidget::addBannerTask(const QString &bannerString)
+{
+  getBannerTask *banTask=NULL;
+
+  if(bannerString.length() != 0){
+    banTask = new getBannerTask();
+    banTask->setFilename(bannerString.toUtf8().data());
+    QObject::connect(banTask, SIGNAL(bannerReady(tvdb_buffer_t*)),this, SLOT(imageReady(tvdb_buffer_t*)));
+    QObject::connect(banTask, SIGNAL(bannerFailed()), this, SLOT(imageFailed()));
+    tasks->addTask(banTask);
+  }
+}
+
+void seriesWidget::createLayout()
+{
+  //taskQueue *tq = &Singleton<taskQueue>::Instance();
+  QVBoxLayout *layout = new QVBoxLayout(this);
+  QHBoxLayout *hLayout = new QHBoxLayout();
+  layout->setMargin(2);
+  hLayout->setMargin(2);
+  bannerImage = new QLabel();
+  imageBuffer = (tvdb_buffer_t*) calloc(1, sizeof(tvdb_buffer_t));
+
+  addBannerTask(QString(bannerName));
+#if 0
+  // Create thread to get Image from TheTvdb
+  if(strlen(bannerName) != 0) {
+    getBannerTask *banTask = new getBannerTask();
+    banTask->setFilename(bannerName);
+    QObject::connect(banTask, SIGNAL(bannerReady(tvdb_buffer_t*)),this, SLOT(imageReady(tvdb_buffer_t*)));
+    QObject::connect(banTask, SIGNAL(bannerFailed()), this, SLOT(imageFailed()));
+    tasks->addTask(banTask);
+  }
+#endif
+
+  // Set layout
+  title->setFont(QFont("Times",20,QFont::Bold));
+  overview->setWordWrap(true);
+
+  // Set title and Rating to the hLayout
+  hLayout->addWidget(title);
+  hLayout->addWidget(firstaired);
+
+  // Add labels to layout
+  layout->addWidget(bannerImage);
+  layout->addLayout(hLayout);
+  layout->addWidget(overview);
+}
+
+#if 0
+seriesWidget::seriesWidget(QWidget *parent) :
+    QWidget(parent)
+{
+  this->bannerName = NULL;
+  this->title = new QLabel("");
+  this->overview = new QLabel("");
+
+  createLayout();
+}
+#endif
+
+seriesWidget::seriesWidget(tvdb_series_t *series, char *bannerName, taskQueue *tasks, int seriesId, QWidget *parent) :
+    QWidget(parent)
+{
+  QTextCodec *codec = QTextCodec::codecForName("utf-8");
+  QString converted;
+
+  this->bannerName = bannerName;
+
+  // Process name
+  converted = codec->toUnicode(series->name);
+  this->title = new QLabel(converted);
+  this->titleString = new QString(converted);
+
+  // Process overview
+  converted = codec->toUnicode(series->overview);
+  this->overview = new QLabel(converted);
+
+  // Handle rest
+  this->firstaired = new QLabel(series->first_aired);
+  this->seriesId = seriesId;
+  this->tasks = tasks;
+
+  createLayout();
+}
+
+seriesWidget::~seriesWidget()
+{
+  delete(titleString);
+  delete(title);
+  delete(overview);
+}
+
+void seriesWidget::imageReady(tvdb_buffer_t *banner)
+{
+  QPixmap *bannerPixmap = new QPixmap(); // Image to show as banner
+
+  // set banner information to the Image
+  bannerPixmap->loadFromData((uchar*) banner->memory, (int) banner->size);
+  bannerImage->setPixmap(*bannerPixmap);
+}
+
+void seriesWidget::imageFailed(void)
+{
+  // Set bogus image in future
+}
+
+QString *seriesWidget::getTitle()
+{
+  return titleString;
+}
+
+int seriesWidget::getSeriesId()
+{
+  return seriesId;
+}
+
diff --git a/branches/qtswarmtv-downloader/serieswidget.hpp b/branches/qtswarmtv-downloader/serieswidget.hpp
new file mode 100644
index 0000000..55da02a
--- /dev/null
+++ b/branches/qtswarmtv-downloader/serieswidget.hpp
@@ -0,0 +1,47 @@
+#ifndef SERIESWIDGET_HPP
+#define SERIESWIDGET_HPP
+
+#include <stdlib.h>
+
+extern "C" {
+#include <tvdb.h>
+}
+
+#include <QWidget>
+#include <QLabel>
+#include <QPixmap>
+#include "taskqueue.hpp"
+
+class seriesWidget : public QWidget
+{
+    Q_OBJECT
+public:
+    //explicit seriesWidget(QWidget *parent = 0);
+    explicit seriesWidget(tvdb_series_t *series, char *banner, taskQueue *tasks, int seriesId, QWidget *parent);
+
+    QString *getTitle();
+    int getSeriesId();
+
+    ~seriesWidget();
+signals:
+
+public slots:
+    void imageReady(tvdb_buffer_t *banner);
+    void imageFailed(void);
+
+private:
+    void createLayout();
+    void addBannerTask(const QString &bannerString);
+
+    QLabel *bannerImage; // Image when available
+    QLabel *title; // Title of the serie
+    QString *titleString; // Title text
+    QLabel *overview; // Overview description
+    QLabel *firstaired; // First aired
+    int seriesId;			// ID of the series displayed
+    char *bannerName; // Buffer holding the banner image
+    tvdb_buffer_t *imageBuffer; // Image buffer
+    taskQueue *tasks; // Task queue object
+};
+
+#endif // SERIESWIDGET_HPP
diff --git a/branches/qtswarmtv-downloader/settingsdialog.cpp b/branches/qtswarmtv-downloader/settingsdialog.cpp
new file mode 100644
index 0000000..f7c6621
--- /dev/null
+++ b/branches/qtswarmtv-downloader/settingsdialog.cpp
@@ -0,0 +1,169 @@
+#include <sqlite3.h>
+#include <stdlib.h>
+#include <string.h>
+#include <QSettings>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include <QMessageBox>
+
+#include "swarmtv.hpp"
+#include "singleton.h"
+#include "settingsdialog.hpp"
+#include "ui_settingsdialog.h"
+#include "settingsnames.hpp"
+
+
+settingsDialog::settingsDialog(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::settingsDialog)
+{
+    ui->setupUi(this);
+}
+
+settingsDialog::~settingsDialog()
+{
+    delete ui;
+}
+
+void settingsDialog::show()
+{
+  int rc=0;
+  config_container *configitems=NULL;
+  QSettings settings;
+
+  // Get data from SwarmTv
+  swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  // Set data in widgets
+  rc = rsstgetallconfig(swarm->getHandle(), &configitems);
+  if(rc != 0){
+    QMessageBox::warning(this, tr("SwarmTv"),
+                         tr("Could not retrieve settings from SwarmTv."),
+                         QMessageBox::Ok);
+    // Exit
+    return;
+  }
+
+  // Set retrieved values into setup
+  ui->refreshLineEdit->setText("900");
+  this->containerToUI(configitems);
+  ui->apiKeyLineEdit->setText(settings.value(TVDB_API_CONFIG).toString());
+
+  // Restore the DBUS message checkboxes
+  ui->dbusStartCheckBox->setChecked(settings.value(TRAY_SHOW_DBUSSTART).toBool());
+  ui->dbusStopCheckBox->setChecked(settings.value(TRAY_SHOW_DBUSSTOP).toBool());
+  ui->dbusRssCheckBox->setChecked(settings.value(TRAY_SHOW_RSS).toBool());
+  ui->dbusSimpleCheckBox->setChecked(settings.value(TRAY_SHOW_SIMPLE).toBool());
+  ui->dbusSqlCheckBox->setChecked(settings.value(TRAY_SHOW_SQL).toBool());
+  ui->dbusDownedCheckBox->setChecked(settings.value(TRAY_SHOW_DOWNED).toBool());
+
+  // Free the settings container
+  rsstfreeconfigcontainer(configitems);
+
+  QWidget::show();
+}
+
+void settingsDialog::containerToUI(config_container *configitems)
+{
+  int count=0;
+
+  // The names of the config settings we are interested in
+  std::string torrentdir ("torrentdir");
+  std::string nzbdir		 ("nzbdir");
+  std::string refresh		 ("refresh");
+  std::string retain		 ("retain");
+  std::string minsize		 ("min_size");
+  std::string smtp_enable("smtp_enable");
+  std::string smtp_to		 ("smtp_to");
+  std::string smtp_from	 ("smtp_from");
+  std::string smtp_host	 ("smtp_host");
+  std::string choice_true ("Y");
+
+  while(count < configitems->nr){
+    if(torrentdir.compare(configitems->config[count].name) == 0){
+      ui->torrentDirLineEdit->setText(configitems->config[count].value);
+    }
+    else if(nzbdir.compare(configitems->config[count].name) == 0){
+      ui->nzbDirectoryLineEdit->setText(configitems->config[count].value);
+    }
+    else if(refresh.compare(configitems->config[count].name) == 0){
+      ui->refreshLineEdit->setText(configitems->config[count].value);
+    }
+    else if(retain.compare(configitems->config[count].name) == 0){
+      ui->retainLineEdit->setText(configitems->config[count].value);
+    }
+    else if(minsize.compare(configitems->config[count].name) == 0){
+      ui->minimalSizeLineEdit->setText(configitems->config[count].value);
+    }
+    else if(smtp_enable.compare(configitems->config[count].name) == 0){
+      if(choice_true.compare(configitems->config[count].value) == 0){
+        ui->emailEnableCheckBox->setChecked(true);
+      } else {
+        ui->emailEnableCheckBox->setChecked(false);
+      }
+    }
+    else if(smtp_to.compare(configitems->config[count].name) == 0){
+      ui->destinationLineEdit->setText(configitems->config[count].value);
+    }
+    else if(smtp_from.compare(configitems->config[count].name) == 0){
+      ui->senderLineEdit->setText(configitems->config[count].value);
+    }
+    else if(smtp_host.compare(configitems->config[count].name) == 0){
+      ui->ServerLineEdit->setText(configitems->config[count].value);
+    }
+
+    count++;
+  }
+}
+
+void settingsDialog::accept()
+{
+  QSettings settings;
+
+  // Get the SwarmTv pointer
+  swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  // Store the set values
+  // The names of the config settings we are interested in
+  std::string torrentdir ("torrentdir");
+  std::string nzbdir		 ("nzbdir");
+  std::string refresh		 ("refresh");
+  std::string retain		 ("retain");
+  std::string minsize		 ("min_size");
+  std::string smtp_enable("smtp_enable");
+  std::string smtp_to		 ("smtp_to");
+  std::string smtp_from	 ("smtp_from");
+  std::string smtp_host	 ("smtp_host");
+  std::string choice_true ("Y");
+  std::string choice_false ("N");
+
+  // Store values
+  rsstsetconfigitem(swarm->getHandle(), torrentdir.c_str(), ui->torrentDirLineEdit->text().toUtf8().data());
+  rsstsetconfigitem(swarm->getHandle(), nzbdir.c_str(), ui->nzbDirectoryLineEdit->text().toUtf8().data());
+  rsstsetconfigitem(swarm->getHandle(), refresh.c_str(), ui->refreshLineEdit->text().toUtf8().data());
+  rsstsetconfigitem(swarm->getHandle(), retain.c_str(), ui->retainLineEdit->text().toUtf8().data());
+  rsstsetconfigitem(swarm->getHandle(), minsize.c_str(), ui->minimalSizeLineEdit->text().toUtf8().data());
+  rsstsetconfigitem(swarm->getHandle(), smtp_to.c_str(), ui->destinationLineEdit->text().toUtf8().data());
+  rsstsetconfigitem(swarm->getHandle(), smtp_from.c_str(), ui->senderLineEdit->text().toUtf8().data());
+  rsstsetconfigitem(swarm->getHandle(), smtp_host.c_str(), ui->ServerLineEdit->text().toUtf8().data());
+
+  // Store values in the config settings
+  settings.setValue(TVDB_API_CONFIG, ui->apiKeyLineEdit->text());
+  settings.setValue(TRAY_SHOW_DBUSSTART, ui->dbusStartCheckBox->isChecked());
+  settings.setValue(TRAY_SHOW_DBUSSTOP, ui->dbusStopCheckBox->isChecked());
+  settings.setValue(TRAY_SHOW_RSS, ui->dbusRssCheckBox->isChecked());
+  settings.setValue(TRAY_SHOW_SIMPLE, ui->dbusSimpleCheckBox->isChecked());
+  settings.setValue(TRAY_SHOW_SQL, ui->dbusSqlCheckBox->isChecked());
+  settings.setValue(TRAY_SHOW_DOWNED, ui->dbusDownedCheckBox->isChecked());
+
+  if(ui->emailEnableCheckBox->checkState() == Qt::Checked) {
+    rsstsetconfigitem(swarm->getHandle(), smtp_enable.c_str(), choice_true.c_str());
+  } else {
+    rsstsetconfigitem(swarm->getHandle(), smtp_enable.c_str(), choice_false.c_str());
+  }
+
+  QDialog::accept();
+}
diff --git a/branches/qtswarmtv-downloader/settingsdialog.hpp b/branches/qtswarmtv-downloader/settingsdialog.hpp
new file mode 100644
index 0000000..d26e337
--- /dev/null
+++ b/branches/qtswarmtv-downloader/settingsdialog.hpp
@@ -0,0 +1,34 @@
+#ifndef SETTINGSDIALOG_HPP
+#define SETTINGSDIALOG_HPP
+#include <stdio.h>
+#include <sqlite3.h>
+#include <stdlib.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include <QDialog>
+
+namespace Ui {
+    class settingsDialog;
+}
+
+class settingsDialog : public QDialog
+{
+    Q_OBJECT
+
+public:
+  explicit settingsDialog(QWidget *parent = 0);
+  ~settingsDialog();
+
+public slots:
+  void show();
+  void accept();
+
+private:
+  Ui::settingsDialog *ui;
+  void containerToUI(config_container *configitems);
+};
+
+#endif // SETTINGSDIALOG_HPP
diff --git a/branches/qtswarmtv-downloader/settingsdialog.ui b/branches/qtswarmtv-downloader/settingsdialog.ui
new file mode 100644
index 0000000..69a1d42
--- /dev/null
+++ b/branches/qtswarmtv-downloader/settingsdialog.ui
@@ -0,0 +1,427 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>settingsDialog</class>
+ <widget class="QDialog" name="settingsDialog">
+  <property name="windowModality">
+   <enum>Qt::ApplicationModal</enum>
+  </property>
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>554</width>
+    <height>320</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>SwarmTv Settings</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="swarmtvqtresources.qrc">
+    <normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</iconset>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="1" column="1">
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
+      <number>2</number>
+     </property>
+     <widget class="QWidget" name="tab">
+      <attribute name="title">
+       <string>Generic</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_4">
+       <item row="0" column="0">
+        <layout class="QGridLayout" name="gridLayout_2">
+         <item row="0" column="0">
+          <layout class="QHBoxLayout" name="horizontalLayout">
+           <item>
+            <widget class="QLabel" name="label_2">
+             <property name="minimumSize">
+              <size>
+               <width>150</width>
+               <height>0</height>
+              </size>
+             </property>
+             <property name="text">
+              <string>Torrent directory</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="torrentDirLineEdit">
+             <property name="toolTip">
+              <string>Directory to store downloaded bittorent files.</string>
+             </property>
+             <property name="whatsThis">
+              <string>This is the path the Torrents are downloaded to.</string>
+             </property>
+             <property name="placeholderText">
+              <string>&lt;directory to put torrents in&gt;</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item row="1" column="0">
+          <layout class="QHBoxLayout" name="horizontalLayout_2">
+           <item>
+            <widget class="QLabel" name="label">
+             <property name="minimumSize">
+              <size>
+               <width>150</width>
+               <height>0</height>
+              </size>
+             </property>
+             <property name="text">
+              <string>NZB directory</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="nzbDirectoryLineEdit">
+             <property name="toolTip">
+              <string>Directory to store downloaded nzb files.</string>
+             </property>
+             <property name="whatsThis">
+              <string>This is the path the NZBs are downloaded to.</string>
+             </property>
+             <property name="placeholderText">
+              <string>&lt;directory to put NZB's in&gt;</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item row="2" column="0">
+          <layout class="QHBoxLayout" name="horizontalLayout_3">
+           <item>
+            <widget class="QLabel" name="label_3">
+             <property name="minimumSize">
+              <size>
+               <width>150</width>
+               <height>0</height>
+              </size>
+             </property>
+             <property name="text">
+              <string>Refresh (s)</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="refreshLineEdit">
+             <property name="toolTip">
+              <string>Seconds between fetching RSS feeds</string>
+             </property>
+             <property name="whatsThis">
+              <string>The number of minutes between refreshes.</string>
+             </property>
+             <property name="placeholderText">
+              <string>&lt;time between refreshes&gt;</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item row="3" column="0">
+          <layout class="QHBoxLayout" name="horizontalLayout_4">
+           <item>
+            <widget class="QLabel" name="label_4">
+             <property name="minimumSize">
+              <size>
+               <width>150</width>
+               <height>0</height>
+              </size>
+             </property>
+             <property name="text">
+              <string>Retain (days)</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="retainLineEdit">
+             <property name="toolTip">
+              <string>Number of days to retain downloaded RSS information.</string>
+             </property>
+             <property name="whatsThis">
+              <string>The number of months to keep meta files (torrents or NZBs) in the database.</string>
+             </property>
+             <property name="placeholderText">
+              <string>&lt;number of days to keep RSS information&gt;</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item row="4" column="0">
+          <layout class="QHBoxLayout" name="horizontalLayout_5">
+           <item>
+            <widget class="QLabel" name="label_5">
+             <property name="minimumSize">
+              <size>
+               <width>150</width>
+               <height>0</height>
+              </size>
+             </property>
+             <property name="text">
+              <string>Minimal size (bytes)</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="minimalSizeLineEdit">
+             <property name="toolTip">
+              <string>Minimal size the RSS information has to indicate below this threshold, download the meta file to check.</string>
+             </property>
+             <property name="whatsThis">
+              <string>The minimal size a RSS feed has to provide for content. When this size is not met, the meta file is downloaded and the size will be red from there.</string>
+             </property>
+             <property name="placeholderText">
+              <string>&lt;Double check sizes below this threshold&gt;</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item row="5" column="0">
+          <layout class="QHBoxLayout" name="horizontalLayout_7">
+           <item>
+            <widget class="QLabel" name="label_9">
+             <property name="minimumSize">
+              <size>
+               <width>150</width>
+               <height>0</height>
+              </size>
+             </property>
+             <property name="text">
+              <string>LibTvdb API Key </string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="apiKeyLineEdit">
+             <property name="toolTip">
+              <string>API key for thetvdb.com interface. Needed to retrieve episode data. Get the API key by registering at http://thetvdb.com</string>
+             </property>
+             <property name="placeholderText">
+              <string>&lt;API key&gt;</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_2">
+      <attribute name="title">
+       <string>Email</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_3">
+       <item row="0" column="0">
+        <layout class="QVBoxLayout" name="verticalLayout_5">
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_4">
+           <item>
+            <widget class="QCheckBox" name="emailEnableCheckBox">
+             <property name="toolTip">
+              <string>When enabled emails will be sent when a download occurs.</string>
+             </property>
+             <property name="text">
+              <string>Enable email notifications</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_6">
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_2">
+               <item>
+                <widget class="QLabel" name="label_6">
+                 <property name="text">
+                  <string>Destination address</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLabel" name="label_7">
+                 <property name="text">
+                  <string>Sender address</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLabel" name="label_8">
+                 <property name="text">
+                  <string>SMTP server</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QVBoxLayout" name="verticalLayout_3">
+               <item>
+                <widget class="QLineEdit" name="destinationLineEdit">
+                 <property name="placeholderText">
+                  <string>&lt;email address&gt;</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLineEdit" name="senderLineEdit">
+                 <property name="placeholderText">
+                  <string>&lt;email address&gt;</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QLineEdit" name="ServerLineEdit">
+                 <property name="toolTip">
+                  <string>server:port</string>
+                 </property>
+                 <property name="placeholderText">
+                  <string>&lt;server:port&gt;</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item row="1" column="0">
+        <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="tab_3">
+      <attribute name="title">
+       <string>Tray Events</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_5">
+       <item row="0" column="0">
+        <layout class="QVBoxLayout" name="verticalLayout_7">
+         <item>
+          <widget class="QLabel" name="label_10">
+           <property name="text">
+            <string>When QtSwarmtv is minimized show these messages at the tray icon.</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout">
+           <item>
+            <widget class="QCheckBox" name="dbusStartCheckBox">
+             <property name="text">
+              <string>Show SwarmTv start of cycle</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="dbusStopCheckBox">
+             <property name="text">
+              <string>Show SwartmTv end of cycle</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="dbusRssCheckBox">
+             <property name="text">
+              <string>Show RSS download</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="dbusSimpleCheckBox">
+             <property name="text">
+              <string>Show application of a simple filter</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="dbusSqlCheckBox">
+             <property name="text">
+              <string>Show aplication of an SQL filter</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="dbusDownedCheckBox">
+             <property name="text">
+              <string>Show meta file download</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="swarmtvqtresources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>settingsDialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>settingsDialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/branches/qtswarmtv-downloader/settingsnames.hpp b/branches/qtswarmtv-downloader/settingsnames.hpp
new file mode 100644
index 0000000..39a329d
--- /dev/null
+++ b/branches/qtswarmtv-downloader/settingsnames.hpp
@@ -0,0 +1,16 @@
+#ifndef SETTINGSNAMES_HPP
+#define SETTINGSNAMES_HPP
+
+// Tvdb API key
+static const QString TVDB_API_CONFIG("config/tvdbapiconfig");
+
+// Which signals to show in the icontray pop messages
+static const QString TRAY_SHOW_DBUSSTART("trayicon/showdbusstart"); // show start of runcycle
+static const QString TRAY_SHOW_DBUSSTOP("trayicon/showdbusstop"); // show end of run cycle
+static const QString TRAY_SHOW_RSS("trayicon/showdbusrss"); // show downloading of RSS feeds
+static const QString TRAY_SHOW_SIMPLE("trayicon/showdbussimple"); // show simple filter handling
+static const QString TRAY_SHOW_SQL("trayicon/showdbussql"); // No sql support in frontend
+static const QString TRAY_SHOW_DOWNED("trayicon/showdbusdowned"); // Show message when a download is performed
+
+
+#endif // SETTINGSNAMES_HPP
diff --git a/branches/qtswarmtv-downloader/simplecell.cpp b/branches/qtswarmtv-downloader/simplecell.cpp
new file mode 100644
index 0000000..3d02a84
--- /dev/null
+++ b/branches/qtswarmtv-downloader/simplecell.cpp
@@ -0,0 +1,22 @@
+#include <QLabel>
+#include "simplecell.hpp"
+
+simpleCell::simpleCell(QWidget *parent) :
+    QLabel(parent)
+{
+}
+
+simpleCell::simpleCell ( const QString & text, QWidget * , Qt::WindowFlags ) :
+    QLabel(text)
+{
+}
+
+int simpleCell::getSimpleId()
+{
+    return simpleId;
+}
+
+void simpleCell::setSimpleId(int simpleId)
+{
+    this->simpleId = simpleId;
+}
diff --git a/branches/qtswarmtv-downloader/simplecell.hpp b/branches/qtswarmtv-downloader/simplecell.hpp
new file mode 100644
index 0000000..2b4f9c5
--- /dev/null
+++ b/branches/qtswarmtv-downloader/simplecell.hpp
@@ -0,0 +1,24 @@
+#ifndef SIMPLECELL_HPP
+#define SIMPLECELL_HPP
+
+#include <QLabel>
+#include <QWidget>
+
+class simpleCell : public QLabel
+{
+    Q_OBJECT
+public:
+    explicit simpleCell(QWidget *parent = 0);
+    simpleCell(const QString & text, QWidget * parent = 0, Qt::WindowFlags f = 0);
+    int getSimpleId();
+    void setSimpleId(int simpleId);
+
+signals:
+
+public slots:
+
+private:
+    int simpleId;
+};
+
+#endif // SIMPLECELL_HPP
diff --git a/branches/qtswarmtv-downloader/simpleeditdialog.cpp b/branches/qtswarmtv-downloader/simpleeditdialog.cpp
new file mode 100644
index 0000000..4ae4957
--- /dev/null
+++ b/branches/qtswarmtv-downloader/simpleeditdialog.cpp
@@ -0,0 +1,249 @@
+#include <sqlite3.h>
+#include <stdlib.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include <iostream>
+
+#include "swarmtv.hpp"
+#include "simpleeditdialog.hpp"
+#include "simpletablecontrol.hpp"
+#include "ui_simpleeditdialog.h"
+#include "readablesize.hpp"
+#include "singleton.h"
+#include "testfilterdialog.hpp"
+
+simpleEditDialog::simpleEditDialog(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::simpleEditDialog)
+{
+  setAttribute(Qt::WA_DeleteOnClose);
+
+  ui->setupUi(this);
+
+  // Set mode to add
+  mode = add;
+
+  // Connect signal
+  QObject::connect(ui->simpleButtonBox, SIGNAL(accepted()), this, SLOT(simpleAccepted()));
+  QObject::connect(ui->testPushButton, SIGNAL(clicked()), this, SLOT(testClicked()));
+  QObject::connect(ui->guessSEPushButton, SIGNAL(clicked()), this, SLOT(fillSeasonEpisode()));
+}
+
+
+simpleEditDialog::simpleEditDialog(int id, QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::simpleEditDialog)
+{
+  setAttribute(Qt::WA_DeleteOnClose);
+
+  this->id=id;
+  mode = edit;
+
+  // Setup the gui widgets
+  ui->setupUi(this);
+
+  // Set values on the dialog
+  fillDialog();
+
+  // Connect signal
+  QObject::connect(ui->simpleButtonBox, SIGNAL(accepted()), this, SLOT(simpleAccepted()));
+  QObject::connect(ui->testPushButton, SIGNAL(clicked()), this, SLOT(testClicked()));
+  QObject::connect(ui->guessSEPushButton, SIGNAL(clicked()), this, SLOT(fillSeasonEpisode()));
+}
+
+
+simpleEditDialog::~simpleEditDialog()
+{
+  delete ui;
+}
+
+
+
+void simpleEditDialog::enableNameEnable(bool enable)
+{
+  ui->nameSimpleLineEdit->setEnabled(enable);
+}
+
+void simpleEditDialog::testClicked()
+{
+  simplefilter_struct simple;
+
+  // Clear simple struct
+  memset(&simple, 0, sizeof(simplefilter_struct));
+
+  // Get filter object
+  getFromUi(simple);
+
+  // Create Object
+  new testFilterDialog(simple);
+}
+
+void simpleEditDialog::setName(QString *name)
+{
+  ui->nameSimpleLineEdit->setText(*name);
+}
+
+void simpleEditDialog::setTitle(QString *title)
+{
+  ui->titleSimpleLineEdit->setText(*title);
+}
+
+void simpleEditDialog::setMaxSize(size_t max)
+{
+  readableSize sizeconv(max);
+  std::string maxString;
+
+  sizeconv.getSize(maxString);
+  ui->maxSizeSimpleLineEdit->setText(maxString.c_str());
+}
+
+void simpleEditDialog::setMinSize(size_t min)
+{
+  readableSize sizeconv(min);
+  std::string minString;
+
+  sizeconv.getSize(minString);
+  ui->minSizeSimpleLineEdit->setText(minString.c_str());
+}
+
+void simpleEditDialog::setMaxSize(QString *max)
+{
+  ui->maxSizeSimpleLineEdit->setText(*max);
+}
+
+void simpleEditDialog::setMinSize(QString *min)
+{
+  ui->minSizeSimpleLineEdit->setText(*min);
+}
+
+void simpleEditDialog::simpleAccepted()
+{
+  simplefilter_struct simple;
+  simpleTableControl *stc = &Singleton<simpleTableControl>::Instance();
+
+  // Get SwarmTv handle
+  swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  // Get all data from the gui into a simple_struct
+  getFromUi(simple);
+
+  // Store the simple struct
+  if(mode == edit) {
+    rssteditsimplefilter(swarm->getHandle(), &simple);
+  } else {
+    rsstaddsimplefilter(swarm->getHandle(), &simple);
+  }
+
+  // Free allocated structure
+  rsstfreesimplefilter(&simple);
+
+  // Update parent
+  stc->updateTable();
+
+  // Close dialog
+  this->close();
+}
+
+
+void simpleEditDialog::fillDialog()
+{
+  simplefilter_struct *simple=NULL;
+  readableSize sizeconv;
+  std::string size;
+  int index=0;
+
+  // Get SwarmTv handle
+  swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  // Get data from swarmtv
+  rsstgetsimplefilterid(swarm->getHandle(), &simple, id);
+
+  // Put the data into the different widgets in the dialog
+  ui->nameSimpleLineEdit->setText(simple->name);
+  ui->titleSimpleLineEdit->setText(simple->title);
+  ui->excludeSimpleLineEdit->setText(simple->exclude);
+  ui->categorySimpleLineEdit->setText(simple->category);
+  ui->sourceSimpleLineEdit->setText(simple->source);
+
+  sizeconv.setSize(simple->minsize);
+  sizeconv.getSize(size);
+  ui->minSizeSimpleLineEdit->setText(size.c_str());
+  sizeconv.setSize(simple->maxsize);
+  sizeconv.getSize(size);
+  ui->maxSizeSimpleLineEdit->setText(size.c_str());
+
+  ui->seasonSpinBox->setValue(simple->fromseason);
+  ui->episodeSpinBox->setValue(simple->fromepisode);
+
+  index = ui->nodupSimpleComboBox->findText(simple->nodup);
+  ui->nodupSimpleComboBox->setCurrentIndex(index);
+
+  // Free structure
+  rsstfreesimplefilter(simple);
+  free(simple);
+}
+
+
+void simpleEditDialog::getFromUi(simplefilter_struct &simple)
+{
+  char *value=NULL;
+  readableSize sizeconv;
+  size_t uisize;
+  std::string uiSizeStr;
+
+  // Get plain text fields
+  simple.id=id;
+  value = strdup(ui->nameSimpleLineEdit->text().toUtf8().data());
+  simple.name = value;
+  value = strdup(ui->titleSimpleLineEdit->text().toUtf8().data());
+  simple.title = value;
+  value = strdup(ui->excludeSimpleLineEdit->text().toUtf8().data());
+  simple.exclude = value;
+  value = strdup(ui->categorySimpleLineEdit->text().toUtf8().data());
+  simple.category = value;
+  value = strdup(ui->sourceSimpleLineEdit->text().toUtf8().data());
+  simple.source = value;
+  value = strdup(ui->nodupSimpleComboBox->currentText().toAscii().data());
+  simple.nodup = value;
+
+  // Convert sizes back to size_t
+  uiSizeStr = ui->minSizeSimpleLineEdit->text().toAscii().data();
+  sizeconv.setSize(uiSizeStr);
+  sizeconv.getSize(uisize);
+  simple.minsize=uisize;
+  uiSizeStr = ui->maxSizeSimpleLineEdit->text().toAscii().data();
+  sizeconv.setSize(uiSizeStr);
+  sizeconv.getSize(uisize);
+  simple.maxsize=uisize;
+
+  // Get from season/episode
+  simple.fromseason = ui->seasonSpinBox->value();
+  simple.fromepisode = ui->episodeSpinBox->value();
+}
+
+void simpleEditDialog::fillSeasonEpisode()
+{
+  int rc=0;
+  simplefilter_struct filter;
+  int season=0;
+  int episode=0;
+
+  // Get SwarmTv handle
+  //swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  // Get values from interface and build the filter object
+  this->getFromUi(filter);
+
+  // Get season and episode from number using current filter setup
+  rc = rsstgetnewestepisode(&filter, &season, &episode);
+
+  // Fill out fields in gui
+  ui->seasonSpinBox->setValue(season);
+  ui->episodeSpinBox->setValue(episode);
+
+  // Free Simple filter
+  rsstfreesimplefilter(&filter);
+}
diff --git a/branches/qtswarmtv-downloader/simpleeditdialog.hpp b/branches/qtswarmtv-downloader/simpleeditdialog.hpp
new file mode 100644
index 0000000..ad51a1f
--- /dev/null
+++ b/branches/qtswarmtv-downloader/simpleeditdialog.hpp
@@ -0,0 +1,47 @@
+#ifndef SIMPLEEDITDIALOG_HPP
+#define SIMPLEEDITDIALOG_HPP
+
+#include <QDialog>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+namespace Ui {
+    class simpleEditDialog;
+}
+
+class simpleEditDialog : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit simpleEditDialog(QWidget *parent = 0);
+    simpleEditDialog(int id, QWidget *parent = 0);
+    ~simpleEditDialog();
+
+    void enableNameEnable(bool enable);
+    void getFromUi(simplefilter_struct &simple);
+    typedef enum{add, edit} addoredit;
+
+    void setName(QString *name);
+    void setTitle(QString *title);
+
+    void setMaxSize(size_t max);
+    void setMinSize(size_t min);
+    void setMaxSize(QString *max);
+    void setMinSize(QString *min);
+
+public slots:
+    void simpleAccepted();
+    void testClicked();
+    void fillSeasonEpisode();
+
+private:
+    addoredit mode;
+    int id;
+    void fillDialog();
+    Ui::simpleEditDialog *ui;
+};
+
+#endif // SIMPLEEDITDIALOG_HPP
diff --git a/branches/qtswarmtv-downloader/simpleeditdialog.ui b/branches/qtswarmtv-downloader/simpleeditdialog.ui
new file mode 100644
index 0000000..ac05597
--- /dev/null
+++ b/branches/qtswarmtv-downloader/simpleeditdialog.ui
@@ -0,0 +1,336 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>simpleEditDialog</class>
+ <widget class="QDialog" name="simpleEditDialog">
+  <property name="windowModality">
+   <enum>Qt::ApplicationModal</enum>
+  </property>
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>536</width>
+    <height>391</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>SwarmTv Simple Filter</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="swarmtvqtresources.qrc">
+    <normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</iconset>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <layout class="QVBoxLayout" name="verticalLayout_4">
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout">
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout_2">
+         <item>
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>Simple filter Name</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_2">
+           <property name="text">
+            <string>Title regexp</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_3">
+           <property name="text">
+            <string>Exclude regexp</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_9">
+           <property name="text">
+            <string>Category</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_10">
+           <property name="text">
+            <string>source regexp</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QLineEdit" name="nameSimpleLineEdit">
+           <property name="placeholderText">
+            <string>&lt;Filter name&gt;</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="titleSimpleLineEdit">
+           <property name="placeholderText">
+            <string>&lt;regexp for title to match&gt;</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="excludeSimpleLineEdit">
+           <property name="placeholderText">
+            <string>&lt;regexp for things to exclude&gt;</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="categorySimpleLineEdit">
+           <property name="placeholderText">
+            <string>&lt;category to match&gt;</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="sourceSimpleLineEdit">
+           <property name="placeholderText">
+            <string>&lt;regexp to match RSS source&gt;</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_7">
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_4">
+           <item>
+            <widget class="QLabel" name="label_5">
+             <property name="text">
+              <string>Min size</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="minSizeSimpleLineEdit">
+             <property name="placeholderText">
+              <string>&lt;min size KB/MB/GB&gt;</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_5">
+           <item>
+            <widget class="QLabel" name="label_4">
+             <property name="text">
+              <string>Max size</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="maxSizeSimpleLineEdit">
+             <property name="placeholderText">
+              <string>&lt;max size KB/MB/GB&gt;</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_9">
+         <item>
+          <widget class="QPushButton" name="guessSEPushButton">
+           <property name="text">
+            <string>Guess season and episode</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_3">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_10">
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_2">
+           <item>
+            <widget class="QLabel" name="label_7">
+             <property name="text">
+              <string>From episode</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QSpinBox" name="episodeSpinBox"/>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_3">
+           <item>
+            <widget class="QLabel" name="label_8">
+             <property name="text">
+              <string>From season</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QSpinBox" name="seasonSpinBox"/>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_6">
+       <item>
+        <widget class="QLabel" name="label_6">
+         <property name="text">
+          <string>No duplicate Filter type</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QComboBox" name="nodupSimpleComboBox">
+         <item>
+          <property name="text">
+           <string>newer</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>newer-title</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>link</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>unique</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>unique-title</string>
+          </property>
+         </item>
+         <item>
+          <property name="text">
+           <string>none</string>
+          </property>
+         </item>
+        </widget>
+       </item>
+       <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>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_8">
+       <item>
+        <widget class="QPushButton" name="testPushButton">
+         <property name="text">
+          <string>Test</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <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="QDialogButtonBox" name="simpleButtonBox">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="standardButtons">
+          <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <tabstops>
+  <tabstop>nameSimpleLineEdit</tabstop>
+  <tabstop>titleSimpleLineEdit</tabstop>
+  <tabstop>excludeSimpleLineEdit</tabstop>
+  <tabstop>categorySimpleLineEdit</tabstop>
+  <tabstop>sourceSimpleLineEdit</tabstop>
+  <tabstop>minSizeSimpleLineEdit</tabstop>
+  <tabstop>maxSizeSimpleLineEdit</tabstop>
+  <tabstop>nodupSimpleComboBox</tabstop>
+  <tabstop>simpleButtonBox</tabstop>
+ </tabstops>
+ <resources>
+  <include location="swarmtvqtresources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>simpleButtonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>simpleEditDialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>296</x>
+     <y>355</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/branches/qtswarmtv-downloader/simpletablecontrol.cpp b/branches/qtswarmtv-downloader/simpletablecontrol.cpp
new file mode 100644
index 0000000..99da947
--- /dev/null
+++ b/branches/qtswarmtv-downloader/simpletablecontrol.cpp
@@ -0,0 +1,211 @@
+#include <QLabel>
+#include <QMessageBox>
+#include <QTableWidget>
+#include <QHeaderView>
+
+#include <stdio.h>
+#include <sqlite3.h>
+#include <stdlib.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include <iostream>
+
+#include "mainwindow.h"
+#include "simpletablecontrol.hpp"
+#include "simpleeditdialog.hpp"
+#include "singleton.h"
+#include "swarmtv.hpp"
+#include "simplecell.hpp"
+
+simpleTableControl::simpleTableControl(QWidget *parent) :
+    QWidget(parent)
+{
+}
+
+void simpleTableControl::setTable(QTableWidget *table)
+{
+    // Store the object we are going to control
+    this->table = table;
+}
+
+int simpleTableControl::updateTable()
+{
+    int rc=0;
+    lastdowned_container container;
+    swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+    // Set Header size policies
+    simpleTableControl::initHeaders();
+
+    // Get the last downloaded data
+    rc = rsstgetlastdownloaded(swarm->getHandle() , &container);
+    if(rc != 0) {
+     fprintf(stderr, "Could not retrieve last downloaded data.\n");
+      return -1;
+    }
+
+    // Fill the table
+    fillTable(&container);
+
+    // Clean up
+    rsstfreelastdownedcontainer(&container);
+
+    return 0;
+}
+
+void simpleTableControl::initHeaders()
+{
+  // Make sure ui is set
+  if(this->table == NULL){
+    std::cerr << "Set table before calling initHeaders " << __FILE__ << ":" << __LINE__ << std::endl;
+  }
+
+  // Set name
+  table->horizontalHeader()->setResizeMode(0, QHeaderView::ResizeToContents);
+
+  // Set Filter Type
+  table->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents);
+
+  // Set Last downloaded Title
+  table->horizontalHeader()->setResizeMode(2, QHeaderView::Stretch);
+}
+
+void simpleTableControl::fillTable(lastdowned_container *container)
+{
+  int 		count=0;
+  simpleCell 	*slabel=NULL;
+  QLabel 		*label=NULL;
+
+  /*
+     * Call method to set
+     */
+  table->setRowCount(container->nr);
+
+  /*
+     * Loop through the content, and set the names + last download to the screen
+     */
+  for(count=0; count < container->nr; count++){
+    /*
+         * Set filtername in first table row
+         */
+    slabel = new simpleCell(container->lastdownloaded[count].filtername);
+        slabel->setSimpleId(container->lastdownloaded[count].filterid);
+        table->setCellWidget(count, 0, slabel);
+        slabel = NULL;
+
+        /*
+         * Set filter type in second row.
+         */
+        label = new QLabel(container->lastdownloaded[count].filtertype);
+        table->setCellWidget(count, 1, label);
+        label=NULL;
+
+        /*
+         * Set lastdownloaded content in the third row
+         */
+        if(container->lastdownloaded[count].downloaded == NULL) {
+            label = new QLabel("--");
+        } else {
+            label = new QLabel(container->lastdownloaded[count].downloaded->title);
+        }
+        table->setCellWidget(count, 2, label);
+        label = NULL;
+    }
+}
+
+void simpleTableControl::cellDoubleClicked(int row, int)
+{
+    int 		id=0;
+    simpleCell *scell=NULL;
+    simpleEditDialog *dialog=NULL;
+
+    // Get cell cell pointer
+    scell = static_cast<simpleCell*>( table->cellWidget(row, 0) );
+
+    // Exctract Id
+    id = scell->getSimpleId();
+
+    // Open dialog, and disable the name field.
+    dialog = new simpleEditDialog(id, this);
+    dialog->enableNameEnable(false);
+    dialog->show();
+}
+
+void simpleTableControl::addSimpleButtonClicked()
+{
+    simpleEditDialog *dialog=NULL;
+
+    // Open dialog, and disable the name field.
+    dialog = new simpleEditDialog(this);
+    dialog->show();
+}
+
+int simpleTableControl::getRowSelected()
+{
+  int row=0;
+
+  // Get line that is currently selected
+  QList<QTableWidgetSelectionRange> items = table->selectedRanges();
+  if(items.count() == 0) {
+    QMessageBox::warning(this, tr("SwarmTv"),
+                         tr("Please select a source to delete."),
+                         QMessageBox::Ok);
+    return -1;
+  }
+  row = items.first().topRow();
+
+  return row;
+}
+
+void simpleTableControl::editSimpleButtonClicked()
+{
+  int row=0;
+
+  // Get selected row
+  row = getRowSelected();
+  if(row == -1) {
+    return;
+  }
+
+  // Handle this through the double click handle
+  cellDoubleClicked(row, 0);
+}
+
+void simpleTableControl::delSimpleButtonClicked()
+{
+  int row=0;
+  int	id=0;
+  int ret=0;
+  simpleCell *scell=NULL;
+
+  // Get SwarmTv handle
+  swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  // Get id from this row
+  row = getRowSelected();
+  if(row == -1) {
+    return;
+  }
+
+  // Get cell cell pointer
+  scell = static_cast<simpleCell*>( table->cellWidget(row, 0) );
+
+  // Exctract Id
+  id = scell->getSimpleId();
+
+  // Ask for comformation
+  ret = QMessageBox::warning(this, tr("SwarmTv"),
+                                 tr("Are you sure you want to delete this filter?"),
+                                 QMessageBox::Ok | QMessageBox::Cancel);
+
+  if(ret == QMessageBox::Ok){
+    // Delete the simple filter
+    rsstdelsimpleid(swarm->getHandle(), id);
+
+    // Update the view
+    this->updateTable();
+  }
+}
diff --git a/branches/qtswarmtv-downloader/simpletablecontrol.hpp b/branches/qtswarmtv-downloader/simpletablecontrol.hpp
new file mode 100644
index 0000000..30334ba
--- /dev/null
+++ b/branches/qtswarmtv-downloader/simpletablecontrol.hpp
@@ -0,0 +1,35 @@
+#ifndef SIMPLETABLECONTROL_HPP
+#define SIMPLETABLECONTROL_HPP
+
+#include <QObject>
+#include <qtablewidget.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+class simpleTableControl : public QWidget
+{
+    Q_OBJECT
+public:
+    explicit simpleTableControl(QWidget *parent = 0);
+    void setTable(QTableWidget *table);
+    int updateTable();
+    void initHeaders();
+
+signals:
+
+public slots:
+    void cellDoubleClicked(int row, int column);
+    void addSimpleButtonClicked();
+    void editSimpleButtonClicked();
+    void delSimpleButtonClicked();
+
+private:
+    int getRowSelected();
+    void fillTable(lastdowned_container *container);
+
+    QTableWidget *table;
+};
+
+#endif // SIMPLETABLECONTROL_HPP
diff --git a/branches/qtswarmtv-downloader/singleapplication.cpp b/branches/qtswarmtv-downloader/singleapplication.cpp
new file mode 100644
index 0000000..fc668f9
--- /dev/null
+++ b/branches/qtswarmtv-downloader/singleapplication.cpp
@@ -0,0 +1,68 @@
+#include <QLocalSocket>
+
+#include "singleapplication.h"
+
+SingleApplication::SingleApplication(int &argc, char *argv[], const QString uniqueKey) : QApplication(argc, argv), _uniqueKey(uniqueKey)
+{
+        sharedMemory.setKey(_uniqueKey);
+        if (sharedMemory.attach())
+                _isRunning = true;
+        else
+        {
+                _isRunning = false;
+                // create shared memory.
+                if (!sharedMemory.create(1))
+                {
+                        qDebug("Unable to create single instance.");
+                        return;
+                }
+                // create local server and listen to incomming messages from other instances.
+                localServer = new QLocalServer(this);
+                connect(localServer, SIGNAL(newConnection()), this, SLOT(receiveMessage()));
+                localServer->listen(_uniqueKey);
+        }
+}
+
+// public slots.
+
+void SingleApplication::receiveMessage()
+{
+        QLocalSocket *localSocket = localServer->nextPendingConnection();
+        if (!localSocket->waitForReadyRead(timeout))
+        {
+                qDebug() << localSocket->errorString().toLatin1();
+                return;
+        }
+        QByteArray byteArray = localSocket->readAll();
+        QString message = QString::fromUtf8(byteArray.constData());
+        emit messageAvailable(message);
+        localSocket->disconnectFromServer();
+}
+
+// public functions.
+
+bool SingleApplication::isRunning()
+{
+        return _isRunning;
+}
+
+bool SingleApplication::sendMessage(const QString &message)
+{
+        if (!_isRunning)
+                return false;
+        QLocalSocket localSocket(this);
+        localSocket.connectToServer(_uniqueKey, QIODevice::WriteOnly);
+        if (!localSocket.waitForConnected(timeout))
+        {
+                qDebug() << localSocket.errorString().toLatin1();
+                return false;
+        }
+        localSocket.write(message.toUtf8());
+        if (!localSocket.waitForBytesWritten(timeout))
+        {
+                qDebug() << localSocket.errorString().toLatin1();
+                return false;
+        }
+        localSocket.disconnectFromServer();
+        return true;
+}
diff --git a/branches/qtswarmtv-downloader/singleapplication.h b/branches/qtswarmtv-downloader/singleapplication.h
new file mode 100644
index 0000000..85c5f60
--- /dev/null
+++ b/branches/qtswarmtv-downloader/singleapplication.h
@@ -0,0 +1,31 @@
+#ifndef SINGLE_APPLICATION_H
+#define SINGLE_APPLICATION_H
+
+#include <QApplication>
+#include <QSharedMemory>
+#include <QLocalServer>
+
+class SingleApplication : public QApplication
+{
+        Q_OBJECT
+public:
+        SingleApplication(int &argc, char *argv[], const QString uniqueKey);
+
+        bool isRunning();
+        bool sendMessage(const QString &message);
+
+public slots:
+        void receiveMessage();
+
+signals:
+        void messageAvailable(QString message);
+
+private:
+        bool _isRunning;
+        QString _uniqueKey;
+        QSharedMemory sharedMemory;
+        QLocalServer *localServer;
+
+        static const int timeout = 1000;
+};
+#endif // SINGLE_APPLICATION_H
diff --git a/branches/qtswarmtv-downloader/singleton.h b/branches/qtswarmtv-downloader/singleton.h
new file mode 100644
index 0000000..316cc33
--- /dev/null
+++ b/branches/qtswarmtv-downloader/singleton.h
@@ -0,0 +1,23 @@
+#ifndef SINGLETON_H
+#define SINGLETON_H
+
+#include <QObject>
+
+template <class T>
+class Singleton
+{
+public:
+    static T& Instance()
+    {
+        static T _instance; // create static instance of our class
+        return _instance;   // return it
+    }
+
+private:
+    Singleton();	// hide constructor
+    ~Singleton();	// hide destructor
+    Singleton(const Singleton &); // hide copy constructor
+    Singleton& operator=(const Singleton &); // hide assign op
+};
+
+#endif // SINGLETON_H
diff --git a/branches/qtswarmtv-downloader/sourceeditdialog.cpp b/branches/qtswarmtv-downloader/sourceeditdialog.cpp
new file mode 100644
index 0000000..54ca595
--- /dev/null
+++ b/branches/qtswarmtv-downloader/sourceeditdialog.cpp
@@ -0,0 +1,113 @@
+#include <sqlite3.h>
+#include <stdlib.h>
+#include <string.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include <QWidget>
+
+#include <iostream>
+
+#include "sourceeditdialog.hpp"
+#include "singleton.h"
+#include "swarmtv.hpp"
+#include "ui_sourceeditdialog.h"
+#include "sourcetablecontrol.hpp"
+
+sourceEditDialog::sourceEditDialog(QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::sourceEditDialog)
+{
+    setAttribute(Qt::WA_DeleteOnClose);
+    ui->setupUi(this);
+
+    // Connect signal
+    QObject::connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(sourceAccepted()));
+}
+
+sourceEditDialog::sourceEditDialog(int id, QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::sourceEditDialog)
+{
+    setAttribute(Qt::WA_DeleteOnClose);
+    this->id = id;
+    ui->setupUi(this);
+
+    // Set values on the dialog
+    fillDialog();
+
+    // Connect signal
+    QObject::connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(sourceAccepted()));
+}
+
+sourceEditDialog::~sourceEditDialog()
+{
+    delete ui;
+}
+
+void sourceEditDialog::setNameEnable(bool enable)
+{
+    ui->nameSourceLineEdit->setEnabled(enable);
+}
+
+void sourceEditDialog::fillDialog()
+{
+    int rc=0;
+    int index=0;
+    source_struct *source=NULL;
+
+    // Get swarmtv object
+    swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+    // Get source information
+    rc = rsstgetsource(swarm->getHandle(), id, &source);
+
+    // Set data to gui
+    ui->nameSourceLineEdit->setText(source->name);
+    ui->urlSourceLineEdit->setText(source->url);
+    index = ui->metaComboBox->findText(source->metatype);
+    ui->metaComboBox->setCurrentIndex(index);
+    index = ui->ParserComboBox->findText(source->parser);
+    ui->ParserComboBox->setCurrentIndex(index);
+
+    // Free source struct
+    rsstfreesource(source);
+}
+
+void sourceEditDialog::storeSource()
+{
+    source_struct source;
+
+    // Get swarmtv class
+    swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+    // Get values from the dialog
+    source.id = 0; // Just to make things tidy
+    source.name =  strdup(ui->nameSourceLineEdit->displayText().toUtf8().data());
+    source.url =  strdup(ui->urlSourceLineEdit->text().toUtf8().data());
+    source.parser =  strdup(ui->ParserComboBox->currentText().toUtf8().data());
+    source.metatype =  strdup(ui->metaComboBox->currentText().toUtf8().data());
+
+    // Store the rss source into swarmtv
+    rsstaddsource(swarm->getHandle(), &source);
+
+        // Free string in struct
+        rsstfreesource(&source);
+}
+
+void sourceEditDialog::sourceAccepted()
+{
+    sourceTableControl *ctrl;
+
+    // Safe filter
+    this->storeSource();
+
+    // Update Dialog
+    ctrl =  static_cast<sourceTableControl*>(this->parent());
+    ctrl->updateTable();
+
+    // Close Dialog
+    this->accept();
+}
diff --git a/branches/qtswarmtv-downloader/sourceeditdialog.hpp b/branches/qtswarmtv-downloader/sourceeditdialog.hpp
new file mode 100644
index 0000000..f918c18
--- /dev/null
+++ b/branches/qtswarmtv-downloader/sourceeditdialog.hpp
@@ -0,0 +1,31 @@
+#ifndef SOURCEEDITDIALOG_HPP
+#define SOURCEEDITDIALOG_HPP
+
+#include <QDialog>
+
+namespace Ui {
+    class sourceEditDialog;
+}
+
+class sourceEditDialog : public QDialog
+{
+    Q_OBJECT
+
+public:
+    //explicit sourceEditDialog(QWidget *parent = 0);
+    sourceEditDialog(int id, QWidget *parent = 0);
+    sourceEditDialog(QWidget *parent = 0);
+    ~sourceEditDialog();
+    void setNameEnable(bool enable);
+
+public slots:
+    void sourceAccepted();
+
+private:
+    int id;
+    Ui::sourceEditDialog *ui;
+    void fillDialog();
+    void storeSource();
+};
+
+#endif // SOURCEEDITDIALOG_HPP
diff --git a/branches/qtswarmtv-downloader/sourceeditdialog.ui b/branches/qtswarmtv-downloader/sourceeditdialog.ui
new file mode 100644
index 0000000..97b68db
--- /dev/null
+++ b/branches/qtswarmtv-downloader/sourceeditdialog.ui
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>sourceEditDialog</class>
+ <widget class="QDialog" name="sourceEditDialog">
+  <property name="windowModality">
+   <enum>Qt::ApplicationModal</enum>
+  </property>
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>502</width>
+    <height>187</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>502</width>
+    <height>187</height>
+   </size>
+  </property>
+  <property name="sizeIncrement">
+   <size>
+    <width>502</width>
+    <height>187</height>
+   </size>
+  </property>
+  <property name="baseSize">
+   <size>
+    <width>502</width>
+    <height>187</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>Edit Source</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="swarmtvqtresources.qrc">
+    <normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</iconset>
+  </property>
+  <property name="sizeGripEnabled">
+   <bool>true</bool>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="sizeConstraint">
+    <enum>QLayout::SetDefaultConstraint</enum>
+   </property>
+   <item row="0" column="0">
+    <layout class="QVBoxLayout" name="verticalLayout_3">
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_3">
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>Name</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_2">
+           <property name="text">
+            <string>Parser</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_3">
+           <property name="text">
+            <string>Meta type</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_4">
+           <property name="text">
+            <string>URL</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout_2">
+         <item>
+          <widget class="QLineEdit" name="nameSourceLineEdit">
+           <property name="placeholderText">
+            <string>&lt;RSS source name&gt;</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout">
+           <item>
+            <widget class="QComboBox" name="ParserComboBox">
+             <item>
+              <property name="text">
+               <string>defaultrss</string>
+              </property>
+             </item>
+             <item>
+              <property name="text">
+               <string>twitter</string>
+              </property>
+             </item>
+            </widget>
+           </item>
+           <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>
+          </layout>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_2">
+           <item>
+            <widget class="QComboBox" name="metaComboBox">
+             <item>
+              <property name="text">
+               <string>torrent</string>
+              </property>
+             </item>
+             <item>
+              <property name="text">
+               <string>nzb</string>
+              </property>
+             </item>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_2">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="urlSourceLineEdit">
+           <property name="placeholderText">
+            <string>&lt;Meta file URL&gt;</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <widget class="QDialogButtonBox" name="buttonBox">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="standardButtons">
+        <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="swarmtvqtresources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>sourceEditDialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/branches/qtswarmtv-downloader/sourcetablecontrol.cpp b/branches/qtswarmtv-downloader/sourcetablecontrol.cpp
new file mode 100644
index 0000000..aa2518e
--- /dev/null
+++ b/branches/qtswarmtv-downloader/sourcetablecontrol.cpp
@@ -0,0 +1,201 @@
+#include <QLabel>
+#include <QMessageBox>
+#include <QHeaderView>
+
+#include <stdio.h>
+#include <sqlite3.h>
+#include <stdlib.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include <iostream>
+
+#include "sourcetablecontrol.hpp"
+#include "sourceeditdialog.hpp"
+#include "singleton.h"
+#include "swarmtv.hpp"
+#include "simplecell.hpp"
+
+sourceTableControl::sourceTableControl(QWidget *parent) :
+    QWidget(parent)
+{
+}
+
+
+void sourceTableControl::setTable(QTableWidget *table)
+{
+    // Store the object we are going to control
+    this->table = table;
+}
+
+
+int sourceTableControl::updateTable()
+{
+    int rc=0;
+    source_container *container;
+    swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+    /*
+     * Get the last downloaded data
+     */
+    rc = rsstgetallsources(swarm->getHandle(), &container);
+    if(rc != 0) {
+      fprintf(stderr, "Could not retrieve last downloaded data.\n");
+      return -1;
+    }
+
+    /*
+     * Fill the table
+     */
+    fillTable(container);
+
+    /*
+     * Clean up
+     */
+    rsstfreesourcecontainer(container);
+
+    return 0;
+}
+
+void sourceTableControl::initHeaders()
+{
+  // Make sure ui is set
+  if(this->table == NULL){
+    std::cerr << "Set table before calling initHeaders " << __FILE__ << ":" << __LINE__ << std::endl;
+  }
+
+  // Name
+  table->horizontalHeader()->setResizeMode(0, QHeaderView::ResizeToContents);
+
+  // Parser
+  table->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents);
+
+  // Meta type
+  table->horizontalHeader()->setResizeMode(2, QHeaderView::ResizeToContents);
+
+  // URL
+  table->horizontalHeader()->setResizeMode(3, QHeaderView::Stretch);
+}
+
+void sourceTableControl::fillTable(source_container *container)
+{
+    int 		count=0;
+    simpleCell 	*slabel=NULL;
+    QLabel 		*label=NULL;
+
+    // Set Header size hints
+    initHeaders();
+
+    // Call method to set
+    table->setRowCount(container->nr);
+
+    // Loop through the content, and set the names + last download to the screen
+    for(count=0; count < container->nr; count++){
+        // Set filtername in first table row
+        slabel = new simpleCell(container->source[count].name);
+        slabel->setSimpleId(container->source[count].id);
+        table->setCellWidget(count, 0, slabel);
+        slabel = NULL;
+
+        // Set filter type in second row.
+        label = new QLabel(container->source[count].parser);
+        table->setCellWidget(count, 1, label);
+        label=NULL;
+
+        // Set filter type in second row.
+        label = new QLabel(container->source[count].metatype);
+        table->setCellWidget(count, 2, label);
+        label=NULL;
+
+        // Set filter type in second row.
+        label = new QLabel(container->source[count].url);
+        table->setCellWidget(count, 3, label);
+        label=NULL;
+    }
+
+}
+
+void sourceTableControl::cellDoubleClicked(int row, int )
+{
+    int id=0;
+    simpleCell 	*scell=NULL;
+    sourceEditDialog *dialog=NULL;
+
+    // Get cell cell pointer
+    scell = static_cast<simpleCell*>( table->cellWidget(row, 0) );
+    id = scell->getSimpleId();
+
+    // Create object of source containing source
+    dialog = new sourceEditDialog(id, this);
+    dialog->setNameEnable(false);
+    dialog->show();
+
+    // Print something.
+    std::cout << "Row clicked : " << row << " ID : " << id << std::endl;
+}
+
+void sourceTableControl::addButtonClicked(void)
+{
+    sourceEditDialog *dialog=NULL;
+
+    // Create object of source containing source
+    dialog = new sourceEditDialog(this);
+    dialog->show();
+}
+
+
+void sourceTableControl::delButtonClicked(void)
+{
+  int row=0;
+  int id=0;
+  int rc=0;
+  QString name;
+  simpleCell 	*scell=NULL;
+  swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+  // Get line that is currently selected
+  QList<QTableWidgetSelectionRange> items = table->selectedRanges();
+  if(items.count() == 0) {
+    QMessageBox::warning(this, tr("SwarmTv"),
+                         tr("Please select a source to delete."),
+                         QMessageBox::Ok);
+
+    return;
+  }
+  row = items.first().topRow();
+
+  // Get cell cell pointer
+  scell = static_cast<simpleCell*>( table->cellWidget(row, 0) );
+  id = scell->getSimpleId();
+  name = scell->text();
+
+  // Show dialog, asking for permission to delete
+  int ret = QMessageBox::warning(this, tr("SwarmTv"),
+                                 tr("Are you sure you want to delete this source?"),
+                                 QMessageBox::Ok | QMessageBox::Cancel);
+  switch(ret) {
+        case QMessageBox::Ok:
+    //@DEBUG
+    std::cout << "deleting source '" << name.toAscii().data() << "." << std::endl;
+    rc = rsstdelsourceid(swarm->getHandle(), id);
+    if(rc != 0) {
+      QMessageBox::warning(this, tr("SwarmTv"),
+                           tr("Deleting of source failed!"),
+                           QMessageBox::Ok);
+    }
+    break;
+        case QMessageBox::Cancel:
+
+    break;
+        default:
+    // When this happens, weird things are going on.
+    exit(1);
+  }
+
+  // Delete the Filter when accepted
+
+  // Update display
+  this->updateTable();
+}
diff --git a/branches/qtswarmtv-downloader/sourcetablecontrol.hpp b/branches/qtswarmtv-downloader/sourcetablecontrol.hpp
new file mode 100644
index 0000000..2bcbfc5
--- /dev/null
+++ b/branches/qtswarmtv-downloader/sourcetablecontrol.hpp
@@ -0,0 +1,34 @@
+#ifndef SOURCETABLECONTROL_HPP
+#define SOURCETABLECONTROL_HPP
+
+#include <QObject>
+#include <QWidget>
+#include <qtablewidget.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+class sourceTableControl : public QWidget
+{
+    Q_OBJECT
+public:
+    explicit sourceTableControl(QWidget *parent = 0);
+    void setTable(QTableWidget *table);
+    int updateTable();
+    void initHeaders();
+
+signals:
+
+public slots:
+    void addButtonClicked(void);
+    void delButtonClicked(void);
+    void cellDoubleClicked(int row, int column);
+
+private:
+    void fillTable(source_container *container);
+
+    QTableWidget *table;
+};
+
+#endif // SOURCETABLECONTROL_HPP
diff --git a/branches/qtswarmtv-downloader/sourcetablecontroller.cpp b/branches/qtswarmtv-downloader/sourcetablecontroller.cpp
new file mode 100644
index 0000000..bf6f625
--- /dev/null
+++ b/branches/qtswarmtv-downloader/sourcetablecontroller.cpp
@@ -0,0 +1,28 @@
+#include <qlabel.h>
+
+#include <stdio.h>
+#include <sqlite3.h>
+#include <stdlib.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include <iostream>
+
+#include "singleton.h"
+#include "swarmtv.hpp"
+#include "simplecell.hpp"
+#include "sourcetablecontroller.hpp"
+
+sourcetablecontroller::sourcetablecontroller(QObject *parent) :
+    QObject(parent)
+{
+}
+
+
+void sourceTableControl::setTable(QTableWidget *table)
+{
+    // Store the object we are going to control
+    this->table = table;
+}
diff --git a/branches/qtswarmtv-downloader/sourcetablecontroller.hpp b/branches/qtswarmtv-downloader/sourcetablecontroller.hpp
new file mode 100644
index 0000000..9645071
--- /dev/null
+++ b/branches/qtswarmtv-downloader/sourcetablecontroller.hpp
@@ -0,0 +1,22 @@
+#ifndef SOURCETABLECONTROLLER_HPP
+#define SOURCETABLECONTROLLER_HPP
+
+#include <QObject>
+
+class sourcetablecontroller : public QObject
+{
+    Q_OBJECT
+public:
+    explicit sourcetablecontroller(QObject *parent = 0);
+    void setTable(QTableWidget *table);
+    int updateTable();
+
+signals:
+
+public slots:
+
+private:
+
+};
+
+#endif // SOURCETABLECONTROLLER_HPP
diff --git a/branches/qtswarmtv-downloader/swarmtv.cpp b/branches/qtswarmtv-downloader/swarmtv.cpp
new file mode 100644
index 0000000..f5d1058
--- /dev/null
+++ b/branches/qtswarmtv-downloader/swarmtv.cpp
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <sqlite3.h>
+#include <stdlib.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include "swarmtv.hpp"
+
+swarmTv::swarmTv()
+{
+    // Initialize the handle.
+    handle = initrsstor();
+}
+
+swarmTv::~swarmTv()
+{
+    // Destroy the handle.
+    freersstor(handle);
+}
+
+rsstor_handle *swarmTv::getHandle()
+{
+    // When the handle is requested, provide it.
+    return handle;
+}
diff --git a/branches/qtswarmtv-downloader/swarmtv.hpp b/branches/qtswarmtv-downloader/swarmtv.hpp
new file mode 100644
index 0000000..c25f26c
--- /dev/null
+++ b/branches/qtswarmtv-downloader/swarmtv.hpp
@@ -0,0 +1,16 @@
+#ifndef SWARMTV_H
+#define SWARMTV_H
+
+
+class swarmTv
+{
+public:
+    swarmTv();
+    ~swarmTv();
+    rsstor_handle *getHandle();
+
+private:
+    rsstor_handle *handle;
+};
+
+#endif // SWARMTV_H
diff --git a/branches/qtswarmtv-downloader/swarmtvqtresources.qrc b/branches/qtswarmtv-downloader/swarmtvqtresources.qrc
new file mode 100644
index 0000000..8aefbc2
--- /dev/null
+++ b/branches/qtswarmtv-downloader/swarmtvqtresources.qrc
@@ -0,0 +1,7 @@
+<RCC>
+    <qresource prefix="/swarmtv/mainlogo">
+        <file>resources/swarmtv_logo.png</file>
+        <file>resources/processing.gif</file>
+        <file>resources/gplv3.png</file>
+    </qresource>
+</RCC>
diff --git a/branches/qtswarmtv-downloader/swarmtvstats.cpp b/branches/qtswarmtv-downloader/swarmtvstats.cpp
new file mode 100644
index 0000000..f39547f
--- /dev/null
+++ b/branches/qtswarmtv-downloader/swarmtvstats.cpp
@@ -0,0 +1,53 @@
+#include <stdio.h>
+#include <sqlite3.h>
+#include <stdlib.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include <qstring.h>
+
+#include "singleton.h"
+#include "swarmtvstats.hpp"
+#include "swarmtv.hpp"
+#include "readablesize.hpp"
+
+
+swarmTvStats::swarmTvStats()
+{
+}
+
+QString *swarmTvStats::getStatsString()
+{
+    int rc=0;
+    stats_struct stats;
+    QString *statsstr = new QString();
+    std::string sizestr;
+    swarmTv *swarm = &Singleton<swarmTv>::Instance();
+
+    // Get the statistics
+    rc = rsstgetstats(swarm->getHandle(), &stats);
+
+    // Convert size
+    readableSize readsize(stats.dbsize);
+    readsize.getSize(sizestr);
+
+    // Create string
+    statsstr->sprintf(
+        "Statistics for SwarmTv %s\n"
+        "================================\n"
+        "Database version         : %d\n"
+        "Number of sources        : %d\n"
+        "Number of simple filters : %d\n"
+        "Number of SQL filters    : %d\n"
+        "Number of meta files     : %d\n"
+        "Number of downloaded     : %d\n"
+        "Database Size            : %s\n",
+        stats.version, stats.database, stats.sources,
+        stats.simples, stats.sqls, stats.metafile,
+        stats.downloaded, sizestr.c_str()
+        );
+
+    return statsstr;
+}
diff --git a/branches/qtswarmtv-downloader/swarmtvstats.hpp b/branches/qtswarmtv-downloader/swarmtvstats.hpp
new file mode 100644
index 0000000..43d57ee
--- /dev/null
+++ b/branches/qtswarmtv-downloader/swarmtvstats.hpp
@@ -0,0 +1,11 @@
+#ifndef SWARMTVSTATS_HPP
+#define SWARMTVSTATS_HPP
+
+class swarmTvStats
+{
+public:
+    swarmTvStats();
+    QString *getStatsString();
+};
+
+#endif // SWARMTVSTATS_HPP
diff --git a/branches/qtswarmtv-downloader/swarmtvtrayicon.cpp b/branches/qtswarmtv-downloader/swarmtvtrayicon.cpp
new file mode 100644
index 0000000..2c85266
--- /dev/null
+++ b/branches/qtswarmtv-downloader/swarmtvtrayicon.cpp
@@ -0,0 +1,84 @@
+#include "swarmtvtrayicon.h"
+
+swarmtvTrayIcon::swarmtvTrayIcon(QMainWindow *parent)
+{
+  parentwin = parent;
+
+  createActions();
+  createTrayIcon();
+
+  trayIcon->setIcon(QIcon(":/swarmtv/mainlogo/resources/swarmtv_logo.png"));
+
+  trayIcon->show();
+
+  QObject::connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
+          this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
+
+}
+
+void swarmtvTrayIcon::setVisible(bool visible)
+{
+  if(visible == true) {
+    parentwin->show();
+  } else {
+    parentwin->hide();
+  }
+}
+
+void swarmtvTrayIcon::createActions()
+{
+  minimizeAction = new QAction(tr("Mi&nimize"), this);
+  connect(minimizeAction, SIGNAL(triggered()), this, SLOT(hide()));
+
+  maximizeAction = new QAction(tr("Ma&ximize"), this);
+  connect(maximizeAction, SIGNAL(triggered()), this, SLOT(showMaximized()));
+
+  restoreAction = new QAction(tr("&Restore"), this);
+  connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal()));
+
+  quitAction = new QAction(tr("&Quit"), this);
+  connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+}
+
+
+void swarmtvTrayIcon::createTrayIcon()
+{
+  trayIconMenu = new QMenu(this);
+  trayIconMenu->addAction(minimizeAction);
+  trayIconMenu->addAction(maximizeAction);
+  trayIconMenu->addAction(restoreAction);
+  trayIconMenu->addSeparator();
+  trayIconMenu->addAction(quitAction);
+
+  trayIcon = new QSystemTrayIcon(this);
+  trayIcon->setContextMenu(trayIconMenu);
+}
+
+void swarmtvTrayIcon::showHideParent()
+{
+  if(parentwin->isVisible() == true) {
+    parentwin->hide();
+  } else {
+    parentwin->show();
+  }
+}
+
+void swarmtvTrayIcon::iconActivated(QSystemTrayIcon::ActivationReason reason)
+{
+    switch (reason) {
+    case QSystemTrayIcon::Trigger:
+    case QSystemTrayIcon::DoubleClick:
+         showHideParent();
+        break;
+    //case QSystemTrayIcon::MiddleClick:
+    //    showMessage();
+    //    break;
+    default:
+        ;
+    }
+}
+
+void swarmtvTrayIcon::showMessage(QString title, QString msg, int time)
+{
+    trayIcon->showMessage(title, msg, QSystemTrayIcon::Information, time);
+}
diff --git a/branches/qtswarmtv-downloader/swarmtvtrayicon.h b/branches/qtswarmtv-downloader/swarmtvtrayicon.h
new file mode 100644
index 0000000..6b0c82d
--- /dev/null
+++ b/branches/qtswarmtv-downloader/swarmtvtrayicon.h
@@ -0,0 +1,39 @@
+#ifndef SWARMTVTRAYICON_H
+#define SWARMTVTRAYICON_H
+
+#include <QApplication>
+#include <QMenu>
+#include <QAction>
+#include <QMainWindow>
+#include <QSystemTrayIcon>
+#include <QWidget>
+
+class swarmtvTrayIcon : public QWidget
+{
+    Q_OBJECT
+public:
+    explicit swarmtvTrayIcon(QMainWindow *parent);
+    void showMessage(QString title, QString msg, int time);
+    void setVisible(bool visible);
+
+signals:
+
+public slots:
+    void showHideParent();
+    void iconActivated(QSystemTrayIcon::ActivationReason reason);
+
+private:
+    void createActions();
+    void createTrayIcon();
+
+    QAction *minimizeAction;
+    QAction *maximizeAction;
+    QAction *restoreAction;
+    QAction *quitAction;
+
+    QSystemTrayIcon *trayIcon;
+    QMenu *trayIconMenu;
+    QMainWindow *parentwin;
+};
+
+#endif // SWARMTVTRAYICON_H
diff --git a/branches/qtswarmtv-downloader/taskinterface.hpp b/branches/qtswarmtv-downloader/taskinterface.hpp
new file mode 100644
index 0000000..40623a6
--- /dev/null
+++ b/branches/qtswarmtv-downloader/taskinterface.hpp
@@ -0,0 +1,10 @@
+#ifndef TASKINTERFACE_HPP
+#define TASKINTERFACE_HPP
+
+class taskInterface
+{
+public:
+  virtual void start(void)=0;
+};
+
+#endif // TASKINTERFACE_HPP
diff --git a/branches/qtswarmtv-downloader/taskqueue.cpp b/branches/qtswarmtv-downloader/taskqueue.cpp
new file mode 100644
index 0000000..5f1e54d
--- /dev/null
+++ b/branches/qtswarmtv-downloader/taskqueue.cpp
@@ -0,0 +1,107 @@
+#include <QList>
+#include <QThread>
+#include <QObject>
+#include <iostream>
+
+#include "taskqueue.hpp"
+
+//taskQueue::taskQueue(QObject *parent)
+taskQueue::taskQueue(QObject *)
+{
+  // Start Clean
+  tasks.clear();
+  current_task=0;
+}
+
+taskQueue::~taskQueue()
+{
+  // set stop state
+  stopTasks();
+  // wait for the thread to be done
+  this->wait(1000);
+}
+
+// Set mode in a thread safe way
+void taskQueue::setState(status_enum state)
+{
+  mutex.lock();
+  current_state = state;
+  mutex.unlock();
+}
+
+// Append a task to the current list
+void taskQueue::addTask(taskInterface *task)
+{
+  mutex.lock();
+  if(tasks.empty() == true) {
+    // When the first task is inserted initialize the iterator
+    tasks.append(task);
+    //current = tasks.begin();
+    current_task = 0;
+  } else {
+    tasks.append(task);
+  }
+  mutex.unlock();
+
+  // Start processing tasks
+  startIfNotStarted();
+}
+
+// Stops thread after current task, deleting all tasks after that.
+void taskQueue::clearTasks(void)
+{
+  std::cout << "Clear called." << std::endl;
+  // Stop the tasks and wait for thread to finish
+  stopTasks();
+  // Wait for the thread to stop
+  wait();
+
+  // Free all tasks in the Task queue
+  mutex.lock();
+  tasks.clear();
+  qDeleteAll(tasks);
+  current_task=0;
+  mutex.unlock();
+}
+
+// Stops thread execution after current task
+void taskQueue::stopTasks(void)
+{
+  setState(state_stop);
+}
+
+// Get the current state
+taskQueue::status_enum taskQueue::getState()
+{
+  mutex.lock();
+  return this->current_state;
+  mutex.unlock();
+}
+
+// Runs inside the task thread
+void taskQueue::run(void)
+{
+  taskInterface* currentTask=NULL;
+
+  while(current_task < tasks.size() && current_state == state_run){
+    currentTask = tasks[current_task];
+    currentTask->start();
+    current_task++;
+  }
+
+  // State to idle
+  std::cout << "Task queue idle." << std::endl;
+  current_state = state_idle;
+}
+
+void taskQueue::startIfNotStarted()
+{
+  // Check if the thread is running
+  mutex.lock();
+  if(this->isRunning() == false) {
+    current_state = state_run;
+    this->start();
+  }
+  mutex.unlock();
+}
+
diff --git a/branches/qtswarmtv-downloader/taskqueue.hpp b/branches/qtswarmtv-downloader/taskqueue.hpp
new file mode 100644
index 0000000..159535a
--- /dev/null
+++ b/branches/qtswarmtv-downloader/taskqueue.hpp
@@ -0,0 +1,55 @@
+#ifndef TASKQUEUE_HPP
+#define TASKQUEUE_HPP
+
+#include <QThread>
+#include <QList>
+#include <QVector>
+#include <QMutex>
+
+#include <taskinterface.hpp>
+
+class taskQueue : public QThread
+{
+  Q_OBJECT
+public:
+  typedef	enum status_enum_t{state_idle=0, state_run, state_stop} status_enum;
+
+  explicit taskQueue(QObject *parent = 0);
+  ~taskQueue();
+
+  // Append a task to the current list
+  void addTask(taskInterface *task);
+  // Stops thread after current task, deleting all tasks after that.
+  void clearTasks(void);
+  // Stops thread execution after current task
+  void stopTasks(void);
+  // Get the current state
+  status_enum getState();
+
+  // Runs inside the task thread
+  void run(void);
+
+signals:
+public slots:
+private:
+  // Start thread if the thread is not running
+  void startIfNotStarted();
+  // Set mode in a thread safe way
+  void setState(status_enum state);
+
+  // Mutex to protect list and mode.
+  QMutex mutex;
+
+  // QList holding tasks
+  QVector<taskInterface*> tasks;
+  //QVector<taskInterface*>::iterator current;
+  int current_task;
+
+  /// modes:
+  // state_idle	: The task queue is not running.
+  // state_run	: The task queue is currently running.
+  // state_stop	: The execution of tasks stops after this task is finished.
+  status_enum current_state;
+};
+
+#endif
diff --git a/branches/qtswarmtv-downloader/testfilterdialog.cpp b/branches/qtswarmtv-downloader/testfilterdialog.cpp
new file mode 100644
index 0000000..b6ccc31
--- /dev/null
+++ b/branches/qtswarmtv-downloader/testfilterdialog.cpp
@@ -0,0 +1,115 @@
+#include <iostream>
+
+#include <stdio.h>
+#include <sqlite3.h>
+#include <stdlib.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+#include "testfilterdialog.hpp"
+#include "ui_testfilterdialog.h"
+#include "swarmtv.hpp"
+#include "singleton.h"
+#include "simplecell.hpp"
+#include "readablesize.hpp"
+
+testFilterDialog::testFilterDialog(simplefilter_struct &simple, QWidget *parent) :
+    QDialog(parent),
+    ui(new Ui::testFilterDialog)
+{
+  ui->setupUi(this);
+
+  // Set delete on close
+  setAttribute(Qt::WA_DeleteOnClose);
+
+  // Get the data from SwarmTv and Put it in the table
+  handleTest(simple);
+
+  // Set sizing
+  initHeaders();
+
+  // Show dialog
+  this->show();
+}
+
+testFilterDialog::~testFilterDialog()
+{
+    delete ui;
+}
+
+void testFilterDialog::handleTest(simplefilter_struct &simple)
+{
+  int rc=0;
+  newtorrents_container *newtorrents=NULL;
+
+  // Do Filter test
+  rc = rsstfindnewtorrents(&simple, &newtorrents, 150, 0);
+
+  // Fill Table
+  fillTable(newtorrents);
+
+  // Free container
+  rsstfreenewtorrentscontainer(newtorrents);
+}
+
+void testFilterDialog::fillTable(newtorrents_container *newtorrents)
+{
+  int count=0;
+  simpleCell *scell=NULL;
+  QLabel *cell=NULL;
+  QTableWidget *testTable=0;
+  readableSize readable;
+  std::string humansize;
+
+  // Get table handle
+  testTable = ui->testTableWidget;
+
+  // Set number of lines in table
+  testTable->setRowCount(newtorrents->nr);
+  std::cout << "row number " << newtorrents->nr << std::endl;
+
+  // Set data to table
+  while(count < newtorrents->nr){
+    scell = new(simpleCell);
+    scell->setText(newtorrents->newtorrent[count].title);
+    scell->setSimpleId(newtorrents->newtorrent[count].id);
+    testTable->setCellWidget(count, 0, scell);
+    cell = new(QLabel);
+    readable.setSize(newtorrents->newtorrent[count].size);
+    readable.getSize(humansize);
+    cell->setText(humansize.c_str());
+    testTable->setCellWidget(count, 1, cell);
+    cell = new(QLabel);
+    cell->setText(newtorrents->newtorrent[count].source);
+    testTable->setCellWidget(count, 2, cell);
+    cell = new(QLabel);
+    cell->setText(newtorrents->newtorrent[count].metatype);
+    testTable->setCellWidget(count, 3, cell);
+    cell = new(QLabel);
+
+    count++;
+  }
+}
+
+void testFilterDialog::initHeaders()
+{
+  // Make sure ui is set
+  if(ui == NULL){
+    std::cerr << "Set ui before calling initHeaders " << __FILE__ << ":" << __LINE__ << std::endl;
+  }
+
+  // Set title as filling
+  ui->testTableWidget->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
+
+  // Set Size static
+  ui->testTableWidget->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents);
+
+  // Set source static
+  ui->testTableWidget->horizontalHeader()->setResizeMode(2, QHeaderView::ResizeToContents);
+
+  // Set metatype static
+  ui->testTableWidget->horizontalHeader()->setResizeMode(3, QHeaderView::ResizeToContents);
+
+}
diff --git a/branches/qtswarmtv-downloader/testfilterdialog.hpp b/branches/qtswarmtv-downloader/testfilterdialog.hpp
new file mode 100644
index 0000000..a0fc030
--- /dev/null
+++ b/branches/qtswarmtv-downloader/testfilterdialog.hpp
@@ -0,0 +1,33 @@
+#ifndef TESTFILTERDIALOG_HPP
+#define TESTFILTERDIALOG_HPP
+
+#include <QDialog>
+
+#include <stdio.h>
+#include <sqlite3.h>
+#include <stdlib.h>
+
+extern "C" {
+#include <swarmtv.h>
+}
+
+namespace Ui {
+    class testFilterDialog;
+}
+
+class testFilterDialog : public QDialog
+{
+    Q_OBJECT
+
+public:
+    explicit testFilterDialog(simplefilter_struct &simple, QWidget *parent = 0);
+    ~testFilterDialog();
+
+private:
+    Ui::testFilterDialog *ui;
+    void handleTest(simplefilter_struct &simple);
+    void fillTable(newtorrents_container *newtorrents);
+    void initHeaders();
+};
+
+#endif // TESTFILTERDIALOG_HPP
diff --git a/branches/qtswarmtv-downloader/testfilterdialog.ui b/branches/qtswarmtv-downloader/testfilterdialog.ui
new file mode 100644
index 0000000..5063fa5
--- /dev/null
+++ b/branches/qtswarmtv-downloader/testfilterdialog.ui
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>testFilterDialog</class>
+ <widget class="QDialog" name="testFilterDialog">
+  <property name="windowModality">
+   <enum>Qt::ApplicationModal</enum>
+  </property>
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>820</width>
+    <height>455</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Test Filter</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="swarmtvqtresources.qrc">
+    <normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</normaloff>:/swarmtv/mainlogo/resources/swarmtv_logo.png</iconset>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <layout class="QVBoxLayout" name="verticalLayout">
+     <item>
+      <widget class="QTableWidget" name="testTableWidget">
+       <property name="minimumSize">
+        <size>
+         <width>800</width>
+         <height>400</height>
+        </size>
+       </property>
+       <property name="alternatingRowColors">
+        <bool>true</bool>
+       </property>
+       <property name="selectionMode">
+        <enum>QAbstractItemView::NoSelection</enum>
+       </property>
+       <property name="selectionBehavior">
+        <enum>QAbstractItemView::SelectRows</enum>
+       </property>
+       <attribute name="verticalHeaderVisible">
+        <bool>false</bool>
+       </attribute>
+       <column>
+        <property name="text">
+         <string>Title</string>
+        </property>
+       </column>
+       <column>
+        <property name="text">
+         <string>Size</string>
+        </property>
+       </column>
+       <column>
+        <property name="text">
+         <string>Source</string>
+        </property>
+       </column>
+       <column>
+        <property name="text">
+         <string>Meta type</string>
+        </property>
+       </column>
+      </widget>
+     </item>
+     <item>
+      <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="ClosePushButton">
+         <property name="text">
+          <string>Close</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="swarmtvqtresources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>ClosePushButton</sender>
+   <signal>clicked()</signal>
+   <receiver>testFilterDialog</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>255</x>
+     <y>275</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>254</x>
+     <y>149</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
diff --git a/branches/qtswarmtv-downloader/thetvdb.cpp b/branches/qtswarmtv-downloader/thetvdb.cpp
new file mode 100644
index 0000000..291cf60
--- /dev/null
+++ b/branches/qtswarmtv-downloader/thetvdb.cpp
@@ -0,0 +1,34 @@
+#include <stdlib.h>
+
+extern "C" {
+  #include <tvdb.h>
+}
+
+#include "thetvdb.hpp"
+
+theTvdb::theTvdb()
+{
+  tvdb = NULL;
+}
+
+theTvdb::theTvdb(char *apiKey)
+{
+  tvdb = tvdb_init(apiKey);
+}
+
+theTvdb::~theTvdb()
+{
+  tvdb_uninit(tvdb);
+}
+
+void theTvdb::initKey(char *apiKey)
+{
+  if(tvdb == 0) {
+    tvdb = tvdb_init(apiKey);
+  }
+}
+
+htvdb_t theTvdb::getTvdb()
+{
+  return tvdb;
+}
diff --git a/branches/qtswarmtv-downloader/thetvdb.hpp b/branches/qtswarmtv-downloader/thetvdb.hpp
new file mode 100644
index 0000000..1659a34
--- /dev/null
+++ b/branches/qtswarmtv-downloader/thetvdb.hpp
@@ -0,0 +1,21 @@
+#ifndef THETVDB_HPP
+#define THETVDB_HPP
+
+extern "C" {
+  #include <tvdb.h>
+}
+
+class theTvdb
+{
+public:
+    theTvdb();
+    theTvdb(char *apiKey);
+    ~theTvdb();
+
+    void initKey(char *apiKey);
+    htvdb_t getTvdb();
+private:
+    htvdb_t tvdb;
+};
+
+#endif // THETVDB_HPP
diff --git a/branches/qtswarmtv-episodes/settingsdialog.cpp b/branches/qtswarmtv-episodes/settingsdialog.cpp
index 5e9e533..37434a6 100644
--- a/branches/qtswarmtv-episodes/settingsdialog.cpp
+++ b/branches/qtswarmtv-episodes/settingsdialog.cpp
@@ -13,8 +13,7 @@ extern "C" {
 #include "singleton.h"
 #include "settingsdialog.hpp"
 #include "ui_settingsdialog.h"
-
-static const QString TVDB_API_CONFIG("config/tvdbapiconfig");
+#include "settingsname.hpp"

 settingsDialog::settingsDialog(QWidget *parent) :
     QDialog(parent),
@@ -47,6 +46,7 @@ void settingsDialog::show()
     return;
   }

+
   // Set retrieved values into setup
   ui->refreshLineEdit->setText("900");
   this->containerToUI(configitems);
diff --git a/branches/qtswarmtv-episodes/settingsname.hpp b/branches/qtswarmtv-episodes/settingsname.hpp
new file mode 100644
index 0000000..4b47252
--- /dev/null
+++ b/branches/qtswarmtv-episodes/settingsname.hpp
@@ -0,0 +1,11 @@
+#ifndef SETTINGSNAME_HPP
+#define SETTINGSNAME_HPP
+
+// Settings to store API key
+static const QString TVDB_API_CONFIG("config/tvdbapiconfig");
+
+// Settings to store what signals to show at trayicon
+static const QString TVDB_DBUS_SHOW_START("trayicon/showDbusStart");
+static const QString TVDB_DBUS_SHOW_STOP("trayicon/showDbusStop");
+
+#endif // SETTINGSNAME_HPP
diff --git a/tags/swarmtv-0.9.1/libswarmtv/createpc.sh b/tags/swarmtv-0.9.1/libswarmtv/createpc.sh
new file mode 100755
index 0000000..a90ce62
--- /dev/null
+++ b/tags/swarmtv-0.9.1/libswarmtv/createpc.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+cat libswarmtv/libswarmtv.pc.template | sed "s|@PREFIX@|${1}|" > libswarmtv.pc
diff --git a/trunk/qtswarmtv/getbannertask.cpp b/trunk/qtswarmtv/getbannertask.cpp
index ba37469..f9bd7e9 100644
--- a/trunk/qtswarmtv/getbannertask.cpp
+++ b/trunk/qtswarmtv/getbannertask.cpp
@@ -23,8 +23,6 @@ getBannerTask::getBannerTask(QObject *parent) :
 getBannerTask::getBannerTask(char *filename, QObject *parent) :
     QObject(parent)
 {
-  std::cout << "Filename set: " << filename << std::endl;
-
   theTvdb *htvdb=NULL;
   this->tvdb = htvdb->getTvdb();

@@ -35,7 +33,6 @@ getBannerTask::getBannerTask(char *filename, QObject *parent) :
 getBannerTask::getBannerTask(char *filename, theTvdb *htvdb, QObject *parent) :
     QObject(parent)
 {
-  std::cout << "Filename set: " << filename << std::endl;
   this->tvdb=htvdb->getTvdb();
   this->filename=strdup(filename);
   memset(&bannerData, 0, sizeof(tvdb_buffer_t));
@@ -44,7 +41,6 @@ getBannerTask::getBannerTask(char *filename, theTvdb *htvdb, QObject *parent) :
 getBannerTask::getBannerTask(char* filename, htvdb_t tvdb, QObject *parent) :
     QObject(parent)
 {
-  std::cout << "Filename set: " << filename << std::endl;
   this->tvdb=tvdb;
   this->filename=strdup(filename);
   memset(&bannerData, 0, sizeof(tvdb_buffer_t));
@@ -62,7 +58,6 @@ void getBannerTask::setFilename(char *filename)
     free(this->filename);
   }

-  std::cout << "Filename set: " << filename << std::endl;
   this->filename = strdup(filename);
 }

@@ -75,13 +70,11 @@ void getBannerTask::start(void)
 {
   int rc=NULL;

-  std::cout << "Task started, getting: " << filename << std::endl;
   rc = tvdb_banners(tvdb, filename, &bannerData);
   if(rc == TVDB_OK) {
     emit bannerReady(&bannerData);
   } else {
     emit bannerFailed();
   }
-  std::cout << "Task done." << std::endl;
 }

diff --git a/trunk/qtswarmtv/serieslistcontrol.cpp b/trunk/qtswarmtv/serieslistcontrol.cpp
index ada6cf9..c3f030c 100644
--- a/trunk/qtswarmtv/serieslistcontrol.cpp
+++ b/trunk/qtswarmtv/serieslistcontrol.cpp
@@ -10,7 +10,6 @@ extern "C" {
 #include "singleton.h"
 #include "serieslistcontrol.hpp"
 #include "serieswidget.hpp"
-#include "singleton.h"
 #include "thetvdb.hpp"
 #include "simpleeditdialog.hpp"
 #include "getseriestask.hpp"
diff --git a/trunk/swarmtv/libswarmtv/createpc.sh b/trunk/swarmtv/libswarmtv/createpc.sh
new file mode 100755
index 0000000..a90ce62
--- /dev/null
+++ b/trunk/swarmtv/libswarmtv/createpc.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+cat libswarmtv/libswarmtv.pc.template | sed "s|@PREFIX@|${1}|" > libswarmtv.pc