Ticket #2613: list_genre.diff
File list_genre.diff, 5.1 KB (added by , 18 years ago) |
---|
-
mythtv/themes/DVR/tv_lists.xml
56 56 <text lang="RU">ÐаÑегПÑОО</text> 57 57 <action>TV_SEARCH_CATEGORY</action> 58 58 </button> 59 60 <button> 61 <type>TV_SEARCH_CATEGORIES</type> 62 <text>Genres</text> 63 <action>TV_SEARCH_GENRE</action> 64 </button> 59 65 60 66 <button> 61 67 <type>TV_SEARCH_CHANNELS</type> -
mythtv/libs/libmythtv/proglist.h
21 21 plCategory, 22 22 plChannel, 23 23 plTime, 24 plRecordid 24 plRecordid, 25 plGenre 25 26 }; 26 27 27 28 -
mythtv/libs/libmythtv/proglist.cpp
286 286 case plChannel: value = tr("Channel Search"); break; 287 287 case plMovies: value = tr("Movie Search"); break; 288 288 case plTime: value = tr("Time Search"); break; 289 case plGenre: value = tr("Genre Search"); break; 289 290 default: value = tr("Unknown Search"); break; 290 291 } 291 292 ltype->SetText(value); … … 674 675 void ProgLister::chooseView(void) 675 676 { 676 677 if (type == plChannel || type == plCategory || 677 type == plMovies || type == plNewListings) 678 type == plMovies || type == plNewListings || 679 type == plGenre) 678 680 { 679 681 if (viewList.count() < 2) 680 682 return; … … 688 690 case plChannel: msg = tr("Select Channel"); break; 689 691 case plCategory: msg = tr("Select Category"); break; 690 692 case plNewListings: msg = tr("Select List"); break; 693 case plGenre: msg = tr("Select Genre"); break; 691 694 default: msg = tr("Select"); break; 692 695 } 693 696 choosePopup->addLabel(msg); … … 1232 1235 if (view != "") 1233 1236 curView = viewList.findIndex(view); 1234 1237 } 1238 else if (type == plGenre) // list by genre 1239 { 1240 MSqlQuery query(MSqlQuery::InitCon()); 1241 query.prepare("SELECT genre FROM programgenres GROUP BY genre;"); 1242 query.exec(); 1243 1244 if (query.isActive() && query.size()) 1245 { 1246 while (query.next()) 1247 { 1248 QString genre = query.value(0).toString(); 1249 if (genre <= " " || genre == NULL) 1250 continue; 1251 genre = QString::fromUtf8(query.value(0).toString()); 1252 viewList << genre; 1253 viewTextList << genre; 1254 } 1255 } 1256 if (view != "") 1257 curView = viewList.findIndex(view); 1258 } 1235 1259 else if (type == plTitleSearch || type == plKeywordSearch || 1236 1260 type == plPeopleSearch || type == plPowerSearch) 1237 1261 { … … 1518 1542 " AND program.endtime > :PGILSTART " 1519 1543 " AND program.category = :PGILPHRASE "; 1520 1544 } 1545 else if (type == plGenre) // list by category 1546 { 1547 where = "LEFT JOIN programgenres ON " 1548 " programgenres.chanid = program.chanid AND " 1549 " programgenres.starttime = program.starttime " 1550 "WHERE channel.visible = 1 " 1551 " AND program.endtime > :PGILSTART " 1552 " AND programgenres.genre = :PGILPHRASE "; 1553 } 1521 1554 else if (type == plMovies) // list movies 1522 1555 { 1523 1556 where = "WHERE channel.visible = 1 " -
mythtv/programs/mythfrontend/main.cpp
130 130 qApp->lock(); 131 131 } 132 132 133 void startSearchGenre(void) 134 { 135 ProgLister searchGenre(plGenre, "", "", 136 gContext->GetMainWindow(), "proglist"); 137 138 qApp->unlock(); 139 searchGenre.exec(); 140 qApp->lock(); 141 } 142 133 143 void startSearchMovie(void) 134 144 { 135 145 ProgLister searchMovie(plMovies, "", "", … … 317 327 startSearchChannel(); 318 328 else if (sel == "tv_search_category") 319 329 startSearchCategory(); 330 else if (sel == "tv_search_genre") 331 startSearchGenre(); 320 332 else if (sel == "tv_search_movie") 321 333 startSearchMovie(); 322 334 else if (sel == "tv_search_new") -
mythtv/programs/mythfrontend/tv_lists.xml
66 66 <text lang="RU">ÐаÑегПÑОО</text> 67 67 <action>TV_SEARCH_CATEGORY</action> 68 68 </button> 69 70 <button> 71 <type>TV_SEARCH_GENRES</type> 72 <text>Genres</text> 73 <action>TV_SEARCH_GENRE</action> 74 </button> 69 75 70 76 <button> 71 77 <type>TV_SEARCH_CHANNELS</type>