MythTV  master
gameui.h
Go to the documentation of this file.
1 #ifndef GAMEUI_H_
2 #define GAMEUI_H_
3 
4 #include <QString>
5 #include <QObject>
6 
7 // myth
8 #include <mythscreentype.h>
12 #include <mythprogressdialog.h>
13 
14 class MythUIButtonTree;
15 class MythGenericTree;
16 class MythUIText;
17 class MythUIStateType;
18 class RomInfo;
19 class QTimer;
20 class QKeyEvent;
21 class QEvent;
22 class GameScanner;
23 
24 class GameUI : public MythScreenType
25 {
26  Q_OBJECT
27 
28  public:
29  explicit GameUI(MythScreenStack *parentStack);
30  ~GameUI() = default;
31 
32  bool Create() override; // MythScreenType
33  void BuildTree();
34  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
35 
36  public slots:
37  void nodeChanged(MythGenericTree* node);
39  void showImages(void);
40  void searchComplete(const QString&);
41  void gameSearch(MythGenericTree *node = nullptr,
42  bool automode = false);
44  void OnGameSearchDone(MetadataLookup *lookup);
45  void StartGameImageSet(MythGenericTree *node, QStringList coverart,
46  QStringList fanart, QStringList screenshot);
47  void doScan(void);
48  void reloadAllData(bool dbchanged);
49 
50  private:
51  void updateRomInfo(RomInfo *rom);
52  void clearRomInfo(void);
53  void edit(void);
54  void showInfo(void);
55  void ShowMenu(void) override; // MythScreenType
56  void searchStart(void);
57  void toggleFavorite(void);
58  void customEvent(QEvent *event) override; // MythUIType
59  void createBusyDialog(const QString& title);
60 
61  QString getFillSql(MythGenericTree* node) const;
62  QString getChildLevelString(MythGenericTree *node) const;
63  QString getFilter(MythGenericTree *node) const;
64  int getLevelsOnThisBranch(MythGenericTree *node) const;
65  bool isLeaf(MythGenericTree *node) const;
66  void fillNode(MythGenericTree *node);
67  void resetOtherTrees(MythGenericTree *node);
68  void updateChangedNode(MythGenericTree *node, RomInfo *romInfo);
70 
71  private:
72  bool m_showHashed {false};
73  bool m_gameShowFileName {false};
74 
77 
80 
90  MythUIImage *m_boxImage {nullptr};
91 
94 
95  GameScanner *m_scanner {nullptr};
96 };
97 
98 #endif
MythUIBusyDialog * m_busyPopup
Definition: gameui.h:78
This widget is used for grouping other widgets for display when a particular named state is called.
void toggleFavorite(void)
Definition: gameui.cpp:489
void resetOtherTrees(MythGenericTree *node)
Definition: gameui.cpp:858
void clearRomInfo(void)
Definition: gameui.cpp:353
MythGenericTree * m_gameTree
Definition: gameui.h:75
void doScan(void)
Definition: gameui.cpp:1098
MetadataDownload * m_query
Definition: gameui.h:92
unsigned int slots[4]
Definition: element.c:38
void updateChangedNode(MythGenericTree *node, RomInfo *romInfo)
Definition: gameui.cpp:879
void handleDownloadedImages(MetadataLookup *lookup)
Definition: gameui.cpp:1059
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
bool isLeaf(MythGenericTree *node) const
Definition: gameui.cpp:788
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
void showImages(void)
Definition: gameui.cpp:291
MythUIImage * m_boxImage
Definition: gameui.h:90
void reloadAllData(bool dbchanged)
Definition: gameui.cpp:1106
MythUIImage * m_gameImage
Definition: gameui.h:88
void ShowMenu(void) override
Definition: gameui.cpp:422
void OnGameSearchListSelection(RefCountHandler< MetadataLookup > lookup)
Definition: gameui.cpp:946
bool m_showHashed
Definition: gameui.h:72
MythUIStateType * m_gameFavouriteState
Definition: gameui.h:87
MythUIText * m_gameYearText
Definition: gameui.h:84
void nodeChanged(MythGenericTree *node)
Definition: gameui.cpp:215
int getLevelsOnThisBranch(MythGenericTree *node) const
Definition: gameui.cpp:779
void customEvent(QEvent *event) override
Definition: gameui.cpp:500
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: gameui.cpp:178
GameScanner * m_scanner
Definition: gameui.h:95
MythUIButtonTree * m_gameUITree
Definition: gameui.h:81
void searchStart(void)
Definition: gameui.cpp:456
void showInfo(void)
Definition: gameui.cpp:400
MythScreenStack * m_popupStack
Definition: gameui.h:79
MythUIText * m_gamePlotText
Definition: gameui.h:86
void updateRomInfo(RomInfo *rom)
Definition: gameui.cpp:315
MythUIImage * m_fanartImage
Definition: gameui.h:89
~GameUI()=default
QString getFilter(MythGenericTree *node) const
Definition: gameui.cpp:771
void gameSearch(MythGenericTree *node=nullptr, bool automode=false)
Definition: gameui.cpp:892
void fillNode(MythGenericTree *node)
Definition: gameui.cpp:793
GameUI(MythScreenStack *parentStack)
Definition: gameui.cpp:46
void OnGameSearchDone(MetadataLookup *lookup)
Definition: gameui.cpp:956
MetadataImageDownload * m_imageDownload
Definition: gameui.h:93
void edit(void)
Definition: gameui.cpp:378
void BuildTree()
Definition: gameui.cpp:93
bool Create() override
Definition: gameui.cpp:55
QString getFillSql(MythGenericTree *node) const
Definition: gameui.cpp:640
QString getChildLevelString(MythGenericTree *node) const
Definition: gameui.cpp:761
MythUIText * m_gameSystemText
Definition: gameui.h:83
void itemClicked(MythUIButtonListItem *item)
Definition: gameui.cpp:252
MythUIText * m_gameTitleText
Definition: gameui.h:82
Screen in which all other widgets are contained and rendered.
Definition: gameui.h:24
void StartGameImageSet(MythGenericTree *node, QStringList coverart, QStringList fanart, QStringList screenshot)
Definition: gameui.cpp:1010
void searchComplete(const QString &)
Definition: gameui.cpp:301
void createBusyDialog(const QString &title)
Definition: gameui.cpp:932
MythGenericTree * m_favouriteNode
Definition: gameui.h:76
A tree widget for displaying and navigating a MythGenericTree()
bool m_gameShowFileName
Definition: gameui.h:73
MythUIText * m_gameGenreText
Definition: gameui.h:85