]> git.vomp.tv Git - vompclient.git/blob - wmovieview.cc
Fix resuming recording directly after stopping it
[vompclient.git] / wmovieview.cc
1 /*
2     Copyright 2014 Marten Richter
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19 */
20
21 #include "wmovieview.h"
22 #include "i18n.h"
23 #include <sstream>
24
25
26 WMovieView::WMovieView(MovieInfo* movie):
27 WTextbox(NULL)
28 {
29         // portions from nopacity plugin by Louis Braun
30         if (movie)
31         {
32                 std::stringstream info;
33             info << tr("TheMovieDB Information") << ":\n\n";
34             if (!movie->originalTitle.empty()){
35                 info << tr("Original Title") << ": " << movie->originalTitle << "\n\n";
36             }
37             if (!movie->tagline.empty()){
38                 info << tr("Tagline") << ": " << movie->tagline << "\n\n";
39             }
40             if (!movie->overview.empty()){
41                 info << tr("Overview") << ": " << movie->overview << "\n\n";
42             }
43             const char* strAdult = (movie->adult)?(tr("yes")):(tr("no"));
44             info << tr("Adult") << ": " << strAdult << "\n\n";
45             if (!movie->collectionName.empty()){
46                 info << tr("Collection") << ": " << movie->collectionName << "\n\n";
47             }
48             if (movie->budget > 0 ){
49                 info << tr("Budget") << ": " << movie->budget << "$\n\n";
50             }
51             if (movie->revenue > 0 ){
52                 info << tr("Revenue") << ": " << movie->revenue << "$\n\n";
53             }
54             if (!movie->genres.empty() ){
55                 info << tr("Genre") << ": " << movie->genres << "\n\n";
56             }
57             if (!movie->homepage.empty()){
58                 info << tr("Homepage") << ": " << movie->homepage << "\n\n";
59             }
60             if (!movie->releaseDate.empty()){
61                 info << tr("Release Date") << ": " << movie->releaseDate << "\n\n";
62             }
63             if (movie->runtime > 0 ){
64                 info << tr("Runtime") << ": " << movie->runtime << " " << tr("minutes") << "\n\n";
65             }
66             if (movie->popularity > 0 ){
67                 info << tr("TheMovieDB Popularity") << ": " << movie->popularity << "\n\n";
68             }
69             if (movie->voteAverage > 0 ){
70                 info << tr("TheMovieDB Vote Average") << ": " << movie->voteAverage << "\n\n";
71             }
72             setText(info.str().c_str());
73         } else {
74                 setText("This is a bug!");
75         }
76
77 }
78
79 void WMovieView::draw()
80 {
81         WTextbox::draw();
82
83
84 }