summaryrefslogtreecommitdiffstats
path: root/src/kbtaskview.cpp
blob: 9b00adf8e04cfe34984fcbac6031ff579c29de95 (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 <tdelocale.h>

#include <tqptrlist.h>
#include <tqevent.h>

#include "kbtaskview.h"
#include "kbfileinfo.h"
#include "kbtransferitem.h"

KbTaskView::KbTaskView(TQWidget *parent, const char *name)
 : TDEListView(parent, name)
{
	addColumn(i18n("Task"));
	addColumn(i18n("Progress"));
	addColumn(i18n("Speed"));
	addColumn(i18n("Percentage"));
	addColumn(i18n("Remaining"));
	
	setRootIsDecorated(true);
	setSelectionMode(TQListView::Extended);
	setDragEnabled(true);
	setAcceptDrops(true);
		
	//connect(this, SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)),
	//	this, SLOT(SLOT_DoubleClicked(TQListViewItem*, const TQPoint&, int)));
}

KbTaskView::~KbTaskView()
{
}

TQListViewItem* KbTaskView::LastChild()
{
	TQListViewItem* last = NULL;
	TQListViewItem* it = lastItem();
	while (it)
	{
		last = it;
		it = it->parent();
	}
	return last;
}

void KbTaskView::SLOT_DoubleClicked(TQListViewItem* item, const TQPoint&, int)
{
	KbTransferItem *kti = static_cast<KbTransferItem*>(item);
	tqWarning("src: %s|%s", kti->SrcFileInfo()->filePath().latin1(), kti->SrcFileInfo()->fileName().latin1());
	tqWarning("dst: %s|%s", kti->DstFileInfo()->filePath().latin1(), kti->DstFileInfo()->fileName().latin1());
}

#include "kbtaskview.moc"