Replace (un)checkAction with toggleAction (1/3)

Add toggleAction to QAccessibleActionInterface.

This change is split into separate modules, thus we have to be careful
of not breaking qtdeclarative, which currently depends (un)checkAction.
Therefore we apply the patches in this order:
1. Add toggleAction to QAccessibleActionInterface (in qtbase)
2. Replace all references to (un)checkAction with toggleAction
   (in qtdeclarative)
3. Remove all references to (un)checkAction (in qtbase)

Change-Id: Ib00fee3139eeabbece97295bc3d713ab119c92e6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
This commit is contained in:
Jan-Arve Saether 2012-05-22 08:58:48 +02:00 committed by Qt by Nokia
parent a40e0f6c7a
commit c47f220f1a
2 changed files with 14 additions and 0 deletions

View File

@ -461,6 +461,7 @@ struct QAccessibleActionStrings
decreaseAction(QStringLiteral(QT_TRANSLATE_NOOP("QAccessibleActionInterface", "Decrease"))), decreaseAction(QStringLiteral(QT_TRANSLATE_NOOP("QAccessibleActionInterface", "Decrease"))),
showMenuAction(QStringLiteral(QT_TRANSLATE_NOOP("QAccessibleActionInterface", "ShowMenu"))), showMenuAction(QStringLiteral(QT_TRANSLATE_NOOP("QAccessibleActionInterface", "ShowMenu"))),
setFocusAction(QStringLiteral(QT_TRANSLATE_NOOP("QAccessibleActionInterface", "SetFocus"))), setFocusAction(QStringLiteral(QT_TRANSLATE_NOOP("QAccessibleActionInterface", "SetFocus"))),
toggleAction(QStringLiteral(QT_TRANSLATE_NOOP("QAccessibleActionInterface", "Toggle"))),
checkAction(QStringLiteral(QT_TRANSLATE_NOOP("QAccessibleActionInterface", "Check"))), checkAction(QStringLiteral(QT_TRANSLATE_NOOP("QAccessibleActionInterface", "Check"))),
uncheckAction(QStringLiteral(QT_TRANSLATE_NOOP("QAccessibleActionInterface", "Uncheck"))) {} uncheckAction(QStringLiteral(QT_TRANSLATE_NOOP("QAccessibleActionInterface", "Uncheck"))) {}
@ -469,6 +470,7 @@ struct QAccessibleActionStrings
const QString decreaseAction; const QString decreaseAction;
const QString showMenuAction; const QString showMenuAction;
const QString setFocusAction; const QString setFocusAction;
const QString toggleAction;
const QString checkAction; const QString checkAction;
const QString uncheckAction; const QString uncheckAction;
}; };
@ -493,6 +495,8 @@ QString QAccessibleActionInterface::localizedActionDescription(const QString &ac
return tr("Shows the menu"); return tr("Shows the menu");
else if (actionName == strings->setFocusAction) else if (actionName == strings->setFocusAction)
return tr("Sets the focus"); return tr("Sets the focus");
else if (actionName == strings->toggleAction)
return tr("Toggles the state");
else if (actionName == strings->checkAction) else if (actionName == strings->checkAction)
return tr("Checks the checkbox"); return tr("Checks the checkbox");
else if (actionName == strings->uncheckAction) else if (actionName == strings->uncheckAction)
@ -546,6 +550,15 @@ const QString &QAccessibleActionInterface::setFocusAction()
return accessibleActionStrings()->setFocusAction; return accessibleActionStrings()->setFocusAction;
} }
/*!
Returns the name of the toggle default action.
\sa actionNames(), localizedActionName()
*/
const QString &QAccessibleActionInterface::toggleAction()
{
return accessibleActionStrings()->toggleAction;
}
/*! /*!
Returns the name of the check default action. Returns the name of the check default action.
\sa actionNames(), localizedActionName() \sa actionNames(), localizedActionName()

View File

@ -232,6 +232,7 @@ public:
static const QString &decreaseAction(); static const QString &decreaseAction();
static const QString &showMenuAction(); static const QString &showMenuAction();
static const QString &setFocusAction(); static const QString &setFocusAction();
static const QString &toggleAction();
static const QString &checkAction(); static const QString &checkAction();
static const QString &uncheckAction(); static const QString &uncheckAction();
}; };