summaryrefslogtreecommitdiffstats
path: root/src/kbtaskview.cpp
blob: d1f6cc1a3b1a8c470925c34132c18dfbe5379dcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// C++ Implementation: kbtaskview
//
// Description: 
//
//
// Author: Magnus Kulke <mkulke@magnusmachine>, (C) 2004
//
// Copyright: See COPYING file that comes with this distribution
//
//


#include <klocale.h>

#include <qptrlist.h>
#include <qevent.h>

#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<KbTransferItem*>(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"