MythTV  master
gameui.cpp
Go to the documentation of this file.
1 #include <QMetaType>
2 #include <QStringList>
3 #include <QTimer>
4 
5 #include <mythcontext.h>
6 #include <mythuibuttontree.h>
8 #include <mythuiimage.h>
9 #include <mythuitext.h>
10 #include <mythuistatetype.h>
11 #include <mythmainwindow.h>
12 #include <mythdialogbox.h>
13 #include <mythgenerictree.h>
14 #include <mythdirs.h>
15 
16 // MythGame headers
17 #include "gamehandler.h"
18 #include "rominfo.h"
19 #include "gamedetails.h"
20 #include "romedit.h"
21 #include "gamescan.h"
22 #include "gameui.h"
23 
24 static const QString sLocation = "MythGame";
25 
27 {
28  public:
29  GameTreeInfo(const QString& levels, QString filter)
30  : m_levels(levels.split(" "))
31  , m_filter(std::move(filter))
32  {
33  }
34 
35  int getDepth() const { return m_levels.size(); }
36  const QString& getLevel(unsigned i) const { return m_levels[i]; }
37  const QString& getFilter() const { return m_filter; }
38 
39  private:
40  QStringList m_levels;
41  QString m_filter;
42 };
43 
45 
47  : MythScreenType(parent, "GameUI")
48 {
49  m_popupStack = GetMythMainWindow()->GetStack("popup stack");
50 
51  m_query = new MetadataDownload(this);
52  m_imageDownload = new MetadataImageDownload(this);
53 }
54 
56 {
57  if (!LoadWindowFromXML("game-ui.xml", "gameui", this))
58  return false;
59 
60  bool err = false;
61  UIUtilE::Assign(this, m_gameUITree, "gametreelist", &err);
62  UIUtilW::Assign(this, m_gameTitleText, "title");
63  UIUtilW::Assign(this, m_gameSystemText, "system");
64  UIUtilW::Assign(this, m_gameYearText, "year");
65  UIUtilW::Assign(this, m_gameGenreText, "genre");
66  UIUtilW::Assign(this, m_gameFavouriteState, "favorite");
67  UIUtilW::Assign(this, m_gamePlotText, "description");
68  UIUtilW::Assign(this, m_gameImage, "screenshot");
69  UIUtilW::Assign(this, m_fanartImage, "fanart");
70  UIUtilW::Assign(this, m_boxImage, "coverart");
71 
72  if (err)
73  {
74  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'gameui'");
75  return false;
76  }
77 
79  this, &GameUI::itemClicked);
80 
82  this, &GameUI::nodeChanged);
83 
84  m_gameShowFileName = gCoreContext->GetBoolSetting("GameShowFileNames");
85 
86  BuildTree();
87 
89 
90  return true;
91 }
92 
94 {
95  if (m_gameTree)
96  {
98  delete m_gameTree;
99  m_gameTree = nullptr;
100  }
101 
102  m_gameTree = new MythGenericTree("game root", 0, false);
103 
104  // create system filter to only select games where handlers are present
105  QString systemFilter;
106 
107  // The call to GameHandler::count() fills the handler list for us
108  // to move through.
109  unsigned handlercount = GameHandler::count();
110 
111  for (unsigned i = 0; i < handlercount; ++i)
112  {
113  QString system = GameHandler::getHandler(i)->SystemName();
114  if (i == 0)
115  systemFilter = "`system` in ('" + system + "'";
116  else
117  systemFilter += ",'" + system + "'";
118  }
119  if (systemFilter.isEmpty())
120  {
121  systemFilter = "1=0";
122  LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find any game handlers!"));
123  }
124  else
125  systemFilter += ")";
126 
127  m_showHashed = gCoreContext->GetBoolSetting("GameTreeView");
128 
129  // create a few top level nodes - this could be moved to a config based
130  // approach with multiple roots if/when someone has the time to create
131  // the relevant dialog screens
132 
133  QString levels = gCoreContext->GetSetting("GameFavTreeLevels");
134 
135  auto *new_node = new MythGenericTree(tr("Favorites"), 1, true);
136  new_node->SetData(QVariant::fromValue(
137  new GameTreeInfo(levels, systemFilter + " and favorite=1")));
138  m_favouriteNode = m_gameTree->addNode(new_node);
139 
140  levels = gCoreContext->GetSetting("GameAllTreeLevels");
141 
142  if (m_showHashed)
143  {
144  int pos = levels.indexOf("gamename");
145  if (pos >= 0)
146  levels.insert(pos, " hash ");
147  }
148 
149  new_node = new MythGenericTree(tr("All Games"), 1, true);
150  new_node->SetData(QVariant::fromValue(
151  new GameTreeInfo(levels, systemFilter)));
152  m_gameTree->addNode(new_node);
153 
154  new_node = new MythGenericTree(tr("- By Genre"), 1, true);
155  new_node->SetData(QVariant::fromValue(
156  new GameTreeInfo("genre gamename", systemFilter)));
157  m_gameTree->addNode(new_node);
158 
159  new_node = new MythGenericTree(tr("- By Year"), 1, true);
160  new_node->SetData(QVariant::fromValue(
161  new GameTreeInfo("year gamename", systemFilter)));
162  m_gameTree->addNode(new_node);
163 
164  new_node = new MythGenericTree(tr("- By Name"), 1, true);
165  new_node->SetData(QVariant::fromValue(
166  new GameTreeInfo("gamename", systemFilter)));
167  m_gameTree->addNode(new_node);
168 
169  new_node = new MythGenericTree(tr("- By Publisher"), 1, true);
170  new_node->SetData(QVariant::fromValue(
171  new GameTreeInfo("publisher gamename", systemFilter)));
172  m_gameTree->addNode(new_node);
173 
176 }
177 
178 bool GameUI::keyPressEvent(QKeyEvent *event)
179 {
180  if (GetFocusWidget()->keyPressEvent(event))
181  return true;
182 
183  QStringList actions;
184  bool handled = GetMythMainWindow()->TranslateKeyPress("Game", event, actions);
185 
186  for (int i = 0; i < actions.size() && !handled; i++)
187  {
188  QString action = actions[i];
189  handled = true;
190 
191  if (action == "MENU")
192  ShowMenu();
193  else if (action == "EDIT")
194  edit();
195  else if (action == "INFO")
196  showInfo();
197  else if (action == "TOGGLEFAV")
198  toggleFavorite();
199  else if ((action == "INCSEARCH") || (action == "INCSEARCHNEXT"))
200  searchStart();
201  else if (action == "DOWNLOADDATA")
202  gameSearch();
203  else
204  handled = false;
205  }
206 
207  if (!handled && MythScreenType::keyPressEvent(event))
208  handled = true;
209 
210  return handled;
211 }
212 
214 {
215  if (!node)
216  return;
217 
218  if (!isLeaf(node))
219  {
220  if (node->childCount() == 0 || node == m_favouriteNode)
221  {
222  node->deleteAllChildren();
223  fillNode(node);
224  }
225  clearRomInfo();
226  }
227  else
228  {
229  auto *romInfo = node->GetData().value<RomInfo *>();
230  if (!romInfo)
231  return;
232  if (romInfo->Romname().isEmpty())
233  romInfo->fillData();
234  updateRomInfo(romInfo);
235  if (!romInfo->Screenshot().isEmpty() || !romInfo->Fanart().isEmpty() ||
236  !romInfo->Boxart().isEmpty())
237  showImages();
238  else
239  {
240  if (m_gameImage)
241  m_gameImage->Reset();
242  if (m_fanartImage)
243  m_fanartImage->Reset();
244  if (m_boxImage)
245  m_boxImage->Reset();
246  }
247  }
248 }
249 
251 {
253  if (isLeaf(node))
254  {
255  auto *romInfo = node->GetData().value<RomInfo *>();
256  if (!romInfo)
257  return;
258  if (romInfo->RomCount() == 1)
259  {
260  GameHandler::Launchgame(romInfo, nullptr);
261  }
262  else
263  {
264  //: %1 is the game name
265  QString msg = tr("Choose System for:\n%1").arg(node->GetText());
266  MythScreenStack *popupStack = GetMythMainWindow()->
267  GetStack("popup stack");
268  auto *chooseSystemPopup = new MythDialogBox(
269  msg, popupStack, "chooseSystemPopup");
270 
271  if (chooseSystemPopup->Create())
272  {
273  chooseSystemPopup->SetReturnEvent(this, "chooseSystemPopup");
274  QString all_systems = romInfo->AllSystems();
275  QStringList players = all_systems.split(',');
276  for (const auto & player : qAsConst(players))
277  chooseSystemPopup->AddButton(player);
278  popupStack->AddScreen(chooseSystemPopup);
279  }
280  else
281  delete chooseSystemPopup;
282  }
283  }
284 }
285 
287 {
288  if (m_gameImage)
289  m_gameImage->Load();
290  if (m_fanartImage)
291  m_fanartImage->Load();
292  if (m_boxImage)
293  m_boxImage->Load();
294 }
295 
296 void GameUI::searchComplete(const QString& string)
297 {
299  return;
300 
302  if (!parent)
303  return;
304 
305  MythGenericTree *new_node = parent->getChildByName(string);
306  if (new_node)
307  m_gameUITree->SetCurrentNode(new_node);
308 }
309 
311 {
312  if (m_gameTitleText)
314  if (m_gameSystemText)
316  if (m_gameYearText)
317  m_gameYearText->SetText(rom->Year());
318  if (m_gameGenreText)
319  m_gameGenreText->SetText(rom->Genre());
320  if (m_gamePlotText)
321  m_gamePlotText->SetText(rom->Plot());
322 
324  {
325  if (rom->Favorite())
327  else
329  }
330 
331  if (m_gameImage)
332  {
333  m_gameImage->Reset();
335  }
336  if (m_fanartImage)
337  {
338  m_fanartImage->Reset();
340  }
341  if (m_boxImage)
342  {
343  m_boxImage->Reset();
344  m_boxImage->SetFilename(rom->Boxart());
345  }
346 }
347 
349 {
350  if (m_gameTitleText)
352  if (m_gameSystemText)
354  if (m_gameYearText)
356  if (m_gameGenreText)
358  if (m_gamePlotText)
362 
363  if (m_gameImage)
364  m_gameImage->Reset();
365 
366  if (m_fanartImage)
367  m_fanartImage->Reset();
368 
369  if (m_boxImage)
370  m_boxImage->Reset();
371 }
372 
373 void GameUI::edit(void)
374 {
376  if (isLeaf(node))
377  {
378  auto *romInfo = node->GetData().value<RomInfo *>();
379 
380  MythScreenStack *screenStack = GetScreenStack();
381 
382  auto *md_editor = new EditRomInfoDialog(screenStack,
383  "mythgameeditmetadata", romInfo);
384 
385  if (md_editor->Create())
386  {
387  screenStack->AddScreen(md_editor);
388  md_editor->SetReturnEvent(this, "editMetadata");
389  }
390  else
391  delete md_editor;
392  }
393 }
394 
396 {
398  if (isLeaf(node))
399  {
400  auto *romInfo = node->GetData().value<RomInfo *>();
401  if (!romInfo)
402  return;
404  auto *details_dialog = new GameDetailsPopup(mainStack, romInfo);
405 
406  if (details_dialog->Create())
407  {
408  mainStack->AddScreen(details_dialog);
409  details_dialog->SetReturnEvent(this, "detailsPopup");
410  }
411  else
412  delete details_dialog;
413  }
414 }
415 
417 {
419 
420  MythScreenStack *popupStack = GetMythMainWindow()->
421  GetStack("popup stack");
422  auto *showMenuPopup =
423  new MythDialogBox(node->GetText(), popupStack, "showMenuPopup");
424 
425  if (showMenuPopup->Create())
426  {
427  showMenuPopup->SetReturnEvent(this, "showMenuPopup");
428 
429  showMenuPopup->AddButton(tr("Scan For Changes"));
430  if (isLeaf(node))
431  {
432  auto *romInfo = node->GetData().value<RomInfo *>();
433  if (romInfo)
434  {
435  showMenuPopup->AddButton(tr("Show Information"));
436  if (romInfo->Favorite())
437  showMenuPopup->AddButton(tr("Remove Favorite"));
438  else
439  showMenuPopup->AddButton(tr("Make Favorite"));
440  showMenuPopup->AddButton(tr("Retrieve Details"));
441  showMenuPopup->AddButton(tr("Edit Details"));
442  }
443  }
444  popupStack->AddScreen(showMenuPopup);
445  }
446  else
447  delete showMenuPopup;
448 }
449 
451 {
453 
454  if (parent != nullptr)
455  {
456  QStringList childList;
457  QList<MythGenericTree*>::iterator it;
458  QList<MythGenericTree*> *children = parent->getAllChildren();
459 
460  for (it = children->begin(); it != children->end(); ++it)
461  {
462  MythGenericTree *child = *it;
463  childList << child->GetText();
464  }
465 
466  MythScreenStack *popupStack =
467  GetMythMainWindow()->GetStack("popup stack");
468  auto *searchDialog = new MythUISearchDialog(popupStack,
469  tr("Game Search"), childList, true, "");
470 
471  if (searchDialog->Create())
472  {
473  connect(searchDialog, &MythUISearchDialog::haveResult,
474  this, &GameUI::searchComplete);
475 
476  popupStack->AddScreen(searchDialog);
477  }
478  else
479  delete searchDialog;
480  }
481 }
482 
484 {
486  if (isLeaf(node))
487  {
488  auto *romInfo = node->GetData().value<RomInfo *>();
489  romInfo->setFavorite(true);
490  updateChangedNode(node, romInfo);
491  }
492 }
493 
494 void GameUI::customEvent(QEvent *event)
495 {
496  if (event->type() == DialogCompletionEvent::kEventType)
497  {
498  auto *dce = dynamic_cast<DialogCompletionEvent*>(event);
499  if (dce == nullptr)
500  return;
501  QString resultid = dce->GetId();
502  QString resulttext = dce->GetResultText();
503 
504  if (resultid == "showMenuPopup")
505  {
506  if (resulttext == tr("Edit Details"))
507  {
508  edit();
509  }
510  if (resulttext == tr("Scan For Changes"))
511  {
512  doScan();
513  }
514  else if (resulttext == tr("Show Information"))
515  {
516  showInfo();
517  }
518  else if (resulttext == tr("Make Favorite") ||
519  resulttext == tr("Remove Favorite"))
520  {
521  toggleFavorite();
522  }
523  else if (resulttext == tr("Retrieve Details"))
524  {
525  gameSearch();
526  }
527  }
528  else if (resultid == "chooseSystemPopup")
529  {
530  if (!resulttext.isEmpty() && resulttext != tr("Cancel"))
531  {
533  auto *romInfo = node->GetData().value<RomInfo *>();
534  GameHandler::Launchgame(romInfo, resulttext);
535  }
536  }
537  else if (resultid == "editMetadata")
538  {
540  auto *oldRomInfo = node->GetData().value<RomInfo *>();
541  delete oldRomInfo;
542 
543  auto *romInfo = dce->GetData().value<RomInfo *>();
544  node->SetData(QVariant::fromValue(romInfo));
545  node->SetText(romInfo->Gamename());
546 
547  romInfo->SaveToDatabase();
548  updateChangedNode(node, romInfo);
549  }
550  else if (resultid == "detailsPopup")
551  {
552  // Play button pushed
553  itemClicked(nullptr);
554  }
555  }
556  if (event->type() == MetadataLookupEvent::kEventType)
557  {
558  auto *lue = dynamic_cast<MetadataLookupEvent *>(event);
559  if (lue == nullptr)
560  return;
561  MetadataLookupList lul = lue->m_lookupList;
562 
563  if (m_busyPopup)
564  {
565  m_busyPopup->Close();
566  m_busyPopup = nullptr;
567  }
568 
569  if (lul.isEmpty())
570  return;
571 
572  if (lul.count() == 1)
573  {
574  OnGameSearchDone(lul[0]);
575  }
576  else
577  {
578  auto *resultsdialog =
580 
581  connect(resultsdialog, &MetadataResultsDialog::haveResult,
583  Qt::QueuedConnection);
584 
585  if (resultsdialog->Create())
586  m_popupStack->AddScreen(resultsdialog);
587  }
588  }
589  else if (event->type() == MetadataLookupFailure::kEventType)
590  {
591  auto *luf = dynamic_cast<MetadataLookupFailure *>(event);
592  if (luf == nullptr)
593  return;
594  MetadataLookupList lul = luf->m_lookupList;
595 
596  if (m_busyPopup)
597  {
598  m_busyPopup->Close();
599  m_busyPopup = nullptr;
600  }
601 
602  if (!lul.empty())
603  {
604  MetadataLookup *lookup = lul[0];
605  auto *node = lookup->GetData().value<MythGenericTree *>();
606  if (node)
607  {
608  auto *metadata = node->GetData().value<RomInfo *>();
609  if (metadata)
610  {
611  }
612  }
613  LOG(VB_GENERAL, LOG_ERR,
614  QString("No results found for %1").arg(lookup->GetTitle()));
615  }
616  }
617  else if (event->type() == ImageDLEvent::kEventType)
618  {
619  auto *ide = dynamic_cast<ImageDLEvent *>(event);
620  if (ide == nullptr)
621  return;
622  MetadataLookup *lookup = ide->m_item;
623 
624  if (!lookup)
625  return;
626 
627  handleDownloadedImages(lookup);
628  }
629  else if (event->type() == ImageDLFailureEvent::kEventType)
630  {
631  MythErrorNotification n(tr("Failed to retrieve image(s)"),
632  sLocation,
633  tr("Check logs"));
635  }
636 }
637 
639 {
640  QString layer = node->GetText();
641  int childDepth = node->getInt() + 1;
642  QString childLevel = getChildLevelString(node);
643  QString filter = getFilter(node);
644  bool childIsLeaf = childDepth == getLevelsOnThisBranch(node) + 1;
645  auto *romInfo = node->GetData().value<RomInfo *>();
646 
647  QString columns;
648  QString conj = "where ";
649 
650  if (!filter.isEmpty())
651  {
652  filter = conj + filter;
653  conj = " and ";
654  }
655  if ((childLevel == "gamename") && (m_gameShowFileName))
656  {
657  columns = childIsLeaf
658  ? "romname,`system`,year,genre,gamename"
659  : "romname";
660 
661  if (m_showHashed)
662  filter += " and romname like '" + layer + "%'";
663 
664  }
665  else if ((childLevel == "gamename") && (layer.length() == 1))
666  {
667  columns = childIsLeaf
668  ? childLevel + ",`system`,year,genre,gamename"
669  : childLevel;
670 
671  if (m_showHashed)
672  filter += " and gamename like '" + layer + "%'";
673 
674  }
675  else if (childLevel == "hash")
676  {
677  columns = "left(gamename,1)";
678  }
679  else
680  {
681 
682  columns = childIsLeaf
683  ? childLevel + ",`system`,year,genre,gamename"
684  : childLevel;
685  }
686 
687  // this whole section ought to be in rominfo.cpp really, but I've put it
688  // in here for now to minimise the number of files changed by this mod
689  if (romInfo)
690  {
691  if (!romInfo->System().isEmpty())
692  {
693  filter += conj + "trim(system)=:SYSTEM";
694  conj = " and ";
695  }
696  if (!romInfo->Year().isEmpty())
697  {
698  filter += conj + "year=:YEAR";
699  conj = " and ";
700  }
701  if (!romInfo->Genre().isEmpty())
702  {
703  filter += conj + "trim(genre)=:GENRE";
704  conj = " and ";
705  }
706  if (!romInfo->Plot().isEmpty())
707  {
708  filter += conj + "plot=:PLOT";
709  conj = " and ";
710  }
711  if (!romInfo->Publisher().isEmpty())
712  {
713  filter += conj + "publisher=:PUBLISHER";
714  conj = " and ";
715  }
716  if (!romInfo->Gamename().isEmpty())
717  {
718  filter += conj + "trim(gamename)=:GAMENAME";
719  }
720 
721  }
722 
723  filter += conj + " display = 1 ";
724 
725  QString sql;
726 
727  if ((childLevel == "gamename") && (m_gameShowFileName))
728  {
729  sql = "select distinct "
730  + columns
731  + " from gamemetadata "
732  + filter
733  + " order by romname"
734  + ";";
735  }
736  else if (childLevel == "hash")
737  {
738  sql = "select distinct "
739  + columns
740  + " from gamemetadata "
741  + filter
742  + " order by gamename,romname"
743  + ";";
744  }
745  else
746  {
747  sql = "select distinct "
748  + columns
749  + " from gamemetadata "
750  + filter
751  + " order by "
752  + childLevel
753  + ";";
754  }
755 
756  return sql;
757 }
758 
760 {
761  unsigned this_level = node->getInt();
762  while (node->getInt() != 1)
763  node = node->getParent();
764 
765  auto *gi = node->GetData().value<GameTreeInfo *>();
766  return gi->getLevel(this_level - 1);
767 }
768 
770 {
771  while (node->getInt() != 1)
772  node = node->getParent();
773  auto *gi = node->GetData().value<GameTreeInfo *>();
774  return gi->getFilter();
775 }
776 
778 {
779  while (node->getInt() != 1)
780  node = node->getParent();
781 
782  auto *gi = node->GetData().value<GameTreeInfo *>();
783  return gi->getDepth();
784 }
785 
787 {
788  return (node->getInt() - 1) == getLevelsOnThisBranch(node);
789 }
790 
792 {
793 // QString layername = node->GetText();
794  auto *romInfo = node->GetData().value<RomInfo *>();
795 
797 
798  query.prepare(getFillSql(node));
799 
800  if (romInfo)
801  {
802  if (!romInfo->System().isEmpty())
803  query.bindValue(":SYSTEM", romInfo->System());
804  if (!romInfo->Year().isEmpty())
805  query.bindValue(":YEAR", romInfo->Year());
806  if (!romInfo->Genre().isEmpty())
807  query.bindValue(":GENRE", romInfo->Genre());
808  if (!romInfo->Plot().isEmpty())
809  query.bindValue(":PLOT", romInfo->Plot());
810  if (!romInfo->Publisher().isEmpty())
811  query.bindValue(":PUBLISHER", romInfo->Publisher());
812  if (!romInfo->Gamename().isEmpty())
813  query.bindValue(":GAMENAME", romInfo->Gamename());
814  }
815 
816  bool IsLeaf = node->getInt() == getLevelsOnThisBranch(node);
817  if (query.exec() && query.size() > 0)
818  {
819  while (query.next())
820  {
821  QString current = query.value(0).toString().trimmed();
822  auto *new_node =
823  new MythGenericTree(current, node->getInt() + 1, false);
824  if (IsLeaf)
825  {
826  auto *temp = new RomInfo();
827  temp->setSystem(query.value(1).toString().trimmed());
828  temp->setYear(query.value(2).toString());
829  temp->setGenre(query.value(3).toString().trimmed());
830  temp->setGamename(query.value(4).toString().trimmed());
831  new_node->SetData(QVariant::fromValue(temp));
832  node->addNode(new_node);
833  }
834  else
835  {
836  RomInfo *newRomInfo = nullptr;
837  if (node->getInt() > 1)
838  {
839  auto *currentRomInfo = node->GetData().value<RomInfo *>();
840  newRomInfo = new RomInfo(*currentRomInfo);
841  }
842  else
843  {
844  newRomInfo = new RomInfo();
845  }
846  new_node->SetData(QVariant::fromValue(newRomInfo));
847  node->addNode(new_node);
848  if (getChildLevelString(node) != "hash")
849  newRomInfo->setField(getChildLevelString(node), current);
850  }
851  }
852  }
853 }
854 
856 {
857  MythGenericTree *top_level = node;
858  while (top_level->getParent() != m_gameTree)
859  {
860  top_level = top_level->getParent();
861  }
862 
863  QList<MythGenericTree*>::iterator it;
864  QList<MythGenericTree*> *children = m_gameTree->getAllChildren();
865 
866  for (it = children->begin(); it != children->end(); ++it)
867  {
868  MythGenericTree *child = *it;
869  if (child != top_level)
870  {
871  child->deleteAllChildren();
872  }
873  }
874 }
875 
877 {
878  resetOtherTrees(node);
879 
880  if (node->getParent() == m_favouriteNode && !romInfo->Favorite())
881  {
882  // node is being removed
884  }
885  else
886  nodeChanged(node);
887 }
888 
890  bool automode)
891 {
892  if (!node)
893  node = m_gameUITree->GetCurrentNode();
894 
895  if (!node)
896  return;
897 
898  auto *metadata = node->GetData().value<RomInfo *>();
899  if (!metadata)
900  return;
901 
902  auto *lookup = new MetadataLookup();
903  lookup->SetStep(kLookupSearch);
904  lookup->SetType(kMetadataGame);
905  lookup->SetData(QVariant::fromValue(node));
906 
907  if (automode)
908  {
909  lookup->SetAutomatic(true);
910  }
911 
912  lookup->SetTitle(metadata->Gamename());
913  lookup->SetInetref(metadata->Inetref());
914  if (m_query->isRunning())
915  m_query->prependLookup(lookup);
916  else
917  m_query->addLookup(lookup);
918 
919  if (!automode)
920  {
921  //: %1 is the game name
922  QString msg = tr("Fetching details for %1")
923  .arg(metadata->Gamename());
924  createBusyDialog(msg);
925  }
926 }
927 
928 void GameUI::createBusyDialog(const QString& title)
929 {
930  if (m_busyPopup)
931  return;
932 
933  const QString& message = title;
934 
936  "mythgamebusydialog");
937 
938  if (m_busyPopup->Create())
940 }
941 
943 {
944  if (!lookup)
945  return;
946 
947  lookup->SetStep(kLookupData);
948  lookup->IncrRef();
949  m_query->prependLookup(lookup);
950 }
951 
953 {
954  if (m_busyPopup)
955  {
956  m_busyPopup->Close();
957  m_busyPopup = nullptr;
958  }
959 
960  if (!lookup)
961  return;
962 
963  auto *node = lookup->GetData().value<MythGenericTree *>();
964  if (!node)
965  return;
966 
967  auto *metadata = node->GetData().value<RomInfo *>();
968  if (!metadata)
969  return;
970 
971  metadata->setGamename(lookup->GetTitle());
972  metadata->setYear(QString::number(lookup->GetYear()));
973  metadata->setPlot(lookup->GetDescription());
974  metadata->setSystem(lookup->GetSystem());
975 
976  QStringList coverart;
977  QStringList fanart;
978  QStringList screenshot;
979 
980  // Imagery
981  ArtworkList coverartlist = lookup->GetArtwork(kArtworkCoverart);
982  for (const auto & art : qAsConst(coverartlist))
983  coverart.prepend(art.url);
984  ArtworkList fanartlist = lookup->GetArtwork(kArtworkFanart);
985  for (const auto & art : qAsConst(fanartlist))
986  fanart.prepend(art.url);
987  ArtworkList screenshotlist = lookup->GetArtwork(kArtworkScreenshot);
988  for (const auto & art : qAsConst(screenshotlist))
989  screenshot.prepend(art.url);
990 
991  StartGameImageSet(node, coverart, fanart, screenshot);
992 
993  metadata->SaveToDatabase();
994  updateChangedNode(node, metadata);
995 }
996 
997 void GameUI::StartGameImageSet(MythGenericTree *node, QStringList coverart,
998  QStringList fanart, QStringList screenshot)
999 {
1000  if (!node)
1001  return;
1002 
1003  auto *metadata = node->GetData().value<RomInfo *>();
1004  if (!metadata)
1005  return;
1006 
1007  ArtworkMap map;
1008 
1009  if (metadata->Boxart().isEmpty() && !coverart.empty())
1010  {
1011  ArtworkInfo info;
1012  info.url = coverart.takeAt(0).trimmed();
1013  map.insert(kArtworkCoverart, info);
1014  }
1015 
1016  if (metadata->Fanart().isEmpty() && !fanart.empty())
1017  {
1018  ArtworkInfo info;
1019  info.url = fanart.takeAt(0).trimmed();
1020  map.insert(kArtworkFanart, info);
1021  }
1022 
1023  if (metadata->Screenshot().isEmpty() && !screenshot.empty())
1024  {
1025  ArtworkInfo info;
1026  info.url = screenshot.takeAt(0).trimmed();
1027  map.insert(kArtworkScreenshot, info);
1028  }
1029 
1030  auto *lookup = new MetadataLookup();
1031  lookup->SetTitle(metadata->Gamename());
1032  lookup->SetSystem(metadata->System());
1033  lookup->SetInetref(metadata->Inetref());
1034  lookup->SetType(kMetadataGame);
1035  lookup->SetDownloads(map);
1036  lookup->SetData(QVariant::fromValue(node));
1037 
1038  m_imageDownload->addDownloads(lookup);
1039 }
1040 
1042 {
1043  if (!lookup)
1044  return;
1045 
1046  auto *node = lookup->GetData().value<MythGenericTree *>();
1047  if (!node)
1048  return;
1049 
1050  auto *metadata = node->GetData().value<RomInfo *>();
1051  if (!metadata)
1052  return;
1053 
1054  DownloadMap downloads = lookup->GetDownloads();
1055 
1056  if (downloads.isEmpty())
1057  return;
1058 
1059  for (DownloadMap::iterator i = downloads.begin();
1060  i != downloads.end(); ++i)
1061  {
1062  VideoArtworkType type = i.key();
1063  ArtworkInfo info = i.value();
1064  QString filename = info.url;
1065 
1066  if (type == kArtworkCoverart)
1067  metadata->setBoxart(filename);
1068  else if (type == kArtworkFanart)
1069  metadata->setFanart(filename);
1070  else if (type == kArtworkScreenshot)
1071  metadata->setScreenshot(filename);
1072  }
1073 
1074  metadata->SaveToDatabase();
1075  updateChangedNode(node, metadata);
1076 }
1077 
1079 {
1080  if (!m_scanner)
1081  m_scanner = new GameScanner();
1083  m_scanner->doScanAll();
1084 }
1085 
1086 void GameUI::reloadAllData(bool dbChanged)
1087 {
1088  delete m_scanner;
1089  m_scanner = nullptr;
1090 
1091  if (dbChanged)
1092  BuildTree();
1093 }
1094 
GameScanner::doScanAll
void doScanAll(void)
Definition: gamescan.cpp:225
RomInfo::Boxart
QString Boxart() const
Definition: rominfo.h:67
GameUI::getFillSql
QString getFillSql(MythGenericTree *node) const
Definition: gameui.cpp:638
GameUI::m_popupStack
MythScreenStack * m_popupStack
Definition: gameui.h:79
GameUI::isLeaf
static bool isLeaf(MythGenericTree *node)
Definition: gameui.cpp:786
mythuibuttontree.h
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:783
mythuimetadataresults.h
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:126
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:321
GameTreeInfo::m_filter
QString m_filter
Definition: gameui.cpp:41
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(GrabberScript *)
MythUISearchDialog
Provide a dialog to quickly find an entry in a list.
Definition: mythdialogbox.h:349
VideoArtworkType
VideoArtworkType
Definition: metadataimagehelper.h:10
MSqlQuery::size
int size(void) const
Definition: mythdbcon.h:203
GameUI::customEvent
void customEvent(QEvent *event) override
Definition: gameui.cpp:494
RefCountHandler
Definition: referencecounterlist.h:18
GameUI::getChildLevelString
static QString getChildLevelString(MythGenericTree *node)
Definition: gameui.cpp:759
mythuitext.h
MythGenericTree::SetData
void SetData(QVariant data)
Definition: mythgenerictree.h:87
GameTreeInfo::GameTreeInfo
GameTreeInfo(const QString &levels, QString filter)
Definition: gameui.cpp:29
DialogCompletionEvent::GetId
QString GetId()
Definition: mythdialogbox.h:52
MythUIText::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitext.cpp:84
MetadataImageDownload
Definition: metadataimagedownload.h:88
MythGenericTree::GetText
QString GetText(const QString &name="") const
Definition: mythgenerictree.cpp:548
GameUI::createBusyDialog
void createBusyDialog(const QString &title)
Definition: gameui.cpp:928
RomInfo::Plot
QString Plot() const
Definition: rominfo.h:100
GameUI::ShowMenu
void ShowMenu(void) override
Definition: gameui.cpp:416
GameUI::nodeChanged
void nodeChanged(MythGenericTree *node)
Definition: gameui.cpp:213
MetadataLookup::GetTitle
QString GetTitle() const
Definition: metadatacommon.h:298
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
RomInfo::Gamename
QString Gamename() const
Definition: rominfo.h:76
MetadataResultsDialog
Definition: mythuimetadataresults.h:12
GameUI::m_gameYearText
MythUIText * m_gameYearText
Definition: gameui.h:84
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:636
GameUI::edit
void edit(void)
Definition: gameui.cpp:373
GameUI
Definition: gameui.h:25
RomInfo::Favorite
bool Favorite() const
Definition: rominfo.h:115
ArtworkList
QList< ArtworkInfo > ArtworkList
Definition: metadataimagehelper.h:30
EditRomInfoDialog
Definition: romedit.h:9
GameTreeInfo::m_levels
QStringList m_levels
Definition: gameui.cpp:40
MythMainWindow::TranslateKeyPress
bool TranslateKeyPress(const QString &context, QKeyEvent *e, QStringList &actions, bool allowJumps=true)
Get a list of actions for a keypress in the given context.
Definition: mythmainwindow.cpp:1139
GameTreeInfo::getDepth
int getDepth() const
Definition: gameui.cpp:35
GameUI::StartGameImageSet
void StartGameImageSet(MythGenericTree *node, QStringList coverart, QStringList fanart, QStringList screenshot)
Definition: gameui.cpp:997
GameTreeInfo::getLevel
const QString & getLevel(unsigned i) const
Definition: gameui.cpp:36
MythUIImage::Load
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
Definition: mythuiimage.cpp:968
MetadataDownload::prependLookup
void prependLookup(MetadataLookup *lookup)
prependLookup: Add lookup to top of the queue MetadataDownload::m_lookupList takes ownership of the g...
Definition: metadatadownload.cpp:53
GameUI::m_gameUITree
MythUIButtonTree * m_gameUITree
Definition: gameui.h:81
MythGenericTree::getInt
int getInt() const
Definition: mythgenerictree.h:66
MythUISearchDialog::haveResult
void haveResult(QString)
MythUIBusyDialog::Create
bool Create(void) override
Definition: mythprogressdialog.cpp:32
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
ImageDLFailureEvent::kEventType
static Type kEventType
Definition: metadataimagedownload.h:67
romedit.h
GameUI::m_scanner
GameScanner * m_scanner
Definition: gameui.h:95
mythdialogbox.h
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:198
MythScreenStack
Definition: mythscreenstack.h:16
arg
arg(title).arg(filename).arg(doDelete))
GameScanner
Definition: gamescan.h:71
MythGenericTree::GetData
QVariant GetData(void) const
Definition: mythgenerictree.h:88
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
RomInfo::Genre
QString Genre() const
Definition: rominfo.h:79
MythUIButtonTree::SetCurrentNode
bool SetCurrentNode(MythGenericTree *node)
Set the currently selected node.
Definition: mythuibuttontree.cpp:344
MythGenericTree::getChildByName
MythGenericTree * getChildByName(const QString &a_name) const
Definition: mythgenerictree.cpp:379
ImageDLEvent
Definition: metadataimagedownload.h:19
MetadataDownload
Definition: metadatadownload.h:36
MetadataLookup::GetArtwork
ArtworkList GetArtwork(VideoArtworkType type) const
Definition: metadatacommon.cpp:327
GameUI::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: gameui.cpp:178
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
mythuistatetype.h
GameUI::itemClicked
void itemClicked(MythUIButtonListItem *item)
Definition: gameui.cpp:250
MythUIStateType::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuistatetype.cpp:197
GameUI::doScan
void doScan(void)
Definition: gameui.cpp:1078
mythdirs.h
MythUIImage::Reset
void Reset(void) override
Reset the image back to the default defined in the theme.
Definition: mythuiimage.cpp:645
RomInfo::System
QString System() const
Definition: rominfo.h:73
MythUIButtonTree::AssignTree
bool AssignTree(MythGenericTree *tree)
Assign the root node of the tree to be displayed.
Definition: mythuibuttontree.cpp:211
GameTreeInfo
Definition: gameui.cpp:27
GameUI::searchComplete
void searchComplete(const QString &string)
Definition: gameui.cpp:296
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &stackname)
Definition: mythmainwindow.cpp:326
GameUI::m_gameTree
MythGenericTree * m_gameTree
Definition: gameui.h:75
mythuiimage.h
gamescan.h
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
kLookupSearch
@ kLookupSearch
Definition: metadatacommon.h:27
sLocation
static const QString sLocation
Definition: gameui.cpp:24
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:112
GameUI::m_gamePlotText
MythUIText * m_gamePlotText
Definition: gameui.h:86
MetadataLookup
Definition: metadatacommon.h:87
MythGenericTree::addNode
MythGenericTree * addNode(const QString &a_string, int an_int=0, bool selectable_flag=false, bool visible=true)
Definition: mythgenerictree.cpp:87
MetadataLookupFailure::kEventType
static Type kEventType
Definition: metadatadownload.h:32
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
MythUIButtonTree::itemClicked
void itemClicked(MythUIButtonListItem *item)
MetadataLookup::GetDownloads
DownloadMap GetDownloads() const
Definition: metadatacommon.h:371
GameUI::updateChangedNode
void updateChangedNode(MythGenericTree *node, RomInfo *romInfo)
Definition: gameui.cpp:876
RomInfo::Screenshot
QString Screenshot() const
Definition: rominfo.h:61
GameUI::m_gameImage
MythUIImage * m_gameImage
Definition: gameui.h:88
RomInfo::fillData
void fillData()
Definition: rominfo.cpp:244
GameUI::gameSearch
void gameSearch(MythGenericTree *node=nullptr, bool automode=false)
Definition: gameui.cpp:889
GameUI::reloadAllData
void reloadAllData(bool dbchanged)
Definition: gameui.cpp:1086
MetadataLookup::GetDescription
QString GetDescription() const
Definition: metadatacommon.h:311
MetadataLookupFailure
Definition: metadatadownload.h:24
ArtworkInfo
Definition: metadataimagehelper.h:22
RomInfo::setGamename
void setGamename(const QString &lgamename)
Definition: rominfo.h:77
RefCountedList< MetadataLookup >
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:138
MetadataLookup::GetData
QVariant GetData() const
Definition: metadatacommon.h:287
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
kLookupData
@ kLookupData
Definition: metadatacommon.h:28
GameUI::OnGameSearchDone
void OnGameSearchDone(MetadataLookup *lookup)
Definition: gameui.cpp:952
GameHandler::getHandler
static GameHandler * getHandler(uint i)
Definition: gamehandler.cpp:50
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:222
GameScanner::finished
void finished(bool)
MythGenericTree::childCount
int childCount(void) const
Definition: mythgenerictree.cpp:256
MythErrorNotification
Definition: mythnotification.h:362
kArtworkFanart
@ kArtworkFanart
Definition: metadataimagehelper.h:12
GameUI::m_gameGenreText
MythUIText * m_gameGenreText
Definition: gameui.h:85
GameUI::OnGameSearchListSelection
void OnGameSearchListSelection(RefCountHandler< MetadataLookup > lookup)
Definition: gameui.cpp:942
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:637
RomInfo::setFavorite
void setFavorite(bool updateDatabase=false)
Definition: rominfo.cpp:210
rominfo.h
mythgenerictree.h
MythUIBusyDialog
Definition: mythprogressdialog.h:37
MetadataDownload::addLookup
void addLookup(MetadataLookup *lookup)
addLookup: Add lookup to bottom of the queue MetadataDownload::m_lookupList takes ownership of the gi...
Definition: metadatadownload.cpp:38
MetadataLookup::GetYear
uint GetYear() const
Definition: metadatacommon.h:348
MythGenericTree::deleteAllChildren
void deleteAllChildren()
Definition: mythgenerictree.cpp:455
GameUI::handleDownloadedImages
void handleDownloadedImages(MetadataLookup *lookup)
Definition: gameui.cpp:1041
MythUIButtonTree::GetCurrentNode
MythGenericTree * GetCurrentNode(void) const
Definition: mythuibuttontree.h:32
GameUI::showInfo
void showInfo(void)
Definition: gameui.cpp:395
GameUI::m_busyPopup
MythUIBusyDialog * m_busyPopup
Definition: gameui.h:78
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:56
MythScreenType::GetScreenStack
MythScreenStack * GetScreenStack() const
Definition: mythscreentype.cpp:233
MythGenericTree::getAllChildren
QList< MythGenericTree * > * getAllChildren() const
Definition: mythgenerictree.cpp:278
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
GameDetailsPopup
Definition: gamedetails.h:10
GameUI::m_gameShowFileName
bool m_gameShowFileName
Definition: gameui.h:73
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:923
RomInfo
Definition: rominfo.h:13
MetadataLookup::GetSystem
QString GetSystem() const
Definition: metadatacommon.h:345
MetadataResultsDialog::haveResult
void haveResult(RefCountHandler< MetadataLookup >)
GameUI::m_gameSystemText
MythUIText * m_gameSystemText
Definition: gameui.h:83
GameUI::m_gameTitleText
MythUIText * m_gameTitleText
Definition: gameui.h:82
MythUIButtonTree::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuibuttontree.cpp:234
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:414
MetadataLookupEvent::kEventType
static Type kEventType
Definition: metadatadownload.h:20
RomInfo::Fanart
QString Fanart() const
Definition: rominfo.h:64
GameHandler::SystemName
QString SystemName() const
Definition: gamehandler.h:101
GameUI::m_fanartImage
MythUIImage * m_fanartImage
Definition: gameui.h:89
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:692
MythGenericTree::getParent
MythGenericTree * getParent(void) const
Definition: mythgenerictree.cpp:372
GameUI::m_query
MetadataDownload * m_query
Definition: gameui.h:92
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:864
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:42
GameUI::Create
bool Create() override
Definition: gameui.cpp:55
MythGenericTree
Definition: mythgenerictree.h:21
kMetadataGame
@ kMetadataGame
Definition: metadatacommon.h:45
GameUI::showImages
void showImages(void)
Definition: gameui.cpp:286
GameUI::m_imageDownload
MetadataImageDownload * m_imageDownload
Definition: gameui.h:93
GameUI::m_gameFavouriteState
MythUIStateType * m_gameFavouriteState
Definition: gameui.h:87
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:134
GetNotificationCenter
MythNotificationCenter * GetNotificationCenter(void)
Definition: mythmainwindow.cpp:125
mythcontext.h
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:105
MThread::isRunning
bool isRunning(void) const
Definition: mthread.cpp:268
GameHandler::Launchgame
static void Launchgame(RomInfo *romdata, const QString &systemname)
Definition: gamehandler.cpp:822
GameUI::resetOtherTrees
void resetOtherTrees(MythGenericTree *node)
Definition: gameui.cpp:855
GameUI::clearRomInfo
void clearRomInfo(void)
Definition: gameui.cpp:348
build_compdb.action
action
Definition: build_compdb.py:9
GameUI::m_favouriteNode
MythGenericTree * m_favouriteNode
Definition: gameui.h:76
DownloadMap
QMap< VideoArtworkType, ArtworkInfo > DownloadMap
Definition: metadatacommon.h:83
ArtworkMap
QMultiMap< VideoArtworkType, ArtworkInfo > ArtworkMap
Definition: metadataimagehelper.h:31
GameUI::getFilter
static QString getFilter(MythGenericTree *node)
Definition: gameui.cpp:769
GameUI::getLevelsOnThisBranch
static int getLevelsOnThisBranch(MythGenericTree *node)
Definition: gameui.cpp:777
MythGenericTree::SetText
void SetText(const QString &text, const QString &name="", const QString &state="")
Definition: mythgenerictree.cpp:516
gameui.h
RomInfo::setField
void setField(const QString &field, const QString &data)
Definition: rominfo.cpp:169
GameUI::BuildTree
void BuildTree()
Definition: gameui.cpp:93
GameUI::m_showHashed
bool m_showHashed
Definition: gameui.h:72
GameTreeInfo::getFilter
const QString & getFilter() const
Definition: gameui.cpp:37
kArtworkScreenshot
@ kArtworkScreenshot
Definition: metadataimagehelper.h:14
MythUIImage::SetFilename
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
Definition: mythuiimage.cpp:676
GameUI::searchStart
void searchStart(void)
Definition: gameui.cpp:450
ReferenceCounter::IncrRef
virtual int IncrRef(void)
Increments reference count.
Definition: referencecounter.cpp:101
mythmainwindow.h
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:49
query
MSqlQuery query(MSqlQuery::InitCon())
GameUI::toggleFavorite
void toggleFavorite(void)
Definition: gameui.cpp:483
MetadataLookupEvent
Definition: metadatadownload.h:12
kArtworkCoverart
@ kArtworkCoverart
Definition: metadataimagehelper.h:11
gamehandler.h
MetadataLookup::SetStep
void SetStep(LookupStep step)
Definition: metadatacommon.h:243
RomInfo::Year
QString Year() const
Definition: rominfo.h:109
GameUI::fillNode
void fillNode(MythGenericTree *node)
Definition: gameui.cpp:791
gamedetails.h
MythUIStateType::DisplayState
bool DisplayState(const QString &name)
Definition: mythuistatetype.cpp:84
MythUIButtonTree::nodeChanged
void nodeChanged(MythGenericTree *node)
ImageDLEvent::kEventType
static Type kEventType
Definition: metadataimagedownload.h:41
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:915
GameHandler::count
static uint count(void)
Definition: gamehandler.cpp:97
ArtworkInfo::url
QString url
Definition: metadataimagehelper.h:25
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:808
GameUI::m_boxImage
MythUIImage * m_boxImage
Definition: gameui.h:90
MetadataImageDownload::addDownloads
void addDownloads(MetadataLookup *lookup)
addLookup: Add lookup to bottom of the queue MetadataDownload::m_downloadList takes ownership of the ...
Definition: metadataimagedownload.cpp:53
GameUI::updateRomInfo
void updateRomInfo(RomInfo *rom)
Definition: gameui.cpp:310
MythNotificationCenter::Queue
bool Queue(const MythNotification &notification)
Queue a notification Queue() is thread-safe and can be called from anywhere.
Definition: mythnotificationcenter.cpp:1351