Skip to content

Commit

Permalink
TMDB APIv3: update Movie View
Browse files Browse the repository at this point in the history
update names of retrieved API objects
add Backdrop Gallery
add Alternative titles Column
implement Cast & Crew View and Poster & Backdrop Gallery the lazy man's way
using two completely separate models
pass complete person object to Person View
update Gallery and Previewer for new image retrieval using configuration API

Signed-off-by: Marco Porsch <marco.porsch@etit.tu-chemnitz.de>
  • Loading branch information
Marco Porsch committed Mar 14, 2014
1 parent 9de8ae0 commit 72f1da8
Show file tree
Hide file tree
Showing 7 changed files with 214 additions and 168 deletions.
13 changes: 2 additions & 11 deletions src/qml/CastView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,8 @@ Page {

property string movieName: ''
property ListModel castModel: ListModel { }
property variant rawCrew: ''
property bool showsCast: true

Component.onCompleted: {
if (!showsCast && rawCrew) {
for (var i = 0; i < rawCrew.length; i ++) {
castModel.append(new BUTACA.TMDbCrewPerson(rawCrew[i]))
}
}
}

Component {
id: listSectionDelegate

Expand All @@ -83,8 +74,8 @@ Page {
text: showsCast ?
//: This appears in the cast view when the cast is shown
qsTr('Full cast in %1').arg(movieName) :
//: This appears in the cast view when cast and crew are shown
qsTr('Cast and crew in %1').arg(movieName)
//: This appears in the cast view when the crew is shown
qsTr('Full crew in %1').arg(movieName)
showDivider: false
}
delegate: MyListDelegate {
Expand Down
23 changes: 17 additions & 6 deletions src/qml/MediaGalleryView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import QtQuick 1.1
import com.nokia.meego 1.0
import com.nokia.extras 1.1
import 'constants.js' as UIConstants
import 'moviedbwrapper.js' as TMDB

Page {
id: galleryView
Expand All @@ -29,9 +30,10 @@ Page {
property int currentIndex: -1
property bool expanded: false

property string gridSize: ''
property string fullSize: ''
property string saveSize: ''
property int imgType: TMDB.IMAGE_POSTER
property int gridSize: 1
property int fullSize: 4
property int saveSize: 100

tools: ToolBarLayout {
ToolIcon {
Expand Down Expand Up @@ -80,7 +82,10 @@ Page {
fill: parent
margins: UIConstants.PADDING_XSMALL
}
source: sizes[gridSize].url
source: TMDB.image(imgType,
gridSize,
file_path,
{ app_locale: appLocale })
fillMode: Image.PreserveAspectCrop
}

Expand Down Expand Up @@ -124,7 +129,10 @@ Page {

Image {
id: detailedDelegateImage
source: galleryView.galleryViewModel.get(galleryView.currentIndex).sizes[fullSize].url
source: TMDB.image(imgType,
fullSize,
galleryView.galleryViewModel.get(galleryView.currentIndex).file_path,
{ app_locale: appLocale })
anchors {
top: detailedDelegateIndicator.bottom
topMargin: UIConstants.DEFAULT_MARGIN
Expand Down Expand Up @@ -210,7 +218,10 @@ Page {
id: saveImageSheet

property string imageUrl: galleryView.currentIndex >= 0 ?
galleryView.galleryViewModel.get(galleryView.currentIndex).sizes[saveSize].url :
TMDB.image(imgType,
saveSize,
galleryView.galleryViewModel.get(galleryView.currentIndex).file_path,
{ app_locale: appLocale }) :
''

acceptButtonText:
Expand Down
Loading

0 comments on commit 72f1da8

Please sign in to comment.