4 import com.nokia.meego 1.0
6 import 'config.js' as Config
10 property string currentFilterText
12 property alias model: listView.model
13 property alias moving: listView.moving
14 property alias count: listView.count
16 signal episodeContextMenu(variant episode)
18 function showFilterDialog() {
22 function resetSelection() {
23 listView.openedIndex = -1
27 filterDialog.resetSelection();
31 anchors.centerIn: parent
34 horizontalAlignment: Text.AlignHCenter
35 text: '<big>' + _('No episodes') + '</big>' + '<br><small>' + _('Touch to change filter') + '</small>'
36 visible: !listView.visible
40 onClicked: episodeList.showFilterDialog()
47 property int openedIndex: -1
53 height: listItem.opened?(Config.listItemHeight + Config.smallSpacing * 3 + Config.headerHeight):(Config.listItemHeight)
55 property bool opened: (index == listView.openedIndex)
58 source: 'artwork/episode-background.png'
64 visible: listItem.opened
70 source: listItem.opened?'EpisodeActions.qml':''
72 Behavior on opacity { PropertyAnimation { } }
74 opacity: listItem.opened
78 item.episode = modelData
86 topMargin: episodeItem.y + episodeItem.height
93 Behavior on height { PropertyAnimation { } }
97 y: listItem.opened?Config.smallSpacing:0
100 if (listView.openedIndex == index) {
101 listView.openedIndex = -1
103 listView.openedIndex = index
106 onContextMenu: episodeList.episodeContextMenu(item)
108 Behavior on y { PropertyAnimation { } }
114 flickableItem: listView
119 titleText: _('Show episodes')
121 function resetSelection() {
122 selectedIndex = episodeList.model.getFilter();
127 episodeList.currentFilterText = model.get(selectedIndex).name;
128 episodeList.model.setFilter(selectedIndex);
133 Component.onCompleted: {
134 var filters = controller.getEpisodeListFilterNames();
136 for (var index in filters) {
137 model.append({name: filters[index]});