Ticket #6627: mythgame_to_mythui.patch

File mythgame_to_mythui.patch, 50.1 KB (added by Mike Rice <mikerice1969@…>, 15 years ago)

mythgame to mythui patch

  • mythplugins/mythgame/theme/theme.pro

     
    1010!macx:QMAKE_COPY_DIR = sh ../../cpsvndir
    1111
    1212defaultfiles.path = $${PREFIX}/share/mythtv/themes/default
    13 defaultfiles.files = default/*.xml default/images/*.png
     13defaultfiles.files = default/*.xml default/images/*.png default/htmls/*.html
    1414
    1515widefiles.path = $${PREFIX}/share/mythtv/themes/default-wide
    1616widefiles.files = default-wide/*.xml default-wide/images/*.png
  • mythplugins/mythgame/theme/default/game-ui.xml

     
    11<mythuitheme>
    22
    3   <window name="gametree">
     3  <window name="gameui">
    44
    5     <font name="active" face="Arial">
    6         <color>#ffffff</color>
    7         <size>18</size>
    8         <bold>yes</bold>
    9     </font>
    10 
    11     <font name="inactive" face="Arial">
    12         <color>#9999cc</color>
    13         <size>18</size>
    14         <bold>yes</bold>
    15     </font>
    16 
    17     <font name="selectable" face="Arial">
    18         <color>#8cdeff</color>
    19         <size>18</size>
    20         <bold>yes</bold>
    21     </font>
    22 
    235    <font name="largetitle" face="Arial">
    246        <color>#ffffff</color>
    257        <dropcolor>#000000</dropcolor>
     
    3315        <size>20</size>
    3416        <bold>yes</bold>
    3517    </font>
    36 
    37     <container name="background">
    38         <image name="filler" draworder="0" fleximage="yes">
    39             <filename>background.png</filename>
    40             <position>0,10</position>
    41         </image>
    42         <image name="titlelines" draworder="0" fleximage="no">
    43             <filename>trans-titles.png</filename>
    44             <position>0,10</position>
    45         </image>
    46         <image name="infofiller" draworder="0" fleximage="no">
    47             <filename>pf-top.png</filename>
    48             <position>26,350</position>
    49         </image>
    50     </container>
    51 
    52     <container name="gameselector">
     18   
     19    <buttontree name="gametreelist">
    5320        <area>0,10,800,310</area>
    54         <managedtreelist name="gametreelist" draworder="1" bins="2">
    55             <area>40,10,720,270</area>
    56             <image function="selectionbar" filename="mv_selectionbar.png"></image>
    57             <image function="uparrow" filename="mv_up_arrow.png"></image>
    58             <image function="downarrow" filename="mv_down_arrow.png"></image>
    59             <image function="leftarrow" filename="mv_left_arrow.png"></image>
    60             <image function="rightarrow" filename="mv_right_arrow.png"></image>
    61             <bin number="1">
    62                 <area>30,16,190,250</area>
    63                 <fcnfont name="active" function="active"></fcnfont>
    64                 <fcnfont name="inactive" function="inactive"></fcnfont>
    65                 <fcnfont name="active" function="selected"></fcnfont>
    66                 <fcnfont name="selectable" function="selectable"></fcnfont>
    67             </bin>
    68             <bin number="2">
    69                 <area>235,10,535,270</area>
    70                 <fcnfont name="active" function="active"></fcnfont>
    71                 <fcnfont name="active" function="selected"></fcnfont>
    72                 <fcnfont name="inactive" function="inactive"></fcnfont>
    73                 <fcnfont name="selectable" function="selectable"></fcnfont>
    74             </bin>
    75         </managedtreelist>
     21        <numlists>2</numlists>
     22        <spacing>10</spacing>
     23        <buttonlist name="listtemplate" from="basebuttonlist" />
     24    </buttontree>
    7625
    77         <image name="showinglines" draworder="2" fleximage="yes">
    78             <filename>showings.png</filename>
    79             <position>0,0</position>
    80         </image>
    81     </container>
    82 
    83     <container name="game_info">
    84       <area>25,355,750,220</area>
    85 
    86       <textarea name="gametitle" draworder="6">
    87         <area>13,5,500,50</area>
     26    <textarea name="gametitle">
     27        <area>38,360,500,50</area>
    8828        <font>largetitle</font>
    89       </textarea>
     29    </textarea>
    9030
    91       <textarea name="system" draworder="6">
    92         <area>13,75,150,35</area>
     31    <textarea name="system">
     32        <area>38,430,150,35</area>
    9333        <font>infofont</font>
    9434        <value>System:</value>
    95       </textarea>
     35    </textarea>
    9636
    97       <textarea name="systemname" draworder="6">
    98         <area>153,75,500,35</area>
     37    <textarea name="systemname">
     38        <area>178,430,500,35</area>
    9939        <font>infofont</font>
    100       </textarea>
     40    </textarea>
    10141
    102       <textarea name="year" draworder="6">
    103         <area>13,110,150,35</area>
     42    <textarea name="year">
     43        <area>38,465,150,35</area>
    10444        <font>infofont</font>
    10545        <value>Year:</value>
    106       </textarea>
     46    </textarea>
    10747
    108       <textarea name="yearname" draworder="6">
    109         <area>153,110,500,35</area>
     48    <textarea name="yearname">
     49        <area>178,465,500,35</area>
    11050        <font>infofont</font>
    111       </textarea>
     51    </textarea>
    11252
    113       <textarea name="genre" draworder="6">
    114         <area>13,140,150,35</area>
     53    <textarea name="genre">
     54        <area>38,495,150,35</area>
    11555        <font>infofont</font>
    11656        <value>Genre:</value>
    117       </textarea>
     57    </textarea>
    11858
    119       <textarea name="genrename" draworder="6">
    120         <area>153,140,500,35</area>
     59    <textarea name="genrename">
     60        <area>178,495,500,35</area>
    12161        <font>infofont</font>
    122       </textarea>
     62    </textarea>
    12363
    124       <textarea name="favorite" draworder="6">
    125         <area>13,170,150,35</area>
     64    <textarea name="favorite">
     65        <area>38,525,150,35</area>
    12666        <font>infofont</font>
    12767        <value>Favorite:</value>
    128       </textarea>
     68    </textarea>
    12969
    130       <textarea name="showfavorite" draworder="6">
    131         <area>153,170,500,35</area>
     70    <textarea name="showfavorite">
     71        <area>178,525,500,35</area>
    13272        <font>infofont</font>
    133       </textarea>
     73    </textarea>
    13474
    135       <image name="gameimage" draworder="6" fleximage="no">
    136           <position>535,25</position>
    137           <staticsize>180,150</staticsize>
    138       </image>
    139     </container>
     75    <imagetype name="gameimage">
     76        <area>560,380,180,150</area>
     77    </imagetype>
    14078 
    14179  </window>
    14280
  • mythplugins/mythgame/theme/default/htmls/gamedetails.html

     
     1<html>
     2<head>
     3    <style type="text/css">
     4        h1 {font-size:24pt;font-style: normal;color:yellow}
     5        p  {font-size:20pt;font-style: normal;color:#ffffff;margin-top: -10pt}
     6    </style>
     7</head>
     8
     9<body>
     10    <h1>%NAME_LABLE%</h1> <p>%NAME%</p>
     11    <h1>%TYPE_LABLE%</h1> <p>%TYPE%</p>
     12    <h1>%ROM_LABLE%</h1> <p>%ROM%</p>
     13    <h1>%CRC_LABLE%</h1> <p>%CRC%</p>
     14    <h1>%PATH_LABLE%</h1> <p>%PATH%</p>
     15    <h1>%GENRE_LABLE%</h1> <p>%GENRE%</p>
     16    <h1>%YEAR_LABLE%</h1> <p>%YEAR%</p>
     17    <h1>%COUNTRY_LABLE%</h1> <p>%COUNTRY%</p>
     18    <h1>%PUBLISHER_LABLE%</h1> <p>%PUBLISHER%</p>
     19    <h1>%PLAYERS_LABLE%</h1> <p>%PLAYERS%</p>
     20</body>
     21
     22</html>
  • mythplugins/mythgame/theme/default-wide/game-ui.xml

     
    11<mythuitheme>
    22
    3   <window name="gametree">
     3  <window name="gameui">
    44
    5     <font name="active" face="Trebuchet MS">
    6         <color>#ffffff</color>
    7         <size>18</size>
    8         <bold>yes</bold>
    9     </font>
    10 
    11     <font name="inactive" face="Trebuchet MS">
    12         <color>#9999cc</color>
    13         <size>18</size>
    14         <bold>yes</bold>
    15     </font>
    16 
    17     <font name="selectable" face="Trebuchet MS">
    18         <color>#8cdeff</color>
    19         <size>18</size>
    20         <bold>yes</bold>
    21     </font>
    22 
    235    <font name="largetitle" face="Trebuchet MS">
    246        <color>#ffffff</color>
    257        <dropcolor>#000000</dropcolor>
     
    3416        <bold>yes</bold>
    3517    </font>
    3618
    37     <container name="background">
    38         <image name="filler" draworder="0" fleximage="yes">
    39             <filename>background.png</filename> <!-- 1280x326 -->
    40             <position>0,48</position>
    41         </image>
    42         <image name="titlelines" draworder="0" fleximage="no">
    43             <filename>trans-titles.png</filename> <!-- 1280x326 -->
    44             <position>0,50</position>
    45             <staticsize>280,315</staticsize>
    46         </image>
    47         <image name="infofiller" draworder="0" fleximage="no">
    48             <filename>pf-top.png</filename> <!-- 1152x260 -->
    49             <position>64,412</position>
    50         </image>
    51     </container>
    52 
    53     <container name="gameselector">
     19    <buttontree name="gametreelist">
    5420        <area>8,52,1264,310</area>
    55         <managedtreelist name="gametreelist" draworder="1" bins="2">
    56             <area>32,0,1200,296</area>
    57             <image function="selectionbar" filename="mv_selectionbar.png"></image>
    58             <image function="uparrow" filename="mv_up_arrow.png"></image>
    59             <image function="downarrow" filename="mv_down_arrow.png"></image>
    60             <image function="leftarrow" filename="mv_left_arrow.png"></image>
    61             <image function="rightarrow" filename="mv_right_arrow.png"></image>
    62             <bin number="1">
    63                 <area>56,28,288,271</area>
    64                 <fcnfont name="active" function="active"></fcnfont>
    65                 <fcnfont name="inactive" function="inactive"></fcnfont>
    66                 <fcnfont name="active" function="selected"></fcnfont>
    67                 <fcnfont name="selectable" function="selectable"></fcnfont>
    68             </bin>
    69             <bin number="2">
    70                 <area>384,0,816,296</area>
    71                 <fcnfont name="active" function="active"></fcnfont>
    72                 <fcnfont name="active" function="selected"></fcnfont>
    73                 <fcnfont name="inactive" function="inactive"></fcnfont>
    74                 <fcnfont name="selectable" function="selectable"></fcnfont>
    75             </bin>
    76         </managedtreelist>
     21        <numlists>3</numlists>
     22        <spacing>10</spacing>
     23        <buttonlist name="listtemplate" from="basebuttonlist" />
     24    </buttontree>
    7725
    78         <image name="showinglines" draworder="2" fleximage="yes">
    79             <filename>showings.png</filename>
    80             <position>20,10</position>
    81             <staticsize>1200,310</staticsize>
    82         </image>
    83     </container>
    84 
    85     <container name="game_info">
    86       <area>64,412,1152,260</area>
    87 
    88       <textarea name="gametitle" draworder="6">
    89         <area>32,28,752,60</area>
     26    <textarea name="gametitle" draworder="6">
     27        <area>96,440,752,60</area>
    9028        <font>largetitle</font>
    91       </textarea>
     29    </textarea>
    9230
    93       <textarea name="system" draworder="6">
    94         <area>32,98,140,35</area>
     31    <textarea name="system" draworder="6">
     32        <area>96,510,140,35</area>
    9533        <font>infofont</font>
    9634        <value>System:</value>
    97       </textarea>
     35    </textarea>
    9836
    99       <textarea name="systemname" draworder="6">
    100         <area>172,98,580,35</area>
     37    <textarea name="systemname" draworder="6">
     38        <area>236,510,580,35</area>
    10139        <font>infofont</font>
    102       </textarea>
     40    </textarea>
    10341
    104       <textarea name="year" draworder="6">
    105         <area>32,133,140,35</area>
     42    <textarea name="year" draworder="6">
     43        <area>96,545,140,35</area>
    10644        <font>infofont</font>
    10745        <value>Year:</value>
    108       </textarea>
     46    </textarea>
    10947
    110       <textarea name="yearname" draworder="6">
    111         <area>172,133,580,35</area>
     48    <textarea name="yearname" draworder="6">
     49        <area>236,545,580,35</area>
    11250        <font>infofont</font>
    113       </textarea>
     51    </textarea>
    11452
    115       <textarea name="genre" draworder="6">
    116         <area>32,168,140,35</area>
     53    <textarea name="genre" draworder="6">
     54        <area>96,580,140,35</area>
    11755        <font>infofont</font>
    11856        <value>Genre:</value>
    119       </textarea>
     57    </textarea>
    12058
    121       <textarea name="genrename" draworder="6">
    122         <area>172,168,580,35</area>
     59    <textarea name="genrename" draworder="6">
     60        <area>236,580,580,35</area>
    12361        <font>infofont</font>
    124       </textarea>
     62    </textarea>
    12563
    126       <textarea name="favorite" draworder="6">
    127         <area>32,203,140,35</area>
     64    <textarea name="favorite" draworder="6">
     65        <area>96,615,140,35</area>
    12866        <font>infofont</font>
    12967        <value>Favorite:</value>
    130       </textarea>
     68    </textarea>
    13169
    132       <textarea name="showfavorite" draworder="6">
    133         <area>172,203,580,35</area>
     70    <textarea name="showfavorite" draworder="6">
     71        <area>236,615,580,35</area>
    13472        <font>infofont</font>
    135       </textarea>
     73    </textarea>
    13674
    137       <image name="gameimage" draworder="6" fleximage="no">
    138           <position>816,36</position>
    139           <staticsize>300,196</staticsize>
    140       </image>
    141     </container>
    142  
     75    <imagetype name="gameimage">
     76          <area>880,448,300,196</area>
     77    </imagetype>
     78
    14379  </window>
    14480
     81  <window name="gamedetails">
     82
     83    <textarea name="title" from="basetextarea">
     84        <area>80,20,720,40</area>
     85        <font>baselarge</font>
     86        <value>Game Details:</value>
     87    </textarea>
     88
     89    <imagetype name="background">
     90        <filename>pd-background.png</filename>
     91        <position>60,60</position>
     92    </imagetype>
     93
     94    <webbrowser name="browser">
     95        <area>80,70,1094,555</area>
     96        <zoom>1.0</zoom>
     97        <background color="#000000" alpha="1"/>
     98    </webbrowser>
     99
     100  </window>
     101
    145102</mythuitheme>
  • mythplugins/mythgame/mythgame/gameui.cpp

     
     1#include <mythcontext.h>
     2#include <mythuibuttontree.h>
     3#include <mythdialogbox.h>
     4#include <mythgenerictree.h>
     5
     6// MythGame headers
     7#include "gameui.h"
     8#include "gamehandler.h"
     9#include "rominfo.h"
     10#include "gamedetails.h"
     11
     12class GameTreeInfo
     13{
     14  public:
     15    GameTreeInfo(const QString& levels, const QString& filter)
     16      : m_levels(QStringList::split(" ", levels))
     17      , m_filter(filter)
     18    {
     19    }
     20
     21    int getDepth() const                        { return m_levels.size(); }
     22    const QString& getLevel(unsigned i) const   { return m_levels[i]; }
     23    const QString& getFilter() const            { return m_filter; }
     24
     25  private:
     26    QStringList m_levels;
     27    QString m_filter;
     28};
     29
     30Q_DECLARE_METATYPE(GameTreeInfo *)
     31
     32GameUI::GameUI(MythScreenStack *parent)
     33        : MythScreenType(parent, "GameUI")
     34{
     35    gContext->addCurrentLocation("mythgame");
     36}
     37
     38GameUI::~GameUI()
     39{
     40    gContext->removeCurrentLocation();
     41}
     42
     43bool GameUI::Create()
     44{
     45    if (!LoadWindowFromXML("game-ui.xml", "gameui", this))
     46        return false;
     47
     48    bool err = false;
     49    UIUtilE::Assign(this, m_gameTreeUI, "gametreelist", &err);
     50    UIUtilE::Assign(this, m_gameTitle, "gametitle", &err);
     51    UIUtilE::Assign(this, m_gameSystem, "systemname", &err);
     52    UIUtilE::Assign(this, m_gameYear, "yearname", &err);
     53    UIUtilE::Assign(this, m_gameGenre, "genrename", &err);
     54    UIUtilE::Assign(this, m_gameFavourite, "showfavorite", &err);
     55    UIUtilE::Assign(this, m_gameImage, "gameimage", &err);
     56
     57    if (err)
     58    {
     59        VERBOSE(VB_IMPORTANT, "Cannot load screen 'gameui'");
     60        return false;
     61    }
     62   
     63    connect(m_gameTreeUI, SIGNAL(itemClicked(MythUIButtonListItem*)),
     64            this, SLOT(itemClicked(MythUIButtonListItem*)));
     65
     66    connect(m_gameTreeUI, SIGNAL(nodeChanged(MythGenericTree*)),
     67            this, SLOT(nodeChanged(MythGenericTree*)));
     68
     69    m_gameShowFileName = gContext->GetSetting("GameShowFileNames").toInt();
     70
     71    m_gameTree = new MythGenericTree("game root", 0, false);
     72
     73    timer = new QTimer(this);
     74    connect(timer, SIGNAL(timeout()), SLOT(showImageTimeout()));
     75
     76    //  create system filter to only select games where handlers are present
     77    QString systemFilter;
     78
     79    // The call to GameHandler::count() fills the handler list for us
     80    // to move through.
     81    unsigned handlercount = GameHandler::count();
     82
     83    for (unsigned i = 0; i < handlercount; ++i)
     84    {
     85        QString system = GameHandler::getHandler(i)->SystemName();
     86        if (i == 0)
     87            systemFilter = "system in ('" + system + "'";
     88        else
     89            systemFilter += ",'" + system + "'";
     90    }
     91    if (systemFilter.isEmpty())
     92    {
     93        systemFilter = "1=0";
     94        VERBOSE(VB_GENERAL, QString("Couldn't find any game handlers!"));
     95    }
     96    else
     97        systemFilter += ")";
     98
     99    m_showHashed = gContext->GetSetting("GameTreeView").toInt();
     100
     101    //  create a few top level nodes - this could be moved to a config based
     102    //  approach with multiple roots if/when someone has the time to create
     103    //  the relevant dialog screens
     104
     105    QString levels = gContext->GetSetting("GameFavTreeLevels");
     106
     107    MythGenericTree *new_node = new MythGenericTree("Favourites", 1, true);
     108    new_node->SetData(qVariantFromValue(
     109                new GameTreeInfo(levels, systemFilter + " and favorite=1")));
     110    m_favouriteNode = m_gameTree->addNode(new_node);
     111
     112    levels = gContext->GetSetting("GameAllTreeLevels");
     113
     114    if (m_showHashed)
     115    {
     116        int pos = levels.find("gamename",0);
     117        if (pos >= 0)
     118            levels.insert(pos, " hash ");
     119    }
     120
     121    new_node = new MythGenericTree(tr("All Games"), 1, true);
     122    new_node->SetData(qVariantFromValue(
     123                new GameTreeInfo(levels, systemFilter)));
     124    m_gameTree->addNode(new_node);
     125
     126    new_node = new MythGenericTree(tr("-   By Genre"), 1, true);
     127    new_node->SetData(qVariantFromValue(
     128                new GameTreeInfo("genre gamename", systemFilter)));
     129    m_gameTree->addNode(new_node);
     130
     131    new_node = new MythGenericTree(tr("-   By Year"), 1, true);
     132    new_node->SetData(qVariantFromValue(
     133                new GameTreeInfo("year gamename", systemFilter)));
     134    m_gameTree->addNode(new_node);
     135
     136    new_node = new MythGenericTree(tr("-   By Name"), 1, true);
     137    new_node->SetData(qVariantFromValue(
     138                new GameTreeInfo("gamename", systemFilter)));
     139    m_gameTree->addNode(new_node);
     140
     141    new_node = new MythGenericTree(tr("-   By Publisher"), 1, true);
     142    new_node->SetData(qVariantFromValue(
     143                new GameTreeInfo("publisher gamename", systemFilter)));
     144    m_gameTree->addNode(new_node);
     145
     146    m_gameTreeUI->AssignTree(m_gameTree);
     147
     148    BuildFocusList();
     149
     150    return true;
     151}
     152
     153bool GameUI::keyPressEvent(QKeyEvent *event)
     154{
     155    if (GetFocusWidget()->keyPressEvent(event))
     156        return true;
     157
     158    bool handled = false;
     159    QStringList actions;
     160    gContext->GetMainWindow()->TranslateKeyPress("Game", event, actions);
     161
     162    for (int i = 0; i < actions.size() && !handled; i++)
     163    {
     164        QString action = actions[i];
     165        handled = true;
     166
     167        if (action == "MENU")
     168            showMenu();
     169        else if (action == "INFO")
     170            showInfo();
     171        else if (action == "TOGGLEFAV")
     172            toggleFavorite();
     173        else if (action == "INCSEARCH")
     174            searchStart();
     175        else if (action == "INCSEARCHNEXT")
     176            searchStart();
     177        else
     178            handled = false;
     179    }
     180    if (!handled && MythScreenType::keyPressEvent(event))
     181        handled = true;
     182
     183    return handled;
     184}
     185
     186void GameUI::nodeChanged(MythGenericTree* node)
     187{
     188    if (!isLeaf(node))
     189    {
     190        if (node->childCount() == 0 || node == m_favouriteNode)
     191        {
     192            node->deleteAllChildren();
     193            fillNode(node);
     194        }
     195        if (timer->isActive())
     196            timer->stop();
     197        clearRomInfo();
     198    }
     199    else
     200    {
     201        RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
     202        if (romInfo->Romname().isEmpty())
     203            romInfo->fillData();
     204        updateRomInfo(romInfo);
     205        if (!romInfo->ImagePath().isEmpty())
     206        {
     207            if (timer->isActive())
     208                timer->changeInterval(330);
     209            else
     210                timer->start(330, true);
     211        }
     212        else
     213        {
     214            if (m_gameImage->IsVisible())
     215                m_gameImage->Hide();
     216        }
     217    }
     218}
     219
     220void GameUI::itemClicked(MythUIButtonListItem*)
     221{
     222    MythGenericTree *node = m_gameTreeUI->GetCurrentNode();
     223    if (isLeaf(node))
     224    {
     225        RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
     226        if (romInfo->RomCount() == 1)
     227        {
     228            GameHandler::Launchgame(romInfo, NULL);
     229        }
     230        else
     231        {
     232            QString msg = QObject::tr("Choose System for") +
     233                              ":\n" + node->getString();
     234            MythScreenStack *popupStack = GetMythMainWindow()->
     235                                              GetStack("popup stack");
     236            MythDialogBox *chooseSystemPopup = new MythDialogBox(
     237                msg, popupStack, "chooseSystemPopup");
     238
     239            if (chooseSystemPopup->Create())
     240            {
     241                chooseSystemPopup->SetReturnEvent(this, "chooseSystemPopup");
     242                QString all_systems = romInfo->AllSystems();
     243                QStringList players = QStringList::split(",", all_systems);
     244                for (QStringList::Iterator it = players.begin();
     245                     it != players.end(); ++it)
     246                {
     247                    chooseSystemPopup->AddButton(*it);
     248                }
     249                chooseSystemPopup->AddButton(tr("Cancel"));
     250                popupStack->AddScreen(chooseSystemPopup);
     251            }
     252            else
     253                delete chooseSystemPopup;
     254        }
     255    }
     256}
     257
     258void GameUI::showImageTimeout(void)
     259{
     260    m_gameImage->Load();
     261    if (!m_gameImage->IsVisible())
     262        m_gameImage->Show();
     263}
     264
     265void GameUI::searchComplete(QString string)
     266{
     267    MythGenericTree *parent = m_gameTreeUI->GetCurrentNode()->getParent();
     268    MythGenericTree *new_node = parent->getChildByName(string);
     269    if (new_node)
     270    {
     271        m_gameTreeUI->SetCurrentNode(new_node);
     272        // SetActive updates the buttonlist but SetCurrentNode doesn't.
     273        m_gameTreeUI->SetActive(true);
     274    }
     275}
     276
     277void GameUI::updateRomInfo(RomInfo *rom)
     278{
     279    m_gameTitle->SetText(rom->Gamename());
     280    m_gameSystem->SetText(rom->System());
     281    m_gameYear->SetText(rom->Year());
     282    m_gameGenre->SetText(rom->Genre());
     283
     284    if (rom->Favorite())
     285        m_gameFavourite->SetText("Yes");
     286    else
     287        m_gameFavourite->SetText("No");
     288
     289    m_gameImage->SetFilename(rom->ImagePath());
     290}
     291
     292void GameUI::clearRomInfo(void) {
     293    m_gameTitle->SetText("");
     294    m_gameSystem->SetText("");
     295    m_gameYear->SetText("");
     296    m_gameGenre->SetText("");
     297    m_gameFavourite->SetText("");
     298
     299    if (m_gameImage->IsVisible())
     300        m_gameImage->Hide();
     301}
     302
     303void GameUI::edit(void)
     304{
     305    MythGenericTree *node = m_gameTreeUI->GetCurrentNode();
     306    if (isLeaf(node))
     307    {
     308        RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
     309        romInfo->edit_rominfo();
     310        romInfo->fillData();
     311        updateRomInfo(romInfo);
     312    }
     313}
     314
     315void GameUI::showInfo()
     316{
     317    MythGenericTree *node = m_gameTreeUI->GetCurrentNode();
     318    if (isLeaf(node))
     319    {
     320        RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
     321        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     322        GameDetails *details_dialog  = new GameDetails(mainStack, romInfo);
     323
     324        if (details_dialog->Create())
     325            mainStack->AddScreen(details_dialog);
     326        else
     327            delete details_dialog;
     328    }
     329}
     330
     331void GameUI::showMenu()
     332{
     333    MythGenericTree *node = m_gameTreeUI->GetCurrentNode();
     334    if (isLeaf(node))
     335    {
     336        RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
     337        MythScreenStack *popupStack = GetMythMainWindow()->
     338                                              GetStack("popup stack");
     339        MythDialogBox *showMenuPopup =
     340            new MythDialogBox(node->getString(), popupStack, "showMenuPopup");
     341
     342        if (showMenuPopup->Create())
     343        {
     344            showMenuPopup->SetReturnEvent(this, "showMenuPopup");
     345            showMenuPopup->AddButton(tr("Show Information"));
     346            if (romInfo->Favorite())
     347                showMenuPopup->AddButton(tr("Remove Favorite"));
     348            else
     349                showMenuPopup->AddButton(tr("Make Favorite"));
     350            showMenuPopup->AddButton(tr("Edit"));
     351            popupStack->AddScreen(showMenuPopup);
     352        }
     353        else
     354            delete showMenuPopup;
     355    }
     356}
     357
     358void GameUI::searchStart(void)
     359{
     360    MythGenericTree *parent = m_gameTreeUI->GetCurrentNode()->getParent();
     361
     362    if (parent != NULL)
     363    {
     364        QStringList childList;
     365        QList<MythGenericTree*>::iterator it;
     366        QList<MythGenericTree*> *children = parent->getAllChildren();
     367
     368        for (it = children->begin(); it != children->end(); ++it)
     369        {
     370            MythGenericTree *child = *it;
     371            childList << child->getString();
     372        }
     373
     374        MythScreenStack *popupStack =
     375            GetMythMainWindow()->GetStack("popup stack");
     376        MythUISearchDialog *searchDialog = new MythUISearchDialog(popupStack,
     377            tr("Game Search"), childList, true, "");
     378
     379        if (searchDialog->Create())
     380        {
     381            connect(searchDialog, SIGNAL(haveResult(QString)),
     382                    SLOT(searchComplete(QString)));
     383
     384            popupStack->AddScreen(searchDialog);
     385        }
     386        else
     387            delete searchDialog;
     388    }
     389}
     390
     391void GameUI::toggleFavorite(void)
     392{
     393    MythGenericTree *node = m_gameTreeUI->GetCurrentNode();
     394    if (isLeaf(node))
     395    {
     396        RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
     397        romInfo->setFavorite();
     398        if (romInfo->Favorite())
     399            m_gameFavourite->SetText("Yes");
     400        else
     401            m_gameFavourite->SetText("No");
     402
     403        if (node->getParent() == m_favouriteNode) {
     404            m_gameTreeUI->SetCurrentNode(m_favouriteNode);
     405            m_gameTreeUI->SetActive(true);
     406        }
     407    }
     408}
     409
     410void GameUI::customEvent(QEvent *event)
     411{
     412    if (event->type() == kMythDialogBoxCompletionEventType)
     413    {
     414        DialogCompletionEvent *dce =
     415            dynamic_cast<DialogCompletionEvent*>(event);
     416
     417        QString resultid = dce->GetId();
     418        QString resulttext = dce->GetResultText();
     419
     420        if (resultid == "showMenuPopup")
     421        {
     422            if (resulttext == tr("Edit")) {
     423                edit();
     424            }
     425            else if (resulttext == tr("Show Information"))
     426            {
     427                showInfo();
     428            }
     429            else if (resulttext == tr("Make Favorite") ||
     430                     resulttext == tr("Remove Favorite"))
     431            {
     432                toggleFavorite();
     433            }
     434        }
     435        else if (resultid == "chooseSystemPopup")
     436        {
     437            if (resulttext != "" && resulttext != tr("Cancel")) {
     438                MythGenericTree *node = m_gameTreeUI->GetCurrentNode();
     439                RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
     440                GameHandler::Launchgame(romInfo, resulttext);
     441            }
     442        }
     443    }
     444}
     445
     446QString GameUI::getFillSql(MythGenericTree *node) const
     447{
     448    QString layer = node->getString();
     449    int childDepth = node->getInt() + 1;
     450    QString childLevel = getChildLevelString(node);
     451    QString filter = getFilter(node);
     452    bool childIsLeaf = childDepth == getLevelsOnThisBranch(node) + 1;
     453    RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
     454
     455    QString columns;
     456    QString conj = "where ";
     457
     458    if (!filter.isEmpty())
     459    {
     460        filter = conj + filter;
     461        conj = " and ";
     462    }
     463    if ((childLevel == "gamename") && (m_gameShowFileName))
     464    {
     465        columns = childIsLeaf
     466                    ? "romname,system,year,genre,gamename"
     467                    : "romname";
     468
     469        if (m_showHashed)
     470            filter += " and romname like '" + layer + "%'";
     471
     472    }
     473    else if ((childLevel == "gamename") && (layer.length() == 1)) {
     474        columns = childIsLeaf
     475                    ? childLevel + ",system,year,genre,gamename"
     476                    : childLevel;
     477
     478        if (m_showHashed)
     479            filter += " and gamename like '" + layer + "%'";
     480
     481    }
     482    else if (childLevel == "hash") {
     483        columns = "left(gamename,1)";
     484    }
     485    else {
     486
     487        columns = childIsLeaf
     488                    ? childLevel + ",system,year,genre,gamename"
     489                    : childLevel;
     490    }
     491
     492    //  this whole section ought to be in rominfo.cpp really, but I've put it
     493    //  in here for now to minimise the number of files changed by this mod
     494    if (romInfo) {
     495        if (!romInfo->System().isEmpty())
     496        {
     497            filter += conj + "trim(system)=:SYSTEM";
     498            conj = " and ";
     499        }
     500        if (!romInfo->Year().isEmpty())
     501        {
     502            filter += conj + "year=:YEAR";
     503            conj = " and ";
     504        }
     505        if (!romInfo->Genre().isEmpty())
     506        {
     507            filter += conj + "trim(genre)=:GENRE";
     508            conj = " and ";
     509        }
     510        if (!romInfo->Publisher().isEmpty())
     511        {
     512            filter += conj + "publisher=:PUBLISHER";
     513            conj = " and ";
     514        }
     515
     516        if (!romInfo->Gamename().isEmpty())
     517        {
     518            filter += conj + "trim(gamename)=:GAMENAME";
     519        }
     520
     521    }
     522
     523    filter += conj + " display = 1 ";
     524
     525    QString sql;
     526
     527    if ((childLevel == "gamename") && (m_gameShowFileName))
     528    {   
     529        sql = "select distinct "
     530                + columns
     531                + " from gamemetadata "
     532                + filter
     533                + " order by romname"
     534                + ";";
     535    }
     536    else if (childLevel == "hash") {
     537        sql = "select distinct "
     538                + columns
     539                + " from gamemetadata "
     540                + filter
     541                + " order by gamename,romname"
     542                + ";";
     543    }
     544    else
     545    {
     546        sql = "select distinct "
     547                + columns
     548                + " from gamemetadata "
     549                + filter
     550                + " order by "
     551                + childLevel
     552                + ";";
     553    }
     554
     555    return sql;
     556}
     557
     558QString GameUI::getChildLevelString(MythGenericTree *node) const
     559{
     560    unsigned this_level = node->getInt();
     561    while (node->getInt() != 1)
     562        node = node->getParent();
     563
     564    GameTreeInfo *gi = qVariantValue<GameTreeInfo *>(node->GetData());
     565    return gi->getLevel(this_level - 1);
     566}
     567
     568QString GameUI::getFilter(MythGenericTree *node) const
     569{
     570    while (node->getInt() != 1)
     571        node = node->getParent();
     572    GameTreeInfo *gi = qVariantValue<GameTreeInfo *>(node->GetData());
     573    return gi->getFilter();
     574}
     575
     576int GameUI::getLevelsOnThisBranch(MythGenericTree *node) const
     577{
     578    while (node->getInt() != 1)
     579        node = node->getParent();
     580
     581    GameTreeInfo *gi = qVariantValue<GameTreeInfo *>(node->GetData());
     582    return gi->getDepth();
     583}
     584
     585bool GameUI::isLeaf(MythGenericTree *node) const
     586{
     587  return (node->getInt() - 1) == getLevelsOnThisBranch(node);
     588}
     589
     590void GameUI::fillNode(MythGenericTree *node)
     591{
     592    QString layername = node->getString();
     593    RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
     594
     595    MSqlQuery query(MSqlQuery::InitCon());
     596
     597    query.prepare(getFillSql(node));
     598
     599    if (romInfo)
     600    {
     601        if (!romInfo->System().isEmpty())
     602            query.bindValue(":SYSTEM",  romInfo->System());
     603        if (!romInfo->Year().isEmpty())
     604            query.bindValue(":YEAR", romInfo->Year());
     605        if (!romInfo->Genre().isEmpty())
     606            query.bindValue(":GENRE", romInfo->Genre());
     607        if (!romInfo->Publisher().isEmpty())
     608            query.bindValue(":PUBLISHER", romInfo->Publisher());
     609        if (!romInfo->Gamename().isEmpty())
     610            query.bindValue(":GAMENAME", romInfo->Gamename());
     611    }
     612
     613    bool IsLeaf = node->getInt() == getLevelsOnThisBranch(node);
     614    if (query.exec() && query.size() > 0)
     615    {
     616        while (query.next())
     617        {
     618            QString current = query.value(0).toString().stripWhiteSpace();
     619            MythGenericTree *new_node =
     620                new MythGenericTree(current, node->getInt() + 1, false);
     621            if (IsLeaf)
     622            {
     623                RomInfo *temp = new RomInfo();
     624                temp->setSystem(query.value(1).toString().stripWhiteSpace());
     625                temp->setYear(query.value(2).toString());
     626                temp->setGenre(query.value(3).toString().stripWhiteSpace());
     627                temp->setGamename(query.value(4).toString().stripWhiteSpace());
     628                new_node->SetData(qVariantFromValue(temp));
     629                node->addNode(new_node);
     630            }
     631            else
     632            {
     633                RomInfo *newRomInfo;
     634                if (node->getInt() > 1)
     635                {
     636                    RomInfo *currentRomInfo;
     637                    currentRomInfo = qVariantValue<RomInfo *>(node->GetData());
     638                    newRomInfo = new RomInfo(*currentRomInfo);
     639                }
     640                else
     641                {
     642                    newRomInfo = new RomInfo();
     643                }
     644                new_node->SetData(qVariantFromValue(newRomInfo));
     645                node->addNode(new_node);
     646                if (getChildLevelString(node) != "hash")
     647                    newRomInfo->setField(getChildLevelString(node), current);
     648            }
     649        }
     650    }
     651}
  • mythplugins/mythgame/mythgame/gameui.h

     
     1#ifndef GAMEUI_H_
     2#define GAMEUI_H_
     3
     4#include <qtimer.h>
     5
     6// myth
     7#include <mythscreentype.h>
     8
     9class MythUIButtonTree;
     10class MythGenericTree;
     11class RomInfo;
     12
     13class GameUI : public MythScreenType
     14{
     15    Q_OBJECT
     16
     17  public:
     18    GameUI(MythScreenStack *parentStack);
     19    ~GameUI();
     20
     21    bool Create();
     22    bool keyPressEvent(QKeyEvent *event);
     23
     24  public slots:
     25    void nodeChanged(MythGenericTree* node);
     26    void itemClicked(MythUIButtonListItem* item);
     27    void showImageTimeout(void);
     28    void searchComplete(QString);
     29
     30  private:
     31    void updateRomInfo(RomInfo *rom);
     32    void clearRomInfo(void);
     33    void edit(void);
     34    void showInfo(void);
     35    void showMenu(void);
     36    void searchStart(void);
     37    void toggleFavorite(void);
     38    void customEvent(QEvent *event);
     39
     40    QString getFillSql(MythGenericTree* node) const;
     41    QString getChildLevelString(MythGenericTree *node) const;
     42    QString getFilter(MythGenericTree *node) const;
     43    int     getLevelsOnThisBranch(MythGenericTree *node) const;
     44    bool    isLeaf(MythGenericTree *node) const;
     45    void    fillNode(MythGenericTree *node);
     46
     47  private:
     48    bool m_showHashed;
     49    int m_gameShowFileName;
     50    QTimer *timer;
     51
     52    MythGenericTree  *m_gameTree;
     53    MythGenericTree  *m_favouriteNode;
     54
     55    MythUIButtonTree *m_gameTreeUI;
     56    MythUIText       *m_gameTitle;
     57    MythUIText       *m_gameSystem;
     58    MythUIText       *m_gameYear;
     59    MythUIText       *m_gameGenre;
     60    MythUIText       *m_gameFavourite;
     61    MythUIImage      *m_gameImage;
     62};
     63
     64#endif
  • mythplugins/mythgame/mythgame/rominfo.h

     
    130130
    131131bool operator==(const RomInfo& a, const RomInfo& b);
    132132
     133Q_DECLARE_METATYPE(RomInfo *)
     134
    133135#endif
  • mythplugins/mythgame/mythgame/gamedetails.cpp

     
     1#include <QFile>
     2
     3#include "mythcontext.h"
     4#include "mythdb.h"
     5#include "mythuihelper.h"
     6
     7
     8#include "gamedetails.h"
     9
     10GameDetails::GameDetails(MythScreenStack *parent, const RomInfo *romInfo)
     11           : MythScreenType (parent, "gamedetails")
     12{
     13    m_romInfo = *romInfo;
     14    m_browser = NULL;
     15    m_page = QString();
     16}
     17
     18GameDetails::~GameDetails(void)
     19{
     20}
     21
     22bool GameDetails::Create(void)
     23{
     24    bool foundtheme = false;
     25
     26    // Load the theme for this screen
     27    foundtheme = LoadWindowFromXML("game-ui.xml", "gamedetails", this);
     28
     29    if (!foundtheme)
     30        return false;
     31
     32    bool err = false;
     33    UIUtilE::Assign(this, m_browser, "browser", &err);
     34
     35    if (err)
     36    {
     37        VERBOSE(VB_IMPORTANT, "Cannot load screen 'gamedetails'");
     38        return false;
     39    }
     40
     41    BuildFocusList();
     42
     43    return true;
     44}
     45
     46void GameDetails::Init()
     47{
     48    updatePage();
     49}
     50
     51void GameDetails::updatePage(void)
     52{
     53    if (m_page == QString())
     54        loadPage();
     55
     56    m_browser->SetHtml(m_page);
     57}
     58
     59void GameDetails::loadPage(void)
     60{
     61    if (!loadHTML())
     62    {
     63       VERBOSE(VB_IMPORTANT, "  HTML not loaded");
     64    }
     65
     66    addItem("NAME", QObject::tr("Name"), m_romInfo.Gamename());
     67    addItem("TYPE", QObject::tr("Type"), m_romInfo.GameType());
     68    addItem("ROM", QObject::tr("Filename"), m_romInfo.Romname());
     69    addItem("CRC", QObject::tr("CRC"), m_romInfo.CRC_VALUE());
     70    addItem("PATH", QObject::tr("Path"), m_romInfo.Rompath());
     71    addItem("GENRE", QObject::tr("Genre"), m_romInfo.Genre());
     72    addItem("YEAR", QObject::tr("Year"), m_romInfo.Year());
     73    addItem("COUNTRY", QObject::tr("Country"), m_romInfo.Country());
     74    addItem("PUBLISHER", QObject::tr("Publisher"), m_romInfo.Publisher());
     75    addItem("PLAYERS", QObject::tr("Player(s)"), m_romInfo.AllSystems());
     76
     77    m_page = m_html.join("\n");
     78}
     79
     80bool GameDetails::loadHTML(void)
     81{
     82    m_html.clear();
     83
     84    QString filename = "gamedetails.html";
     85    if (!GetMythUI()->FindThemeFile(filename))
     86        return false;
     87
     88    QFile file(QLatin1String(qPrintable(filename)));
     89
     90    if (!file.exists())
     91        return false;
     92
     93    if (file.open(QIODevice::ReadOnly))
     94    {
     95        QTextStream stream(&file);
     96
     97        while (!stream.atEnd())
     98        {
     99            m_html.append(stream.readLine());
     100        }
     101        file.close();
     102    }
     103    else
     104        return false;
     105
     106    return true;
     107}
     108
     109void GameDetails::addItem(const QString &key, const QString &title,
     110                          const QString &data)
     111{
     112    QString escapedKey = "%" + key + "%";
     113
     114    if (data == "")
     115    {
     116        removeItem(key);
     117        return;
     118    }
     119
     120    // find the key in the html and replace with the correct data
     121    for (int x = 0; x < m_html.size(); x++)
     122    {
     123        QString s = m_html[x];
     124        if (s.contains(escapedKey))
     125        {
     126            // replace the label first
     127            s.replace("%" + key + "_LABLE%", title);
     128            // now replace the data
     129            s.replace(escapedKey, data);
     130            m_html[x] = s;
     131        }
     132    }
     133}
     134
     135void GameDetails::removeItem(const QString &key)
     136{
     137    // remove all line in the html that have key in them
     138    // (should only be one line)
     139    for (int x = 0; x < m_html.size(); x++)
     140    {
     141        QString s = m_html[x];
     142        if (s.contains("%" + key + "%"))
     143        {
     144            m_html.removeAll(s);
     145            return;
     146        }
     147    }
     148}
  • mythplugins/mythgame/mythgame/main.cpp

     
    66#include <QDir>
    77#include <QApplication>
    88
     9#include "gameui.h"
    910#include "gamehandler.h"
    1011#include "rominfo.h"
    1112#include "gamesettings.h"
    12 #include "gametree.h"
    1313#include "dbcheck.h"
    1414
    1515#include <mythtv/mythcontext.h>
     
    6060{
    6161    QString themedir = GetMythUI()->GetThemeDir();
    6262
    63     MythThemedMenu *diag = new MythThemedMenu(
     63    MythThemedMenu *menu = new MythThemedMenu(
    6464        themedir, which_menu, GetMythMainWindow()->GetMainStack(), "game menu");
    6565
    6666    GameData data;
    6767
    68     diag->setCallback(GameCallback, &data);
    69     diag->setKillable();
     68    menu->setCallback(GameCallback, &data);
     69    menu->setKillable();
    7070
    71     if (diag->foundTheme())
     71    if (menu->foundTheme())
    7272    {
    73         if (class LCD * lcd = LCD::Get())
    74         {
     73        if (LCD * lcd = LCD::Get())
    7574            lcd->switchToTime();
    76         }
    77         GetMythMainWindow()->GetMainStack()->AddScreen(diag);
     75
     76        GetMythMainWindow()->GetMainStack()->AddScreen(menu);
    7877        return 0;
    7978    }
    8079    else
    8180    {
    8281        VERBOSE(VB_IMPORTANT, QString("Couldn't find menu %1 or theme %2")
    8382                              .arg(which_menu).arg(themedir));
    84         delete diag;
     83        delete menu;
    8584        return -1;
    8685    }
    8786}
    8887
    8988void runGames(void);
     89int  RunGames(void);
    9090
    9191void setupKeys(void)
    9292{
     
    105105{
    106106    if (!gContext->TestPopupVersion("mythgame", libversion,
    107107                                    MYTH_BINARY_VERSION))
     108    {
     109        VERBOSE(VB_IMPORTANT,
     110                QString("libmythgame.so/main.o: binary version mismatch"));
    108111        return -1;
     112    }
    109113
    110 
    111114    gContext->ActivateSettingsCache(false);
    112115    if (!UpgradeGameDatabaseSchema())
    113116    {
     
    126129    return 0;
    127130}
    128131
    129 void runGames(void)
     132void runGames()
    130133{
    131     gContext->addCurrentLocation("mythgame");
    132     GameTree gametree(gContext->GetMainWindow(), "gametree", "game-");
    133     gametree.exec();
    134     gContext->removeCurrentLocation();
     134    RunGames();
    135135}
    136136
     137int RunGames(void)
     138{
     139    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     140    GameUI *game = new GameUI(mainStack);
     141
     142    if (game->Create())
     143    {
     144        mainStack->AddScreen(game);
     145        return 0;
     146    }
     147    else
     148    {
     149        delete game;
     150        return -1;
     151    }
     152}
     153
    137154int mythplugin_run(void)
    138155{
    139     runGames();
    140     return 0;
     156    return RunGames();
    141157}
    142158
    143159int mythplugin_config(void)
  • mythplugins/mythgame/mythgame/gamedetails.h

     
     1#ifndef GAMEDETAILS_H_
     2#define GAMEDETAILS_H_
     3
     4#include <QString>
     5#include <QKeyEvent>
     6
     7#include "mythscreentype.h"
     8#include "mythuiwebbrowser.h"
     9#include "rominfo.h"
     10
     11class GameDetails : public MythScreenType
     12{
     13    Q_OBJECT
     14  public:
     15    GameDetails(MythScreenStack *parent, const RomInfo *romInfo);
     16    ~GameDetails();
     17
     18    bool Create(void);
     19    void Init(void);
     20
     21  private:
     22    void updatePage(void);
     23    void loadPage(void);
     24    bool loadHTML(void);
     25    void addItem(const QString &key, const QString &title, const QString &data);
     26    void removeItem(const QString &key);
     27
     28    RomInfo            m_romInfo;
     29    MythUIWebBrowser  *m_browser;
     30    QString            m_page;
     31    QStringList        m_html;
     32};
     33
     34#endif
  • mythplugins/mythgame/mythgame/mythgame.pro

     
    99INSTALLS += target
    1010
    1111# Input
    12 HEADERS += gamehandler.h rominfo.h unzip.h gamesettings.h gametree.h
    13 HEADERS += rom_metadata.h romedit.h
     12HEADERS += gamehandler.h rominfo.h unzip.h gamesettings.h gameui.h
     13HEADERS += rom_metadata.h romedit.h gamedetails.h
    1414
    15 SOURCES += main.cpp gamehandler.cpp rominfo.cpp gametree.cpp unzip.c
     15SOURCES += main.cpp gamehandler.cpp rominfo.cpp gameui.cpp unzip.c
    1616SOURCES += gamesettings.cpp dbcheck.cpp rom_metadata.cpp romedit.cpp
     17SOURCES += gamedetails.cpp
    1718
    1819use_hidesyms {
    1920    QMAKE_CXXFLAGS += -fvisibility=hidden
  • mythtv/themes/Terra/game-ui.xml

     
     1<mythuitheme>
     2
     3  <window name="gameui">
     4
     5    <imagetype name="backdrop" from="basebackdrop" />
     6    <imagetype name="topbar" from="basetopbar" />
     7
     8    <textarea name="heading" from="baseheading">
     9        <value>Play Games</value>
     10    </textarea>
     11
     12    <buttontree name="gametreelist">
     13        <area>8,52,1264,375</area>
     14        <numlists>3</numlists>
     15        <spacing>10</spacing>
     16        <buttonlist name="listtemplate">
     17            <area>0,0,1264,375</area>
     18            <layout>vertical</layout>
     19            <buttonarea>0,0,100%,97%</buttonarea>
     20            <statetype name="buttonitem">
     21                <state name="active">
     22                    <area>0,0,100%,30</area>
     23                    <imagetype name="buttonbackground">
     24                        <gradient start="#4b4b3e" end="#4b4b3e" alpha="255"/>
     25                    </imagetype>
     26                    <textarea name="buttontext">
     27                        <area>5,0,85%,30</area>
     28                        <font>basesmall</font>
     29                        <cutdown>yes</cutdown>
     30                        <align>left,vcenter</align>
     31                    </textarea>
     32                </state>
     33                <state name="selected" from="active">
     34                    <imagetype name="buttonbackground">
     35                        <gradient start="#8a916f" end="#8a916f" alpha="255"/>
     36                    </imagetype>
     37                    <textarea name="buttontext">
     38                        <area>5,0,85%,30</area>
     39                        <font>basesmallbrown</font>
     40                        <cutdown>yes</cutdown>
     41                        <align>left,vcenter</align>
     42                    </textarea>
     43                </state>
     44                <state name="inactive" from="active" />
     45            </statetype>
     46        </buttonlist>
     47    </buttontree>
     48
     49      <textarea name="gametitle">
     50        <area>96,440,752,60</area>
     51        <font>baseextralarge</font>
     52      </textarea>
     53
     54      <textarea name="system">
     55        <area>96,510,140,35</area>
     56        <font>basemedium</font>
     57        <value>System:</value>
     58      </textarea>
     59
     60      <textarea name="systemname">
     61        <area>236,510,580,35</area>
     62        <font>basemedium</font>
     63      </textarea>
     64
     65      <textarea name="year">
     66        <area>96,545,140,35</area>
     67        <font>basemedium</font>
     68        <value>Year:</value>
     69      </textarea>
     70
     71      <textarea name="yearname">
     72        <area>236,545,580,35</area>
     73        <font>basemedium</font>
     74      </textarea>
     75
     76      <textarea name="genre">
     77        <area>96,580,140,35</area>
     78        <font>basemedium</font>
     79        <value>Genre:</value>
     80      </textarea>
     81
     82      <textarea name="genrename">
     83        <area>236,580,580,35</area>
     84        <font>basemedium</font>
     85      </textarea>
     86
     87      <textarea name="favorite">
     88        <area>96,615,140,35</area>
     89        <font>basemedium</font>
     90        <value>Favorite:</value>
     91      </textarea>
     92
     93      <textarea name="showfavorite">
     94        <area>236,615,580,35</area>
     95        <font>basemedium</font>
     96      </textarea>
     97
     98      <imagetype name="gameimage">
     99          <area>880,448,300,196</area>
     100      </imagetype>
     101
     102  </window>
     103
     104  <window name="gamedetails">
     105
     106      <textarea name="title" from="basetextarea">
     107          <area>80,20,720,40</area>
     108          <font>baselarge</font>
     109          <value>Game Details:</value>
     110      </textarea>
     111
     112      <imagetype name="background">
     113          <filename>pd-background.png</filename>
     114          <position>60,60</position>
     115      </imagetype>
     116
     117      <webbrowser name="browser">
     118          <area>80,70,1094,555</area>
     119          <zoom>1.0</zoom>
     120          <background color="#000000" alpha="1"/>
     121      </webbrowser>
     122
     123  </window>
     124
     125</mythuitheme>
  • mythtv/themes/Terra/base.xml

     
    717717        </button>
    718718    </window>
    719719
     720    <window name="MythSearchDialog">
     721        <area>-1,-1,500,500</area>
     722        <imagetype name="backimg">
     723            <area>0,0,500,500</area>
     724            <filename>mythdialogbox-background.png</filename>
     725        </imagetype>
     726
     727        <textarea name="title" from="basetextarea">
     728            <area>12,20,470,60</area>
     729            <multiline>yes</multiline>
     730            <align>allcenter</align>
     731        </textarea>
     732
     733        <textedit name="input" from="basetextedit">
     734            <position>32,85</position>
     735        </textedit>
     736
     737        <buttonlist name="itemlist">
     738            <area>12,150,470,270</area>
     739            <layout>vertical</layout>
     740            <buttonarea>0,0,470,270</buttonarea>
     741            <align>left,vcenter</align>
     742            <showarrow>no</showarrow>
     743            <spacing>3</spacing>
     744            <wrapstyle>selection</wrapstyle>
     745            <statetype name="buttonitem">
     746                <state name="active">
     747                    <area>0,0,100%,30</area>
     748                    <imagetype name="buttonbackground">
     749                        <gradient start="#4b4b3e" end="#4b4b3e" alpha="255"/>
     750                    </imagetype>
     751                    <textarea name="buttontext">
     752                        <area>5,0,85%,30</area>
     753                        <font>basesmall</font>
     754                        <cutdown>yes</cutdown>
     755                        <align>left,vcenter</align>
     756                    </textarea>
     757                </state>
     758                <state name="selected" from="active">
     759                    <imagetype name="buttonbackground">
     760                        <gradient start="#8a916f" end="#8a916f" alpha="255"/>
     761                    </imagetype>
     762                    <textarea name="buttontext">
     763                        <area>5,0,85%,30</area>
     764                        <font>basesmallbrown</font>
     765                        <cutdown>yes</cutdown>
     766                        <align>left,vcenter</align>
     767                    </textarea>
     768                </state>
     769                <state name="inactive" from="active" />
     770            </statetype>
     771        </buttonlist>
     772
     773        <button name="cancel" from="basebutton">
     774            <position>18,435</position>
     775            <value>Cancel</value>
     776        </button>
     777
     778        <button name="ok" from="basebutton">
     779            <position>259,435</position>
     780            <value>Ok</value>
     781        </button>
     782    </window>
     783
    720784    <!-- Busy Dialog -->
    721785    <window name="MythBusyDialog">
    722786        <area>-1,-1,580,165</area>