StelGuiBase.cpp   StelGuiBase.cpp 
skipping to change at line 51 skipping to change at line 51
if (a) if (a)
{ {
const QString& englishText = a->property("englishTex t").toString(); const QString& englishText = a->property("englishTex t").toString();
if (!englishText.isEmpty()) if (!englishText.isEmpty())
{ {
a->setText(q_(englishText)); a->setText(q_(englishText));
} }
} }
} }
} }
// 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
// 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, bool global)
{
Q_UNUSED(helpGroup);
QAction* a;
a = new QAction(stelAppGraphicsWidget);
a->setObjectName(actionName);
a->setText(q_(text));
QList<QKeySequence> shortcuts;
QRegExp shortCutSplitRegEx(",(?!,|$)");
QStringList shortcutStrings = shortCut.split(shortCutSplitRegEx);
for (int i = 0; i < shortcutStrings.size(); ++i)
shortcuts << QKeySequence(shortcutStrings.at(i).trimmed());
a->setShortcuts(shortcuts);
a->setCheckable(checkable);
a->setAutoRepeat(autoRepeat);
a->setProperty("englishText", QVariant(text));
if (global)
{
a->setShortcutContext(Qt::ApplicationShortcut);
}
else
{
a->setShortcutContext(Qt::WidgetShortcut);
}
stelAppGraphicsWidget->addAction(a);
return a;
}
QAction* StelGuiBase::getGuiActions(const QString& actionName)
{
QAction* a = stelAppGraphicsWidget->findChild<QAction*>(actionName);
if (!a)
{
qWarning() << "Can't find action " << actionName;
return NULL;
}
return a;
}
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 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/