diff -p -r -u -N -X /tmp/diff.exclude -x release.21111.0803bare -x release.21111.0803bareb release.21111.0803bare/mythtv/programs/mythfrontend/playbackbox.cpp release.21111.0803bareb/mythtv/programs/mythfrontend/playbackbox.cpp
|
|
const uint PreviewGenState::minBlockSeco |
60 | 60 | |
61 | 61 | const uint PlaybackBox::previewGeneratorMaxRunning = 2; |
62 | 62 | |
| 63 | static int comp_title(ProgramInfo *a, ProgramInfo *b) |
| 64 | { |
| 65 | if (a->sortTitle == b->sortTitle) |
| 66 | { |
| 67 | return (a->recstartts < b->recstartts ? 1 : -1); |
| 68 | } |
| 69 | else |
| 70 | return (a->sortTitle < b->sortTitle ? 1 : -1); |
| 71 | } |
| 72 | |
| 73 | static int comp_title_rev(ProgramInfo *a, ProgramInfo *b) |
| 74 | { |
| 75 | return comp_title(b, a); |
| 76 | } |
| 77 | |
63 | 78 | static int comp_programid(ProgramInfo *a, ProgramInfo *b) |
64 | 79 | { |
65 | 80 | if (a->programid == b->programid) |
… |
… |
PlaybackBox::PlaybackBox(BoxType ltype, |
246 | 261 | drawListBounds(0, 0, 0, 0), drawInfoBounds(0, 0, 0, 0), |
247 | 262 | drawGroupBounds(0, 0, 0, 0), drawUsageBounds(0, 0, 0, 0), |
248 | 263 | drawVideoBounds(0, 0, 0, 0), blackholeBounds(0, 0, 0, 0), |
249 | | drawCurGroupBounds(0, 0, 0, 0), |
| 264 | drawCurGroupBounds(0, 0, 0, 0), drawSortOrderBounds(0, 0, 0, 0), |
250 | 265 | // General popup support |
251 | 266 | popup(NULL), expectingPopup(false), |
252 | 267 | // Recording Group popup support |
… |
… |
PlaybackBox::PlaybackBox(BoxType ltype, |
308 | 323 | if (!drawTransPixmap) |
309 | 324 | drawTransPixmap = new QPixmap(); |
310 | 325 | |
| 326 | episodeSort = gContext->GetSetting("PlayBoxEpisodeSort", "Date"); |
| 327 | |
311 | 328 | bool displayCat = gContext->GetNumSetting("DisplayRecGroupIsCategory", 0); |
312 | 329 | int initialFilt = gContext->GetNumSetting("QueryInitialFilter", 0); |
313 | 330 | |
… |
… |
void PlaybackBox::parseContainer(QDomEle |
597 | 614 | drawUsageBounds = area; |
598 | 615 | if (name.lower() == "cur_group") |
599 | 616 | drawCurGroupBounds = area; |
| 617 | if (name.lower() == "sortorder_info") |
| 618 | drawSortOrderBounds = area; |
600 | 619 | |
601 | 620 | } |
602 | 621 | |
… |
… |
void PlaybackBox::paintEvent(QPaintEvent |
707 | 726 | updateUsage(&p); |
708 | 727 | } |
709 | 728 | |
| 729 | if (r.intersects(drawSortOrderBounds) && !paintSkipUpdate) |
| 730 | { |
| 731 | updateSortOrder(&p); |
| 732 | } |
| 733 | |
710 | 734 | if (r.intersects(drawVideoBounds) && !paintSkipUpdate) |
711 | 735 | { |
712 | 736 | updateVideo(&p); |
… |
… |
void PlaybackBox::updateCurGroup(QPainte |
776 | 800 | } |
777 | 801 | } |
778 | 802 | |
| 803 | void PlaybackBox::updateSortOrder(QPainter *p) |
| 804 | { |
| 805 | QRect pr = drawSortOrderBounds; |
| 806 | QPixmap pix(pr.size()); |
| 807 | pix.fill(this, pr.topLeft()); |
| 808 | QPainter tmp(&pix); |
| 809 | |
| 810 | LayerSet *container = theme->GetSet("sortorder_info"); |
| 811 | if (container) |
| 812 | { |
| 813 | UITextType *type = (UITextType *)container->GetType("sortorder"); |
| 814 | if (type) |
| 815 | { |
| 816 | QString newtag = "(2) " + episodeSort; |
| 817 | type->SetText(tr(newtag)); |
| 818 | } |
| 819 | } |
| 820 | |
| 821 | if (container) |
| 822 | { |
| 823 | container->Draw(&tmp, 4, 0); |
| 824 | container->Draw(&tmp, 5, 0); |
| 825 | container->Draw(&tmp, 6, 0); |
| 826 | container->Draw(&tmp, 7, 0); |
| 827 | container->Draw(&tmp, 8, 0); |
| 828 | } |
| 829 | |
| 830 | tmp.end(); |
| 831 | p->drawPixmap(pr.topLeft(), pix); |
| 832 | } |
| 833 | |
779 | 834 | |
780 | 835 | void PlaybackBox::updateGroupInfo(QPainter *p, QRect& pr, |
781 | 836 | QPixmap& pix, QString cont_name) |
… |
… |
bool PlaybackBox::FillList(bool useCache |
1852 | 1907 | if (p->title == "") |
1853 | 1908 | p->title = tr("_NO_TITLE_"); |
1854 | 1909 | |
| 1910 | // Set sortTitle |
| 1911 | QString tmptitle = p->title; |
| 1912 | QString tmpsubtitle = p->subtitle; |
| 1913 | tmptitle.remove(QRegExp("^(The |A |An )")); |
| 1914 | tmpsubtitle.remove(QRegExp("^(The |A |An )")); |
| 1915 | p->sortTitle = tmptitle + " - " + tmpsubtitle; |
| 1916 | |
1855 | 1917 | if ((((p->recgroup == recGroup) || |
1856 | 1918 | ((recGroup == "All Programs") && |
1857 | 1919 | (p->recgroup != "Deleted") && |
… |
… |
bool PlaybackBox::FillList(bool useCache |
1974 | 2036 | return 0; |
1975 | 2037 | } |
1976 | 2038 | |
1977 | | QString episodeSort = gContext->GetSetting("PlayBoxEpisodeSort", "Date"); |
1978 | | |
1979 | 2039 | if (episodeSort == "OrigAirDate") |
1980 | 2040 | { |
1981 | 2041 | QMap<QString, ProgramList>::Iterator Iprog; |
… |
… |
bool PlaybackBox::FillList(bool useCache |
2018 | 2078 | } |
2019 | 2079 | } |
2020 | 2080 | } |
| 2081 | else if (episodeSort == "Title") |
| 2082 | { |
| 2083 | QMap<QString, ProgramList>::Iterator Iprog; |
| 2084 | for (Iprog = progLists.begin(); Iprog != progLists.end(); ++Iprog) |
| 2085 | { |
| 2086 | if (!Iprog.key().isEmpty()) |
| 2087 | { |
| 2088 | if (listOrder == 0 || type == Delete) |
| 2089 | Iprog.data().Sort(comp_title_rev); |
| 2090 | else |
| 2091 | Iprog.data().Sort(comp_title); |
| 2092 | } |
| 2093 | } |
| 2094 | } |
2021 | 2095 | |
2022 | 2096 | if (progLists[watchGroupLabel].count() > 1) |
2023 | 2097 | { |
… |
… |
bool PlaybackBox::FillList(bool useCache |
2278 | 2352 | if (oldprogramid > p->programid) |
2279 | 2353 | break; |
2280 | 2354 | } |
2281 | | else |
| 2355 | else if (episodeSort == "Date") |
2282 | 2356 | { |
2283 | 2357 | if (oldstartts > p->recstartts) |
2284 | 2358 | break; |
2285 | 2359 | } |
| 2360 | else |
| 2361 | { |
| 2362 | if (oldsTitle > sTitle) |
| 2363 | break; |
| 2364 | } |
2286 | 2365 | } |
2287 | 2366 | else |
2288 | 2367 | { |
… |
… |
bool PlaybackBox::FillList(bool useCache |
2296 | 2375 | if (oldprogramid < p->programid) |
2297 | 2376 | break; |
2298 | 2377 | } |
2299 | | else |
| 2378 | else if (episodeSort == "Date") |
2300 | 2379 | { |
2301 | 2380 | if (oldstartts < p->recstartts) |
2302 | 2381 | break; |
2303 | 2382 | } |
| 2383 | else |
| 2384 | { |
| 2385 | if (oldsTitle > sTitle) |
| 2386 | break; |
| 2387 | } |
2304 | 2388 | } |
2305 | 2389 | } |
2306 | 2390 | } |
… |
… |
void PlaybackBox::keyPressEvent(QKeyEven |
4269 | 4353 | exitWin(); |
4270 | 4354 | else if (action == "1" || action == "HELP") |
4271 | 4355 | showIconHelp(); |
| 4356 | else if (action == "2") |
| 4357 | { |
| 4358 | // Update Sort Order |
| 4359 | if (episodeSort == "OrigAirDate") { |
| 4360 | episodeSort = "Id"; |
| 4361 | } else if (episodeSort == "Id") { |
| 4362 | episodeSort = "Title"; |
| 4363 | } else if (episodeSort == "Title") { |
| 4364 | episodeSort = "Date"; |
| 4365 | } else { /* (episodeSort == "Date") */ |
| 4366 | episodeSort = "OrigAirDate"; |
| 4367 | } |
| 4368 | |
| 4369 | connected = FillList(true); |
| 4370 | paintSkipUpdate = false; |
| 4371 | update(drawTotalBounds); |
| 4372 | } |
4272 | 4373 | else if (action == "MENU") |
4273 | 4374 | showMenu(); |
4274 | 4375 | else if (action == "NEXTFAV") |
diff -p -r -u -N -X /tmp/diff.exclude -x release.21111.0803bare -x release.21111.0803bareb release.21111.0803bare/mythtv/programs/mythfrontend/playbackbox.h release.21111.0803bareb/mythtv/programs/mythfrontend/playbackbox.h
|
|
class PlaybackBox : public MythDialog |
332 | 332 | void updateShowTitles(QPainter *); |
333 | 333 | void updateInfo(QPainter *); |
334 | 334 | void updateUsage(QPainter *); |
| 335 | void updateSortOrder(QPainter *); |
335 | 336 | void updateProgramInfo(QPainter *p, QRect& pr, QPixmap& pix); |
336 | 337 | void updateCurGroup(QPainter *p); |
337 | 338 | void updateGroupInfo(QPainter *p, QRect& pr, QPixmap& pix, |
… |
… |
class PlaybackBox : public MythDialog |
347 | 348 | QString formatShortDate; |
348 | 349 | QString formatLongDate; |
349 | 350 | QString formatTime; |
| 351 | |
| 352 | QString episodeSort; |
350 | 353 | /// titleView controls showing titles in group list |
351 | 354 | bool titleView; |
352 | 355 | /// useCategories controls showing categories in group list |
… |
… |
class PlaybackBox : public MythDialog |
401 | 404 | QRect drawVideoBounds; |
402 | 405 | QRect blackholeBounds; |
403 | 406 | QRect drawCurGroupBounds; |
| 407 | QRect drawSortOrderBounds; |
404 | 408 | |
405 | 409 | // Popup support ////////////////////////////////////////////////////////// |
406 | 410 | // General popup support |