Ticket #10250: mythgame-multi.patch
| File mythgame-multi.patch, 87.4 KB (added by , 14 years ago) |
|---|
-
mythplugins/mythgame/mythgame/dbcheck.cpp
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/dbcheck.cpp mythtv-build-010912/mythplugins/mythgame/mythgame/dbcheck.cpp
old new 10 10 #include "dbcheck.h" 11 11 #include "gamesettings.h" 12 12 13 const QString currentDatabaseVersion = "101 8";13 const QString currentDatabaseVersion = "1019"; 14 14 15 15 static bool UpdateDBVersionNumber(const QString &newnumber) 16 16 { … … 437 437 return false; 438 438 } 439 439 440 if (dbver == "1018") 441 { 442 const QString updates[] = { 443 "ALTER TABLE gamemetadata " 444 "ADD developer varchar(128) NOT NULL AFTER publisher," 445 "ADD esrb tinyint(1) NOT NULL default -1 AFTER developer," 446 "ADD metarating tinyint(1) NOT NULL default 0 AFTER esrb," 447 "ADD rating tinyint(1) NOT NULL default 0 AFTER metarating;", 448 "ADD players tinyint(1) NOT NULL default 1 AFTER rating;", 449 "" 450 }; 451 if (!performActualUpdate(updates, "1019", dbver)) 452 return false; 453 } 454 440 455 return true; 441 456 } -
mythplugins/mythgame/mythgame/gamedetails.cpp
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/gamedetails.cpp mythtv-build-010912/mythplugins/mythgame/mythgame/gamedetails.cpp
old new 81 81 handleText("year", m_romInfo->Year()); 82 82 handleText("country", m_romInfo->Country()); 83 83 handleText("publisher", m_romInfo->Publisher()); 84 handleText("developer", m_romInfo->Developer()); 85 handleText("esrb", m_romInfo->ESRB_str()); 86 handleText("metarating", m_romInfo->Metarating_str()); 87 handleText("rating", m_romInfo->Rating_str()); 88 handleText("players", QString::number(m_romInfo->Players())); 84 89 handleText("description", m_romInfo->Plot()); 85 90 handleText("allsystems", m_romInfo->AllSystems()); 86 91 handleImage("fanart", m_romInfo->Fanart()); -
mythplugins/mythgame/mythgame/gamedetails.h
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/gamedetails.h mythtv-build-010912/mythplugins/mythgame/mythgame/gamedetails.h
old new 38 38 MythUIText *m_country; 39 39 MythUIText *m_plot; 40 40 MythUIText *m_publisher; 41 MythUIText *m_developer; 42 MythUIText *m_esrb; 43 MythUIText *m_metarating; 44 MythUIText *m_rating; 45 MythUIText *m_players; 41 46 MythUIText *m_allSystems; 42 47 MythUIImage *m_fanartImage; 43 48 MythUIImage *m_boxImage; -
mythplugins/mythgame/mythgame/gamehandler.cpp
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/gamehandler.cpp mythtv-build-010912/mythplugins/mythgame/mythgame/gamehandler.cpp
old new 155 155 *Year = QObject::tr("19xx"); 156 156 *Country = QObject::tr("Unknown"); 157 157 *GameName = QObject::tr("Unknown"); 158 *Genre = Q Object::tr("Unknown");158 *Genre = QString("Unknown%1").arg( handler->GameType() ); 159 159 *Plot = QObject::tr("Unknown"); 160 160 *Publisher = QObject::tr("Unknown"); 161 161 *Version = QObject::tr("0"); … … 168 168 { 169 169 LOG(VB_GENERAL, LOG_INFO, LOC + QString("ROMDB FOUND for %1 - %2") 170 170 .arg(romDB[key].GameName()).arg(key)); 171 *Year = romDB[key].Year(); 172 *Country = romDB[key].Country(); 173 *Genre = romDB[key].Genre(); 174 *Publisher = romDB[key].Publisher(); 175 *GameName = romDB[key].GameName(); 176 *Version = romDB[key].Version(); 171 if (!romDB[key].Year().trimmed().isEmpty()) 172 *Year = romDB[key].Year(); 173 if (!romDB[key].Country().trimmed().isEmpty()) 174 *Country = romDB[key].Country(); 175 if (!romDB[key].Genre().trimmed().isEmpty()) 176 *Genre = romDB[key].Genre(); 177 if (!romDB[key].Publisher().trimmed().isEmpty()) 178 *Publisher = romDB[key].Publisher(); 179 if (!romDB[key].GameName().trimmed().isEmpty()) 180 *GameName = romDB[key].GameName(); 181 if (!romDB[key].Version().trimmed().isEmpty()) 182 *Version = romDB[key].Version(); 177 183 } 178 184 else 179 185 { 180 186 LOG(VB_GENERAL, LOG_ERR, LOC + QString("NO ROMDB FOUND for %1 (%2)") 181 187 .arg(rom).arg(*CRC32)); 182 188 } 183 184 }; 185 186 if ((*Genre == "Unknown") || (*Genre).isEmpty()) 187 *Genre = QString("Unknown%1").arg( handler->GameType() ); 188 189 } 189 190 } 190 191 191 192 static void purgeGameDB(QString filename, QString RomPath) … … 390 391 391 392 GameScanMap::Iterator iter; 392 393 393 QString GameName, Genre, Country, CRC32, Year, Plot ;394 QString Publisher, Version, Fanart, Boxart, ScreenShot;394 QString GameName, Genre, Country, CRC32, Year, Plot, Publisher; 395 QString Developer, Version, Fanart, Boxart, ScreenShot; 395 396 QString thequery, queryvalues; 397 int ESRB = -1, Metarating = 0, Rating = 0, Players = 1; 396 398 397 399 int removalprompt = gCoreContext->GetSetting("GameRemovalPrompt").toInt(); 398 400 int indepth = gCoreContext->GetSetting("GameDeepScan").toInt(); 399 401 QString screenShotPath = gCoreContext->GetSetting("mythgame.screenshotdir"); 402 Developer = QObject::tr("Unknown"); 400 403 401 404 for (iter = m_GameMap.begin(); iter != m_GameMap.end(); ++iter) 402 405 { … … 451 454 query.prepare("INSERT INTO gamemetadata " 452 455 "(system, romname, gamename, genre, year, gametype, " 453 456 "rompath, country, crc_value, diskcount, display, plot, " 454 "publisher, version, fanart, boxart, screenshot) " 457 "publisher, developer, esrb, metarating, rating, " 458 "players, version, fanart, boxart, screenshot) " 455 459 "VALUES (:SYSTEM, :ROMNAME, :GAMENAME, :GENRE, :YEAR, " 456 ":GAMETYPE, :ROMPATH, :COUNTRY, :CRC32, '1', '1', :PLOT, :PUBLISHER, :VERSION, " 457 ":FANART, :BOXART, :SCREENSHOT)"); 460 ":GAMETYPE, :ROMPATH, :COUNTRY, :CRC32, '1', '1', :PLOT, " 461 ":PUBLISHER, :DEVELOPER, :ESRB, :METARATING, :RATING, " 462 ":PLAYERS, :VERSION, :FANART, :BOXART, :SCREENSHOT)"); 458 463 459 464 query.bindValue(":SYSTEM",handler->SystemName()); 460 465 query.bindValue(":ROMNAME",iter.value().Rom()); … … 467 472 query.bindValue(":CRC32", CRC32); 468 473 query.bindValue(":PLOT", Plot); 469 474 query.bindValue(":PUBLISHER", Publisher); 475 query.bindValue(":DEVELOPER", Developer); 476 query.bindValue(":ESRB", QString::number(ESRB)); 477 query.bindValue(":METARATING", QString::number(Metarating)); 478 query.bindValue(":RATING", QString::number(Rating)); 479 query.bindValue(":PLAYERS", QString::number(Players)); 470 480 query.bindValue(":VERSION", Version); 471 481 query.bindValue(":FANART", Fanart); 472 482 query.bindValue(":BOXART", Boxart); -
mythplugins/mythgame/mythgame/gamescan.cpp
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/gamescan.cpp mythtv-build-010912/mythplugins/mythgame/mythgame/gamescan.cpp
old new 117 117 RomInfo *add = new RomInfo(0, (*p).romfile, (*p).system, 118 118 (*p).romname, "", "", "", (*p).rompath, 119 119 "", "", 0, (*p).gametype, 0, "", "", "", 120 "", "", "", "", "");120 "", -1, 0, 0, 1, "", "", "", "", ""); 121 121 add->SaveToDatabase(); 122 122 m_DBDataChanged = true; 123 123 } … … 125 125 SendProgressEvent(++counter); 126 126 } 127 127 128 for (QList<uint>::iterator p = m_remove.begin(); 129 p != m_remove.end(); ++p) 128 // Do not remove if user has requested a prompt 129 // Very annoying to accidentally hit the menu scan option when a large database 130 // has been defined for games on a removable device 131 if (!gCoreContext->GetSetting("GameRemovalPrompt").toInt()) 130 132 { 131 removeOrphan(*p); 132 m_DBDataChanged = true; 133 for (QList<uint>::iterator p = m_remove.begin(); p != m_remove.end(); ++p) 134 { 135 removeOrphan(*p); 136 m_DBDataChanged = true; 137 } 133 138 } 134 139 } 135 140 -
mythplugins/mythgame/mythgame/gamesettings.cpp
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/gamesettings.cpp mythtv-build-010912/mythplugins/mythgame/mythgame/gamesettings.cpp
old new 24 24 HostLineEdit *gc = new HostLineEdit("GameAllTreeLevels"); 25 25 gc->setLabel(QObject::tr("Game display order")); 26 26 gc->setValue("system gamename"); 27 gc->setHelpText(QObject::tr(" Order in which to sort the games"28 " - this is for all systems. Available choices:"29 " system, year, genre and gamename"));27 gc->setHelpText(QObject::tr("Metadata values used to build dynamic game " 28 "tree. Available choices: system, year, genre, players, " 29 "esrb, rating, developer, publisher, and country")); 30 30 return gc; 31 31 } 32 32 … … 35 35 HostLineEdit *gc = new HostLineEdit("GameFavTreeLevels"); 36 36 gc->setLabel(QObject::tr("Favourite display order")); 37 37 gc->setValue("gamename"); 38 gc->setHelpText(QObject::tr("Order in which to sort the games " 39 "marked as favourites " 40 "- this is for all systems. Available choices: " 41 "system, year, genre and gamename")); 38 gc->setHelpText(QObject::tr("Order in which to sort the games marked " 39 "as favourites. Available choices: system, year, genre, " 40 "esrb, rating, developer, publisher, and country")); 42 41 return gc; 43 42 } 44 43 -
mythplugins/mythgame/mythgame/gameui.cpp
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/gameui.cpp mythtv-build-010912/mythplugins/mythgame/mythgame/gameui.cpp
old new 5 5 #include <mythcontext.h> 6 6 #include <mythuibuttontree.h> 7 7 #include <metadata/mythuimetadataresults.h> 8 #include <metadata/mythuiimageresults.h> 8 9 #include <mythuiimage.h> 9 10 #include <mythuitext.h> 10 11 #include <mythuistatetype.h> … … 24 25 class GameTreeInfo 25 26 { 26 27 public: 27 GameTreeInfo(const QString& levels, const QString& filter) 28 : m_levels(levels.split(" ")) 28 GameTreeInfo(const QString& sortby, const QString& si, const QString& filter) 29 : m_sortby(sortby.split(" ")) 30 , m_sorted(si.toLower()) 29 31 , m_filter(filter) 30 32 { 31 33 } 32 34 33 int getDepth() const { return m_ levels.size(); }34 const QString& getLevel(unsigned i) const { return m_ levels[i]; }35 int getDepth() const { return m_sortby.size(); } 36 const QString& getLevel(unsigned i) const { return m_sortby[i]; } 35 37 const QString& getFilter() const { return m_filter; } 38 const QString& getSorted(unsigned i) const { return m_sorted[i]; } 39 void setSorted(const QString &lsorted, int i) 40 { 41 if (i > 0) 42 m_sorted.insert(i, lsorted.toLower()); 43 while ((m_sorted.size() - 1) > i) 44 m_sorted.removeLast(); 45 } 46 const QStringList getToSort(int i) 47 { 48 QStringList to_sort = QStringList(m_sortby); 49 50 for (int k = 0; k < i; k++) 51 { 52 if (to_sort.contains(m_sorted[k])) 53 to_sort.removeOne(m_sorted[k]); 54 } 55 56 return to_sort; 57 } 36 58 37 59 private: 38 QStringList m_levels; 60 QStringList m_sortby; 61 QStringList m_sorted; 39 62 QString m_filter; 40 63 }; 41 64 … … 44 67 GameUI::GameUI(MythScreenStack *parent) 45 68 : MythScreenType(parent, "GameUI"), 46 69 m_showHashed(false), m_gameShowFileName(0), 47 m_ gameTree(NULL), m_favouriteNode(NULL),48 m_ busyPopup(0),70 m_showHidden(false), m_gameTree(NULL), 71 m_favouriteNode(NULL), m_busyPopup(0), 49 72 m_gameUITree(NULL), m_gameTitleText(NULL), 50 73 m_gameSystemText(NULL), m_gameYearText(NULL), 51 74 m_gameGenreText(NULL), m_gamePlotText(NULL), 75 m_gamePublisherText(NULL), m_gameDeveloperText(NULL), 76 m_gameESRBText(NULL), m_gameMetaratingText(NULL), 77 m_gameRatingText(NULL), m_gamePlayersText(NULL), 52 78 m_gameFavouriteState(NULL), m_gameImage(NULL), 53 79 m_fanartImage(NULL), m_boxImage(NULL), 54 80 m_scanner(NULL) … … 74 100 UIUtilW::Assign(this, m_gameSystemText, "system"); 75 101 UIUtilW::Assign(this, m_gameYearText, "year"); 76 102 UIUtilW::Assign(this, m_gameGenreText, "genre"); 103 UIUtilW::Assign(this, m_gamePublisherText, "publisher"); 104 UIUtilW::Assign(this, m_gameDeveloperText, "developer"); 105 UIUtilW::Assign(this, m_gameESRBText, "esrb"); 106 UIUtilW::Assign(this, m_gameMetaratingText, "metarating"); 107 UIUtilW::Assign(this, m_gameRatingText, "rating"); 108 UIUtilW::Assign(this, m_gamePlayersText, "players"); 77 109 UIUtilW::Assign(this, m_gameFavouriteState, "favorite"); 78 110 UIUtilW::Assign(this, m_gamePlotText, "description"); 79 111 UIUtilW::Assign(this, m_gameImage, "screenshot"); … … 134 166 // approach with multiple roots if/when someone has the time to create 135 167 // the relevant dialog screens 136 168 137 QString levels= gCoreContext->GetSetting("GameFavTreeLevels");169 QString sortby = gCoreContext->GetSetting("GameFavTreeLevels"); 138 170 139 171 MythGenericTree *new_node = new MythGenericTree(tr("Favorites"), 1, true); 140 172 new_node->SetData(qVariantFromValue( 141 new GameTreeInfo( levels, systemFilter + " and favorite=1")));173 new GameTreeInfo(sortby, sortby.section(' ', 0, 0), systemFilter + " and favorite=1"))); 142 174 m_favouriteNode = m_gameTree->addNode(new_node); 175 if (m_gameTitleText) 176 m_gameTitleText->SetText(QString("Sort by Favorites")); 143 177 144 levels= gCoreContext->GetSetting("GameAllTreeLevels");178 sortby = gCoreContext->GetSetting("GameAllTreeLevels"); 145 179 146 180 if (m_showHashed) 147 181 { 148 int pos = levels.indexOf("gamename");182 int pos = sortby.indexOf("gamename"); 149 183 if (pos >= 0) 150 levels.insert(pos, " hash ");184 sortby.insert(pos, " hash "); 151 185 } 152 186 153 new_node = new MythGenericTree(tr("All Games"), 1, true); 154 new_node->SetData(qVariantFromValue( 155 new GameTreeInfo(levels, systemFilter))); 156 m_gameTree->addNode(new_node); 187 if (sortby.trimmed().isEmpty()) 188 { 189 new_node = new MythGenericTree(tr("Games"), 1, true); 190 new_node->SetData(qVariantFromValue( 191 new GameTreeInfo(m_showHashed ? "hash" : "gamename", 192 m_showHashed ? "hash" : "gamename", 193 systemFilter))); 194 m_gameTree->addNode(new_node); 195 } 157 196 158 new_node = new MythGenericTree(tr("- By Genre"), 1, true);159 new_node->SetData(qVariantFromValue(160 new GameTreeInfo("genre gamename", systemFilter)));161 m_gameTree->addNode(new_node);197 QString sort_item; 198 for (unsigned i = 0; !(sort_item = sortby.section(' ', i, i).trimmed()).isEmpty(); i++) 199 { 200 QString new_sort = sortby; 162 201 163 new_node = new MythGenericTree(tr("- By Year"), 1, true); 164 new_node->SetData(qVariantFromValue( 165 new GameTreeInfo("year gamename", systemFilter))); 166 m_gameTree->addNode(new_node); 202 new_sort.remove(sort_item + " "); 203 new_sort.insert(0, sort_item + " "); 167 204 168 new_node = new MythGenericTree(tr("- By Name"), 1, true); 169 new_node->SetData(qVariantFromValue( 170 new GameTreeInfo("gamename", systemFilter))); 171 m_gameTree->addNode(new_node); 172 173 new_node = new MythGenericTree(tr("- By Publisher"), 1, true); 174 new_node->SetData(qVariantFromValue( 175 new GameTreeInfo("publisher gamename", systemFilter))); 176 m_gameTree->addNode(new_node); 205 sort_item[0] = sort_item[0].toUpper(); 206 new_node = new MythGenericTree(sort_item, 1, true); 207 new_node->SetData(qVariantFromValue( 208 new GameTreeInfo(new_sort.trimmed(), sort_item, systemFilter))); 209 m_gameTree->addNode(new_node); 210 } 177 211 212 fillNode(m_gameTree->getSelectedChild()); 178 213 m_gameUITree->AssignTree(m_gameTree); 179 214 } 180 215 … … 221 256 if (!node) 222 257 return; 223 258 259 int sortLevel = (node->getInt() / 2); 260 bool sortTree = (node->getInt() % 2); 261 224 262 if (!isLeaf(node)) 225 263 { 264 if (sortLevel && !sortTree) 265 { 266 QString si = node->getParent()->getString().toLower(); 267 setSortedString(node, si, sortLevel - 1); 268 } 269 226 270 if (node->childCount() == 0 || node == m_favouriteNode) 227 271 { 228 272 node->deleteAllChildren(); 229 273 fillNode(node); 230 274 } 231 275 clearRomInfo(); 276 277 if (m_gameTitleText && sortTree) 278 m_gameTitleText->SetText(QString("Sort by " + node->getString())); 279 280 if (sortLevel) 281 { 282 if (!sortTree) 283 { 284 QString tmptitle = getSortedString(node, sortLevel - 1); 285 286 if (m_gameTitleText) 287 { 288 if (tmptitle == "esrb") 289 tmptitle = tmptitle.toUpper(); 290 else 291 tmptitle[0] = tmptitle[0].toUpper(); 292 293 m_gameTitleText->SetText("Select " + tmptitle); 294 } 295 } 296 } 232 297 } 233 298 else 234 299 { … … 329 394 m_gameGenreText->SetText(rom->Genre()); 330 395 if (m_gamePlotText) 331 396 m_gamePlotText->SetText(rom->Plot()); 397 if (m_gamePublisherText) 398 m_gamePublisherText->SetText(rom->Publisher()); 399 if (m_gameDeveloperText) 400 m_gameDeveloperText->SetText(rom->Developer()); 401 if (m_gameESRBText) 402 m_gameESRBText->SetText(rom->ESRB_str()); 403 if (m_gameMetaratingText) 404 m_gameMetaratingText->SetText(rom->Metarating_str()); 405 if (m_gameRatingText) 406 m_gameRatingText->SetText(rom->Rating_str()); 407 if (m_gamePlayersText) 408 m_gamePlayersText->SetText(QString::number(rom->Players())); 332 409 333 410 if (m_gameFavouriteState) 334 411 { … … 367 444 m_gameGenreText->Reset(); 368 445 if (m_gamePlotText) 369 446 m_gamePlotText->Reset(); 447 if (m_gamePublisherText) 448 m_gamePublisherText->Reset(); 449 if (m_gameDeveloperText) 450 m_gameDeveloperText->Reset(); 451 if (m_gameESRBText) 452 m_gameESRBText->Reset(); 453 if (m_gameMetaratingText) 454 m_gameMetaratingText->Reset(); 455 if (m_gameRatingText) 456 m_gameRatingText->Reset(); 457 if (m_gamePlayersText) 458 m_gamePlayersText->Reset(); 370 459 if (m_gameFavouriteState) 371 460 m_gameFavouriteState->Reset(); 372 461 … … 438 527 showMenuPopup->SetReturnEvent(this, "showMenuPopup"); 439 528 440 529 showMenuPopup->AddButton(tr("Scan For Changes")); 530 531 if (showHidden()) 532 showMenuPopup->AddButton(tr("Hide Hidden")); 533 else 534 showMenuPopup->AddButton(tr("Show Hidden")); 535 441 536 if (isLeaf(node)) 442 537 { 443 538 RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData()); … … 521 616 { 522 617 doScan(); 523 618 } 619 else if (resulttext == tr("Show Hidden") || 620 resulttext == tr("Hide Hidden")) 621 { 622 toggleHidden(); 623 } 524 624 else if (resulttext == tr("Show Information")) 525 625 { 526 626 showInfo(); … … 637 737 638 738 QString GameUI::getFillSql(MythGenericTree *node) const 639 739 { 640 QString layer = node->getString(); 641 int childDepth = node->getInt() + 1; 642 QString childLevel = getChildLevelString(node); 740 int sortLevel = (node->getInt() / 2); 741 bool sortTree = (node->getInt() % 2); 742 QString layer = sortTree ? node->getString() : node->getParent()->getString(); 743 QString childLevel = layer.toLower(); 643 744 QString filter = getFilter(node); 644 bool childIsLeaf = childDepth == getLevelsOnThisBranch(node) + 1;745 bool childIsLeaf = ((layer == "Games") || (sortLevel == getLevelsOnThisBranch(node))); 645 746 RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData()); 646 747 647 748 QString columns; 648 749 QString conj = "where "; 649 750 751 if (childIsLeaf) 752 { 753 childLevel = m_showHashed ? "hash" : "gamename"; 754 } 755 else if (layer == "Favorites") 756 { 757 childLevel = getChildLevelString(node); 758 } 759 650 760 if (!filter.isEmpty()) 651 761 { 652 762 filter = conj + filter; … … 713 823 filter += conj + "publisher=:PUBLISHER"; 714 824 conj = " and "; 715 825 } 826 if (!romInfo->Developer().isEmpty()) 827 { 828 filter += conj + "developer=:DEVELOPER"; 829 conj = " and "; 830 } 831 if (!romInfo->Country().isEmpty()) 832 { 833 filter += conj + "trim(country)=:COUNTRY"; 834 } 716 835 if (!romInfo->Gamename().isEmpty()) 717 836 { 718 837 filter += conj + "trim(gamename)=:GAMENAME"; 719 838 } 720 839 840 for (int i = 0; i < sortLevel; i++) 841 { 842 QString si = getSortedString(node, i); 843 844 if (si == "esrb") 845 filter += conj + "esrb=:ESRB"; 846 else if (si == "metarating") 847 filter += conj + "metarating=:METARATING"; 848 else if (si == "rating") 849 filter += conj + "rating=:RATING"; 850 else if (si == "players") 851 filter += conj + "players=:PLAYERS"; 852 } 721 853 } 722 854 723 filter += conj + " display = 1 "; 855 if (!showHidden()) 856 filter += conj + " display = 1 "; 724 857 725 858 QString sql; 726 859 … … 758 891 759 892 QString GameUI::getChildLevelString(MythGenericTree *node) const 760 893 { 761 unsigned this_level = node->getInt() ;894 unsigned this_level = node->getInt() / 2; 762 895 while (node->getInt() != 1) 763 896 node = node->getParent(); 764 897 765 898 GameTreeInfo *gi = qVariantValue<GameTreeInfo *>(node->GetData()); 766 return gi->getLevel(this_level - 1); 899 return gi->getLevel(this_level); 900 } 901 902 QString GameUI::getSortedString(MythGenericTree *node, unsigned index) const 903 { 904 unsigned this_index = (index == 0xffff) ? (node->getInt() / 2): index; 905 while (node->getInt() != 1) 906 node = node->getParent(); 907 908 GameTreeInfo *gi = qVariantValue<GameTreeInfo *>(node->GetData()); 909 return gi->getSorted(this_index); 767 910 } 768 911 769 912 QString GameUI::getFilter(MythGenericTree *node) const … … 774 917 return gi->getFilter(); 775 918 } 776 919 920 void GameUI::setSortedString(MythGenericTree *node, QString si, unsigned index) 921 { 922 while (node->getInt() != 1) 923 node = node->getParent(); 924 GameTreeInfo *gi = qVariantValue<GameTreeInfo *>(node->GetData()); 925 gi->setSorted(si, index); 926 } 927 928 QStringList GameUI::getToSortList(MythGenericTree *node, int index) 929 { 930 while (node->getInt() != 1) 931 node = node->getParent(); 932 GameTreeInfo *gi = qVariantValue<GameTreeInfo *>(node->GetData()); 933 return gi->getToSort(index); 934 } 935 777 936 int GameUI::getLevelsOnThisBranch(MythGenericTree *node) const 778 937 { 779 938 while (node->getInt() != 1) … … 785 944 786 945 bool GameUI::isLeaf(MythGenericTree *node) const 787 946 { 788 return (node->getInt() - 1) == getLevelsOnThisBranch(node);947 return (((node->getInt() - 1) / 2) == getLevelsOnThisBranch(node)) || node->getParent()->getString() == "Games"; 789 948 } 790 949 791 950 void GameUI::fillNode(MythGenericTree *node) 792 951 { 793 952 QString layername = node->getString(); 794 953 RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData()); 954 int sortLevel = (node->getInt() / 2); 955 bool sortTree = (node->getInt() % 2); 956 957 bool childIsLeaf = (layername == "Games") || 958 (!sortTree && (sortLevel == getLevelsOnThisBranch(node))); 959 960 if (!childIsLeaf && sortLevel && !sortTree) 961 { 962 QStringList ts = getToSortList(node, sortLevel); 963 int ns = getLevelsOnThisBranch(node); 964 965 MythGenericTree *new_node = new MythGenericTree(tr("Games"), 966 node->getInt() + 1, 967 false); 968 new_node->SetData(qVariantFromValue(romInfo)); 969 node->addNode(new_node); 970 971 for (int i = 0; i < (ns - sortLevel); i++) 972 { 973 QString ni = ts[i]; 974 975 if (ni == "esrb") 976 ni = ni.toUpper(); 977 else 978 ni[0] = ni[0].toUpper(); 979 980 MythGenericTree *new_node = new MythGenericTree(ni, 981 node->getInt() + 1, 982 false); 983 new_node->SetData(qVariantFromValue(romInfo)); 984 node->addNode(new_node); 985 } 986 987 return; 988 } 795 989 796 990 MSqlQuery query(MSqlQuery::InitCon()); 797 991 … … 809 1003 query.bindValue(":PLOT", romInfo->Plot()); 810 1004 if (!romInfo->Publisher().isEmpty()) 811 1005 query.bindValue(":PUBLISHER", romInfo->Publisher()); 1006 if (!romInfo->Developer().isEmpty()) 1007 query.bindValue(":DEVELOPER", romInfo->Developer()); 1008 1009 for (int i = 0; i < sortLevel; i++) 1010 { 1011 QString si = getSortedString(node, i); 1012 1013 if (si == "esrb") 1014 query.bindValue(":ESRB", QString::number(romInfo->ESRB())); 1015 else if (si == "metarating") 1016 query.bindValue(":METARATING", QString::number(romInfo->Metarating())); 1017 else if (si == "rating") 1018 query.bindValue(":RATING", QString::number(romInfo->Rating())); 1019 else if (si == "players") 1020 query.bindValue(":PLAYERS", QString::number(romInfo->Players())); 1021 } 1022 1023 if (!romInfo->Country().isEmpty()) 1024 query.bindValue(":COUNTRY", romInfo->Country()); 812 1025 if (!romInfo->Gamename().isEmpty()) 813 1026 query.bindValue(":GAMENAME", romInfo->Gamename()); 814 1027 } 815 1028 816 bool IsLeaf = node->getInt() == getLevelsOnThisBranch(node);817 1029 if (query.exec() && query.size() > 0) 818 1030 { 819 1031 while (query.next()) … … 821 1033 QString current = query.value(0).toString().trimmed(); 822 1034 MythGenericTree *new_node = 823 1035 new MythGenericTree(current, node->getInt() + 1, false); 824 if ( IsLeaf)1036 if (childIsLeaf) 825 1037 { 826 1038 RomInfo *temp = new RomInfo(); 827 1039 temp->setSystem(query.value(1).toString().trimmed()); … … 834 1046 else 835 1047 { 836 1048 RomInfo *newRomInfo; 837 if ( node->getInt() > 1)1049 if (sortLevel > 0) 838 1050 { 839 1051 RomInfo *currentRomInfo; 840 1052 currentRomInfo = qVariantValue<RomInfo *>(node->GetData()); … … 846 1058 } 847 1059 new_node->SetData(qVariantFromValue(newRomInfo)); 848 1060 node->addNode(new_node); 849 if (getChildLevelString(node) != "hash") 850 newRomInfo->setField(getChildLevelString(node), current); 1061 QString ci = node->getString().toLower(); 1062 1063 if (ci != "hash") 1064 { 1065 if (ci == "favorites") 1066 ci = getChildLevelString(node); 1067 1068 newRomInfo->setField(ci, current); 1069 if (ci == "rating") 1070 new_node->SetText(newRomInfo->Rating_str()); 1071 else if (ci == "esrb") 1072 new_node->SetText(newRomInfo->ESRB_str()); 1073 } 851 1074 } 852 1075 } 853 1076 } … … 970 1193 return; 971 1194 972 1195 metadata->setGamename(lookup->GetTitle()); 973 metadata->setYear(QString::number(lookup->GetYear()));974 1196 metadata->setPlot(lookup->GetDescription()); 975 metadata->setSystem(lookup->GetSystem()); 1197 if (metadata->Genre().trimmed().isEmpty() || metadata->Genre().contains("Unknown")) 1198 metadata->setGenre(lookup->GetCategories().join("/")); 1199 if (metadata->Country().trimmed().isEmpty()) 1200 metadata->setCountry(lookup->GetCountries().join("/")); 1201 if (metadata->Publisher().trimmed().isEmpty() || metadata->Publisher().contains("Unknown")) 1202 metadata->setPublisher(lookup->GetPublishers().join("/")); 1203 if (metadata->Developer().trimmed().isEmpty() || metadata->Developer().contains("Unknown")) 1204 metadata->setDeveloper(lookup->GetStudios().join("/")); 1205 if ((metadata->Year().trimmed().isEmpty() || !metadata->Year().compare("0") || 1206 !metadata->Year().compare("19xx")) && (lookup->GetYear() > 1950)) 1207 metadata->setYear(QString::number(lookup->GetYear())); 1208 if (lookup->GetPopularity() > 0) 1209 metadata->setMetarating(lookup->GetPopularity()); 976 1210 977 QStringList coverart, fanart, screenshot;1211 m_metadataNode = node; 978 1212 979 1213 // Imagery 980 1214 ArtworkList coverartlist = lookup->GetArtwork(kArtworkCoverart); 981 for (ArtworkList::const_iterator p = coverartlist.begin(); 982 p != coverartlist.end(); ++p) 1215 if (coverartlist.count() > 0) 983 1216 { 984 coverart.prepend((*p).url); 1217 ImageSearchResultsDialog *resultsdialog = 1218 new ImageSearchResultsDialog(m_popupStack, coverartlist, kArtworkCoverart); 1219 1220 connect(resultsdialog, SIGNAL(haveResult(ArtworkInfo, VideoArtworkType)), 1221 SLOT(OnImageSearchListSelection(ArtworkInfo, VideoArtworkType))); 1222 1223 if (resultsdialog->Create()) 1224 m_popupStack->AddScreen(resultsdialog); 985 1225 } 1226 986 1227 ArtworkList fanartlist = lookup->GetArtwork(kArtworkFanart); 987 for (ArtworkList::const_iterator p = fanartlist.begin(); 988 p != fanartlist.end(); ++p) 1228 if (fanartlist.count() > 0) 989 1229 { 990 fanart.prepend((*p).url); 1230 ImageSearchResultsDialog *resultsdialog = 1231 new ImageSearchResultsDialog(m_popupStack, fanartlist, kArtworkFanart); 1232 1233 connect(resultsdialog, SIGNAL(haveResult(ArtworkInfo, VideoArtworkType)), 1234 SLOT(OnImageSearchListSelection(ArtworkInfo, VideoArtworkType))); 1235 1236 if (resultsdialog->Create()) 1237 m_popupStack->AddScreen(resultsdialog); 991 1238 } 1239 992 1240 ArtworkList screenshotlist = lookup->GetArtwork(kArtworkScreenshot); 993 for (ArtworkList::const_iterator p = screenshotlist.begin(); 994 p != screenshotlist.end(); ++p) 1241 if (screenshotlist.count() > 0) 995 1242 { 996 screenshot.prepend((*p).url);997 }1243 ImageSearchResultsDialog *resultsdialog = 1244 new ImageSearchResultsDialog(m_popupStack, screenshotlist, kArtworkScreenshot); 998 1245 999 StartGameImageSet(node, coverart, fanart, screenshot); 1246 connect(resultsdialog, SIGNAL(haveResult(ArtworkInfo, VideoArtworkType)), 1247 SLOT(OnImageSearchListSelection(ArtworkInfo, VideoArtworkType))); 1248 1249 if (resultsdialog->Create()) 1250 m_popupStack->AddScreen(resultsdialog); 1251 } 1000 1252 1001 1253 metadata->SaveToDatabase(); 1002 1254 updateChangedNode(node, metadata); 1003 1255 } 1004 1256 1005 void GameUI::StartGameImageSet(MythGenericTree *node, QStringList coverart, 1006 QStringList fanart, QStringList screenshot) 1257 void GameUI::OnImageSearchListSelection(ArtworkInfo info, VideoArtworkType type) 1007 1258 { 1008 if (!node) 1009 return; 1010 1011 RomInfo *metadata = qVariantValue<RomInfo *>(node->GetData()); 1259 RomInfo *metadata = qVariantValue<RomInfo *>(m_metadataNode->GetData()); 1012 1260 1013 1261 if (!metadata) 1014 1262 return; 1015 1263 1016 ArtworkMap map; 1017 1018 QString inetref = metadata->Inetref(); 1019 QString system = metadata->System(); 1020 QString title = metadata->Gamename(); 1021 1022 if (metadata->Boxart().isEmpty() && coverart.size()) 1023 { 1024 ArtworkInfo info; 1025 info.url = coverart.takeAt(0).trimmed(); 1026 map.insert(kArtworkCoverart, info); 1027 } 1028 1029 if (metadata->Fanart().isEmpty() && fanart.size()) 1030 { 1031 ArtworkInfo info; 1032 info.url = fanart.takeAt(0).trimmed(); 1033 map.insert(kArtworkFanart, info); 1034 } 1035 1036 if (metadata->Screenshot().isEmpty() && screenshot.size()) 1037 { 1038 ArtworkInfo info; 1039 info.url = screenshot.takeAt(0).trimmed(); 1040 map.insert(kArtworkScreenshot, info); 1041 } 1042 1043 MetadataLookup *lookup = new MetadataLookup(); 1044 lookup->SetTitle(metadata->Gamename()); 1045 lookup->SetSystem(metadata->System()); 1046 lookup->SetInetref(metadata->Inetref()); 1047 lookup->SetType(kMetadataGame); 1048 lookup->SetDownloads(map); 1049 lookup->SetData(qVariantFromValue(node)); 1050 1051 m_imageDownload->addDownloads(lookup); 1264 MetadataLookup *m_lookup = new MetadataLookup(); 1265 m_lookup->SetType(kMetadataGame); 1266 m_lookup->SetHost(gCoreContext->GetMasterHostName()); 1267 m_lookup->SetAutomatic(true); 1268 1269 ArtworkMap downloads; 1270 downloads.insert(type, info); 1271 m_lookup->SetDownloads(downloads); 1272 m_lookup->SetAllowOverwrites(true); 1273 m_lookup->SetTitle(metadata->Gamename()); 1274 m_lookup->SetSystem(metadata->System()); 1275 m_lookup->SetInetref(metadata->Inetref()); 1276 m_lookup->SetData(qVariantFromValue(m_metadataNode)); 1277 m_imageDownload->addDownloads(m_lookup); 1052 1278 } 1053 1279 1054 1280 void GameUI::handleDownloadedImages(MetadataLookup *lookup) -
mythplugins/mythgame/mythgame/gameui.h
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/gameui.h mythtv-build-010912/mythplugins/mythgame/mythgame/gameui.h
old new 44 44 void OnGameSearchDone(MetadataLookup *lookup); 45 45 void StartGameImageSet(MythGenericTree *node, QStringList coverart, 46 46 QStringList fanart, QStringList screenshot); 47 void OnImageSearchListSelection(ArtworkInfo info, VideoArtworkType type); 47 48 void doScan(void); 48 49 void reloadAllData(bool dbchanged); 49 50 … … 55 56 void showMenu(void); 56 57 void searchStart(void); 57 58 void toggleFavorite(void); 59 void toggleHidden(void) { m_showHidden = 1 - m_showHidden; } 60 int showHidden() const { return m_showHidden; } 58 61 void customEvent(QEvent *event); 59 62 void createBusyDialog(QString title); 60 63 61 64 QString getFillSql(MythGenericTree* node) const; 62 65 QString getChildLevelString(MythGenericTree *node) const; 66 QString getSortedString(MythGenericTree *node, unsigned level=0xffff) const; 63 67 QString getFilter(MythGenericTree *node) const; 68 void setSortedString(MythGenericTree *node, QString si, unsigned index); 69 QStringList getToSortList(MythGenericTree *node, int index); 64 70 int getLevelsOnThisBranch(MythGenericTree *node) const; 65 71 bool isLeaf(MythGenericTree *node) const; 66 72 void fillNode(MythGenericTree *node); … … 71 77 private: 72 78 bool m_showHashed; 73 79 int m_gameShowFileName; 80 bool m_showHidden; 74 81 75 82 MythGenericTree *m_gameTree; 76 83 MythGenericTree *m_favouriteNode; 84 MythGenericTree *m_metadataNode; 77 85 78 86 MythUIBusyDialog *m_busyPopup; 79 87 MythScreenStack *m_popupStack; … … 84 92 MythUIText *m_gameYearText; 85 93 MythUIText *m_gameGenreText; 86 94 MythUIText *m_gamePlotText; 95 MythUIText *m_gamePublisherText; 96 MythUIText *m_gameDeveloperText; 97 MythUIText *m_gameESRBText; 98 MythUIText *m_gameMetaratingText; 99 MythUIText *m_gameRatingText; 100 MythUIText *m_gamePlayersText; 87 101 MythUIStateType *m_gameFavouriteState; 88 102 MythUIImage *m_gameImage; 89 103 MythUIImage *m_fanartImage; -
mythplugins/mythgame/mythgame/romedit.cpp
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/romedit.cpp mythtv-build-010912/mythplugins/mythgame/mythgame/romedit.cpp
old new 20 20 QString name, RomInfo *romInfo) : MythScreenType(parent, name), 21 21 m_id(""), m_retObject(NULL), m_gamenameEdit(NULL), m_genreEdit(NULL), 22 22 m_yearEdit(NULL), m_countryEdit(NULL), m_plotEdit(NULL), 23 m_publisherEdit(NULL), m_favoriteCheck(NULL), m_screenshotButton(NULL), 24 m_screenshotText(NULL), m_fanartButton(NULL), m_fanartText(NULL), 25 m_boxartButton(NULL), m_boxartText(NULL), m_doneButton(NULL) 23 m_publisherEdit(NULL), m_developerEdit(NULL), m_esrbList(NULL), 24 m_ratingList(NULL), m_playersEdit(NULL), m_favoriteCheck(NULL), 25 m_displayCheck(NULL), m_screenshotButton(NULL), m_screenshotText(NULL), 26 m_fanartButton(NULL), m_fanartText(NULL), m_boxartButton(NULL), 27 m_boxartText(NULL), m_doneButton(NULL) 26 28 { 27 29 m_workingRomInfo = new RomInfo(*romInfo); 28 30 } … … 44 46 UIUtilE::Assign(this, m_countryEdit, "country_edit", &err); 45 47 UIUtilE::Assign(this, m_plotEdit, "description_edit", &err); 46 48 UIUtilE::Assign(this, m_publisherEdit, "publisher_edit", &err); 49 UIUtilE::Assign(this, m_developerEdit, "developer_edit", &err); 50 UIUtilE::Assign(this, m_esrbList, "esrb_list", &err); 51 UIUtilE::Assign(this, m_ratingList, "rating_list", &err); 52 UIUtilE::Assign(this, m_playersEdit, "players_edit", &err); 47 53 48 54 UIUtilE::Assign(this, m_favoriteCheck, "favorite_check", &err); 55 UIUtilE::Assign(this, m_displayCheck, "display_check", &err); 49 56 50 57 UIUtilE::Assign(this, m_screenshotButton, "screenshot_button", &err); 51 58 UIUtilE::Assign(this, m_screenshotText, "screenshot_text", &err); … … 72 79 connect(m_countryEdit, SIGNAL(valueChanged()), SLOT(SetCountry())); 73 80 connect(m_plotEdit, SIGNAL(valueChanged()), SLOT(SetPlot())); 74 81 connect(m_publisherEdit, SIGNAL(valueChanged()), SLOT(SetPublisher())); 82 connect(m_developerEdit, SIGNAL(valueChanged()), SLOT(SetDeveloper())); 83 connect(m_esrbList, SIGNAL(itemSelected(MythUIButtonListItem *)), SLOT(SetESRB())); 84 connect(m_ratingList, SIGNAL(itemSelected(MythUIButtonListItem *)), SLOT(SetRating())); 85 connect(m_playersEdit, SIGNAL(valueChanged()), SLOT(SetPlayers())); 75 86 76 87 connect(m_favoriteCheck, SIGNAL(valueChanged()), SLOT(ToggleFavorite())); 77 88 connect(m_displayCheck, SIGNAL(valueChanged()), SLOT(ToggleDisplay())); 78 89 connect(m_screenshotButton, SIGNAL(Clicked()), SLOT(FindScreenshot())); 79 90 connect(m_fanartButton, SIGNAL(Clicked()), SLOT(FindFanart())); 80 91 connect(m_boxartButton, SIGNAL(Clicked()), SLOT(FindBoxart())); … … 147 158 m_countryEdit->SetText(m_workingRomInfo->Country()); 148 159 m_plotEdit->SetText(m_workingRomInfo->Plot()); 149 160 m_publisherEdit->SetText(m_workingRomInfo->Publisher()); 150 161 m_developerEdit->SetText(m_workingRomInfo->Developer()); 162 new MythUIButtonListItem(m_esrbList, "RP"); 163 new MythUIButtonListItem(m_esrbList, "C"); 164 new MythUIButtonListItem(m_esrbList, "E"); 165 new MythUIButtonListItem(m_esrbList, "E10"); 166 new MythUIButtonListItem(m_esrbList, "T"); 167 new MythUIButtonListItem(m_esrbList, "M"); 168 new MythUIButtonListItem(m_esrbList, "AO"); 169 m_esrbList->SetItemCurrent(m_workingRomInfo->ESRB() + 1); 170 new MythUIButtonListItem(m_ratingList, "Unrated"); 171 new MythUIButtonListItem(m_ratingList, "1"); 172 new MythUIButtonListItem(m_ratingList, "2"); 173 new MythUIButtonListItem(m_ratingList, "3"); 174 new MythUIButtonListItem(m_ratingList, "4"); 175 new MythUIButtonListItem(m_ratingList, "5"); 176 new MythUIButtonListItem(m_ratingList, "6"); 177 new MythUIButtonListItem(m_ratingList, "7"); 178 new MythUIButtonListItem(m_ratingList, "8"); 179 new MythUIButtonListItem(m_ratingList, "9"); 180 new MythUIButtonListItem(m_ratingList, "10"); 181 m_ratingList->SetItemCurrent(m_workingRomInfo->Rating()); 182 m_playersEdit->SetText(QString::number(m_workingRomInfo->Players())); 151 183 if (m_workingRomInfo->Favorite()) 152 184 m_favoriteCheck->SetCheckState(MythUIStateType::Full); 185 if (m_workingRomInfo->Display()) 186 m_displayCheck->SetCheckState(MythUIStateType::Full); 153 187 154 188 m_screenshotText->SetText(m_workingRomInfo->Screenshot()); 155 189 m_fanartText->SetText(m_workingRomInfo->Fanart()); … … 207 241 m_workingRomInfo->setPublisher(m_publisherEdit->GetText()); 208 242 } 209 243 244 void EditRomInfoDialog::SetDeveloper() 245 { 246 m_workingRomInfo->setDeveloper(m_developerEdit->GetText()); 247 } 248 249 void EditRomInfoDialog::SetESRB() 250 { 251 m_workingRomInfo->setESRB(m_esrbList->GetCurrentPos() - 1); 252 } 253 254 void EditRomInfoDialog::SetRating() 255 { 256 m_workingRomInfo->setRating(m_ratingList->GetCurrentPos()); 257 } 258 259 void EditRomInfoDialog::SetPlayers() 260 { 261 m_workingRomInfo->setPlayers(m_playersEdit->GetText().toInt()); 262 } 263 210 264 void EditRomInfoDialog::ToggleFavorite() 211 265 { 212 266 m_workingRomInfo->setFavorite(); 213 267 } 214 268 269 void EditRomInfoDialog::ToggleDisplay() 270 { 271 m_workingRomInfo->setDisplay(); 272 } 273 215 274 void EditRomInfoDialog::FindScreenshot() 216 275 { 217 276 FindImagePopup(gCoreContext->GetSetting("mythgame.screenshotDir"), … … 238 297 if (file.isEmpty()) 239 298 return; 240 299 241 m_workingRomInfo->setScreenshot(file); 242 m_screenshotText->SetText(file); 300 if (file.size() == 1) 301 { 302 m_workingRomInfo->setScreenshot(NULL); 303 m_screenshotText->SetText(NULL); 304 } 305 else 306 { 307 m_workingRomInfo->setScreenshot(file); 308 m_screenshotText->SetText(file); 309 } 243 310 } 244 311 245 312 void EditRomInfoDialog::SetFanart(QString file) … … 247 314 if (file.isEmpty()) 248 315 return; 249 316 250 m_workingRomInfo->setFanart(file); 251 m_fanartText->SetText(file); 317 if (file.size() == 1) 318 { 319 m_workingRomInfo->setFanart(NULL); 320 m_fanartText->SetText(NULL); 321 } 322 else 323 { 324 m_workingRomInfo->setFanart(file); 325 m_fanartText->SetText(file); 326 } 252 327 } 253 328 254 329 void EditRomInfoDialog::SetBoxart(QString file) … … 256 331 if (file.isEmpty()) 257 332 return; 258 333 259 m_workingRomInfo->setBoxart(file); 260 m_boxartText->SetText(file); 334 if (file.size() == 1) 335 { 336 m_workingRomInfo->setBoxart(NULL); 337 m_boxartText->SetText(NULL); 338 } 339 else 340 { 341 m_workingRomInfo->setBoxart(file); 342 m_boxartText->SetText(file); 343 } 261 344 } -
mythplugins/mythgame/mythgame/romedit.h
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/romedit.h mythtv-build-010912/mythplugins/mythgame/mythgame/romedit.h
old new 27 27 void SetCountry(); 28 28 void SetPlot(); 29 29 void SetPublisher(); 30 void SetDeveloper(); 31 void SetESRB(); 32 void SetMetarating(); 33 void SetRating(); 34 void SetPlayers(); 30 35 void ToggleFavorite(); 36 void ToggleDisplay(); 31 37 void FindScreenshot(); 32 38 void FindFanart(); 33 39 void FindBoxart(); … … 50 56 MythUITextEdit *m_countryEdit; 51 57 MythUITextEdit *m_plotEdit; 52 58 MythUITextEdit *m_publisherEdit; 59 MythUITextEdit *m_developerEdit; 60 MythUIButtonList *m_esrbList; 61 MythUIButtonList *m_ratingList; 62 MythUITextEdit *m_playersEdit; 53 63 MythUICheckBox *m_favoriteCheck; 64 MythUICheckBox *m_displayCheck; 54 65 MythUIButton *m_screenshotButton; 55 66 MythUIText *m_screenshotText; 56 67 MythUIButton *m_fanartButton; -
mythplugins/mythgame/mythgame/rominfo.cpp
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/rominfo.cpp mythtv-build-010912/mythplugins/mythgame/mythgame/rominfo.cpp
old new 33 33 query.prepare("INSERT INTO gamemetadata " 34 34 "(system, romname, gamename, genre, year, gametype, " 35 35 "rompath, country, crc_value, diskcount, display, plot, " 36 "publisher, version, fanart, boxart, screenshot) " 36 "publisher, developer, esrb, metarating, rating, players, " 37 "version, fanart, boxart, screenshot) " 37 38 "VALUES (:SYSTEM, :ROMNAME, :GAMENAME, :GENRE, :YEAR, " 38 ":GAMETYPE, :ROMPATH, :COUNTRY, :CRC32, '1', '1', :PLOT, " 39 ":PUBLISHER, :VERSION, :FANART, :BOXART, :SCREENSHOT)"); 39 ":GAMETYPE, :ROMPATH, :COUNTRY, :CRC32, '1', :DISPLAY, " 40 ":PLOT, :PUBLISHER, :DEVELOPER, :ESRB, :METARATING, " 41 ":RATING, :PLAYERS, :VERSION, :FANART, :BOXART, " 42 ":SCREENSHOT)"); 40 43 41 44 query.bindValue(":SYSTEM",System()); 42 45 query.bindValue(":ROMNAME",Romname()); … … 47 50 query.bindValue(":ROMPATH",Rompath()); 48 51 query.bindValue(":COUNTRY",Country()); 49 52 query.bindValue(":CRC32", QString()); 53 query.bindValue(":DISPLAY", Display()); 50 54 query.bindValue(":PLOT", Plot()); 51 55 query.bindValue(":PUBLISHER", Publisher()); 56 query.bindValue(":DEVELOPER", Developer()); 57 query.bindValue(":ESRB", QString::number(ESRB())); 58 query.bindValue(":METARATING", QString::number(Metarating())); 59 query.bindValue(":RATING", QString::number(Rating())); 60 query.bindValue(":PLAYERS", QString::number(Players())); 52 61 query.bindValue(":VERSION", Version()); 53 62 query.bindValue(":FANART", Fanart()); 54 63 query.bindValue(":BOXART", Boxart()); … … 62 71 " genre = :GENRE," 63 72 " year = :YEAR," 64 73 " country = :COUNTRY," 74 " display = :DISPLAY," 65 75 " plot = :PLOT," 66 76 " publisher = :PUBLISHER," 77 " developer = :DEVELOPER," 78 " esrb = :ESRB," 79 " metarating = :METARATING," 80 " rating = :RATING," 81 " players = :PLAYERS," 67 82 " favorite = :FAVORITE," 68 83 " screenshot = :SCREENSHOT," 69 84 " fanart = :FANART," 70 85 " boxart = :BOXART, " 71 " inetref = :INETREF " 86 " inetref = :INETREF, " 87 " display = :DISPLAY " 72 88 "WHERE gametype = :GAMETYPE AND " 73 89 " romname = :ROMNAME"); 74 90 query.bindValue(":GAMENAME", Gamename()); 75 91 query.bindValue(":GENRE", Genre()); 76 92 query.bindValue(":YEAR", Year()); 77 93 query.bindValue(":COUNTRY", Country()); 78 94 query.bindValue(":PLOT", Plot()); 79 95 query.bindValue(":PUBLISHER", Publisher()); 96 query.bindValue(":DEVELOPER", Developer()); 97 query.bindValue(":ESRB", QString::number(ESRB())); 98 query.bindValue(":METARATING", QString::number(Metarating())); 99 query.bindValue(":RATING", QString::number(Rating())); 100 query.bindValue(":PLAYERS", QString::number(Players())); 80 101 query.bindValue(":FAVORITE", Favorite()); 81 102 query.bindValue(":SCREENSHOT", Screenshot()); 82 103 query.bindValue(":FANART", Fanart()); 83 104 query.bindValue(":BOXART", Boxart()); 84 105 query.bindValue(":INETREF", Inetref()); 106 query.bindValue(":DISPLAY", Display()); 85 107 query.bindValue(":GAMETYPE", GameType()); 86 108 query.bindValue(":ROMNAME", Romname()); 87 109 } … … 197 219 plot = data; 198 220 else if (field == "publisher") 199 221 publisher = data; 222 else if (field == "developer") 223 developer = data; 224 else if (field == "esrb") 225 esrb = data.toInt(); 226 else if (field == "metarating") 227 metarating = data.toInt(); 228 else if (field == "rating") 229 rating = data.toInt(); 230 else if (field == "players") 231 players = data.toInt(); 200 232 else if (field == "crc_value") 201 233 crc_value = data; 202 234 else if (field == "inetref") 203 235 inetref = data; 236 else if (field == "display") 237 display = data.toInt(); 204 238 else if (field == "diskcount") 205 239 diskcount = data.toInt(); 206 240 else if (field == "gametype") … … 262 296 263 297 QString thequery = "SELECT system,gamename,genre,year,romname,favorite," 264 298 "rompath,country,crc_value,diskcount,gametype,plot,publisher," 265 "version,screenshot,fanart,boxart,inetref,intid FROM gamemetadata " 266 "WHERE gamename = :GAMENAME " 267 + systemtype + " ORDER BY diskcount DESC"; 299 "developer,esrb,metarating,rating,players,version,screenshot," 300 "fanart,boxart,inetref,display,intid " 301 "FROM gamemetadata WHERE gamename = :GAMENAME " + systemtype + 302 " ORDER BY diskcount DESC"; 268 303 269 304 query.prepare(thequery); 270 305 query.bindValue(":SYSTEM", system); … … 285 320 setGameType(query.value(10).toString()); 286 321 setPlot(query.value(11).toString()); 287 322 setPublisher(query.value(12).toString()); 288 setVersion(query.value(13).toString()); 289 setScreenshot(query.value(14).toString()); 290 setFanart(query.value(15).toString()); 291 setBoxart(query.value(16).toString()); 292 setInetref(query.value(17).toString()); 293 setId(query.value(18).toInt()); 323 setDeveloper(query.value(13).toString()); 324 setESRB(query.value(14).toInt()); 325 setMetarating(query.value(15).toInt()); 326 setRating(query.value(16).toInt()); 327 setPlayers(query.value(17).toInt()); 328 setVersion(query.value(18).toString()); 329 setScreenshot(query.value(19).toString()); 330 setFanart(query.value(20).toString()); 331 setBoxart(query.value(21).toString()); 332 setInetref(query.value(22).toString()); 333 setField("display",query.value(23).toString()); 334 setId(query.value(24).toInt()); 294 335 } 295 336 296 337 setRomCount(romInDB(romname,gametype)); … … 325 366 326 367 MSqlQuery query(MSqlQuery::InitCon()); 327 368 328 QString querystr = "SELECT intid,system,romname,gamename,genre,year,publisher," 369 QString querystr = "SELECT intid,system,romname,gamename,genre,year," 370 "publisher,developer,esrb,metarating,rating,players," 329 371 "favorite,rompath,screenshot,fanart,plot,boxart," 330 372 "gametype,diskcount,country,crc_value,inetref,display," 331 373 "version FROM gamemetadata ORDER BY diskcount DESC"; … … 347 389 query.value(3).toString(), 348 390 query.value(4).toString(), 349 391 query.value(5).toString(), 350 query.value(7).toBool(), 351 query.value(8).toString(), 352 query.value(15).toString(), 353 query.value(16).toString(), 354 query.value(14).toInt(), 392 query.value(12).toBool(), 355 393 query.value(13).toString(), 394 query.value(20).toString(), 395 query.value(21).toString(), 396 query.value(19).toInt(), 397 query.value(18).toString(), 356 398 0, QString(), 357 query.value(1 1).toString(),399 query.value(16).toString(), 358 400 query.value(6).toString(), 359 query.value(19).toString(), 360 query.value(9).toString(), 361 query.value(10).toString(), 362 query.value(12).toString(), 363 query.value(17).toString()); 401 query.value(7).toString(), 402 query.value(8).toInt(), 403 query.value(9).toInt(), 404 query.value(10).toInt(), 405 query.value(11).toInt(), 406 query.value(24).toString(), 407 query.value(14).toString(), 408 query.value(15).toString(), 409 query.value(17).toString(), 410 query.value(22).toString()); 364 411 ret.append(add); 365 412 } 366 413 … … 373 420 374 421 MSqlQuery query(MSqlQuery::InitCon()); 375 422 376 QString querystr = "SELECT intid,system,romname,gamename,genre,year,publisher," 423 QString querystr = "SELECT intid,system,romname,gamename,genre,year," 424 "publisher,developer,esrb,metarating,rating,players," 377 425 "favorite,rompath,screenshot,fanart,plot,boxart," 378 426 "gametype,diskcount,country,crc_value,inetref,display," 379 427 "version FROM gamemetadata WHERE intid = :INTID"; … … 396 444 query.value(3).toString(), 397 445 query.value(4).toString(), 398 446 query.value(5).toString(), 399 query.value(7).toBool(), 400 query.value(8).toString(), 401 query.value(15).toString(), 402 query.value(16).toString(), 403 query.value(14).toInt(), 447 query.value(12).toBool(), 404 448 query.value(13).toString(), 449 query.value(20).toString(), 450 query.value(21).toString(), 451 query.value(19).toInt(), 452 query.value(18).toString(), 405 453 0, QString(), 406 query.value(1 1).toString(),454 query.value(16).toString(), 407 455 query.value(6).toString(), 408 query.value(19).toString(), 409 query.value(9).toString(), 410 query.value(10).toString(), 411 query.value(12).toString(), 412 query.value(17).toString()); 456 query.value(7).toString(), 457 query.value(8).toInt(), 458 query.value(9).toInt(), 459 query.value(10).toInt(), 460 query.value(11).toInt(), 461 query.value(24).toString(), 462 query.value(14).toString(), 463 query.value(15).toString(), 464 query.value(17).toString(), 465 query.value(22).toString(), 466 query.value(23).toBool()); 413 467 } 414 468 415 469 return ret; -
mythplugins/mythgame/mythgame/rominfo.h
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/rominfo.h mythtv-build-010912/mythplugins/mythgame/mythgame/rominfo.h
old new 18 18 QString lrompath = "", QString lcountry ="", QString lcrc_value = "", 19 19 int ldiskcount = 0, QString lgametype = "", int lromcount = 0, 20 20 QString lallsystems = "", QString lplot = "", QString lpublisher = "", 21 QString lversion = "", QString lscreenshot = "", QString lfanart = "", 22 QString lboxart = "", QString linetref = "") 21 QString ldeveloper = "", int lesrb = -1, int lmetarating = 0, 22 int lrating = 0, int lplayers = 1, QString lversion = "", 23 QString lscreenshot = "", QString lfanart = "", QString lboxart = "", 24 QString linetref = "", bool ldisplay = true) 23 25 { 24 26 id = lid; 25 27 romname = lromname; … … 40 42 allsystems = lallsystems; 41 43 plot = lplot; 42 44 publisher = lpublisher; 45 developer = ldeveloper; 46 esrb = lesrb; 47 metarating = lmetarating; 48 rating = lrating; 49 players = lplayers; 43 50 version = lversion; 44 51 inetref = linetref; 52 display = ldisplay; 45 53 } 46 54 47 55 RomInfo(const RomInfo &lhs) … … 65 73 allsystems = lhs.allsystems; 66 74 plot = lhs.plot; 67 75 publisher = lhs.publisher; 76 developer = lhs.developer; 77 esrb = lhs.esrb; 78 metarating = lhs.metarating; 79 rating = lhs.rating; 80 players = lhs.players; 68 81 version = lhs.version; 69 82 inetref = lhs.inetref; 83 display = lhs.display; 70 84 } 71 85 72 86 ~RomInfo() {} … … 124 138 QString Publisher() const { return publisher; } 125 139 void setPublisher(const QString &lpublisher) { publisher = lpublisher; } 126 140 141 QString Developer() const { return developer; } 142 void setDeveloper(const QString &ldeveloper) { developer = ldeveloper; } 143 144 int ESRB() const { return esrb; } 145 QString ESRB_str() const 146 { 147 switch (esrb) 148 { 149 case 0: 150 return "C"; 151 case 1: 152 return "E"; 153 case 2: 154 return "E10"; 155 case 3: 156 return "T"; 157 case 4: 158 return "M"; 159 case 5: 160 return "AO"; 161 default: 162 return "RP"; 163 } 164 } 165 void setESRB(const int &lesrb) { esrb = lesrb; } 166 167 int Metarating() const { return metarating; } 168 QString Metarating_str() const 169 { 170 if (metarating == 0) 171 return "Unrated"; 172 173 return QString::number(metarating); 174 } 175 void setMetarating(const int &lmetarating) { metarating = lmetarating; } 176 177 int Rating() const { return rating; } 178 QString Rating_str() const 179 { 180 if (rating == 0) 181 return "Unrated"; 182 183 return QString::number(rating); 184 } 185 void setRating(const int &lrating) { rating = lrating; } 186 187 int Players() const { return players; } 188 void setPlayers(const int &lplayers) { players = lplayers; } 189 127 190 QString Version() const { return version; } 128 191 void setVersion(const QString &lversion) { version = lversion; } 129 192 … … 136 199 int Favorite() const { return favorite; } 137 200 void setFavorite(bool updateDatabase = false); 138 201 202 int Display() const { return display; } 203 void setDisplay() { display = 1 - display; } 204 139 205 QString getExtension(); 140 206 QString toString(); 141 207 … … 157 223 QString allsystems; 158 224 QString plot; 159 225 QString publisher; 226 QString developer; 227 int esrb; 228 int metarating; 229 int rating; 230 int players; 160 231 QString version; 161 232 int romcount; 162 233 int diskcount; … … 167 238 QString fanart; 168 239 QString boxart; 169 240 QString inetref; 241 bool display; 170 242 }; 171 243 172 244 bool operator==(const RomInfo& a, const RomInfo& b); -
mythplugins/mythgame/mythgame/scripts/giantbomb/XSLT/giantbombGame.xsl
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/scripts/giantbomb/XSLT/giantbombGame.xsl mythtv-build-010912/mythplugins/mythgame/mythgame/scripts/giantbomb/XSLT/giantbombGame.xsl
old new 63 63 </xsl:for-each> 64 64 </systems> 65 65 </xsl:if> 66 <xsl:if test=".//company"> 66 <xsl:if test=".//publishers"> 67 <publishers> 68 <xsl:for-each select=".//publishers/company"> 69 <xsl:element name="publisher"> 70 <xsl:attribute name="name"><xsl:value-of select="normalize-space(./name)"/></xsl:attribute> 71 </xsl:element> 72 </xsl:for-each> 73 </publishers> 74 </xsl:if> 75 <xsl:if test=".//developers"> 67 76 <studios> 68 <xsl:for-each select=".// company">77 <xsl:for-each select=".//developers/company"> 69 78 <xsl:element name="studio"> 70 79 <xsl:attribute name="name"><xsl:value-of select="normalize-space(./name)"/></xsl:attribute> 71 80 </xsl:element> 72 81 </xsl:for-each> 73 82 </studios> 74 83 </xsl:if> 84 <xsl:if test="./expected_release_year/text() != ''"> 85 <year><xsl:value-of select="normalize-space(./expected_release_year)"/></year> 86 </xsl:if> 75 87 <!-- Input format: 2001-10-23 00:00:00 --> 76 88 <xsl:if test="./original_release_date/text() != ''"> 77 <releasedate><xsl:value-of select="gamebombXpath:pubDate(string(./original_release_date), '%Y-%m-%d %H:%M:%S', '%Y-%m-%d')"/></releasedate> 78 </xsl:if> 79 <xsl:if test="./original_release_date/text() = ''"> 80 <xsl:if test="gamebombXpath:futureReleaseDate(.) != ''"> 81 <releasedate><xsl:value-of select="gamebombXpath:futureReleaseDate(.)"/></releasedate> 82 </xsl:if> 89 <year><xsl:value-of select="gamebombXpath:pubDate(string(./original_release_date), '%Y-%m-%d %H:%M:%S', '%Y')"/></year> 83 90 </xsl:if> 84 91 <!--Input format: 2010-05-10 16:59:49.972923 --> 85 92 <xsl:if test="./date_last_updated/text() != ''"> -
mythplugins/mythgame/mythgame/scripts/giantbomb/giantbomb_api.py
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/mythgame/scripts/giantbomb/giantbomb_api.py mythtv-build-010912/mythplugins/mythgame/mythgame/scripts/giantbomb/giantbomb_api.py
old new 103 103 self.config['debug'] = debug 104 104 105 105 self.config['searchURL'] = u'http://api.giantbomb.com/search/?api_key=%s&offset=0&query=%%s&resources=game&format=xml' % self.config['apikey'] 106 self.config['platformsURL'] = u'http://api.giantbomb.com/game/%%s/?api_key=%s&format=xml&field_list=platforms' % self.config['apikey'] 106 107 self.config['dataURL'] = u'http://api.giantbomb.com/game/%%s/?api_key=%s&format=xml' % self.config['apikey'] 107 108 108 109 self.error_messages = {'GiantBombHttpError': u"! Error: A connection error to api.giantbomb.com was raised (%s)\n", 'GiantBombXmlError': u"! Error: Invalid XML was received from api.giantbomb.com (%s)\n", 'GiantBombBaseError': u"! Error: An error was raised (%s)\n", } … … 262 263 return args[0] 263 264 # end pubDate() 264 265 265 def futureReleaseDate(self, context, gameElement):266 '''Convert the "expected" release date into the default MNV item format.267 return the formatted pubDate string268 return If there is not enough information to make a date then return an empty string269 '''270 try:271 if gameElement.find('expected_release_year').text != None:272 year = gameElement.find('expected_release_year').text273 else:274 year = None275 if gameElement.find('expected_release_quarter').text != None:276 quarter = gameElement.find('expected_release_quarter').text277 else:278 quarter = None279 if gameElement.find('expected_release_month').text != None:280 month = gameElement.find('expected_release_month').text281 else:282 month = None283 except:284 return u''285 if not year:286 return u''287 if month and not quarter:288 pubdate = time.strptime((u'%s-%s-01' % (year, month)), '%Y-%m-%d')289 elif not month and quarter:290 month = str((int(quarter)*3))291 pubdate = time.strptime((u'%s-%s-01' % (year, month)), '%Y-%m-%d')292 else:293 pubdate = time.strptime((u'%s-12-01' % (year, )), '%Y-%m-%d')294 295 return time.strftime('%Y-%m-%d', pubdate)296 # end futureReleaseDate()297 298 266 def findImages(self, context, *args): 299 267 '''Parse the "image" and "description" elements for images and put in a persistant array 300 268 return True when there are images available … … 382 350 'htmlToString': self.htmlToString, 383 351 'getHtmlData': self.getHtmlData, 384 352 'pubDate': self.pubDate, 385 'futureReleaseDate': self.futureReleaseDate,386 353 'findImages': self.findImages, 387 354 'getImages': self.getImages, 388 355 'supportedJobs': self.supportedJobs, … … 416 383 417 384 items = queryXslt(queryResult) 418 385 386 games = items.xpath('//item') 387 for x in range(0, len(games)): 388 inrtag = games[x].find("inetref") 389 nametag = games[x].find("title") 390 url = self.config['platformsURL'] % inrtag.text 391 res = etree.parse(url, parser=self.xmlParser) 392 ptag = res.xpath('//name') 393 display = nametag.text 394 display += ' for ' 395 for i in range(0, len(ptag)): 396 display += '%s/' % ptag[i].text 397 display = display[:-1] 398 nametag.text = display 399 419 400 if items.getroot() != None: 420 401 if len(items.xpath('//item')): 421 402 sys.stdout.write(etree.tostring(items, encoding='UTF-8', method="xml", xml_declaration=True, pretty_print=True, )) -
mythplugins/mythgame/theme/default/game-ui.xml
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/theme/default/game-ui.xml mythtv-build-010912/mythplugins/mythgame/theme/default/game-ui.xml
old new 84 84 <window name="edit_metadata"> 85 85 86 86 <textarea name="title" from="basetextarea"> 87 <area>10, 50,1260,50</area>87 <area>10,10,780,50</area> 88 88 <value>Edit Game Information</value> 89 89 <align>hcenter,vcenter</align> 90 90 <font>baselarge</font> … … 93 93 <!-- Labels --> 94 94 95 95 <textarea name="gamename_label" from="basetextarea"> 96 <area> 25,110,250,40</area>96 <area>0,62,190,40</area> 97 97 <value>Game Name:</value> 98 98 <align>right,top</align> 99 99 </textarea> 100 100 101 <textarea name="favorite_label" from="basetextarea"> 102 <area>480,62,250,40</area> 103 <value>Favorite:</value> 104 <align>right,top</align> 105 </textarea> 106 101 107 <textarea name="genre_label" from="basetextarea"> 102 <area> 25,155,250,40</area>108 <area>0,107,190,40</area> 103 109 <value>Genre:</value> 104 110 <align>right,top</align> 105 111 </textarea> 106 112 113 <textarea name="display_label" from="basetextarea"> 114 <area>480,107,250,40</area> 115 <value>Display:</value> 116 <align>right,top</align> 117 </textarea> 118 107 119 <textarea name="year_label" from="basetextarea"> 108 <area> 25,200,250,40</area>120 <area>0,152,190,40</area> 109 121 <value>Year:</value> 110 122 <align>right,top</align> 111 123 </textarea> 112 124 125 <textarea name="esrb_label" from="basetextarea"> 126 <area>460,147,340,40</area> 127 <value>ESRB</value> 128 <align>center</align> 129 </textarea> 130 113 131 <textarea name="country_label" from="basetextarea"> 114 <area> 25,245,250,40</area>132 <area>0,197,190,40</area> 115 133 <value>Country:</value> 116 134 <align>right,top</align> 117 135 </textarea> 118 136 119 137 <textarea name="publisher_label" from="basetextarea"> 120 <area> 25,290,250,40</area>138 <area>0,242,190,40</area> 121 139 <value>Publisher:</value> 122 140 <align>right,top</align> 123 141 </textarea> 124 142 125 <textarea name="plot_label" from="basetextarea"> 126 <area>25,335,250,40</area> 127 <value>Plot:</value> 143 <textarea name="rating_label" from="basetextarea"> 144 <area>460,237,340,40</area> 145 <value>Rating</value> 146 <align>center</align> 147 </textarea> 148 149 <textarea name="developer_label" from="basetextarea"> 150 <area>0,287,190,40</area> 151 <value>Developer:</value> 128 152 <align>right,top</align> 129 153 </textarea> 130 154 131 <textarea name="favorite_label" from="basetextarea"> 132 <area>25,385,250,40</area> 133 <value>Favorite:</value> 155 <textarea name="players_label" from="basetextarea"> 156 <area>0,332,190,40</area> 157 <value>Players:</value> 158 <align>right,top</align> 159 </textarea> 160 161 <textarea name="plot_label" from="basetextarea"> 162 <area>0,377,190,40</area> 163 <value>Plot:</value> 134 164 <align>right,top</align> 135 165 </textarea> 136 166 137 167 <textarea name="screenshot_label" from="basetextarea"> 138 <area> 25,430,250,40</area>168 <area>0,430,190,40</area> 139 169 <value>Screenshot:</value> 140 170 <align>right,top</align> 141 171 </textarea> 142 172 143 173 <textarea name="fanart_label" from="basetextarea"> 144 <area> 25,475,250,40</area>174 <area>0,475,190,40</area> 145 175 <value>Fanart:</value> 146 176 <align>right,top</align> 147 177 </textarea> 148 178 149 179 <textarea name="coverart_label" from="basetextarea"> 150 <area> 25,520,250,40</area>180 <area>0,520,190,40</area> 151 181 <value>Boxart:</value> 152 182 <align>right,top</align> 153 183 </textarea> … … 155 185 <!-- Widgets --> 156 186 157 187 <textedit name="title_edit" from="basetextedit"> 158 <position>2 85,100</position>188 <position>200,60</position> 159 189 </textedit> 160 190 191 <checkbox name="favorite_check" from="basecheckbox"> 192 <position>740,60</position> 193 </checkbox> 194 161 195 <textedit name="genre_edit" from="basetextedit"> 162 <position>2 85,145</position>196 <position>200,105</position> 163 197 </textedit> 164 198 199 <checkbox name="display_check" from="basecheckbox"> 200 <position>740,105</position> 201 </checkbox> 202 165 203 <textedit name="year_edit" from="basetextedit"> 166 <position>2 85,190</position>204 <position>200,150</position> 167 205 </textedit> 168 206 169 207 <textedit name="country_edit" from="basetextedit"> 170 <position>2 85,235</position>208 <position>200,195</position> 171 209 </textedit> 172 210 211 <buttonlist name="esrb_list" from="baseselector"> 212 <position>535,185</position> 213 </buttonlist> 214 173 215 <textedit name="publisher_edit" from="basetextedit"> 174 <position>2 85,280</position>216 <position>200,240</position> 175 217 </textedit> 176 218 177 <textedit name="de scription_edit" from="basetextedit">178 <position>2 85,325</position>219 <textedit name="developer_edit" from="basetextedit"> 220 <position>200,285</position> 179 221 </textedit> 180 222 181 <checkbox name="favorite_check" from="basecheckbox"> 182 <position>285,380</position> 183 </checkbox> 223 <buttonlist name="rating_list" from="baseselector"> 224 <position>535,275</position> 225 </buttonlist> 226 227 <textedit name="players_edit" from="basetextedit"> 228 <position>200,330</position> 229 </textedit> 230 231 <textedit name="description_edit"> 232 <area>200,365,590,60</area> 233 <statetype name="background"> 234 <state name="active"> 235 <area>0,0,590,60</area> 236 <shape name="background" from="basewidgetshape" /> 237 <shape name="textbackground"> 238 <area>0,0,590,60</area> 239 <type>roundbox</type> 240 <cornerradius>4</cornerradius> 241 <fill color="#FFFFFF" alpha="200" /> 242 </shape> 243 </state> 244 <state name="selected" from="active"> 245 <shape name="background"> 246 <shape name="background" from="baseselectedwidgetshape" /> 247 </shape> 248 <shape name="textbackground"> 249 <fill color="#FFFFFF" alpha="255" /> 250 </shape> 251 </state> 252 <state name="inactive" from="active" /> 253 </statetype> 254 <imagetype name="cursor"> 255 </imagetype> 256 <textarea name="text"> 257 <area>3,1,557,57</area> 258 <font>basesmallblack</font> 259 <multiline>yes</multiline> 260 </textarea> 261 </textedit> 184 262 185 263 <button name="screenshot_button" from="basesearchbutton"> 186 <position>2 85,420</position>264 <position>200,430</position> 187 265 </button> 188 266 189 267 <textarea name="screenshot_text" from="basetextarea"> 190 <area> 325,425,250,40</area>268 <area>240,430,550,40</area> 191 269 <value>/path/to/the/thing.jpg</value> 192 270 </textarea> 193 271 194 272 <button name="fanart_button" from="basesearchbutton"> 195 <position>2 85,465</position>273 <position>200,475</position> 196 274 </button> 197 275 198 276 <textarea name="fanart_text" from="basetextarea"> 199 <area> 325,470,250,40</area>277 <area>240,475,550,40</area> 200 278 <value>/path/to/the/thing.jpg</value> 201 279 </textarea> 202 280 203 281 <button name="coverart_button" from="basesearchbutton"> 204 <position>2 85,510</position>282 <position>200,520</position> 205 283 </button> 206 284 207 285 <textarea name="coverart_text" from="basetextarea"> 208 <area> 325,515,250,40</area>286 <area>240,520,550,40</area> 209 287 <value>/path/to/the/thing.jpg</value> 210 288 </textarea> 211 289 -
mythplugins/mythgame/theme/default-wide/game-ui.xml
diff -ur /raidz/dev/htpc/mythtv-git/mythplugins/mythgame/theme/default-wide/game-ui.xml mythtv-build-010912/mythplugins/mythgame/theme/default-wide/game-ui.xml
old new 227 227 <!-- Labels --> 228 228 229 229 <textarea name="gamename_label" from="basetextarea"> 230 <area> 250,110,250,40</area>230 <area>0,102,250,40</area> 231 231 <value>Game Name:</value> 232 232 <align>right,top</align> 233 233 </textarea> 234 234 235 235 <textarea name="genre_label" from="basetextarea"> 236 <area> 250,155,250,40</area>236 <area>550,102,250,40</area> 237 237 <value>Genre:</value> 238 238 <align>right,top</align> 239 239 </textarea> 240 240 241 241 <textarea name="year_label" from="basetextarea"> 242 <area> 250,200,250,40</area>242 <area>0,147,250,40</area> 243 243 <value>Year:</value> 244 244 <align>right,top</align> 245 245 </textarea> 246 246 247 247 <textarea name="country_label" from="basetextarea"> 248 <area> 250,245,250,40</area>248 <area>550,147,250,40</area> 249 249 <value>Country:</value> 250 250 <align>right,top</align> 251 251 </textarea> 252 252 253 253 <textarea name="publisher_label" from="basetextarea"> 254 <area> 250,290,250,40</area>254 <area>0,192,250,40</area> 255 255 <value>Publisher:</value> 256 256 <align>right,top</align> 257 257 </textarea> 258 258 259 <textarea name="plot_label" from="basetextarea"> 260 <area>250,335,250,40</area> 261 <value>Plot:</value> 259 <textarea name="developer_label" from="basetextarea"> 260 <area>550,192,250,40</area> 261 <value>Developer:</value> 262 <align>right,top</align> 263 </textarea> 264 265 <textarea name="players_label" from="basetextarea"> 266 <area>0,237,250,40</area> 267 <value>Players:</value> 262 268 <align>right,top</align> 263 269 </textarea> 264 270 265 271 <textarea name="fav_label" from="basetextarea"> 266 <area> 250,400,250,40</area>272 <area>520,237,250,40</area> 267 273 <value>Favorite:</value> 268 274 <align>right,top</align> 269 275 </textarea> 270 276 277 <textarea name="display_label" from="basetextarea"> 278 <area>800,237,250,40</area> 279 <value>Display:</value> 280 <align>right,top</align> 281 </textarea> 282 283 <textarea name="plot_label" from="basetextarea"> 284 <area>0,305,250,40</area> 285 <value>Plot:</value> 286 <align>right,top</align> 287 </textarea> 288 289 <textarea name="esrb_label" from="basetextarea"> 290 <area>0,382,290,40</area> 291 <value>ESRB:</value> 292 <align>right,top</align> 293 </textarea> 294 295 <textarea name="rating_label" from="basetextarea"> 296 <area>550,382,290,40</area> 297 <value>Rating:</value> 298 <align>right,top</align> 299 </textarea> 300 271 301 <textarea name="screenshot_label" from="basetextarea"> 272 <area> 250,445,250,40</area>302 <area>0,425,250,40</area> 273 303 <value>Screenshot:</value> 274 304 <align>right,top</align> 275 305 </textarea> 276 306 277 307 <textarea name="fanart_label" from="basetextarea"> 278 <area> 250,490,250,40</area>308 <area>0,470,250,40</area> 279 309 <value>Fanart:</value> 280 310 <align>right,top</align> 281 311 </textarea> 282 312 283 313 <textarea name="coverart_label" from="basetextarea"> 284 <area> 250,535,250,40</area>314 <area>0,515,250,40</area> 285 315 <value>Boxart:</value> 286 316 <align>right,top</align> 287 317 </textarea> … … 289 319 <!-- Widgets --> 290 320 291 321 <textedit name="title_edit" from="basetextedit"> 292 <position> 510,100</position>322 <position>260,100</position> 293 323 </textedit> 294 324 295 325 <textedit name="genre_edit" from="basetextedit"> 296 <position> 510,145</position>326 <position>810,100</position> 297 327 </textedit> 298 328 299 329 <textedit name="year_edit" from="basetextedit"> 300 <position> 510,190</position>330 <position>260,145</position> 301 331 </textedit> 302 332 303 333 <textedit name="country_edit" from="basetextedit"> 304 <position> 510,235</position>334 <position>810,145</position> 305 335 </textedit> 306 336 307 337 <textedit name="publisher_edit" from="basetextedit"> 308 <position>510,280</position> 338 <position>260,190</position> 339 </textedit> 340 341 <textedit name="developer_edit" from="basetextedit"> 342 <position>810,190</position> 309 343 </textedit> 310 344 311 <textedit name=" description_edit" from="basetextedit">312 <position> 510,325</position>345 <textedit name="players_edit" from="basetextedit"> 346 <position>260,235</position> 313 347 </textedit> 314 348 315 349 <checkbox name="favorite_check" from="basecheckbox"> 316 <position> 510,400</position>350 <position>780,235</position> 317 351 </checkbox> 318 352 353 <checkbox name="display_check" from="basecheckbox"> 354 <position>1060,235</position> 355 </checkbox> 356 357 <textedit name="description_edit"> 358 <area>260,280,830,85</area> 359 <statetype name="background"> 360 <state name="active"> 361 <area>0,0,830,85</area> 362 <shape name="background" from="basewidgetshape" /> 363 <shape name="textbackground"> 364 <area>0,0,830,85</area> 365 <type>roundbox</type> 366 <cornerradius>4</cornerradius> 367 <fill color="#FFFFFF" alpha="200" /> 368 </shape> 369 </state> 370 <state name="selected" from="active"> 371 <shape name="background"> 372 <shape name="background" from="baseselectedwidgetshape" /> 373 </shape> 374 <shape name="textbackground"> 375 <fill color="#FFFFFF" alpha="255" /> 376 </shape> 377 </state> 378 <state name="inactive" from="active" /> 379 </statetype> 380 <imagetype name="cursor"> 381 <filename>cursor.png</filename> 382 </imagetype> 383 <textarea name="text"> 384 <area>3,1,797,82</area> 385 <font>basesmallblack</font> 386 <multiline>yes</multiline> 387 </textarea> 388 </textedit> 389 390 <buttonlist name="esrb_list" from="baseselector"> 391 <position>300,375</position> 392 </buttonlist> 393 394 <buttonlist name="rating_list" from="baseselector"> 395 <position>850,375</position> 396 </buttonlist> 397 319 398 <button name="screenshot_button" from="basesearchbutton"> 320 <position> 510,445</position>399 <position>260,425</position> 321 400 </button> 322 401 323 402 <textarea name="screenshot_text" from="basetextarea"> 324 <area> 550,440,750,40</area>403 <area>300,425,950,40</area> 325 404 <value>/path/to/the/thing.jpg</value> 326 405 </textarea> 327 406 328 407 <button name="fanart_button" from="basesearchbutton"> 329 <position> 510,480</position>408 <position>260,470</position> 330 409 </button> 331 410 332 411 <textarea name="fanart_text" from="basetextarea"> 333 <area> 550,485,750,40</area>412 <area>300,470,950,40</area> 334 413 <value>/path/to/the/thing.jpg</value> 335 414 </textarea> 336 415 337 416 <button name="coverart_button" from="basesearchbutton"> 338 <position> 510,525</position>417 <position>260,515</position> 339 418 </button> 340 419 341 420 <textarea name="coverart_text" from="basetextarea"> 342 <area> 550,530,750,40</area>421 <area>300,515,950,40</area> 343 422 <value>/path/to/the/thing.jpg</value> 344 423 </textarea> 345 424 -
mythtv/libs/libmythmetadata/metadatacommon.cpp
diff -ur /raidz/dev/htpc/mythtv-git/mythtv/libs/libmythmetadata/metadatacommon.cpp mythtv-build-010912/mythtv/libs/libmythmetadata/metadatacommon.cpp
old new 55 55 m_album(), 56 56 m_tracknum(0), 57 57 m_system(), 58 m_publishers(), 58 59 m_year(0), 59 60 m_releasedate(), 60 61 m_lastupdated(), … … 119 120 QString album, 120 121 uint tracknum, 121 122 const QString system, 123 const QStringList publishers, 122 124 const uint year, 123 125 const QDate releasedate, 124 126 const QDateTime lastupdated, … … 179 181 m_album(album), 180 182 m_tracknum(tracknum), 181 183 m_system(system), 184 m_publishers(publishers), 182 185 m_year(year), 183 186 m_releasedate(releasedate), 184 187 m_lastupdated(lastupdated), … … 396 399 metadataMap["album"] = m_album; 397 400 metadataMap["tracknum"] = QString::number(m_tracknum); 398 401 metadataMap["system"] = m_system; 402 metadataMap["publishers"] = m_publishers.join(", "); 399 403 metadataMap["year"] = QString::number(m_year); 400 404 401 405 metadataMap["releasedate"] = MythDateToString(m_releasedate, kDateFull); … … 799 803 AddCertifications(lookup, item, docroot); 800 804 if (lookup->GetCategories().size()) 801 805 AddCategories(lookup, item, docroot); 806 if (lookup->GetPublishers().size()) 807 AddPublishers(lookup, item, docroot); 802 808 if (lookup->GetStudios().size()) 803 809 AddStudios(lookup, item, docroot); 804 810 if (lookup->GetCountries().size()) … … 837 843 } 838 844 } 839 845 846 void AddPublishers(MetadataLookup *lookup, 847 QDomElement placetoadd, 848 QDomDocument docroot) 849 { 850 QStringList pubs = lookup->GetPublishers(); 851 QDomElement publishers = docroot.createElement("publishers"); 852 placetoadd.appendChild(publishers); 853 854 for (QStringList::const_iterator i = pubs.begin(); 855 i != pubs.end(); ++i) 856 { 857 QDomElement pub = docroot.createElement("publisher"); 858 publishers.appendChild(pub); 859 pub.setAttribute("name", *i); 860 } 861 } 862 840 863 void AddStudios(MetadataLookup *lookup, 841 864 QDomElement placetoadd, 842 865 QDomDocument docroot) … … 886 909 channum, chansign, channame, chanplaybackfilters, recgroup, 887 910 playgroup, seriesid, programid, storagegroup, album, system, 888 911 inetref, tmsref, imdb, homepage, trailerURL, language; 889 QStringList categories, countries, studios;912 QStringList categories, countries, publishers, studios; 890 913 float userrating = 0; 891 914 QDate releasedate; 892 915 QDateTime lastupdated, startts, endts, recstartts, recendts; … … 1012 1035 } 1013 1036 } 1014 1037 1038 // Publishers 1039 QDomElement publishersxml = item.firstChildElement("publishers"); 1040 if (!publishersxml.isNull()) 1041 { 1042 QDomElement publisher = publishersxml.firstChildElement("publisher"); 1043 if (!publisher.isNull()) 1044 { 1045 while (!publisher.isNull()) 1046 { 1047 if (publisher.hasAttribute("name")) 1048 publishers.append(publisher.attribute("name")); 1049 publisher = publisher.nextSiblingElement("publisher"); 1050 } 1051 } 1052 } 1053 1015 1054 // Studios 1016 1055 QDomElement studiosxml = item.firstChildElement("studios"); 1017 1056 if (!studiosxml.isNull()) … … 1078 1117 chanplaybackfilters, recgroup, playgroup, seriesid, programid, 1079 1118 storagegroup, startts, endts, recstartts, recendts, programflags, 1080 1119 audioproperties, videoproperties, subtitletype, certification, 1081 countries, popularity, budget, revenue, album, tracknum, system, year, 1082 releasedate, lastupdated, runtime, runtimesecs, inetref, tmsref, 1083 imdb, people, studios, homepage, trailerURL, artwork, DownloadMap()); 1120 countries, popularity, budget, revenue, album, tracknum, system, 1121 publishers, year, releasedate, lastupdated, runtime, runtimesecs, 1122 inetref, tmsref, imdb, people, studios, homepage, trailerURL, artwork, 1123 DownloadMap()); 1084 1124 } 1085 1125 1086 1126 MetadataLookup* ParseMetadataMovieNFO(const QDomElement& item, -
mythtv/libs/libmythmetadata/metadatacommon.h
diff -ur /raidz/dev/htpc/mythtv-git/mythtv/libs/libmythmetadata/metadatacommon.h mythtv-build-010912/mythtv/libs/libmythmetadata/metadatacommon.h
old new 118 118 QString album, 119 119 uint tracknum, 120 120 QString system, 121 const QStringList publishers, 121 122 const uint year, 122 123 const QDate releasedate, 123 124 const QDateTime lastupdated, … … 304 305 305 306 // General - Game 306 307 QString GetSystem() const { return m_system; }; 308 QStringList GetPublishers() const { return m_publishers; }; 307 309 308 310 // Times 309 311 uint GetYear() const { return m_year; }; … … 384 386 385 387 // General - Game 386 388 QString m_system; 389 QStringList m_publishers; 387 390 388 391 // Times 389 392 uint m_year; … … 427 430 META_PUBLIC void AddCategories(MetadataLookup *lookup, 428 431 QDomElement placetoadd, 429 432 QDomDocument docroot); 433 META_PUBLIC void AddPublishers(MetadataLookup *lookup, 434 QDomElement placetoadd, 435 QDomDocument docroot); 430 436 META_PUBLIC void AddStudios(MetadataLookup *lookup, 431 437 QDomElement placetoadd, 432 438 QDomDocument docroot);
