Ticket #10581: hotmenu_v1.patch

File hotmenu_v1.patch, 20.6 KB (added by Jim Stichnoth, 12 years ago)
  • mythtv/libs/libmythtv/osd.cpp

    diff --git a/mythtv/libs/libmythtv/osd.cpp b/mythtv/libs/libmythtv/osd.cpp
    index 207ecef..59f721c 100644
    a b void OSD::DialogQuit(void) 
    955955    m_PulsedDialogText = QString();
    956956}
    957957
    958 void OSD::DialogShow(const QString &window, const QString &text, int updatefor)
     958void OSD::DialogShow(const QString &window, const QString &text, int updatefor,
     959                     const QString &hotMenuAction, bool handleAccel)
    959960{
    960961    if (m_Dialog)
    961962    {
    void OSD::DialogShow(const QString &window, const QString &text, int updatefor) 
    982983            dialog = new ChannelEditor(m_ParentObject, window.toLatin1());
    983984        else if (window == OSD_DLG_CONFIRM)
    984985            dialog = new MythConfirmationDialog(NULL, text, false);
     986        else if (!hotMenuAction.isEmpty())
     987            dialog = new MythEditableDialogBox(text, NULL, window.toLatin1(),
     988                                               hotMenuAction, handleAccel);
    985989        else
    986990            dialog = new MythDialogBox(text, NULL, window.toLatin1(), false, true);
    987991
  • mythtv/libs/libmythtv/osd.h

    diff --git a/mythtv/libs/libmythtv/osd.h b/mythtv/libs/libmythtv/osd.h
    index a795469..5919617 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 
    166168    bool DialogHandleKeypress(QKeyEvent *e);
    167169    void DialogQuit(void);
    168170    void DialogShow(const QString &window, const QString &text = "",
    169                     int updatefor = 0);
     171                    int updatefor = 0,
     172                    const QString &hotMenuAction = "",
     173                    bool handleAccel = false);
    170174    void DialogSetText(const QString &text);
    171175    void DialogBack(QString text = "", QVariant data = 0, bool exit = false);
    172176    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 e57c91f..8cdcb40 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 86f56af..37983fc 100644
    a b void TV::InitKeys(void) 
    540540    REG_KEY("TV Frontend", "CHANGEGROUPVIEW", QT_TRANSLATE_NOOP("MythControls",
    541541            "Change Group View"), "");
    542542
     543    REG_KEY("TV Playback", ACTION_HOTMENU, QT_TRANSLATE_NOOP("MythControls",
     544            "Playback Custom Menu"), "");
    543545    REG_KEY("TV Playback", "BACK", QT_TRANSLATE_NOOP("MythControls",
    544546            "Exit or return to DVD menu"), "");
    545547    REG_KEY("TV Playback", ACTION_CLEAROSD, QT_TRANSLATE_NOOP("MythControls",
    void TV::InitFromDB(void) 
    10461048    kv["VbiFormat"]                = "";
    10471049    kv["DecodeVBIFormat"]          = "";
    10481050
     1051    kv["HotMenuActions"]           = "";
     1052
    10491053    int ff_rew_def[8] = { 3, 5, 10, 20, 30, 60, 120, 180 };
    10501054    for (uint i = 0; i < sizeof(ff_rew_def)/sizeof(ff_rew_def[0]); i++)
    10511055        kv[QString("FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
    void TV::InitFromDB(void) 
    10871091    db_remember_last_channel_group = kv["ChannelGroupRememberLast"].toInt();
    10881092    channelGroupId         = kv["ChannelGroupDefault"].toInt();
    10891093
     1094    db_hotmenu_items       = kv["HotMenuActions"];
     1095
    10901096    QString beVBI          = kv["VbiFormat"];
    10911097    QString feVBI          = kv["DecodeVBIFormat"];
    10921098
    bool TV::ActiveHandleAction(PlayerContext *ctx, 
    43064312
    43074313        SetActive(ctx, 0, false);
    43084314    }
     4315    else if (has_action(ACTION_HOTMENU, actions))
     4316        ShowHotMenu(ctx, "");
    43094317    else if (has_action(ACTION_ENABLEUPMIX, actions))
    43104318        EnableUpmix(ctx, true);
    43114319    else if (has_action(ACTION_DISABLEUPMIX, actions))
    void TV::customEvent(QEvent *e) 
    86428650        return;
    86438651    }
    86448652
     8653    if (e->type() == DialogEditEvent::kEventType)
     8654    {
     8655        DialogEditEvent *dee =
     8656            reinterpret_cast<DialogEditEvent*>(e);
     8657        QString item = dee->GetData().toString();
     8658        PlayerContext *mctx = GetPlayerReadLock(0, __FILE__, __LINE__);
     8659        OSD *osd = GetOSDLock(mctx);
     8660        if (osd && osd->DialogVisible(OSD_DLG_HOTMENU) && item != "MENU")
     8661        {
     8662            osd->DialogShow(OSD_DLG_EDITHOTMENU, tr("Edit Custom Menu Item") +
     8663                            "\n\n"  + ActionToString(item));
     8664            osd->DialogAddButton(tr("Move to Top"),
     8665                                 QString("HOTMENUEDIT_MOVETOP_%1")
     8666                                 .arg(item));
     8667            osd->DialogAddButton(tr("Move Up"),
     8668                                 QString("HOTMENUEDIT_MOVEUP_%1")
     8669                                 .arg(item));
     8670            osd->DialogAddButton(tr("Move Down"),
     8671                                 QString("HOTMENUEDIT_MOVEDOWN_%1")
     8672                                 .arg(item));
     8673            osd->DialogAddButton(tr("Move to Bottom"),
     8674                                 QString("HOTMENUEDIT_MOVEBOTTOM_%1")
     8675                                 .arg(item));
     8676            osd->DialogAddButton(tr("Remove"),
     8677                                 QString("HOTMENUEDIT_DELETE_%1")
     8678                                 .arg(item), false, (dee->GetResult() == -1));
     8679            osd->DialogBack(item, ACTION_HOTMENU, true);
     8680        }
     8681        else if (osd && osd->DialogVisible(OSD_DLG_MENU))
     8682        {
     8683            QString itemString = ActionToString(item, true);
     8684            if (!itemString.isEmpty() && !item.startsWith("DIALOG_MENU_"))
     8685            {
     8686                osd->DialogShow(OSD_DLG_EDITHOTMENU,
     8687                                ActionToString(item) + "\n\n" +
     8688                                tr("Add to Custom Menu?"));
     8689                osd->DialogAddButton(tr("OK"),
     8690                                     QString("HOTMENUADD_%1").arg(item),
     8691                                     false, true);
     8692                osd->DialogAddButton(tr("Cancel"), "HOTMENUCANCEL");
     8693                osd->DialogBack("", "HOTMENUCANCEL", true);
     8694            }
     8695        }
     8696        ReturnOSDLock(mctx, osd);
     8697        ReturnPlayerLock(mctx);
     8698        return;
     8699    }
     8700
    86458701    if (e->type() == OSDHideEvent::kEventType)
    86468702    {
    86478703        OSDHideEvent *ce = reinterpret_cast<OSDHideEvent*>(e);
    void TV::OSDDialogEvent(int result, QString text, QString action) 
    1006010116            LOG(VB_GENERAL, LOG_ERR, "Unrecognised dialog event.");
    1006110117        }
    1006210118    }
     10119    else if (action == ACTION_HOTMENU)
     10120    {
     10121        hide = false;
     10122        ShowHotMenu(actx, text);
     10123    }
     10124    else if (action == "HOTMENUCANCEL")
     10125    {
     10126        // Bring back to the top-level menu, which isn't ideal.
     10127        hide = false;
     10128        ShowOSDMenu(actx);
     10129    }
     10130    else if (action.startsWith("HOTMENUADD_"))
     10131    {
     10132        action.remove("HOTMENUADD_");
     10133        QStringList itemList =
     10134            db_hotmenu_items.split(',', QString::SkipEmptyParts);
     10135        if (!itemList.contains(action))
     10136        {
     10137            if (!db_hotmenu_items.isEmpty())
     10138                db_hotmenu_items += ",";
     10139            db_hotmenu_items += action;
     10140            gCoreContext->SaveSetting("HotMenuActions", db_hotmenu_items);
     10141        }
     10142        hide = false;
     10143        ShowHotMenu(actx, action);
     10144    }
     10145    else if (action.startsWith("HOTMENUEDIT_"))
     10146    {
     10147        action = action.mid(12);
     10148        int separator = action.indexOf('_');
     10149        QString op = action.left(separator);
     10150        QString item = action.mid(separator + 1);
     10151        QStringList itemList =
     10152            db_hotmenu_items.split(',', QString::SkipEmptyParts);
     10153        int oldIndex = itemList.indexOf(item);
     10154        if (oldIndex >= 0)
     10155        {
     10156            int newIndex = oldIndex;
     10157            itemList.removeOne(item);
     10158            if (op == "MOVETOP")
     10159                newIndex = 0;
     10160            else if (op == "MOVEUP")
     10161                newIndex = (oldIndex > 0 ? oldIndex - 1 : 0);
     10162            else if (op == "MOVEDOWN")
     10163                newIndex = (oldIndex < itemList.size() ?
     10164                            oldIndex + 1 : itemList.size());
     10165            else if (op == "MOVEBOTTOM")
     10166                newIndex = itemList.size();
     10167            else if (op == "DELETE")
     10168                newIndex = -1;
     10169            if (newIndex >= 0)
     10170                itemList.insert(newIndex, item);
     10171        }
     10172        QString old = db_hotmenu_items;
     10173        db_hotmenu_items = "";
     10174        for (int i = 0; i < itemList.size(); ++i)
     10175        {
     10176            if (i > 0)
     10177                db_hotmenu_items += ",";
     10178            db_hotmenu_items += itemList[i];
     10179        }
     10180        if (db_hotmenu_items != old)
     10181            gCoreContext->SaveSetting("HotMenuActions", db_hotmenu_items);
     10182        hide = false;
     10183        ShowHotMenu(actx, item);
     10184    }
    1006310185    else if (result < 0)
    1006410186        ; // exit dialog
    1006510187    else if (HandleTrackAction(actx, action))
    void TV::OSDDialogEvent(int result, QString text, QString action) 
    1031910441            DoQueueTranscode(actx, "Medium Quality");
    1032010442        else if (action == "QUEUETRANSCODE_LOW")
    1032110443            DoQueueTranscode(actx, "Low Quality");
     10444        else if (action == "MENU")
     10445        {
     10446            hide = false;
     10447            ShowOSDMenu(actx);
     10448        }
    1032210449        else
    1032310450        {
    1032410451            LOG(VB_GENERAL, LOG_ERR, LOC +
    void TV::HandleOSDInfo(PlayerContext *ctx, QString action) 
    1035910486    }
    1036010487}
    1036110488
     10489QString TV::ActionToString(const QString &action, bool strict)
     10490{
     10491    static QHash<QString, QString> map;
     10492    if (map.isEmpty())
     10493    {
     10494        // AUDIO
     10495        map[ACTION_TOGGELAUDIOSYNC] = tr("Adjust Audio Sync");
     10496        map[ACTION_DISABLEUPMIX] = tr("Disable Audio Upmixer");
     10497        map[ACTION_ENABLEUPMIX] = tr("Enable Audio Upmixer");
     10498        // don't do AUDIO:AUDIOTRACKS
     10499        // don't do AUDIO:VISUALISATIONS
     10500        // VIDEO
     10501        map["TOGGLEMANUALZOOM"] = tr("Manual Zoom Mode");
     10502        // VIDEO:VIDEOASPECT
     10503        for (int i = kAspect_Off; i < kAspect_END; i++)
     10504        {
     10505            map[QString("TOGGLEASPECT%1").arg(i)] =
     10506                tr("Aspect Ratio") + " - " +
     10507                toString((AspectOverrideMode) i);
     10508        }
     10509        // VIDEO:ADJUSTFILL
     10510        map["TOGGLEFILL"] = tr("Next Zoom Mode");
     10511        for (int i = kAdjustFill_Off; i < kAdjustFill_END; i++)
     10512        {
     10513            map[QString("TOGGLEFILL%1").arg(i)] =
     10514                tr("Adjust Fill") + " - " + toString((AdjustFillMode) i);
     10515        }
     10516        // VIDEO:ADJUSTPICTURE
     10517        map[ACTION_TOGGLENIGHTMODE] = tr("Toggle night mode");
     10518        // VIDEO:3D
     10519        map[ACTION_3DNONE]                = tr("No 3D");
     10520        map[ACTION_3DSIDEBYSIDE]          = tr("3D Side by Side");
     10521        map[ACTION_3DSIDEBYSIDEDISCARD]   = tr("Discard 3D Side by Side");
     10522        map[ACTION_3DTOPANDBOTTOM]        = tr("3D Top and Bottom");
     10523        map[ACTION_3DTOPANDBOTTOMDISCARD] = tr("Discard 3D Top and Bottom");
     10524        // VIDEO:ADVANCEDVIDEO
     10525        // VIDEO:ADVANCEDVIDEO:DEINTERLACER
     10526        // VIDEO:ADVANCEDVIDEO:VIDEOSCAN
     10527        QString vs = tr("Video Scan");
     10528        map["SELECTSCAN_0"] = vs + " - " + tr("Detect");
     10529        map["SELECTSCAN_1"] = vs + " - " + tr("Interlaced (Normal)");
     10530        map["SELECTSCAN_2"] = vs + " - " + tr("Interlaced (Reversed)");
     10531        map["SELECTSCAN_3"] = vs + " - " + tr("Progressive");
     10532        // SUBTITLES
     10533        map[ACTION_DISABLESUBS] = tr("Disable Subtitles");
     10534        map[ACTION_ENABLESUBS]  = tr("Enable Subtitles");
     10535        // NAVIGATE:COMMSKIP
     10536        for (int i = 0; i < kCommSkipCount ; ++i)
     10537            map[QString("TOGGLECOMMSKIP%1").arg(i)] =
     10538                toString((CommSkipMode)i);
     10539        // JOBS
     10540        map["EDIT"] = tr("Edit Recording");
     10541        map["TOGGLEAUTOEXPIRE"] = tr("Toggle Auto-Expire");
     10542        // PLAYBACK
     10543        map[ACTION_PAUSE] = tr("Pause");
     10544        map[ACTION_TOGGLEOSDDEBUG] = tr("Playback data");
     10545        // PLAYBACK:TIMESTRETCH
     10546        const QString adjts = tr("Time Stretch");
     10547        map["ADJUSTSTRETCH"]    = tr("Adjust Time Stretch");
     10548        map["TOGGLESTRETCH"]    = adjts + " - " + tr("Toggle");
     10549        map["ADJUSTSTRETCH0.5"] = adjts + " - " + tr("0.5X");
     10550        map["ADJUSTSTRETCH0.9"] = adjts + " - " + tr("0.9X");
     10551        map["ADJUSTSTRETCH1.0"] = adjts + " - " + tr("1.0X");
     10552        map["ADJUSTSTRETCH1.1"] = adjts + " - " + tr("1.1X");
     10553        map["ADJUSTSTRETCH1.2"] = adjts + " - " + tr("1.2X");
     10554        map["ADJUSTSTRETCH1.3"] = adjts + " - " + tr("1.3X");
     10555        map["ADJUSTSTRETCH1.4"] = adjts + " - " + tr("1.4X");
     10556        map["ADJUSTSTRETCH1.5"] = adjts + " - " + tr("1.5X");
     10557        // SCHEDULE
     10558        map[ACTION_GUIDE]         = tr("Program Guide");
     10559        map[ACTION_FINDER]        = tr("Program Finder");
     10560        map[ACTION_VIEWSCHEDULED] = tr("Upcoming Recordings");
     10561        map["SCHEDULE"]           = tr("Edit Recording Schedule");
     10562
     10563        //map["TOGGLEFILL"] = toString(kAdjustFill_Toggle);
     10564    }
     10565    if (map.contains(action))
     10566        return map[action];
     10567    else if (strict)
     10568        return "";
     10569    else
     10570        return action.left(1) + action.mid(1).toLower();
     10571}
     10572
     10573void TV::ShowHotMenu(const PlayerContext *ctx, const QString &itemSelected)
     10574{
     10575    if (ctx->playingInfo->QueryIsEditing())
     10576        return;
     10577    OSD *osd = GetOSDLock(ctx);
     10578    if (osd)
     10579    {
     10580        QStringList itemList =
     10581            db_hotmenu_items.split(',', QString::SkipEmptyParts);
     10582        itemList += "MENU";
     10583        osd->DialogShow(OSD_DLG_HOTMENU, tr("Playback Custom Menu"), 0,
     10584                        ACTION_HOTMENU, true);
     10585        int num;
     10586        for (num = 0; num < itemList.size(); ++num)
     10587        {
     10588            int displayNum = num + 1;
     10589            if (displayNum == 10)
     10590                displayNum = 0;
     10591            else if (displayNum > 10)
     10592                displayNum = -1;
     10593            QString prefix = "";
     10594            if (displayNum >= 0)
     10595                prefix = QString("[%1] ").arg(displayNum);
     10596            QString action = itemList[num];
     10597            osd->DialogAddButton(prefix + ActionToString(itemList[num]),
     10598                                 action, false, action == itemSelected);
     10599        }
     10600    }
     10601    ReturnOSDLock(ctx, osd);
     10602}
     10603
    1036210604void TV::ShowOSDMenu(const PlayerContext *ctx, const QString category,
    1036310605                     const QString selected)
    1036410606{
    void TV::ShowOSDMenu(const PlayerContext *ctx, const QString category, 
    1036710609    OSD *osd = GetOSDLock(ctx);
    1036810610    if (osd)
    1036910611    {
    10370         osd->DialogShow(OSD_DLG_MENU, tr("Playback Menu"));
     10612        osd->DialogShow(OSD_DLG_MENU, tr("Playback Menu"), 0, ACTION_HOTMENU);
    1037110613        QString currenttext = QString();
    1037210614        QString back = QString();
    1037310615
  • mythtv/libs/libmythtv/tv_play.h

    diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h
    index d7b22ab..cf8ab60 100644
    a b class MTV_PUBLIC TV : public QObject 
    171171    static void ReloadKeys(void);
    172172    static void SetFuncPtr(const char *, void *);
    173173    static int  ConfiguredTunerCards(void);
     174    static QString ActionToString(const QString &action, bool strict = false);
    174175
    175176    /// \brief Helper class for Sleep Timer code.
    176177    class SleepTimerInfo
    class MTV_PUBLIC TV : public QObject 
    570571    // Menu dialog
    571572    void ShowOSDMenu(const PlayerContext*, const QString category = "",
    572573                     const QString selected = "");
     574    void ShowHotMenu(const PlayerContext *ctx, const QString &itemSelected);
    573575
    574576    void FillOSDMenuAudio    (const PlayerContext *ctx, OSD *osd,
    575577                              QString category, const QString selected,
    class MTV_PUBLIC TV : public QObject 
    636638    bool    db_use_channel_groups;
    637639    bool    db_remember_last_channel_group;
    638640    ChannelGroupList db_channel_groups;
     641    QString db_hotmenu_items;
    639642
    640643    CommSkipMode autoCommercialSkip;
    641644    bool    tryUnflaggedSkip;
  • mythtv/libs/libmythui/mythdialogbox.cpp

    diff --git a/mythtv/libs/libmythui/mythdialogbox.cpp b/mythtv/libs/libmythui/mythdialogbox.cpp
    index 625aa1e..c35d3a0 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 06c3271..d84c28c 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