2
Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
3
Copyright (C) 2010 Volker Krause <vkrause@kde.org>
5
This library is free software; you can redistribute it and/or modify it
6
under the terms of the GNU Library General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or (at your
8
option) any later version.
10
This library is distributed in the hope that it will be useful, but WITHOUT
11
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13
License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to the
17
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23
import org.kde.pim.mobileui 4.5
28
width: QML.ListView.width
31
function iconForStatus( online, status )
34
return "images/status/offline.png";
38
return "images/status/online.png"
39
} else if ( status == 1 ) {
40
return "images/status/receiving.png";
42
return KDE.iconPath( "dialog-warning", 26 );
46
function statusMessage( msg, progress )
48
if ( progress <= 0 || progress >= 100 )
50
return KDE.i18nc( "status message (50%)", "%1 (%2%)", msg, progress );
56
opacity: (_delegateTopLevel.QML.ListView.isCurrentItem ? 0.25 : 0)
57
color: "lightsteelblue"
66
anchors { top: parent.top; left: parent.left }
67
source: iconForStatus( model.online, model.status )
72
anchors { verticalCenter: statusIcon.verticalCenter; left: statusIcon.right }
73
width: parent.width - statusIcon.width
74
elide: QML.Text.ElideRight
80
anchors { left: nameLabel.left; top: nameLabel.bottom; topMargin: 2 }
81
width: nameLabel.width
83
elide: QML.Text.ElideRight
84
text: statusMessage( model.statusMessage, model.progress )
91
onClicked: { _delegateTopLevel.QML.ListView.view.currentIndex = model.index; }