Ticket #10581: hotmenu_v2.patch

File hotmenu_v2.patch, 20.8 KB (added by Jim Stichnoth, 13 years ago)
  • mythtv/libs/libmythtv/osd.cpp

    diff --git a/mythtv/libs/libmythtv/osd.cpp b/mythtv/libs/libmythtv/osd.cpp
    index 1b30ad4..44acfd6 100644
    a b void OSD::DialogQuit(void)  
    967967    m_PulsedDialogText = QString();
    968968}
    969969
    970 void OSD::DialogShow(const QString &window, const QString &text, int updatefor)
     970void OSD::DialogShow(const QString &window, const QString &text, int updatefor,
     971                     const QString &hotMenuAction, bool handleAccel)
    971972{
    972973    if (m_Dialog)
    973974    {
    void OSD::DialogShow(const QString &window, const QString &text, int updatefor)  
    995996            dialog = new ChannelEditor(m_ParentObject, window.toLatin1());
    996997        else if (window == OSD_DLG_CONFIRM)
    997998            dialog = new MythConfirmationDialog(NULL, text, false);
     999        else if (!hotMenuAction.isEmpty())
     1000            dialog = new MythEditableDialogBox(text, NULL, window.toLatin1(),
     1001                                               hotMenuAction, handleAccel);
    9981002        else
    9991003            dialog = new MythDialogBox(text, NULL, window.toLatin1(), false, true);
    10001004
  • mythtv/libs/libmythtv/osd.h

    diff --git a/mythtv/libs/libmythtv/osd.h b/mythtv/libs/libmythtv/osd.h
    index 110205d..fc20f1f 100644
    a b  
    1212// menu dialogs should always be on top
    1313#define OSD_DLG_VIDEOEXIT "xx_OSD_VIDEO_EXIT"
    1414#define OSD_DLG_MENU      "xx_OSD_MENU"
     15#define OSD_DLG_HOTMENU   "xx_OSD_HOTMENU"
     16#define OSD_DLG_EDITHOTMENU "xx_OSD_EDITHOTMENU"
    1517#define OSD_DLG_SLEEP     "xx_OSD_SLEEP"
    1618#define OSD_DLG_IDLE      "xx_OSD_IDLE"
    1719#define OSD_DLG_INFO      "xx_OSD_INFO"
    class OSD  
    168170    bool DialogHandleKeypress(QKeyEvent *e);
    169171    void DialogQuit(void);
    170172    void DialogShow(const QString &window, const QString &text = "",
    171                     int updatefor = 0);
     173                    int updatefor = 0,
     174                    const QString &hotMenuAction = "",
     175                    bool handleAccel = false);
    172176    void DialogSetText(const QString &text);
    173177    void DialogBack(QString text = "", QVariant data = 0, bool exit = false);
    174178    void DialogAddButton(QString text, QVariant data,
  • mythtv/libs/libmythtv/tv_actions.h

    diff --git a/mythtv/libs/libmythtv/tv_actions.h b/mythtv/libs/libmythtv/tv_actions.h
    index b2ffe61..504b57b 100644
    a b  
    33
    44#define ACTION_EXITSHOWNOPROMPTS "EXITSHOWNOPROMPTS"
    55
     6#define ACTION_HOTMENU "HOTMENU"
     7
    68#define ACTION_PLAYBACK      "PLAYBACK"
    79#define ACTION_STOP          "STOPPLAYBACK"
    810#define ACTION_DAYLEFT       "DAYLEFT"
  • mythtv/libs/libmythtv/tv_play.cpp

    diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
    index d5f1adf..64297e0 100644
    a b void TV::InitKeys(void)  
    567567    REG_KEY("TV Frontend", "CHANGEGROUPVIEW", QT_TRANSLATE_NOOP("MythControls",
    568568            "Change Group View"), "");
    569569
     570    REG_KEY("TV Playback", ACTION_HOTMENU, QT_TRANSLATE_NOOP("MythControls",
     571            "Playback Custom Menu"), "");
    570572    REG_KEY("TV Playback", "BACK", QT_TRANSLATE_NOOP("MythControls",
    571573            "Exit or return to DVD menu"), "Esc");
    572574    REG_KEY("TV Playback", ACTION_CLEAROSD, QT_TRANSLATE_NOOP("MythControls",
    void TV::InitFromDB(void)  
    10961098    kv["VbiFormat"]                = "";
    10971099    kv["DecodeVBIFormat"]          = "";
    10981100
     1101    kv["HotMenuActions"]           = "";
     1102
    10991103    int ff_rew_def[8] = { 3, 5, 10, 20, 30, 60, 120, 180 };
    11001104    for (uint i = 0; i < sizeof(ff_rew_def)/sizeof(ff_rew_def[0]); i++)
    11011105        kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
    void TV::InitFromDB(void)  
    11321136    db_remember_last_channel_group = kv["ChannelGroupRememberLast"].toInt();
    11331137    channelGroupId         = kv["ChannelGroupDefault"].toInt();
    11341138
     1139    db_hotmenu_items       = kv["HotMenuActions"];
     1140
    11351141    QString beVBI          = kv["VbiFormat"];
    11361142    QString feVBI          = kv["DecodeVBIFormat"];
    11371143
    bool TV::ActiveHandleAction(PlayerContext *ctx,  
    44614467
    44624468        SetActive(ctx, 0, false);
    44634469    }
     4470    else if (has_action(ACTION_HOTMENU, actions))
     4471        ShowHotMenu(ctx, "");
    44644472    else if (has_action(ACTION_ENABLEUPMIX, actions))
    44654473        EnableUpmix(ctx, true);
    44664474    else if (has_action(ACTION_DISABLEUPMIX, actions))
    void TV::customEvent(QEvent *e)  
    91809188        return;
    91819189    }
    91829190
     9191    if (e->type() == DialogEditEvent::kEventType)
     9192    {
     9193        DialogEditEvent *dee =
     9194            reinterpret_cast<DialogEditEvent*>(e);
     9195        QString item = dee->GetData().toString();
     9196        PlayerContext *mctx = GetPlayerReadLock(0, __FILE__, __LINE__);
     9197        OSD *osd = GetOSDLock(mctx);
     9198        if (osd && osd->DialogVisible(OSD_DLG_HOTMENU) && item != "MENU")
     9199        {
     9200            osd->DialogShow(OSD_DLG_EDITHOTMENU, tr("Edit Custom Menu Item") +
     9201                            "\n\n"  + ActionToString(item));
     9202            osd->DialogAddButton(tr("Move to Top"),
     9203                                 QString("HOTMENUEDIT_MOVETOP_%1")
     9204                                 .arg(item));
     9205            osd->DialogAddButton(tr("Move Up"),
     9206                                 QString("HOTMENUEDIT_MOVEUP_%1")
     9207                                 .arg(item));
     9208            osd->DialogAddButton(tr("Move Down"),
     9209                                 QString("HOTMENUEDIT_MOVEDOWN_%1")
     9210                                 .arg(item));
     9211            osd->DialogAddButton(tr("Move to Bottom"),
     9212                                 QString("HOTMENUEDIT_MOVEBOTTOM_%1")
     9213                                 .arg(item));
     9214            osd->DialogAddButton(tr("Remove"),
     9215                                 QString("HOTMENUEDIT_DELETE_%1")
     9216                                 .arg(item), false, (dee->GetResult() == -1));
     9217            osd->DialogBack(item, ACTION_HOTMENU, true);
     9218        }
     9219        else if (osd && osd->DialogVisible(OSD_DLG_MENU))
     9220        {
     9221            QString itemString = ActionToString(item, true);
     9222            if (!itemString.isEmpty() && !item.startsWith("DIALOG_MENU_"))
     9223            {
     9224                osd->DialogShow(OSD_DLG_EDITHOTMENU,
     9225                                ActionToString(item) + "\n\n" +
     9226                                tr("Add to Custom Menu?"));
     9227                osd->DialogAddButton(tr("OK"),
     9228                                     QString("HOTMENUADD_%1").arg(item),
     9229                                     false, true);
     9230                osd->DialogAddButton(tr("Cancel"), "HOTMENUCANCEL");
     9231                osd->DialogBack("", "HOTMENUCANCEL", true);
     9232            }
     9233        }
     9234        ReturnOSDLock(mctx, osd);
     9235        ReturnPlayerLock(mctx);
     9236        return;
     9237    }
     9238
    91839239    if (e->type() == OSDHideEvent::kEventType)
    91849240    {
    91859241        OSDHideEvent *ce = reinterpret_cast<OSDHideEvent*>(e);
    void TV::OSDDialogEvent(int result, QString text, QString action)  
    1064810704            LOG(VB_GENERAL, LOG_ERR, "Unrecognised dialog event.");
    1064910705        }
    1065010706    }
     10707    else if (action == ACTION_HOTMENU)
     10708    {
     10709        hide = false;
     10710        ShowHotMenu(actx, text);
     10711    }
     10712    else if (action == "HOTMENUCANCEL")
     10713    {
     10714        // Bring back to the top-level menu, which isn't ideal.
     10715        hide = false;
     10716        ShowOSDMenu(actx);
     10717    }
     10718    else if (action.startsWith("HOTMENUADD_"))
     10719    {
     10720        action.remove("HOTMENUADD_");
     10721        QStringList itemList =
     10722            db_hotmenu_items.split(',', QString::SkipEmptyParts);
     10723        if (!itemList.contains(action))
     10724        {
     10725            if (!db_hotmenu_items.isEmpty())
     10726                db_hotmenu_items += ",";
     10727            db_hotmenu_items += action;
     10728            gCoreContext->SaveSetting("HotMenuActions", db_hotmenu_items);
     10729        }
     10730        hide = false;
     10731        ShowHotMenu(actx, action);
     10732    }
     10733    else if (action.startsWith("HOTMENUEDIT_"))
     10734    {
     10735        action = action.mid(12);
     10736        int separator = action.indexOf('_');
     10737        QString op = action.left(separator);
     10738        QString item = action.mid(separator + 1);
     10739        QStringList itemList =
     10740            db_hotmenu_items.split(',', QString::SkipEmptyParts);
     10741        int oldIndex = itemList.indexOf(item);
     10742        if (oldIndex >= 0)
     10743        {
     10744            int newIndex = oldIndex;
     10745            itemList.removeOne(item);
     10746            if (op == "MOVETOP")
     10747                newIndex = 0;
     10748            else if (op == "MOVEUP")
     10749                newIndex = (oldIndex > 0 ? oldIndex - 1 : 0);
     10750            else if (op == "MOVEDOWN")
     10751                newIndex = (oldIndex < itemList.size() ?
     10752                            oldIndex + 1 : itemList.size());
     10753            else if (op == "MOVEBOTTOM")
     10754                newIndex = itemList.size();
     10755            else if (op == "DELETE")
     10756                newIndex = -1;
     10757            if (newIndex >= 0)
     10758                itemList.insert(newIndex, item);
     10759        }
     10760        QString old = db_hotmenu_items;
     10761        db_hotmenu_items = "";
     10762        for (int i = 0; i < itemList.size(); ++i)
     10763        {
     10764            if (i > 0)
     10765                db_hotmenu_items += ",";
     10766            db_hotmenu_items += itemList[i];
     10767        }
     10768        if (db_hotmenu_items != old)
     10769            gCoreContext->SaveSetting("HotMenuActions", db_hotmenu_items);
     10770        hide = false;
     10771        ShowHotMenu(actx, item);
     10772    }
    1065110773    else if (result < 0)
    1065210774        ; // exit dialog
    1065310775    else if (HandleTrackAction(actx, action))
    void TV::OSDDialogEvent(int result, QString text, QString action)  
    1091711039            DoQueueTranscode(actx, "Medium Quality");
    1091811040        else if (action == "QUEUETRANSCODE_LOW")
    1091911041            DoQueueTranscode(actx, "Low Quality");
     11042        else if (action == "MENU")
     11043        {
     11044            hide = false;
     11045            ShowOSDMenu(actx);
     11046        }
    1092011047        else
    1092111048        {
    1092211049            LOG(VB_GENERAL, LOG_ERR, LOC +
    void TV::HandleOSDInfo(PlayerContext *ctx, QString action)  
    1095711084    }
    1095811085}
    1095911086
     11087QString TV::ActionToString(const QString &action, bool strict)
     11088{
     11089    static QHash<QString, QString> map;
     11090    if (map.isEmpty())
     11091    {
     11092        // AUDIO
     11093        map[ACTION_TOGGELAUDIOSYNC] = tr("Adjust Audio Sync");
     11094        map[ACTION_DISABLEUPMIX] = tr("Disable Audio Upmixer");
     11095        map[ACTION_ENABLEUPMIX] = tr("Enable Audio Upmixer");
     11096        // don't do AUDIO:AUDIOTRACKS
     11097        // don't do AUDIO:VISUALISATIONS
     11098        // VIDEO
     11099        map["TOGGLEMANUALZOOM"] = tr("Manual Zoom Mode");
     11100        // VIDEO:VIDEOASPECT
     11101        for (int i = kAspect_Off; i < kAspect_END; i++)
     11102        {
     11103            map[QString("TOGGLEASPECT%1").arg(i)] =
     11104                tr("Aspect Ratio") + " - " +
     11105                toString((AspectOverrideMode) i);
     11106        }
     11107        // VIDEO:ADJUSTFILL
     11108        map["TOGGLEFILL"] = tr("Next Zoom Mode");
     11109        for (int i = kAdjustFill_Off; i < kAdjustFill_END; i++)
     11110        {
     11111            map[QString("TOGGLEFILL%1").arg(i)] =
     11112                tr("Adjust Fill") + " - " + toString((AdjustFillMode) i);
     11113        }
     11114        // VIDEO:ADJUSTPICTURE
     11115        map[ACTION_TOGGLENIGHTMODE] = tr("Toggle night mode");
     11116        // VIDEO:3D
     11117        map[ACTION_3DNONE]                = tr("No 3D");
     11118        map[ACTION_3DSIDEBYSIDE]          = tr("3D Side by Side");
     11119        map[ACTION_3DSIDEBYSIDEDISCARD]   = tr("Discard 3D Side by Side");
     11120        map[ACTION_3DTOPANDBOTTOM]        = tr("3D Top and Bottom");
     11121        map[ACTION_3DTOPANDBOTTOMDISCARD] = tr("Discard 3D Top and Bottom");
     11122        // VIDEO:ADVANCEDVIDEO
     11123        // VIDEO:ADVANCEDVIDEO:DEINTERLACER
     11124        // VIDEO:ADVANCEDVIDEO:VIDEOSCAN
     11125        QString vs = tr("Video Scan");
     11126        map["SELECTSCAN_0"] = vs + " - " + tr("Detect");
     11127        map["SELECTSCAN_1"] = vs + " - " + tr("Interlaced (Normal)");
     11128        map["SELECTSCAN_2"] = vs + " - " + tr("Interlaced (Reversed)");
     11129        map["SELECTSCAN_3"] = vs + " - " + tr("Progressive");
     11130        // SUBTITLES
     11131        map[ACTION_DISABLESUBS]         = tr("Disable Subtitles");
     11132        map[ACTION_ENABLESUBS]          = tr("Enable Subtitles");
     11133        map[ACTION_TOGGLESUBTITLEZOOM]  = tr("Adjust Subtitle Zoom");
     11134        map[ACTION_TOGGLESUBTITLEDELAY] = tr("Adjust Subtitle Delay");
     11135        // NAVIGATE:COMMSKIP
     11136        for (int i = 0; i < kCommSkipCount ; ++i)
     11137            map[QString("TOGGLECOMMSKIP%1").arg(i)] =
     11138                toString((CommSkipMode)i);
     11139        // JOBS
     11140        map["EDIT"] = tr("Edit Recording");
     11141        map["TOGGLEAUTOEXPIRE"] = tr("Toggle Auto-Expire");
     11142        // PLAYBACK
     11143        map[ACTION_PAUSE] = tr("Pause");
     11144        map[ACTION_TOGGLEOSDDEBUG] = tr("Playback data");
     11145        // PLAYBACK:TIMESTRETCH
     11146        const QString adjts = tr("Time Stretch");
     11147        map["ADJUSTSTRETCH"]    = tr("Adjust Time Stretch");
     11148        map["TOGGLESTRETCH"]    = adjts + " - " + tr("Toggle");
     11149        map["ADJUSTSTRETCH0.5"] = adjts + " - " + tr("0.5X");
     11150        map["ADJUSTSTRETCH0.9"] = adjts + " - " + tr("0.9X");
     11151        map["ADJUSTSTRETCH1.0"] = adjts + " - " + tr("1.0X");
     11152        map["ADJUSTSTRETCH1.1"] = adjts + " - " + tr("1.1X");
     11153        map["ADJUSTSTRETCH1.2"] = adjts + " - " + tr("1.2X");
     11154        map["ADJUSTSTRETCH1.3"] = adjts + " - " + tr("1.3X");
     11155        map["ADJUSTSTRETCH1.4"] = adjts + " - " + tr("1.4X");
     11156        map["ADJUSTSTRETCH1.5"] = adjts + " - " + tr("1.5X");
     11157        // SCHEDULE
     11158        map[ACTION_GUIDE]         = tr("Program Guide");
     11159        map[ACTION_FINDER]        = tr("Program Finder");
     11160        map[ACTION_VIEWSCHEDULED] = tr("Upcoming Recordings");
     11161        map["SCHEDULE"]           = tr("Edit Recording Schedule");
     11162
     11163        //map["TOGGLEFILL"] = toString(kAdjustFill_Toggle);
     11164    }
     11165    if (map.contains(action))
     11166        return map[action];
     11167    else if (strict)
     11168        return "";
     11169    else
     11170        return action.left(1) + action.mid(1).toLower();
     11171}
     11172
     11173void TV::ShowHotMenu(const PlayerContext *ctx, const QString &itemSelected)
     11174{
     11175    if (ctx->playingInfo->QueryIsEditing())
     11176        return;
     11177    OSD *osd = GetOSDLock(ctx);
     11178    if (osd)
     11179    {
     11180        QStringList itemList =
     11181            db_hotmenu_items.split(',', QString::SkipEmptyParts);
     11182        itemList += "MENU";
     11183        osd->DialogShow(OSD_DLG_HOTMENU, tr("Playback Custom Menu"), 0,
     11184                        ACTION_HOTMENU, true);
     11185        int num;
     11186        for (num = 0; num < itemList.size(); ++num)
     11187        {
     11188            int displayNum = num + 1;
     11189            if (displayNum == 10)
     11190                displayNum = 0;
     11191            else if (displayNum > 10)
     11192                displayNum = -1;
     11193            QString prefix = "";
     11194            if (displayNum >= 0)
     11195                prefix = QString("[%1] ").arg(displayNum);
     11196            QString action = itemList[num];
     11197            osd->DialogAddButton(prefix + ActionToString(itemList[num]),
     11198                                 action, false, action == itemSelected);
     11199        }
     11200    }
     11201    ReturnOSDLock(ctx, osd);
     11202}
     11203
    1096011204void TV::ShowOSDMenu(const PlayerContext *ctx, const QString category,
    1096111205                     const QString selected)
    1096211206{
    void TV::ShowOSDMenu(const PlayerContext *ctx, const QString category,  
    1096511209    OSD *osd = GetOSDLock(ctx);
    1096611210    if (osd)
    1096711211    {
    10968         osd->DialogShow(OSD_DLG_MENU, tr("Playback Menu"));
     11212        osd->DialogShow(OSD_DLG_MENU, tr("Playback Menu"), 0, ACTION_HOTMENU);
    1096911213        QString currenttext = QString();
    1097011214        QString back = QString();
    1097111215
  • mythtv/libs/libmythtv/tv_play.h

    diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h
    index 56556dc..6b0165c 100644
    a b class MTV_PUBLIC TV : public QObject  
    193193    static void ReloadKeys(void);
    194194    static void SetFuncPtr(const char *, void *);
    195195    static int  ConfiguredTunerCards(void);
     196    static QString ActionToString(const QString &action, bool strict = false);
    196197
    197198    /// \brief Helper class for Sleep Timer code.
    198199    class SleepTimerInfo
    class MTV_PUBLIC TV : public QObject  
    608609    // Menu dialog
    609610    void ShowOSDMenu(const PlayerContext*, const QString category = "",
    610611                     const QString selected = "");
     612    void ShowHotMenu(const PlayerContext *ctx, const QString &itemSelected);
    611613
    612614    void FillOSDMenuAudio    (const PlayerContext *ctx, OSD *osd,
    613615                              QString category, const QString selected,
    class MTV_PUBLIC TV : public QObject  
    674676    bool    db_use_channel_groups;
    675677    bool    db_remember_last_channel_group;
    676678    ChannelGroupList db_channel_groups;
     679    QString db_hotmenu_items;
    677680
    678681    CommSkipMode autoCommercialSkip;
    679682    bool    tryUnflaggedSkip;
  • mythtv/libs/libmythui/mythdialogbox.cpp

    diff --git a/mythtv/libs/libmythui/mythdialogbox.cpp b/mythtv/libs/libmythui/mythdialogbox.cpp
    index a215390..6364c66 100644
    a b  
    2424
    2525QEvent::Type DialogCompletionEvent::kEventType =
    2626    (QEvent::Type) QEvent::registerEventType();
     27QEvent::Type DialogEditEvent::kEventType =
     28    (QEvent::Type) QEvent::registerEventType();
    2729
    2830
    2931MythMenu::MythMenu(const QString &text, QObject *retobject, const QString &resultid) :
    void MythDialogBox::SendEvent(int res, QString text, QVariant data)  
    444446
    445447/////////////////////////////////////////////////////////////////
    446448
     449bool MythEditableDialogBox::keyPressEvent(QKeyEvent *event)
     450{
     451    if (GetFocusWidget()->keyPressEvent(event))
     452        return true;
     453
     454    bool handled = false;
     455    QStringList actions;
     456    handled = GetMythMainWindow()->
     457        TranslateKeyPress("TV Playback", event, actions);
     458    for (int i = 0; i < actions.size() && !handled; i++)
     459    {
     460        QString action = actions[i];
     461        MythUIButtonListItem *item = m_buttonList->GetItemCurrent();
     462        QString text = item->GetText();
     463        QVariant data = item->GetData();
     464        if (action == m_editAction)
     465        {
     466            handled = true;
     467            int res = m_buttonList->GetCurrentPos();
     468            DialogEditEvent *dee = new DialogEditEvent(m_id, res, text, data);
     469            QCoreApplication::postEvent(m_retObject, dee);
     470        }
     471        else if (m_handleAccel)
     472        {
     473            if (action.length() == 1 &&
     474                action >= ACTION_0 && action <= ACTION_9)
     475            {
     476                int digit = action.at(0).digitValue(); // -1 if not a digit
     477                // Treat '1' as the first item, '0' as the 10th item
     478                if (digit == 0)
     479                    digit = 10;
     480                MythUIButtonListItem *item =
     481                    m_buttonList->GetItemAt(digit - 1);
     482                if (item)
     483                {
     484                    handled = true;
     485                    Select(item);
     486                }
     487            }
     488            else if (action == "DELETE")
     489            {
     490                handled = true;
     491                DialogEditEvent *dee =
     492                    new DialogEditEvent(m_id, -1, text, data);
     493                QCoreApplication::postEvent(m_retObject, dee);
     494            }
     495        }
     496    }
     497
     498    if (!handled && MythDialogBox::keyPressEvent(event))
     499        return true;
     500
     501    return handled;
     502}
     503
     504/////////////////////////////////////////////////////////////////
     505
    447506MythConfirmationDialog::MythConfirmationDialog(MythScreenStack *parent,
    448507                                               const QString &message,
    449508                                               bool showCancel)
  • mythtv/libs/libmythui/mythdialogbox.h

    diff --git a/mythtv/libs/libmythui/mythdialogbox.h b/mythtv/libs/libmythui/mythdialogbox.h
    index d19a5be..08eb554 100644
    a b class MUI_PUBLIC DialogCompletionEvent : public QEvent  
    5151    QVariant m_resultData;
    5252};
    5353
     54class MUI_PUBLIC DialogEditEvent : public QEvent
     55{
     56  public:
     57    DialogEditEvent(const QString &id, int result, QString text,
     58                    QVariant data)
     59        : QEvent(kEventType),
     60        m_id(id), m_result(result), m_resultText(text), m_resultData(data) { }
     61
     62    QString GetId() { return m_id; }
     63    int GetResult() { return m_result; }
     64    QString GetResultText() { return m_resultText; }
     65    QVariant GetData() { return m_resultData; }
     66
     67    static Type kEventType;
     68
     69  private:
     70    QString m_id;
     71    int m_result;
     72    QString m_resultText;
     73    QVariant m_resultData;
     74};
     75
    5476
    5577class MUI_PUBLIC MythMenuItem
    5678{
    class MUI_PUBLIC MythDialogBox : public MythScreenType  
    170192    MythMenu *m_currentMenu;
    171193};
    172194
     195class MUI_PUBLIC MythEditableDialogBox : public MythDialogBox
     196{
     197    Q_OBJECT
     198  public:
     199    MythEditableDialogBox(const QString &text,
     200                     MythScreenStack *parent, const char *name,
     201                     const QString &editAction, bool handleAccel) :
     202        MythDialogBox(text, parent, name, false/*fullscreen*/, true/*osd*/),
     203        m_editAction(editAction), m_handleAccel(handleAccel) { }
     204    virtual bool keyPressEvent(QKeyEvent *event);
     205 protected:
     206    const QString m_editAction; // action that initiates a DialogEditEvent
     207    bool m_handleAccel; // whether to handle accelerators: DELETE, 0, ..., 9
     208};
     209
    173210
    174211/**
    175212 *  \class MythConfirmationDialog