StelGuiBase.cpp   StelGuiBase.cpp 
skipping to change at line 55 skipping to change at line 55
{ {
a->setText(q_(englishText)); a->setText(q_(englishText));
} }
} }
} }
} }
// Note: "text" and "helpGroup" must be in English -- this method and the h elp // Note: "text" and "helpGroup" must be in English -- this method and the h elp
// dialog take care of translating them. Of course, they still have to be // dialog take care of translating them. Of course, they still have to be
// marked for translation using the N_() macro. // marked for translation using the N_() macro.
QAction* StelGuiBase::addGuiActions(const QString& actionName, const QStrin g& text, const QString& shortCut, const QString& helpGroup, bool checkable, bool autoRepeat) QAction* StelGuiBase::addGuiActions(const QString& actionName, const QStrin g& text, const QString& shortCut, const QString& helpGroup, bool checkable, bool autoRepeat, bool global)
{ {
Q_UNUSED(helpGroup); Q_UNUSED(helpGroup);
QAction* a; QAction* a;
a = new QAction(stelAppGraphicsWidget); a = new QAction(stelAppGraphicsWidget);
a->setObjectName(actionName); a->setObjectName(actionName);
a->setText(q_(text)); a->setText(q_(text));
QList<QKeySequence> shortcuts; QList<QKeySequence> shortcuts;
QRegExp shortCutSplitRegEx(",(?!,|$)"); QRegExp shortCutSplitRegEx(",(?!,|$)");
QStringList shortcutStrings = shortCut.split(shortCutSplitRegEx); QStringList shortcutStrings = shortCut.split(shortCutSplitRegEx);
for (int i = 0; i < shortcutStrings.size(); ++i) for (int i = 0; i < shortcutStrings.size(); ++i)
shortcuts << QKeySequence(shortcutStrings.at(i).trimmed()); shortcuts << QKeySequence(shortcutStrings.at(i).trimmed());
a->setShortcuts(shortcuts); a->setShortcuts(shortcuts);
a->setCheckable(checkable); a->setCheckable(checkable);
a->setAutoRepeat(autoRepeat); a->setAutoRepeat(autoRepeat);
a->setProperty("englishText", QVariant(text)); a->setProperty("englishText", QVariant(text));
a->setShortcutContext(Qt::WidgetShortcut); if (global)
{
a->setShortcutContext(Qt::ApplicationShortcut);
}
else
{
a->setShortcutContext(Qt::WidgetShortcut);
}
stelAppGraphicsWidget->addAction(a); stelAppGraphicsWidget->addAction(a);
return a; return a;
} }
QAction* StelGuiBase::getGuiActions(const QString& actionName) QAction* StelGuiBase::getGuiActions(const QString& actionName)
{ {
QAction* a = stelAppGraphicsWidget->findChild<QAction*>(actionName); QAction* a = stelAppGraphicsWidget->findChild<QAction*>(actionName);
if (!a) if (!a)
{ {
qWarning() << "Can't find action " << actionName; qWarning() << "Can't find action " << actionName;
 End of changes. 2 change blocks. 
2 lines changed or deleted 9 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/