Initial commit

This commit is contained in:
Niels
2025-05-30 16:03:59 +02:00
commit 73a6841c08
34 changed files with 5064 additions and 0 deletions
+84
View File
@@ -0,0 +1,84 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
Page {
Flickable {
id: flick
width:parent.width
height: parent.height - Theme.paddingLarge * 3
anchors.top: parent.top
anchors.topMargin: Theme.paddingLarge * 3
contentHeight: column1.height
Column {
id: column1
width: parent.width
spacing: Theme.paddingLarge
Row {
//width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.paddingLarge * 2
Image{
source: "../harbour-labyrinth.png"
height: Theme.itemSizeExtraLarge
width: height
fillMode: Image.PreserveAspectFit
//anchors.horizontalCenter: parent.horizontalCenter
}
Column{
id: column2
anchors.verticalCenter: parent.verticalCenter
//width: parent.width
//spacing: Theme.paddingLarge
Label {
font.pixelSize: Theme.fontSizeExtraLarge
font.bold: true
text: "Labyrinth v"+ Qt.application.version
//anchors.horizontalCenter: parent.horizontalCenter
}
Label {
text: "(License: WTFPL)"
font.pixelSize: Theme.fontSizeSmall
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
Separator {
width: parent.width
anchors.margins: Theme.paddingSmall
anchors.horizontalCenter: parent.horizontalCenter
//height: Theme.itemSizeSmall
}
Text {
width: parent.width-(Theme.paddingLarge * 2)
font.pixelSize: Theme.fontSizeExtraSmall
text:"<p>DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE</p>
<p>Version 2, December 2004</p>
<p>Copyright (C) 2004 Sam Hocevar <sam@hocevar.net></p>
<p>Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.</p>
<p>DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</p>
<p>0. You just DO WHAT THE FUCK YOU WANT TO.</p>"
color: Theme.primaryColor
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
}
Separator {
width: parent.width
anchors.margins: Theme.paddingSmall
anchors.horizontalCenter: parent.horizontalCenter
//height: Theme.itemSizeSmall
}
}
}
}
+55
View File
@@ -0,0 +1,55 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import "../JSONListModel"
import "../delegates"
Page {
id: page
property string showname: ""
property string showimage: ""
property string summary: ""
property string showid: ""
property string actorname: ""
property string filter: ""
//property string country: "DK"
//property string _country: country ? "?country="+country : ""
//property string jsonSource: "http://api.tvmaze.com/schedule"+_country
SilicaListView {
id: listView
anchors.fill: parent
clip: true
JSONListModel {
id: jsonModel1
source: "http://api.tvmaze.com/people/"+showid+"/castcredits?embed=show" //"http://api.tvmaze.com/schedule?country=US&date="+Qt.formatDateTime(new Date(), "yyyy-MM-dd") //2016-07-16" //+filter
query: "$[*]._embedded.show."
}
model: jsonModel1.model
BusyIndicator {
id: busyIndicator
running: !jsonModel1.jsonready
size: BusyIndicatorSize.Large
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
header: PageHeader {
id: pHeader
title: actorname
description: "Known for"
}
delegate: ShowDelegate {}
ViewPlaceholder {
enabled: listView.count == 0 && jsonModel1.jsonready
text: "No TVmaze data"
hintText: "no information about cast"
}
}
}
+153
View File
@@ -0,0 +1,153 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import "../JSONListModel"
Page {
id: page
property string showname: ""
property string showimage: ""
property string summary: ""
property string showid: ""
property string jsonSource: "http://api.tvmaze.com/schedule"+_country //"date="+Qt.formatDateTime(new Date(), "yyyy-MM-dd")
//property string filter: ""
property string country: ""
//property string date: ""
property string _country: country ? "?country="+country : ""
//property string _date: date ? ""
SilicaListView {
id: listView
anchors.fill: parent
clip: true
JSONListModel {
id: jsonModel1
source: "http://api.tvmaze.com/shows/"+showid+"/cast" //"http://api.tvmaze.com/schedule?country=US&date="+Qt.formatDateTime(new Date(), "yyyy-MM-dd") //2016-07-16" //+filter
query: "$[*]"
}
model: jsonModel1.model
BusyIndicator {
id: busyIndicator
running: !jsonModel1.jsonready
size: BusyIndicatorSize.Large
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
header: PageHeader {
id: pHeader
title: showname
description: "Main cast"
}
delegate: BackgroundItem {
id: myListItem
width: ListView.view.width
height: (showImg.height + showRect.height ) * showImg.scale
OpacityRampEffect {
sourceItem: showRect
direction: OpacityRamp.TopToBottom
offset: 0.0
slope: 1.0
}
Rectangle {
id: showRect
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: firstName.height + Theme.paddingLarge
color: Theme.rgba(Theme.highlightBackgroundColor, Theme.highlightBackgroundOpacity)
}
Image {
id: nextIcon
anchors.verticalCenter: showRect.verticalCenter
anchors.right: showRect.right
anchors.rightMargin: Theme.paddingMedium
source: "image://theme/icon-m-right"
}
Image {
id: seenIcon
visible: false
anchors.right: parent.right
anchors.bottom: showImg.bottom
anchors.rightMargin: Theme.paddingMedium
source: "image://theme/icon-m-acknowledge"
}
Image {
id: showImg
property int errorCount: 0
anchors.top: showRect.bottom
anchors.margins: Theme.paddingLarge
// anchors.topMargin: Theme.paddingLarge
// anchors.leftMargin: Theme.paddingLarge
anchors.left: parent.left
// width: parent.width * 0.4
// height: parent.height
scale: 1.2
fillMode: Image.PreserveAspectFit
source: model.person.image ? model.person.image.medium ? model.person.image.medium : "../No-Image-.png" : "../No-Image-.png"
}
Text {
id: firstName
text: model.person.name !== null ? model.person.name : ""
color: highlighted ? Theme.highlightColor : Theme.primaryColor
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: showRect.verticalCenter
wrapMode: Text.ElideRight
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeLarge
}
Text {
id: showType
text: model.character.name !== null ? "<u>Character</u><br><b>" + model.character.name + "</b>" : ""
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.WordWrap
anchors.bottomMargin: Theme.paddingLarge
anchors.bottom: showImg.bottom
anchors.left: showImg.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingLarge * showImg.scale
anchors.rightMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
onPressAndHold: {
pageStack.push(Qt.resolvedUrl("ShowImg.qml"),{"img": model.person.image ? model.person.image.medium ? model.person.image.medium : "../No-Image-.png" : "../No-Image-.png"})
//window.pageStack.push(Qt.resolvedUrl("SeasonsPage.qml"),{"showid": model.id,"showname": showname,"showimage": showImg.source} )
}
onClicked: {
// frompage = pageStack.currentPage
pageStack.push(Qt.resolvedUrl("CastInfoPage.qml"),
{"showid": model.person.id,"actorname": model.person.name,"showname": showname, "showimage": showImg.source, "summary": model.summary})
}
}
PullDownMenu {
MenuItem {
text: qsTr("Show seasons")
onClicked: pageStack.replace(Qt.resolvedUrl("SeasonsPage.qml"),{"showid": showid,"showname": showname,"showimage": showimage},PageStackAction.Immediate )
}
}
ViewPlaceholder {
enabled: listView.count == 0 && jsonModel1.jsonready
text: "No TVmaze data"
hintText: "no information about cast"
}
}
}
+554
View File
@@ -0,0 +1,554 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import "../JSONListModel"
import Nemo.Notifications 1.0
Page {
id: page
//property int ny: 0
SilicaListView {
id: listView
anchors.fill: parent
clip: true
model: favorites
header: PageHeader {
id: pHeader
title: "Favorites"
}
delegate: ListItem {
id: showDelegate
width: ListView.view.width
property string f_name: name ? name : ""
property string f_summary: summary ? summary : ""
property string f_stat: status ? status : ""
property string f_premiered: premiered ? premiered : ""
property string f_rating: rating ? rating : ""
property int f_updated: updated ? updated : ""
property string f_imdb: imdb ? imdb : ""
property string f_official: official ? official : ""
property string f_network: network ? network : ""
property string f_image: image ? image : "../No-Image-.png"
property string f_next: next ? next : ""
property string f_nextse: nextse ? nextse : ""
property string f_prev: prev ? prev : ""
property bool f_upd: false
property bool running: false
property bool ended: false
property bool max: false
contentHeight: showImg.height + showName.height + (Theme.paddingLarge * 4)
Notification {
id: notification
category: "Update"
//summary: "Updated tv show"
//itemCount: favorites.count
//itemCount: favorites.count
//expireTimeout: 0
//itemCount: favorites.count
}
JSONSimple {
id: updateFavorite
source: "http://api.tvmaze.com/shows/"+showid
onReadyChanged: {
if (ready) {
if (updated !== simple.updated ) {
var ne
var nese
var pr
f_upd = true
f_name = simple.name
f_summary = simple.summary
f_stat = simple.status
simple.premiered ? f_premiered = simple.premiered : f_premiered = ""
f_rating = simple.rating.average
f_updated = simple.updated
//officialSite ? sofficial = officialSite : ""
simple.externals.imdb ? f_imdb = simple.externals.imdb : f_imdb = ""
simple.officialSite ? f_official = simple.officialSite : f_official = ""
simple.webChannel ? f_network = simple.webChannel.name : f_network = simple.network.name
f_image = simple.image.medium
simple._links.previousepisode ? pr = simple._links.previousepisode.href : pr = ""
simple._links.nextepisode ? ne = simple._links.nextepisode.href : ne = ""
// console.log(simple.officialSite)
if (pr !== "") {
prevshow.showNlink = ne
prevshow.showPlink = pr
prevshow.source = pr
} else {
if (next !== ""){
nextshow.source = ne
} else {
doneUdating = true
}
}
updateFav(showid, f_name, f_image, f_summary, f_stat, f_premiered, f_rating, f_network, f_updated, f_imdb, f_official)
}
//console.log("IMDB: "+f_imdb)
}
}
}
JSONSimple {
id: nextshow
//property string showid: ""
property string showNlink: ""
property string ne: ""
property string nese: ""
onReadyChanged: {
if (ready) {
console.log(" ---- UPDATING NEXTSHOW")
simple.airdate ? ne = simple.airdate : ne = "?"
ne !== "?" ? nese = "S"+simple.season+"E"+simple.number : nese = ""
f_next = ne
f_nextse = nese
console.log(f_name+" has been updated. ")
updateNext(showid, ne, nese)
notification.summary = f_name
notification.subText = "Labyrinth"
notification.body = "Next episode: "+f_next
//notification.text = "Next episode: "+f_next
notification.publish()
//doneUdating = true
}
}
}
JSONSimple {
id: prevshow
//property string showid: ""
property string showPlink: ""
property string showNlink: ""
property string pr: ""
onReadyChanged: {
if (ready) {
console.log(" ---- UPDATING PREVSHOW")
simple.airdate ? pr = simple.airdate : pr = "?"
f_prev = pr
updatePrev(showid, pr)
if (showNlink !== "") {
//nextshow.showid = showid
//nextShow.showNlink = showNlink
nextshow.source = showNlink
} else {
f_next = "?"
f_nextse = ""
updateNext(showid, "?", "")
//doneUdating = true
}
}
}
}
function showRemorseItem() {
var idx = index
remorseAction("Removing "+name+" from favorites!", function() {delFav(showid);listView.model.remove(idx)})
}
OpacityRampEffect {
sourceItem: showRect
direction: OpacityRamp.TopToBottom
offset: 0.0
slope: 1.0
}
Rectangle {
id: showRect
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: showName.height + Theme.paddingLarge
color: Theme.rgba(Theme.highlightBackgroundColor, Theme.highlightBackgroundOpacity)
}
Image {
id: nextIcon
anchors.verticalCenter: showRect.verticalCenter
anchors.right: showRect.right
anchors.rightMargin: Theme.paddingMedium
source: "image://theme/icon-m-right"
}
Image {
id: seenIcon
visible: false
anchors.right: parent.right
anchors.bottom: showImg.bottom
anchors.rightMargin: Theme.paddingMedium
source: "image://theme/icon-m-acknowledge"
}
Text {
id: showName
//text: ""
text: f_name
color: highlighted ? Theme.highlightColor : Theme.primaryColor
anchors.leftMargin: Theme.paddingMedium
anchors.rightMargin: Theme.paddingMedium
anchors.left: parent.left
anchors.right: nextIcon.left
anchors.verticalCenter: showRect.verticalCenter
wrapMode: Text.ElideRight
font.pixelSize: Theme.fontSizeLarge
maximumLineCount: 1
}
Image {
id: showImg
fillMode: Image.PreserveAspectFit
source: f_image
anchors.top: showRect.bottom
anchors.margins: Theme.paddingLarge
anchors.left: parent.left
width: height * 0.8
height: (showName.height + showS.height + showP.height + showR.height + showN.height + showPr.height + Theme.paddingLarge) * showImg.scale
scale: 1.1
BusyIndicator {
id: imgBysy
running: showImg.progress !== 1.0
size: BusyIndicatorSize.Large
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
Image {
id: favIcon
anchors.right: parent.right
anchors.top: showImg.top
anchors.topMargin: Theme.paddingSmall
height: showStatus.height + (showStatus.height/2)
width: height
//anchors.top: showImg.top
anchors.rightMargin: Theme.paddingMedium
source: getFav(showid) ? "image://theme/icon-m-favorite-selected" : "image://theme/icon-m-favorite"
MouseArea {
anchors.fill: favIcon
onClicked: showRemorseItem()//remorse.executeqsTr("Removing "+name+" from favorites!"), function() {delFav(model.showid)}, 5000)
}
}
//icon-m-refresh
Image {
id: updIcon
anchors.right: favIcon.left
anchors.top: showImg.top
anchors.topMargin: Theme.paddingSmall
height: showStatus.height + (showStatus.height/2)
width: height
//anchors.top: showImg.top
anchors.rightMargin: Theme.paddingMedium
mirror: true
source: f_upd ? "image://theme/icon-m-notifications" : ""
}
Text {
id: showS
text: "Status:"
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.WordWrap
anchors.topMargin: Theme.paddingMedium
anchors.bottom: showP.top
anchors.left: showImg.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
Text {
id: showStatus
text: f_stat
color: {//highlighted ? Theme.highlightColor : running && f_next !== "?" ? Theme.primaryColor : ended ? Theme.errorColor : Theme.secondaryColor
if (highlighted) Theme.highlightColor;
else if (f_stat === "Ended") Theme.errorColor;
else if (f_stat === "Running" && f_next !== "?") Theme.highlightColor
else if (f_stat === "Running" && f_next === "?") Theme.primaryColor
else Theme.secondaryColor
}
wrapMode: Text.WordWrap
anchors.topMargin: Theme.paddingMedium
anchors.bottom: showP.top
anchors.left: showS.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
font.bold: true
}
Text {
id: showP
text: "Premiered:"
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.WordWrap
anchors.bottom: showR.top
anchors.left: showImg.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
Text {
id: showPrem
text: f_premiered
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.WordWrap
anchors.bottom: showR.top
anchors.left: showP.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
font.bold: true
}
Text {
id: showR
text: "Average rating:"
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.WordWrap
anchors.bottom: showN.top
anchors.left: showImg.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
Text {
id: showRating
text: f_rating
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.WordWrap
anchors.bottom: showN.top
anchors.left: showR.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
font.bold: true
}
Text {
id: showN
text: "Network:"
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.ElideRight
maximumLineCount: 1
anchors.bottom: showPr.top
anchors.left: showImg.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
Text {
id: showNetwork
text: f_network
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.ElideRight
maximumLineCount: 1
anchors.bottom: showPr.top
anchors.left: showN.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
font.bold: true
}
Text {
id: showPr
text: "Previous:"
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.ElideRight
maximumLineCount: 1
anchors.bottom: showNe.top
anchors.left: showImg.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
Text {
id: showPrev
text: f_prev
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.ElideRight
maximumLineCount: 1
anchors.bottom: showNe.top
anchors.left: showPr.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
font.bold: f_prev !== "Unknown" ? true : false
}
Text {
id: showNe
text: f_nextse ? "Next: ("+f_nextse+")" : "Next: "
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.ElideRight
maximumLineCount: 1
anchors.bottom: showImg.bottom
anchors.bottomMargin: Theme.paddingSmall
anchors.left: showImg.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
Text {
id: showNext
text: f_next
color: highlighted ? Theme.highlightColor : f_stat === "Running" && f_next !== "?" ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.ElideRight
maximumLineCount: 1
anchors.bottom: showImg.bottom
anchors.bottomMargin: Theme.paddingSmall
anchors.left: showNe.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingSmall
font.pixelSize: Theme.fontSizeSmall
font.bold: text !== "Unknown" ? true : false
}
onPressAndHold: pageStack.push(Qt.resolvedUrl("ShowImg.qml"),{"img": f_image})
onClicked: {
//frompage === undefined ?
if (f_upd) f_upd = false
pageStack.push(Qt.resolvedUrl("../pages/InfoPage.qml"),
{"showid": showid,"showname": name, "showimage": showImg.source, "summary": summary, "showstatus": status, "showprem": showPrem.text, "showrating": showRating.text,
"shownetwork": showNetwork.text, "showupdated": model.updated, "showprev": showPrev.text, "shownext": showNext.text, "shownextse": nextse, "simdb": f_imdb, "sofficial": f_official})
}
}
PullDownMenu {
MenuItem {
text: qsTr("About Labyrinth")
onClicked: pageStack.push(Qt.resolvedUrl("About.qml"))
}
MenuItem {
text: qsTr("Popular shows by rating")
onClicked: pageStack.replace(Qt.resolvedUrl("PopularPage.qml"),{"showweight": false},PageStackAction.Immediate)
}
MenuItem {
text: qsTr("Popular shows by clicks")
onClicked: pageStack.replace(Qt.resolvedUrl("PopularPage.qml"),{"showweight": true},PageStackAction.Immediate)
}
/* MenuItem {
text: qsTr("Refresh Favorites")
onClicked: {//pageStack.replace(Qt.resolvedUrl("SearchPage.qml"),{},PageStackAction.Immediate)
favorites.clear()
pageStack.replace(Qt.resolvedUrl("Favorites.qml"),{},PageStackAction.Immediate)
}
} */
MenuItem {
text: qsTr("Search TV show")
onClicked: pageStack.replace(Qt.resolvedUrl("SearchPage.qml"),{},PageStackAction.Immediate)
}
MenuItem {
text: qsTr("Notify")
onClicked: notification.publish()
}
}
}
Notification {
id: notifi
category: "x-nemo.example"
appName: "Example App"
appIcon: "/usr/share/example-app/icon-l-application"
summary: "Notification summary"
body: "Notification body"
previewSummary: "Notification preview summary"
previewBody: "Notification preview body"
itemCount: 5
timestamp: "2013-02-20 18:21:00"
remoteActions: [ {
"name": "default",
"displayName": "Do something",
"icon": "icon-s-do-it",
"service": "org.nemomobile.example",
"path": "/example",
"iface": "org.nemomobile.example",
"method": "doSomething",
"arguments": [ "argument", 1 ]
},{
"name": "ignore",
"displayName": "Ignore the problem",
"icon": "icon-s-ignore",
"input" : {
"label": "Please select",
"editable": true,
"choices": [ "Yes", "No", "Maybe" ]
},
"service": "org.nemomobile.example",
"path": "/example",
"iface": "org.nemomobile.example",
"method": "ignore",
"arguments": [ "argument", 1 ]
} ]
onClicked: console.log("Clicked")
onClosed: console.log("Closed, reason: " + reason)
}
/* ViewPlaceholder {
enabled: !updateModel.ready || favorites.count === 0//listView.count === 0 //|| jsonModel1.jsonready
text: dbcount > 0 ? "Checking TVMAZE for updated TV-shows" : listView.count === 0 ? "Favorites empty" : ""
hintText: updateModel.ready === 0 ? "add shows from TVMAZE" : ""
Image {
id: logo
anchors.horizontalCenter: parent.horizontalCenter
//anchors.verticalCenter: parent.verticalCenter
width: parent.width * 0.4
height: width
anchors.bottom: parent.top
anchors.bottomMargin: Theme.paddingLarge
opacity: 0.2
source: "../harbour-labyrinth.png"
}
BusyIndicator {
id: checking
running: !updateModel.ready
size: BusyIndicatorSize.Large
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.bottom
anchors.topMargin: Theme.paddingLarge
//anchors.centerIn: logo
//anchors.horizontalCenter: parent.horizontalCenter
//anchors.top: logo.bottom
//anchors.topMargin: Theme.paddingLarge
//anchors.verticalCenter: parent.verticalCenter
} */
/* Button {
text: "Search TVMaze"
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: Theme.paddingLarge
onClicked: pageStack.replace(Qt.resolvedUrl("SearchPage.qml"),{},PageStackAction.Immediate)
} */
// }
//}
}
+380
View File
@@ -0,0 +1,380 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
Page {
id:infoPage
property string showname
property string showimage: ""
property string summary: ""
property string showid: ""
property string showstatus: ""
property string showprem: ""
property string showrating: ""
property string shownetwork: ""
property string showupdated: ""
property string showprev: ""
property string shownext: ""
property string shownextse: ""
property string simdb: ""
property string sofficial: ""
property bool favorite: getFav(showid)
SilicaFlickable {
id: flick
anchors.top: parent.top
clip: true
anchors.bottom: parent.bottom
width: parent.width// - (Theme.paddingLarge * 2)
height: (showImg.height * showImg.scale) + sumheader.height + Theme.paddingLarge
anchors.horizontalCenter: parent.horizontalCenter
contentHeight: showSummary.height + showImg.height + sumheader.height + seasonA.height + seasonB.height + (Theme.paddingLarge * 5)
PageHeader {id: sumheader; title: showname; }
RemorsePopup {id: remorse}
Image {
id: favIcon
anchors.right: parent.right
anchors.top: showImg.top
anchors.topMargin: Theme.paddingSmall
//anchors.verticalCenter: showStatus.verticalCenter
height: showStatus.height + (showStatus.height/2)
width: height
anchors.rightMargin: Theme.paddingMedium
source: favorite ? "image://theme/icon-m-favorite-selected" : "image://theme/icon-m-favorite"
MouseArea {
anchors.fill: favIcon
onClicked: if (getFav(showid)) {favorite = false; delFav(showid)} else {favorite = true; addFav(showid, showname, showimage, summary, showstatus, showprem, showrating, shownetwork)}
}
}
Text {
id: showStatus
text: "Status: <b>" + showstatus + "</b>"
color: Theme.primaryColor
wrapMode: Text.WordWrap
anchors.topMargin: Theme.paddingMedium
anchors.bottom: showPrem.top
anchors.left: showImg.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
/* Image {
id: showImg
anchors.top: sumheader.bottom
anchors.topMargin: Theme.paddingMedium
anchors.left: parent.left
anchors.leftMargin: Theme.paddingLarge
fillMode: Image.PreserveAspectFit
source: showimage
//width: height * 0.8
//height: parent.height
} */
Image {
id: showImg
property bool zoomed: false
/* anchors.top: sumheader.bottom
anchors.topMargin: Theme.paddingMedium
anchors.bottomMargin: Theme.paddingLarge
anchors.rightMargin: Theme.paddingMedium
anchors.leftMargin: Theme.paddingMedium
anchors.left: parent.left */
anchors.top: sumheader.bottom
anchors.margins: Theme.paddingLarge
anchors.left: parent.left
scale: 1.1
// x: 0
// y: 0
fillMode: Image.PreserveAspectFit
source: showimage ? showimage : "../No-Image-.png"
// width: 210
width: height * 0.8
// height: showName.height + showS.height + showP.height + showR.height + showN.height + showPr.height + Theme.paddingMedium
// height: (showName.height + showS.height + showP.height + showR.height + showN.height + showPr.height + Theme.paddingLarge) * showImg.scale
height: (showPrem.height + showRating.height + showNetwork.height + showPrev.height + showNext.height + showStatus.height + Theme.itemSizeSmall) * showImg.scale
// scale: 1.1
// height: showName.height + showStatus.height + showPrem.height + showRating.height + showNext.height + showPrev.height
BusyIndicator {
id: imgBysy
running: showImg.progress !== 1.0
size: BusyIndicatorSize.Large
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
MouseArea {
anchors.fill: showImg
onClicked: {
//if (showImg.width !== Screen.width) {showImg.width = Screen.width; showImg.height = Screen.height;} else {showImg.height = showPrem.height + showRating.height + showNetwork.height + showPrev.height + showNext.height + showStatus.height}
}
}
}
Text {
id: showPrem
text: showprem ? "Premiered: <b>" + showprem + "</b>" : "Premiered: ?"
color: Theme.primaryColor
wrapMode: Text.WordWrap
anchors.bottom: showRating.top
anchors.left: showImg.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
Text {
id: showRating
text: "Average rating: <b>" + showrating + "</b>"
color: Theme.primaryColor
wrapMode: Text.WordWrap
anchors.bottom: showNetwork.top
anchors.left: showImg.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
Text {
id: showNetwork
text: "Network: <b>" + shownetwork + "</b>"
color: Theme.primaryColor
wrapMode: Text.ElideRight
maximumLineCount: 1
anchors.bottom: showPrev.top
anchors.left: showImg.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
Text {
id: showPrev
text: showprev !== "" ? "Previous: <b>" + showprev+"</b>" : ""
color: Theme.primaryColor
wrapMode: Text.ElideRight
maximumLineCount: 1
anchors.bottom: showNext.top
anchors.left: showImg.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
Text {
id: showNext
text: shownext !== "" || shownext !== "Unknown" ? "Next: ("+shownextse + ") <b>" + shownext + "</b>" : "" //nextse !=="" ? "Next: ("+nextse+")" : "Next: " + next
color: Theme.primaryColor
wrapMode: Text.ElideRight
maximumLineCount: 1
anchors.bottom: showImg.bottom
anchors.bottomMargin: Theme.paddingMedium
anchors.left: showImg.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
BackgroundItem {
id: seasonA
anchors.left: parent.left
anchors.right: parent.right
anchors.top: showImg.bottom
anchors.topMargin: Theme.paddingLarge
OpacityRampEffect {
sourceItem: actorRect
direction: OpacityRamp.TopToBottom
offset: 0.0
slope: 1.0
}
Rectangle {
id: actorRect
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: actorName.height + Theme.paddingLarge
color: Theme.rgba(Theme.highlightBackgroundColor, Theme.highlightBackgroundOpacity)
}
Image {
id: nextIconActor
anchors.verticalCenter: actorRect.verticalCenter
anchors.right: actorRect.right
anchors.rightMargin: Theme.paddingMedium
source: "image://theme/icon-m-right" + "?" + (seasonA.highlighted ? Theme.highlightColor : Theme.primaryColor)
}
Text {
id: actorName
text: "Show main cast"
color: seasonA.highlighted ? Theme.highlightColor : Theme.primaryColor
anchors.leftMargin: Theme.paddingMedium
anchors.rightMargin: Theme.paddingMedium
anchors.left: parent.left
anchors.right: nextIconActor.left
anchors.verticalCenter: actorRect.verticalCenter
wrapMode: Text.ElideRight
font.pixelSize: Theme.fontSizeLarge
maximumLineCount: 1
}
onClicked: pageStack.push(Qt.resolvedUrl("CastPage.qml"),{"showid": showid,"showname": showname,"showimage": showimage} )
}
/* IconButton {
anchors.bottom: showImg.bottom
anchors.bottomMargin: Theme.paddingLarge
anchors.right: parent.right
anchors.rightMargin: Theme.paddingLarge
//width: 200
//height: 50
icon.source: "../imdb.png"
onClicked: console.log("Delete!")
} */
BackgroundItem {
id: seasonB
anchors.left: parent.left
anchors.right: parent.right
anchors.top: seasonA.bottom
anchors.topMargin: Theme.paddingLarge
OpacityRampEffect {
sourceItem: seasonRect
direction: OpacityRamp.TopToBottom
offset: 0.0
slope: 1.0
}
Rectangle {
id: seasonRect
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: seasonName.height + Theme.paddingLarge
color: Theme.rgba(Theme.highlightBackgroundColor, Theme.highlightBackgroundOpacity)
}
Image {
id: nextIconSeason
anchors.verticalCenter: seasonRect.verticalCenter
anchors.right: seasonRect.right
anchors.rightMargin: Theme.paddingMediumIMDB
source: "image://theme/icon-m-right" + "?" + (seasonB.highlighted ? Theme.highlightColor : Theme.primaryColor)
}
Text {
id: seasonName
text: "Show seasons"
color: seasonB.highlighted ? Theme.highlightColor : Theme.primaryColor
anchors.leftMargin: Theme.paddingMedium
anchors.rightMargin: Theme.paddingMedium
anchors.left: parent.left
anchors.right: nextIconSeason.left
anchors.verticalCenter: seasonRect.verticalCenter
wrapMode: Text.ElideRight
font.pixelSize: Theme.fontSizeLarge
maximumLineCount: 1
// font.bold: true
}
onClicked: pageStack.push(Qt.resolvedUrl("SeasonsPage.qml"),{"showid": showid,"showname": showname,"showimage": showimage} )
}
/* Text {
id: showSummaryH
anchors.top: seasonB.bottom
anchors.topMargin: Theme.paddingLarge
anchors.left: parent.left
anchors.leftMargin: Theme.paddingLarge
text: "Summary"
color: Theme.secondaryColor
font.pixelSize: Theme.fontSizeLarge
//font.underline: true
//font.bold: true
} */
Text {
id: showSummary
anchors.top: seasonB.bottom
//anchors.topMargin: Theme.paddingSmall
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: Theme.paddingLarge
anchors.rightMargin: Theme.paddingLarge
text: summary
textFormat: Text.StyledText
color: Theme.primaryColor
wrapMode: Text.WordWrap
font.pixelSize: Theme.fontSizeMedium
}
function fitToScreen() {
showImg.scale = Math.min(flick.width / showImg.width, flick.height / showImg.height, 1)
//pinchArea.minScale = scale
prevScale = scale
}
/* Image {
id: showImg
anchors.top: sumheader.bottom
anchors.topMargin: Theme.paddingMedium
anchors.left: parent.left
anchors.leftMargin: Theme.paddingLarge
fillMode: Image.PreserveAspectFit
source: showimage
//width: height * 0.8
//height: parent.height
property real prevScale
MouseArea {
anchors.fill: parent
onClicked: {
scale = Math.min(flick.width / width, flick.height / height, 1)
//pinchArea.minScale = scale
//prevScale = scale
}
//transform: Scale { origin.x: 25; origin.y: 25; xScale: 3}
}
} */
PullDownMenu {
MenuItem {
visible: simdb !== "" ? true : false
text: qsTr("Open IMDB page")
onClicked: { //remorse.execute(qsTr("Opening webpage"), function() {Qt.openUrlExternally("http://m.imdb.com/title/"+simdb)}, 2000)//Qt.openUrlExternally("http://m.imdb.com/title/"+imdb)//pageStack.push(Qt.resolvedUrl("SeasonsPage.qml"),{"showid": showid,"showname": showname,"showimage": showimage} )
//WebViewer {webPageAddress: defaultDevice }
console.log("IMDB: "+simdb)
pageStack.push(Qt.resolvedUrl("WebViewer.qml"),{"webPageAddress": "http://m.imdb.com/title/"+simdb} )
}
}
MenuItem {
visible: sofficial !== "" ? true : false
text: qsTr("Official site")
onClicked: { //remorse.execute(qsTr("Opening webpage"), function() {Qt.openUrlExternally("http://m.imdb.com/title/"+simdb)}, 2000)//Qt.openUrlExternally("http://m.imdb.com/title/"+imdb)//pageStack.push(Qt.resolvedUrl("SeasonsPage.qml"),{"showid": showid,"showname": showname,"showimage": showimage} )
//WebViewer {webPageAddress: defaultDevice }
console.log("Official: "+sofficial)
pageStack.push(Qt.resolvedUrl("WebViewer.qml"),{"webPageAddress": sofficial} )
}
}
}
}
}
+73
View File
@@ -0,0 +1,73 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import "../JSONListModel"
import "../delegates"
Page {
id: page
//property string filter: ""
//property string country: ""
//property string _country: country ? "?country="+country : ""
//property string jsonSource: "http://api.tvmaze.com/schedule"+_country //"date="+Qt.formatDateTime(new Date(), "yyyy-MM-dd")
property string jsonSource: "http://api.tvmaze.com/shows"
property bool showweight: false
SilicaListView {
id: listView
anchors.fill: parent
clip: true
JSONListModel {
id: jsonModel1
sortby: showweight ? "weight" : "rating.average"
source: jsonSource //"http://api.tvmaze.com/schedule?country=SE&date="+Qt.formatDateTime(new Date(), "yyyy-MM-dd") //2016-07-16" //+filter
query: showweight ? "$[?(@.weight>7)]" : "$[?(@.rating.average>7.9)]"
}
model: jsonModel1.model
BusyIndicator {
id: busyIndicator
running: !jsonModel1.jsonready
size: BusyIndicatorSize.Large
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
header: PageHeader {
id: pHeader
title: showweight ? "Popular shows by clicks" : "Popular shows by rating"
}
delegate: ShowDelegate {}
PullDownMenu {
MenuItem {
visible: showweight
text: qsTr("Popular shows by rating")
onClicked: pageStack.replace(Qt.resolvedUrl("PopularPage.qml"),{"showweight": false},PageStackAction.Immediate)
}
MenuItem {
visible: !showweight
text: qsTr("Popular shows by clicks")
onClicked: pageStack.replace(Qt.resolvedUrl("PopularPage.qml"),{"showweight": true},PageStackAction.Immediate)
}
MenuItem {
text: qsTr("Favourites")
onClicked: pageStack.replace(Qt.resolvedUrl("Favorites.qml"),{},PageStackAction.Immediate)
}
MenuItem {
text: qsTr("Search shows")
onClicked: pageStack.replace(Qt.resolvedUrl("SearchPage.qml"),{},PageStackAction.Immediate)
}
}
ViewPlaceholder {
visible: listView.count === 0 && jsonModel1.jsonready
text: "Unable to load TVmaze data!"
hintText: "Check your connection"
}
}
}
+82
View File
@@ -0,0 +1,82 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import "../JSONListModel"
import "../delegates"
Page {
id: page
property string filter: ""
SilicaListView {
id: listView
anchors.fill: parent
clip: true
JSONListModel {
id: jsonModel1
source: filter !=="" ? "http://api.tvmaze.com/search/shows?q="+filter : ""
query: "$[*].show"
}
model: jsonModel1.model
BusyIndicator {
id: busyIndicator
running: !jsonModel1.jsonready
size: BusyIndicatorSize.Large
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
header: PageHeader {
id: pHeader
SearchField {
id: searchField
width: parent.width
placeholderText: "Search"
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
EnterKey.iconSource: "image://theme/icon-m-enter-close"
EnterKey.onClicked: {filter = text;focus = false}
focus: true
onTextChanged: if (text.length > 1) filter = text; else {filter = "";focus=true;}
// onTextChanged: if (text.length > 1) jsonModel1.source = "http://www.radio-browser.info/webservice/json/stations/"+searchby+"/"+text; else {jsonModel1.source = "";focus=true;jsonModel1.model.clear()}
onClicked: {listView.currentIndex = -1}
}
}
delegate: ShowDelegate {}
PullDownMenu {
MenuItem {
text: qsTr("Popular shows by rating")
onClicked: pageStack.replace(Qt.resolvedUrl("PopularPage.qml"),{"showweight": false},PageStackAction.Immediate)
}
MenuItem {
text: qsTr("Popular shows by clicks")
onClicked: pageStack.replace(Qt.resolvedUrl("PopularPage.qml"),{"showweight": true},PageStackAction.Immediate)
}
MenuItem {
text: qsTr("Favorites")
onClicked: pageStack.replace(Qt.resolvedUrl("Favorites.qml"),{},PageStackAction.Immediate)
}
}
ViewPlaceholder {
enabled: listView.count === 0 //|| jsonModel1.jsonready
text: "Search a TV Show"
hintText: "on TVMaze"
Image {
id: logo
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.top
anchors.bottomMargin: Theme.paddingLarge
opacity: 0.2
source: "../harbour-labyrinth.png"
}
}
}
}
+195
View File
@@ -0,0 +1,195 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import "../JSONListModel"
Page {
id: page
property string filter: ""
property string showid: ""
property string showname: ""
property string showimage: ""
property string number: ""
SilicaListView {
id: listView
anchors.fill: parent
clip: true
JSONListModel {
id: jsonModel1
source: "http://api.tvmaze.com/shows/"+showid+"/episodes"
query: "$[?(@.season==="+number+")]"
}
model: jsonModel1.model
BusyIndicator {
id: busyIndicator
running: !jsonModel1.jsonready
size: BusyIndicatorSize.Large
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
header: PageHeader {
id: pHeader
title: showname
description: "Season: "+number
}
delegate: BackgroundItem {
id: myListItem
enabled: model.summary !== ""
width: ListView.view.width
height: showImg.height + showRect.height + showAirdate.height + showSummary.height + showSummaryIcon.height + Theme.paddingLarge//showImg.height > 20 ? showImg.height + showSummary.height + showAirdate.heigth + showRect.height + showSummaryIcon.height + (Theme.paddingLarge * 3) : firstName.height + showAirdate.height + showAirdate.heigth + showRuntime.height + showSummary.height + showRect.height + (Theme.paddingLarge * 3)
OpacityRampEffect {
sourceItem: showRect
direction: OpacityRamp.TopToBottom
offset: 0.0
slope: 1.0
}
Rectangle {
id: showRect
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: firstName.height + Theme.paddingLarge
color: Theme.rgba(Theme.highlightBackgroundColor, Theme.highlightBackgroundOpacity)
}
Image {
id: seenIcon
visible: false
anchors.right: parent.right
anchors.top: showImg.top
anchors.topMargin: Theme.paddingLarge
anchors.rightMargin: Theme.paddingMedium
source: "image://theme/icon-m-acknowledge"
}
Image {
id: showImg
property int errorCount: 0
anchors.top: showAirdate.bottom
//anchors.margins: Theme.paddingLarge
anchors.topMargin: Theme.paddingSmall
/* anchors.topMargin: Theme.paddingLarge
anchors.bottomMargin: Theme.paddingMedium
anchors.rightMargin: Theme.paddingMedium
anchors.leftMargin: Theme.paddingMedium */
anchors.left: parent.left
// width: parent.width * 0.4
// x: 0
// y: 0
// width: parent.width * 0.4
// height: parent.width * 0.3
height: width * 0.6
width: page.width
//scale: 1.1
// height: parent.height
fillMode: Image.PreserveAspectFit
source: model.image ? model.image.medium ? model.image.medium : "" : ""
}
Text {
id: firstName
text: model.number + ": " + model.name
color: highlighted ? Theme.highlightColor : Theme.primaryColor
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: showRect.verticalCenter
wrapMode: Text.ElideRight
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeLarge
}
Text {
id: showSummary
//anchors.bottom: showSummaryIcon.top
anchors.top: showImg.bottom
anchors.topMargin: Theme.paddingLarge
anchors.leftMargin: Theme.paddingMedium
anchors.rightMargin: Theme.paddingMedium
anchors.bottomMargin: Theme.paddingLarge
anchors.left: parent.left
anchors.right: parent.right
text: ""
color: Theme.primaryColor
wrapMode: Text.WordWrap
width: parent.width
font.pixelSize: Theme.fontSizeSmall
}
Image {
id: showSummaryIcon
anchors.top: showImg.bottom
anchors.bottomMargin: Theme.paddingLarge
//anchors.topMargin: Theme.paddingMedium
anchors.right: parent.right
anchors.rightMargin: Theme.paddingMedium
source: model.summary !== "" ? "image://theme/icon-lock-more" : ""
}
Text {
id: showAirdate
text: "Air date: <b>"+model.airdate+"</b>"
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.WordWrap
//anchors.topMargin: Theme.paddingMedium
anchors.top: showRect.bottom
anchors.left: parent.left
anchors.leftMargin: Theme.paddingMedium
//anchors.right: parent.right
anchors.rightMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
Text {
id: showRuntime
text: model.runtime !== null ? "(Runtime: <b>" + model.runtime + " minutes)</b>" : ""
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.WordWrap
anchors.top: showRect.bottom
//anchors.topMargin: Theme.paddingMedium
//anchors.left: showImg.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingMedium
anchors.rightMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeSmall
}
onClicked: {
showSummary.text !== "" ? showSummary.text = "" : showSummary.text = model.summary
}
}
ViewPlaceholder {
enabled: listView.count == 0 && jsonModel1.jsonready
text: "No TVmaze data"
hintText: "no information about season"
}
}
Component {
id: sectionDelegate
Text {
id: sectionLabel
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: Theme.fontSizeExtraLarge
color: Theme.highlightColor
text: "SEASON: "+section
}
}
}
+156
View File
@@ -0,0 +1,156 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import "../JSONListModel"
Page {
id: page
property string filter: ""
property string showid: ""
property string showname: ""
property string showimage: ""
SilicaListView {
id: listView
anchors.fill: parent
clip: true
JSONListModel {
id: jsonModel1
source: "http://api.tvmaze.com/shows/"+showid+"/seasons"
query: "$[*]"
}
model: jsonModel1.model
BusyIndicator {
id: busyIndicator
running: !jsonModel1.jsonready
size: BusyIndicatorSize.Large
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
header: PageHeader {
id: pHeader
title: showname
}
delegate: BackgroundItem {
id: myListItem
width: ListView.view.width
height: (showImg.height * showImg.scale) + showRect.height + Theme.paddingLarge
OpacityRampEffect {
sourceItem: showRect
direction: OpacityRamp.TopToBottom
offset: 0.0
slope: 1.0
}
Rectangle {
id: showRect
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: firstName.height + Theme.paddingLarge
color: Theme.rgba(Theme.highlightBackgroundColor, Theme.highlightBackgroundOpacity)
}
Image {
id: nextIcon
anchors.verticalCenter: showRect.verticalCenter
anchors.right: showRect.right
anchors.rightMargin: Theme.paddingMedium
source: "image://theme/icon-m-right"
}
Image {
id: seenIcon
visible: false
anchors.right: parent.right
anchors.bottom: showImg.bottom
anchors.rightMargin: Theme.paddingMedium
source: "image://theme/icon-m-acknowledge"
}
Image {
id: showImg
property int errorCount: 0
anchors.top: showRect.bottom
anchors.margins: Theme.paddingLarge
/* anchors.topMargin: Theme.paddingLarge
anchors.bottomMargin: Theme.paddingLarge
anchors.rightMargin: Theme.paddingMedium
anchors.leftMargin: Theme.paddingMedium */
anchors.left: parent.left
scale: 1.2
//height: parent.height
// width: parent.width * 0.4
fillMode: Image.PreserveAspectFit
source: model.image ? model.image.medium ? model.image.medium : showimage : showimage
}
Text {
id: firstName
text: "Season: "+model.number //!== null ? "<b>"+model.name+"</b>" : ""
color: highlighted ? Theme.highlightColor : Theme.primaryColor
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: showRect.verticalCenter
wrapMode: Text.ElideRight
anchors.leftMargin: Theme.paddingLarge
font.pixelSize: Theme.fontSizeLarge
}
Text {
id: showType
text: "<u>Premiere</u><br><b>" + model.premiereDate + "</b>"
color: highlighted ? Theme.highlightColor : Theme.primaryColor
wrapMode: Text.WordWrap
anchors.bottomMargin: Theme.paddingMedium
anchors.bottom: showImg.bottom
anchors.left: showImg.right
anchors.right: parent.right
anchors.leftMargin: Theme.paddingLarge
font.pixelSize: Theme.fontSizeSmall
}
onPressAndHold: {
pageStack.push(Qt.resolvedUrl("ShowImg.qml"),{"img": model.image ? model.image.medium ? model.image.medium : showimage : showimage})
//window.pageStack.push(Qt.resolvedUrl("SeasonsPage.qml"),{"showid": model.id,"showname": showname,"showimage": showImg.source} )
}
onClicked: {
onClicked: pageStack.push(Qt.resolvedUrl("SeasonNrPage.qml"),{"showid": showid,"showname": showname,"showimage": showImg,"number": model.number} )
}
}
PullDownMenu {
MenuItem {
text: qsTr("Show cast")
onClicked: pageStack.replace(Qt.resolvedUrl("CastPage.qml"),{"showid": showid,"showname": showname,"showimage": showimage},PageStackAction.Immediate )
}
}
ViewPlaceholder {
enabled: listView.count == 0 && jsonModel1.jsonready
text: "No TVmaze data"
hintText: "no information about seasons"
}
}
Component {
id: sectionDelegate
Text {
id: sectionLabel
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: Theme.fontSizeExtraLarge
color: Theme.highlightColor
text: "SEASON: "+section
}
}
}
+23
View File
@@ -0,0 +1,23 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
Page {
property string img: ""
Image {
id: showImg
fillMode: Image.PreserveAspectFit
source: img
anchors.fill: parent
width: parent.width
height: parent.height
BusyIndicator {
id: imgBysy
running: showImg.progress !== 1.0
size: BusyIndicatorSize.Large
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
}
+58
View File
@@ -0,0 +1,58 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.WebView 1.0
WebViewPage {
id: webViewPage
allowedOrientations: Orientation.Portrait | Orientation.Landscape
property string webPageAddress: ""
property bool webViewLoading: false
property int webViewLoadProgress: 0
WebView {
id: webView
anchors.fill: parent
active: true
url: webPageAddress
onLoadingChanged: {
webViewPage.webViewLoading = loading
webViewPage.webViewLoadProgress = 0
}
onLoadProgressChanged: {
webViewPage.webViewLoadProgress = loadProgress
}
}
Rectangle {
id: panel
color: Theme.highlightDimmerColor
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
//margins: Theme.padding
}
width: parent.width
height: opacity === 0.0 ? 0 : Theme.paddingLarge
radius: 5
opacity: (webViewPage.webViewLoading || loadStatusShowTimer.running) ? 0.75 : 0.0
Behavior on opacity { FadeAnimator {} }
Timer {
id: loadStatusShowTimer
}
Rectangle {
anchors.left: parent.left
color: Theme.secondaryHighlightColor
width: webViewPage.webViewLoading ? parent.width * (webViewPage.webViewLoadProgress / 100) : 0
height: parent.height
}
}
}