From c3f8ee64e905cdb103b5bfa07525fb4e85c31120 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 24 Jul 2013 11:49:27 -0500 Subject: Initial import of kasablanca 0.4.0.2 --- src/kbtaskview.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/kbtaskview.cpp (limited to 'src/kbtaskview.cpp') diff --git a/src/kbtaskview.cpp b/src/kbtaskview.cpp new file mode 100644 index 0000000..d1f6cc1 --- /dev/null +++ b/src/kbtaskview.cpp @@ -0,0 +1,64 @@ +// +// C++ Implementation: kbtaskview +// +// Description: +// +// +// Author: Magnus Kulke , (C) 2004 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include + +#include +#include + +#include "kbtaskview.h" +#include "kbfileinfo.h" +#include "kbtransferitem.h" + +KbTaskView::KbTaskView(QWidget *parent, const char *name) + : KListView(parent, name) +{ + addColumn(i18n("Task")); + addColumn(i18n("Progress")); + addColumn(i18n("Speed")); + addColumn(i18n("Percentage")); + addColumn(i18n("Remaining")); + + setRootIsDecorated(true); + setSelectionMode(QListView::Extended); + setDragEnabled(true); + setAcceptDrops(true); + + //connect(this, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), + // this, SLOT(SLOT_DoubleClicked(QListViewItem*, const QPoint&, int))); +} + +KbTaskView::~KbTaskView() +{ +} + +QListViewItem* KbTaskView::LastChild() +{ + QListViewItem* last = NULL; + QListViewItem* it = lastItem(); + while (it) + { + last = it; + it = it->parent(); + } + return last; +} + +void KbTaskView::SLOT_DoubleClicked(QListViewItem* item, const QPoint&, int) +{ + KbTransferItem *kti = static_cast(item); + qWarning("src: %s|%s", kti->SrcFileInfo()->filePath().latin1(), kti->SrcFileInfo()->fileName().latin1()); + qWarning("dst: %s|%s", kti->DstFileInfo()->filePath().latin1(), kti->DstFileInfo()->fileName().latin1()); +} + +#include "kbtaskview.moc" -- cgit v1.2.1