diff options
author | Alexander Potashev <aspotashev@gmail.com> | 2011-05-09 10:35:29 +0200 |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-05-10 12:54:56 +0200 |
commit | ec4d346f95de4933b660d5ce005751abdced4c7d (patch) | |
tree | 2a1f684982e19debfa26fab46c743c79b5131e9f /src/gui/util/qundostack_p.h | |
parent | e04ad81dc41a6f3b503b04cd39267259ee3da72c (diff) |
Allow using not only prefixes for undo command text
Functions QUndo{Group,Stack}::create{Undo,Redo}Action() now use action
text templates "Undo %1" and "Redo %1" if no custom prefix was provided.
This makes more flexible translations possible. The surrounding text
(like "Undo" and "Redo") can now be suffixed to the command name as
German and Korean languages require ("%1 rueckgaengig machen" for German).
Also, now the default action text (when no command can be undone) can be
translated differently from the prefix. For example, it can be
translated as "Undo action", not just "Undo".
When a non-empty prefix is passed to QUndo*****::create****Action(),
those functions work as before, and the features described above become
unavailable.
Task-number: QTBUG-14442
Merge-request: 1212
Reviewed-by: ossi
(cherry picked from commit 213c25ad24e4f3b0a44f82f23d34746cd294f8d6)
Diffstat (limited to 'src/gui/util/qundostack_p.h')
-rw-r--r-- | src/gui/util/qundostack_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/util/qundostack_p.h b/src/gui/util/qundostack_p.h index 3c7d0e7d85..2906fd8564 100644 --- a/src/gui/util/qundostack_p.h +++ b/src/gui/util/qundostack_p.h @@ -98,10 +98,12 @@ class QUndoAction : public QAction Q_OBJECT public: QUndoAction(const QString &prefix, QObject *parent = 0); + void setTextFormat(const QString &textFormat, const QString &defaultText); public Q_SLOTS: void setPrefixedText(const QString &text); private: QString m_prefix; + QString m_defaultText; }; #endif // QT_NO_ACTION |