Permalink
Browse files

Standardize arrow key behavior and remove unneeded setting.

  • Loading branch information...
1 parent d9fb218 commit 0e84bfed22793516acf1ddc643521cb982c92cc7 @sphery sphery committed Sep 7, 2011
@@ -260,11 +260,6 @@ MythPopupBox::MythPopupBox(MythMainWindow *parent, const char *name)
{
float wmult, hmult;
- if (gCoreContext->GetNumSetting("UseArrowAccels", 1))
- arrowAccel = true;
- else
- arrowAccel = false;
-
GetMythUI()->GetScreenSettings(wmult, hmult);
setLineWidth(3);
@@ -292,11 +287,6 @@ MythPopupBox::MythPopupBox(MythMainWindow *parent, bool graphicPopup,
{
float wmult, hmult;
- if (gCoreContext->GetNumSetting("UseArrowAccels", 1))
- arrowAccel = true;
- else
- arrowAccel = false;
-
GetMythUI()->GetScreenSettings(wmult, hmult);
setLineWidth(3);
@@ -474,7 +464,7 @@ QAbstractButton *MythPopupBox::addButton(QString caption, QObject *target,
slot = SLOT(defaultButtonPressedHandler());
}
- MythPushButton *button = new MythPushButton(caption, this, arrowAccel);
+ MythPushButton *button = new MythPushButton(caption, this);
m_parent->connect(button, SIGNAL(pressed()), target, slot);
addWidget(button, false);
return button;
@@ -584,7 +574,7 @@ void MythPopupBox::keyPressEvent(QKeyEvent *e)
{
QString action = actions[i];
- if ((action == "ESCAPE") || (arrowAccel && action == "LEFT"))
+ if (action == "ESCAPE")
{
reject();
handled = true;
@@ -205,7 +205,6 @@ class MPUBLIC MythPopupBox : public MythDialog
QVBoxLayout *vbox;
QColor popupForegroundColor;
int hpadding, wpadding;
- bool arrowAccel;
};
/*!
@@ -1171,8 +1171,6 @@ MythPushButton::MythPushButton(const QString &ontext, const QString &offtext,
QWidget *parent, bool isOn, bool aa)
: QPushButton(ontext, parent)
{
- arrowAccel = aa;
-
onText = ontext;
offText = offtext;
@@ -1218,22 +1216,6 @@ void MythPushButton::keyPressEvent(QKeyEvent *e)
emit pressed();
handled = true;
}
- else if (arrowAccel)
- {
- if (action == "LEFT")
- {
- parent()->event(e);
- handled = true;
- }
- else if (action == "RIGHT")
- {
- if (isCheckable())
- toggleText();
- setDown(true);
- emit pressed();
- handled = true;
- }
- }
}
}
@@ -284,14 +284,14 @@ class MPUBLIC MythPushButton : public QPushButton
public:
MythPushButton(QWidget *parent, const char *name = "MythPushButton",
bool aa = false)
- : QPushButton(parent), arrowAccel(aa)
+ : QPushButton(parent)
{
setObjectName(name);
setCheckable(false);
}
MythPushButton(const QString &text, QWidget *parent, bool aa = false)
- : QPushButton(text, parent), arrowAccel(aa)
+ : QPushButton(text, parent)
{
setObjectName("MythPushButton");
setCheckable(false);
@@ -319,7 +319,6 @@ class MPUBLIC MythPushButton : public QPushButton
QString helptext;
QString onText;
QString offText;
- bool arrowAccel;
QStringList keyPressActions;
};
@@ -828,7 +828,6 @@ TV::TV(void)
db_browse_all_tuners(false),
db_use_channel_groups(false), db_remember_last_channel_group(false),
- arrowAccel(false),
tryUnflaggedSkip(false),
smartForward(false),
ff_rew_repos(1.0f), ff_rew_reverse(false),
@@ -941,7 +940,6 @@ void TV::InitFromDB(void)
kv["TimeFormat"] = "h:mm AP";
kv["ShortDateFormat"] = "M/d";
- kv["UseArrowAccels"] = "1";
kv["TryUnflaggedSkip"] = "0";
kv["ChannelGroupDefault"] = "-1";
@@ -989,7 +987,6 @@ void TV::InitFromDB(void)
db_channel_format = kv["ChannelFormat"];
db_time_format = kv["TimeFormat"];
db_short_date_format = kv["ShortDateFormat"];
- arrowAccel = kv["UseArrowAccels"].toInt();
tryUnflaggedSkip = kv["TryUnflaggedSkip"].toInt();
smartForward = kv["SmartForward"].toInt();
ff_rew_repos = kv["FFRewReposTime"].toFloat() * 0.01f;
@@ -636,8 +636,6 @@ class MTV_PUBLIC TV : public QObject
bool db_remember_last_channel_group;
ChannelGroupList db_channel_groups;
- bool arrowAccel;
-
CommSkipMode autoCommercialSkip;
bool tryUnflaggedSkip;
@@ -189,23 +189,11 @@ bool MythDialogBox::keyPressEvent(QKeyEvent *event)
if (m_exitdata == 0 && m_exittext.isEmpty())
Close();
}
- else if (action == "LEFT")
- {
- SendEvent(-1, m_backtext, m_backdata);
- if (m_backdata == 0 && m_backtext.isEmpty())
- Close();
- }
else if (action == "MENU")
{
SendEvent(-2);
Close();
}
- else if (action == "RIGHT")
- {
- MythUIButtonListItem *item = m_buttonList->GetItemCurrent();
- if (item)
- Select(item);
- }
else
handled = false;
}
@@ -212,13 +212,7 @@ bool MythThemedMenu::keyPressEvent(QKeyEvent *event)
QString action = actions[i];
handled = true;
- if (action == "RIGHT")
- {
- MythUIButtonListItem *item = m_buttonList->GetItemCurrent();
- buttonAction(item);
- }
- else if (action == "LEFT" || action == "ESCAPE" ||
- action == "EXIT" || action == "EXITPROMPT" )
+ if (action == "ESCAPE" || action == "EXIT" || action == "EXITPROMPT")
{
bool callbacks = m_state->m_callback;
bool lastScreen = (GetMythMainWindow()->GetMainStack()
@@ -1721,17 +1721,6 @@ static HostLineEdit *ScreenShotPath()
return ge;
}
-static HostCheckBox *UseArrowAccels()
-{
- HostCheckBox *gc = new HostCheckBox("UseArrowAccels");
- gc->setLabel(QObject::tr("Use arrow key accelerators"));
- gc->setValue(true);
- gc->setHelpText(QObject::tr("If enabled, arrow key accelerators will "
- "be used, with LEFT performing an exit action and "
- "RIGHT selecting the current item."));
- return gc;
-}
-
static HostLineEdit *SetupPinCode()
{
HostLineEdit *ge = new HostLineEdit("SetupPinCode");
@@ -3292,7 +3281,6 @@ MainGeneralSettings::MainGeneralSettings()
VerticalConfigurationGroup *general =
new VerticalConfigurationGroup(false, true, false, false);
general->setLabel(QObject::tr("General"));
- general->addChild(UseArrowAccels());
general->addChild(UseVirtualKeyboard());
general->addChild(ScreenShotPath());
addChild(general);

0 comments on commit 0e84bfe

Please sign in to comment.