summaryrefslogtreecommitdiffstats
path: root/noatun/modules/simple/propertiesdialog.ui.h
blob: 5a3953c8f14165aba83139e58b8ea6adf0cf4c71 (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
/*
   This file is part of KDE/aRts (Noatun) - xine integration
   Copyright (C) 2002 Ewald Snel <ewald@rambo.its.tudelft.nl>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
*/

#include <klocale.h>

void PropertiesDialog::setPlayObject( PlaylistItem pi, Arts::PlayObject po )
{
    // Arts::PlayObject properties
    if (!po.isNull())
    {
	Arts::poCapabilities ncaps = po.capabilities();
	TQCheckListItem *item;

	descriptionLabel->setText( po.description().c_str() );

	// Determine capabilities
	if (!(item = (TQCheckListItem *)capsList->findItem( "capSeek", 0 )))
	{
	    item = new TQCheckListItem( capsList, "capSeek",
				       TQCheckListItem::CheckBox );
	}
	item->setOn( (ncaps & Arts::capSeek) );

	if (!(item = (TQCheckListItem *)capsList->findItem( "capPause", 0 )))
	{
	    item = new TQCheckListItem( capsList, "capPause",
				       TQCheckListItem::CheckBox );
	}
	item->setOn( (ncaps & Arts::capPause) );

	// Defaults
	nameField->setText( i18n("unknown") );
	typeLabel->setText( i18n("unknown") );
	lengthLabel->setText( i18n("unknown") );
	audioLabel->setText( i18n("unknown") );
	videoLabel->setText( i18n("unknown") );
    }

    // PlaylistItem properties (name and mimetype)
    if (!pi.isNull())
    {
	setCaption( i18n("Properties for %1").arg(pi.url().fileName()) );

	TDESharedPtr<KMimeType> mime = KMimeType::mimeType( pi.mimetype() );
	iconLabel->setPixmap( mime->pixmap( TDEIcon::Desktop, TDEIcon::SizeMedium ) );

	nameField->setText( pi.url().fileName() );
	typeLabel->setText( pi.mimetype() );
	lengthLabel->setText( pi.lengthString() );
    }
}