Desktop UI: Use common podcast and episode list model
This commit is contained in:
parent
fa9586bbdb
commit
300643918a
1 changed files with 4 additions and 8 deletions
|
@ -16,9 +16,7 @@ ApplicationWindow {
|
||||||
|
|
||||||
onReadyChanged: {
|
onReadyChanged: {
|
||||||
if (ready) {
|
if (ready) {
|
||||||
py.call('main.load_podcasts', [], function (podcasts) {
|
podcastListModel.reload();
|
||||||
Util.updateModelFrom(podcastListModel, podcasts);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +30,7 @@ ApplicationWindow {
|
||||||
|
|
||||||
TableView {
|
TableView {
|
||||||
width: 200
|
width: 200
|
||||||
model: ListModel { id: podcastListModel }
|
model: GPodderPodcastListModel { id: podcastListModel }
|
||||||
headerVisible: false
|
headerVisible: false
|
||||||
alternatingRowColors: false
|
alternatingRowColors: false
|
||||||
|
|
||||||
|
@ -72,15 +70,13 @@ ApplicationWindow {
|
||||||
|
|
||||||
onCurrentRowChanged: {
|
onCurrentRowChanged: {
|
||||||
var id = podcastListModel.get(currentRow).id;
|
var id = podcastListModel.get(currentRow).id;
|
||||||
py.call('main.load_episodes', [id], function (episodes) {
|
episodeListModel.loadEpisodes(id);
|
||||||
Util.updateModelFrom(episodeListModel, episodes);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TableView {
|
TableView {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
model: ListModel { id: episodeListModel }
|
model: GPodderEpisodeListModel { id: episodeListModel }
|
||||||
|
|
||||||
TableViewColumn { role: 'title'; title: 'Title' }
|
TableViewColumn { role: 'title'; title: 'Title' }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue