From: lvaatamoinen Date: Mon, 19 Oct 2009 13:59:20 +0000 (+0000) Subject: - code commit X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=commitdiff_plain;h=033e50732cef6dd961ac23dcd6371c873114ebe9 - code commit git-svn-id: file:///svnroot/qtrapids/trunk@4 42ac0dd5-4c8c-4c71-bb3e-ecdfe252ffda --- diff --git a/src/engine/engine.pro b/src/engine/engine.pro new file mode 100644 index 0000000..566e172 --- /dev/null +++ b/src/engine/engine.pro @@ -0,0 +1,2 @@ +TEMPLATE = subdirs + diff --git a/src/gui/DownloadView.cpp b/src/gui/DownloadView.cpp new file mode 100644 index 0000000..a589e39 --- /dev/null +++ b/src/gui/DownloadView.cpp @@ -0,0 +1,33 @@ +/*************************************************************************** + * Copyright (C) 2009 by Lassi Väätämöinen * + * lassi.vaatamoinen@ixonos.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "DownloadView.h" + +DownloadView::DownloadView(QWidget* parent): QTreeWidget(parent) +{ + setRootIsDecorated(false); // Hide branch lines, making one-level treeview (similar to list) + setHeaderItem(DownloadViewItem::getHeaderItem()); +} + + +DownloadView::~DownloadView() +{ +} + + diff --git a/src/gui/DownloadView.h b/src/gui/DownloadView.h new file mode 100644 index 0000000..07ec860 --- /dev/null +++ b/src/gui/DownloadView.h @@ -0,0 +1,79 @@ +/*************************************************************************** + * Copyright (C) 2009 by Lassi Väätämöinen * + * lassi.vaatamoinen@ixonos.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DOWNLOADVIEW_H +#define DOWNLOADVIEW_H + +#include + +/** + @author Lassi Väätämöinen +*/ +class DownloadView : public QTreeWidget +{ +Q_OBJECT + + public: + DownloadView(QWidget* parent); + + ~DownloadView(); + + private: + +}; + + +/** + @class DownloadViewItem + @brief Represents one item row of DownloadView +*/ +class DownloadViewItem : public QTreeWidgetItem { + + public: + + DownloadViewItem(QTreeWidget* parent, int type) : + QTreeWidgetItem(parent, type = QTreeWidgetItem::UserType) + { + }; + + DownloadViewItem(const QStringList& strings, + int type = QTreeWidgetItem::UserType ) : + QTreeWidgetItem (strings, type = Type) + { + }; + + + /// @return An item comprising of string list, suitable for QTableView + /// header. + static DownloadViewItem *getHeaderItem() + { + DownloadViewItem *item + = new DownloadViewItem(QStringList() << "Name" + << "Size" << "Status" + << "Progress" << "DL speed" + << "UL speed" << "Seeds/Leechers" + << "ratio" << "ETA"); + + return item; + } + + /// @todo QTorrentHandle as one hidden column +}; + +#endif diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp new file mode 100644 index 0000000..bbd5433 --- /dev/null +++ b/src/gui/MainWindow.cpp @@ -0,0 +1,31 @@ +/*************************************************************************** + * Copyright (C) 2009 by Lassi Väätämöinen * + * lassi.vaatamoinen@ixonos.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "MainWindow.h" + +MainWindow::MainWindow() +{ +} + + +MainWindow::~MainWindow() +{ +} + + diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h new file mode 100644 index 0000000..59b472f --- /dev/null +++ b/src/gui/MainWindow.h @@ -0,0 +1,48 @@ +/*************************************************************************** + * Copyright (C) 2009 by Lassi Väätämöinen * + * lassi.vaatamoinen@ixonos.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + + +class QTabWidget; + +/** + @author Lassi Väätämöinen +*/ +class MainWindow : public QMainWindow { + Q_OBJECT + + public: + MainWindow(); + + ~MainWindow(); + + public slots: + private slots: + + private: + QTabWidget *tabWidget_; + + +}; + +#endif diff --git a/src/gui/SeedView.cpp b/src/gui/SeedView.cpp new file mode 100644 index 0000000..3e8d526 --- /dev/null +++ b/src/gui/SeedView.cpp @@ -0,0 +1,31 @@ +/*************************************************************************** + * Copyright (C) 2009 by Lassi Väätämöinen * + * lassi.vaatamoinen@ixonos.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "SeedView.h" + +SeedView::SeedView(QWidget* parent): QTreeWidget(parent) +{ +} + + +SeedView::~SeedView() +{ +} + + diff --git a/src/gui/SeedView.h b/src/gui/SeedView.h new file mode 100644 index 0000000..ef42f6b --- /dev/null +++ b/src/gui/SeedView.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2009 by Lassi Väätämöinen * + * lassi.vaatamoinen@ixonos.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SEEDVIEW_H +#define SEEDVIEW_H + +#include + +/** + @author Lassi Väätämöinen +*/ +class SeedView : public QTreeWidget +{ +Q_OBJECT + public: + SeedView(QWidget* parent); + + ~SeedView(); + + private: + // Name + // Size + // Status + // UP speed + // Seeds/Leechers + // Connected peers + // total uploaded + // ratio +}; + +#endif diff --git a/src/gui/gui.pro b/src/gui/gui.pro new file mode 100644 index 0000000..78ba94a --- /dev/null +++ b/src/gui/gui.pro @@ -0,0 +1,15 @@ +SOURCES += DownloadView.cpp \ +MainWindow.cpp \ +SeedView.cpp \ + main.cpp +HEADERS += DownloadView.h \ +MainWindow.h \ +SeedView.h +TEMPLATE = app + +TARGET = qtrapids + +CONFIG -= release + +CONFIG += debug + diff --git a/src/gui/main.cpp b/src/gui/main.cpp new file mode 100644 index 0000000..0366a84 --- /dev/null +++ b/src/gui/main.cpp @@ -0,0 +1,40 @@ +/*************************************************************************** + * Copyright (C) 2009 by Lassi Väätämöinen * + * lassi.vaatamoinen@ixonos.com * + * * + * 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 2 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, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include "DownloadView.h" + +int main(int argc, char *argv[]) +{ + // Q_INIT_RESOURCE(application); + QApplication app(argc, argv); + DownloadView* dlw = new DownloadView(NULL); + //qtrapids * mw = new qtrapids(); + dlw->show(); + DownloadViewItem* dlwItem = new DownloadViewItem(QStringList() << "Name" + << "Size" << "Status" + << "Progress" << "DL speed" + << "UL speed" << "Seeds/Leechers" + << "ratio"); + dlwItem->insertChild(0, new DownloadViewItem(QStringList() << "Name")); + dlw->insertTopLevelItem(0,dlwItem); + qDebug() << dlw->columnCount(); + return app.exec(); +} diff --git a/src/src.pro b/src/src.pro new file mode 100644 index 0000000..c6c5594 --- /dev/null +++ b/src/src.pro @@ -0,0 +1,14 @@ +SUBDIRS += gui \ + engine +SOURCES += qtrapids.cpp \ + main.cpp +HEADERS += qtrapids.h +CONFIG += warn_on \ + thread \ + qt +TARGET = qtrapids +DESTDIR = ../bin +RESOURCES = application.qrc + +TEMPLATE = subdirs +