Mercurial > minori
comparison src/gui/pages/anime_list.cpp @ 52:0c4138de2ea7
anime list: we are finally read-write
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Mon, 25 Sep 2023 22:49:42 -0400 |
| parents | 75c804f713b2 |
| children | 4c6dd5999b39 |
comparison
equal
deleted
inserted
replaced
| 51:75c804f713b2 | 52:0c4138de2ea7 |
|---|---|
| 14 #include "core/array.h" | 14 #include "core/array.h" |
| 15 #include "core/session.h" | 15 #include "core/session.h" |
| 16 #include "core/time.h" | 16 #include "core/time.h" |
| 17 #include "gui/dialog/information.h" | 17 #include "gui/dialog/information.h" |
| 18 #include "gui/translate/anime.h" | 18 #include "gui/translate/anime.h" |
| 19 #include "services/anilist.h" | 19 #include "services/services.h" |
| 20 #include <QDebug> | 20 #include <QDebug> |
| 21 #include <QHBoxLayout> | 21 #include <QHBoxLayout> |
| 22 #include <QHeaderView> | 22 #include <QHeaderView> |
| 23 #include <QMenu> | 23 #include <QMenu> |
| 24 #include <QProgressBar> | 24 #include <QProgressBar> |
| 313 ((AnimeListWidgetModel*)sort_models[tab_bar->currentIndex()]->sourceModel())->GetAnimeFromIndex(index); | 313 ((AnimeListWidgetModel*)sort_models[tab_bar->currentIndex()]->sourceModel())->GetAnimeFromIndex(index); |
| 314 if (!anime) { | 314 if (!anime) { |
| 315 return; | 315 return; |
| 316 } | 316 } |
| 317 | 317 |
| 318 InformationDialog* dialog = new InformationDialog(*anime, [this] { | 318 InformationDialog* dialog = new InformationDialog(*anime, [this, anime] { |
| 319 Services::UpdateAnimeEntry(anime->GetId()); | |
| 319 Refresh(); | 320 Refresh(); |
| 320 }, this); | 321 }, this); |
| 321 | 322 |
| 322 dialog->show(); | 323 dialog->show(); |
| 323 dialog->raise(); | 324 dialog->raise(); |
| 337 const QModelIndex index = ((AnimeListWidgetModel*)sort_models[tab_bar->currentIndex()]->sourceModel()) | 338 const QModelIndex index = ((AnimeListWidgetModel*)sort_models[tab_bar->currentIndex()]->sourceModel()) |
| 338 ->index(selection.indexes().first().row()); | 339 ->index(selection.indexes().first().row()); |
| 339 Anime::Anime* anime = | 340 Anime::Anime* anime = |
| 340 ((AnimeListWidgetModel*)sort_models[tab_bar->currentIndex()]->sourceModel())->GetAnimeFromIndex(index); | 341 ((AnimeListWidgetModel*)sort_models[tab_bar->currentIndex()]->sourceModel())->GetAnimeFromIndex(index); |
| 341 | 342 |
| 342 InformationDialog* dialog = new InformationDialog(*anime, [this] { | 343 InformationDialog* dialog = new InformationDialog(*anime, [this, anime] { |
| 344 Services::UpdateAnimeEntry(anime->GetId()); | |
| 343 Refresh(); | 345 Refresh(); |
| 344 }, this); | 346 }, this); |
| 345 | 347 |
| 346 dialog->show(); | 348 dialog->show(); |
| 347 dialog->raise(); | 349 dialog->raise(); |
