comparison src/gui/widgets/anime_info.cc @ 82:8b65c417c225

*: fix old stuff, make video players and extensions constants
author Paper <mrpapersonic@gmail.com>
date Mon, 23 Oct 2023 13:37:42 -0400
parents 9b2b41f83a5e
children d02fdf1d6708
comparison
equal deleted inserted replaced
81:9b2b41f83a5e 82:8b65c417c225
10 QVBoxLayout* layout = new QVBoxLayout(this); 10 QVBoxLayout* layout = new QVBoxLayout(this);
11 11
12 _title.reset(new TextWidgets::OneLineSection(tr("Alternative titles"), "", this)); 12 _title.reset(new TextWidgets::OneLineSection(tr("Alternative titles"), "", this));
13 layout->addWidget(_title.get()); 13 layout->addWidget(_title.get());
14 14
15 _details.reset(new TextWidgets::LabelledSection(tr("Details"), new TextWidgets::LabelledSection( 15 _details.reset(new TextWidgets::LabelledSection(tr("Details"), tr("Type:\nEpisodes:\nStatus:\nSeason:\nGenres:\nScore:"), "", this));
16 tr("Details"), tr("Type:\nEpisodes:\nStatus:\nSeason:\nGenres:\nScore:"), "", this), "", this));
17 layout->addWidget(_details.get()); 16 layout->addWidget(_details.get());
18 17
19 _synopsis.reset(new TextWidgets::LabelledSection(tr("Synopsis"), "", this)); 18 _synopsis.reset(new TextWidgets::SelectableSection(tr("Synopsis"), "", this));
20 _synopsis->GetParagraph()->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); 19 _synopsis->GetParagraph()->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
21 layout->addWidget(_synopsis.get()); 20 layout->addWidget(_synopsis.get());
22 } 21 }
23 22
24 AnimeInfoWidget::AnimeInfoWidget(const Anime::Anime& anime, QWidget* parent) : AnimeInfoWidget(parent) { 23 AnimeInfoWidget::AnimeInfoWidget(const Anime::Anime& anime, QWidget* parent) : AnimeInfoWidget(parent) {
25 SetAnime(anime); 24 SetAnime(anime);
26 } 25 }
27 26
28 AnimeInfoWidget::SetAnime(const Anime::Anime& anime) { 27 void AnimeInfoWidget::SetAnime(const Anime::Anime& anime) {
29 /* alt titles */ 28 /* alt titles */
30 _title->GetParagraph()->SetText(Strings::ToQString(Strings::Implode(anime.GetTitleSynonyms(), ", "))); 29 _title->GetLine()->setText(Strings::ToQString(Strings::Implode(anime.GetTitleSynonyms(), ", ")));
31 30
32 /* details */ 31 /* details */
33 QString details_data; 32 QString details_data;
34 QTextStream details_data_s(&details_data); 33 QTextStream details_data_s(&details_data);
35 details_data_s << Translate::ToString(anime.GetFormat()).c_str() << "\n" 34 details_data_s << Translate::ToString(anime.GetFormat()).c_str() << "\n"
37 << Translate::ToString(anime.GetUserStatus()).c_str() << "\n" 36 << Translate::ToString(anime.GetUserStatus()).c_str() << "\n"
38 << Translate::ToString(anime.GetSeason()).c_str() << " " << anime.GetAirDate().GetYear() << "\n" 37 << Translate::ToString(anime.GetSeason()).c_str() << " " << anime.GetAirDate().GetYear() << "\n"
39 << Strings::Implode(anime.GetGenres(), ", ").c_str() << "\n" 38 << Strings::Implode(anime.GetGenres(), ", ").c_str() << "\n"
40 << anime.GetAudienceScore() << "%"; 39 << anime.GetAudienceScore() << "%";
41 _details->GetParagraph()->SetText(Strings::ToQString(Strings::Implode(anime.GetTitleSynonyms(), ", "))); 40 _details->GetParagraph()->SetText(Strings::ToQString(Strings::Implode(anime.GetTitleSynonyms(), ", ")));
42 layout->addWidget();
43 41
44 _synopsis->GetParagraph()->SetText(Strings::ToQString(Strings::Implode(anime.GetTitleSynonyms(), ", "))); 42 _synopsis->GetParagraph()->SetText(Strings::ToQString(Strings::Implode(anime.GetTitleSynonyms(), ", ")));
45 layout->addWidget(synopsis);
46 } 43 }
47 44
48 #include "gui/widgets/moc_anime_info.cpp" 45 #include "gui/widgets/moc_anime_info.cpp"