Add notes and titles to presentation-serviceitem when creating it, and updated stageview to show title+thumbnail+notes.

This commit is contained in:
Tomas Groth 2014-07-14 11:58:05 +02:00
parent 022ac9bfac
commit 06110df08b
2 changed files with 28 additions and 3 deletions

View File

@ -323,11 +323,18 @@ class PresentationMediaItem(MediaManagerItem):
i = 1
img = doc.get_thumbnail_path(i, True)
if img:
# Get titles and notes
titles, notes = doc.get_titles_and_notes()
while img:
service_item.add_from_command(path, name, img)
service_item.add_from_command(path, name, img, titles[i - 1], notes[i - 1])
i += 1
img = doc.get_thumbnail_path(i, True)
doc.close_presentation()
if titles.count('') != len(titles):
service_item.add_capability(ItemCapabilities.HasDisplayTitle)
if notes.count('') != len(notes):
service_item.add_capability(ItemCapabilities.HasNotes)
service_item.add_capability(ItemCapabilities.HasThumbnails)
return True
else:
# File is no longer present

View File

@ -102,7 +102,21 @@ window.OpenLP = {
$("#verseorder span").removeClass("currenttag");
$("#tag" + OpenLP.currentTags[OpenLP.currentSlide]).addClass("currenttag");
var slide = OpenLP.currentSlides[OpenLP.currentSlide];
var text = slide["text"];
var text = "";
// use title if available
if (slide["title"]) {
text = slide["title"];
} else {
text = slide["text"];
}
// use thumbnail if available
if (slide["img"]) {
text += "<br /><img src='" + slide["img"] + "'><br />";
}
// use notes if available
if (slide["notes"]) {
text += '<br />' + slide["notes"];
}
text = text.replace(/\n/g, "<br />");
$("#currentslide").html(text);
text = "";
@ -110,7 +124,11 @@ window.OpenLP = {
for (var idx = OpenLP.currentSlide + 1; idx < OpenLP.currentSlides.length; idx++) {
if (OpenLP.currentTags[idx] != OpenLP.currentTags[idx - 1])
text = text + "<p class=\"nextslide\">";
text = text + OpenLP.currentSlides[idx]["text"];
if (OpenLP.currentSlides[idx]["title"]) {
text = text + OpenLP.currentSlides[idx]["title"];
} else {
text = text + OpenLP.currentSlides[idx]["text"];
}
if (OpenLP.currentTags[idx] != OpenLP.currentTags[idx - 1])
text = text + "</p>";
else