diff options
author | Michal Labedzki <michal.labedzki@tieto.com> | 2013-12-21 17:55:43 +0100 |
---|---|---|
committer | Michal Labedzki <michal.labedzki@tieto.com> | 2014-11-04 08:21:55 +0000 |
commit | 5025bc258cdeabbd498919d5c6b4554accdad842 (patch) | |
tree | 53301fcaa347e0a933086ce102b56b27e13aeee9 /ui/qt/proto_tree.cpp | |
parent | 15e78de432f55f5478f1b3994f3d7e060b60508d (diff) |
Qt: Dynamic languages
- get language as soon as possible (before creating any Qt objects) to make all
translations working
- dynamic list of supported languages
- runtime change of GUI language (no need to restart application)
- add flags icons support
- search for *.qm languages in buildin resources, then
data dir called "languages" (main directory in sources or
/usr/share/wireshark/languages), then user directory
(UNIX: ~/.wireshark/languages); "languages" directory should contains
files wireshark_xx.qm where xx is language code (en, en_GB, etc.),
and optional xx.svg for flag icon
- try to fix some untranslated manually-created UI items
(need manual reset text of those components)
Change-Id: I62ca8a8cddce47cec9dbcad6b0bd68b6cfd92229
Reviewed-on: https://code.wireshark.org/review/5041
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'ui/qt/proto_tree.cpp')
-rw-r--r-- | ui/qt/proto_tree.cpp | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/ui/qt/proto_tree.cpp b/ui/qt/proto_tree.cpp index 36e597dc5a..ecef518e3b 100644 --- a/ui/qt/proto_tree.cpp +++ b/ui/qt/proto_tree.cpp @@ -159,6 +159,7 @@ ProtoTree::ProtoTree(QWidget *parent) : decode_as_(NULL) { QMenu *submenu, *subsubmenu; + QAction *action; setAccessibleName(tr("Packet details")); setUniformRowHeights(true); @@ -170,25 +171,32 @@ ProtoTree::ProtoTree(QWidget *parent) : ctx_menu_.addAction(window()->findChild<QAction *>("actionViewCollapseAll")); ctx_menu_.addSeparator(); // " <menuitem name='CreateAColumn' action='/Create a Column'/>\n" - ctx_menu_.addSeparator(); - submenu = new QMenu(tr("Apply as Filter")); - ctx_menu_.addMenu(submenu); + action = window()->findChild<QAction *>("actionApply_as_Filter"); + submenu = new QMenu(); + action->setMenu(submenu); + ctx_menu_.addAction(action); submenu->addAction(window()->findChild<QAction *>("actionAnalyzeAAFSelected")); submenu->addAction(window()->findChild<QAction *>("actionAnalyzeAAFNotSelected")); submenu->addAction(window()->findChild<QAction *>("actionAnalyzeAAFAndSelected")); submenu->addAction(window()->findChild<QAction *>("actionAnalyzeAAFOrSelected")); submenu->addAction(window()->findChild<QAction *>("actionAnalyzeAAFAndNotSelected")); submenu->addAction(window()->findChild<QAction *>("actionAnalyzeAAFOrNotSelected")); - submenu = new QMenu(tr("Prepare a Filter")); - ctx_menu_.addMenu(submenu); + + action = window()->findChild<QAction *>("actionPrepare_a_Filter"); + submenu = new QMenu(); + action->setMenu(submenu); + ctx_menu_.addAction(action); submenu->addAction(window()->findChild<QAction *>("actionAnalyzePAFSelected")); submenu->addAction(window()->findChild<QAction *>("actionAnalyzePAFNotSelected")); submenu->addAction(window()->findChild<QAction *>("actionAnalyzePAFAndSelected")); submenu->addAction(window()->findChild<QAction *>("actionAnalyzePAFOrSelected")); submenu->addAction(window()->findChild<QAction *>("actionAnalyzePAFAndNotSelected")); submenu->addAction(window()->findChild<QAction *>("actionAnalyzePAFOrNotSelected")); - submenu = new QMenu(tr("Colorize with Filter")); - ctx_menu_.addMenu(submenu); + +// action = window()->findChild<QAction *>("actionColorize_with_Filter"); +// submenu = new QMenu(); +// action->setMenu(submenu); +// ctx_menu_.addAction(action); // " <menuitem name='Color1' action='/Colorize with Filter/Color 1'/>\n" // " <menuitem name='Color2' action='/Colorize with Filter/Color 2'/>\n" // " <menuitem name='Color3' action='/Colorize with Filter/Color 3'/>\n" @@ -205,15 +213,21 @@ ProtoTree::ProtoTree(QWidget *parent) : // " <menuitem name='FollowUDPStream' action='/Follow UDP Stream'/>\n" // " <menuitem name='FollowSSLStream' action='/Follow SSL Stream'/>\n" ctx_menu_.addSeparator(); - submenu = new QMenu(tr("Copy")); - ctx_menu_.addMenu(submenu); + + action = window()->findChild<QAction *>("actionCopy"); + submenu = new QMenu(); + action->setMenu(submenu); + ctx_menu_.addAction(action); submenu->addAction(window()->findChild<QAction *>("actionEditCopyDescription")); submenu->addAction(window()->findChild<QAction *>("actionEditCopyFieldName")); submenu->addAction(window()->findChild<QAction *>("actionEditCopyValue")); submenu->addSeparator(); submenu->addAction(window()->findChild<QAction *>("actionEditCopyAsFilter")); - subsubmenu = new QMenu(tr("Bytes")); - submenu->addMenu(subsubmenu); + + action = window()->findChild<QAction *>("actionBytes"); + subsubmenu = new QMenu(); + action->setMenu(subsubmenu); + submenu->addAction(action); subsubmenu->addSeparator(); // " <menu name= 'Bytes' action='/Copy/Bytes'>\n" // " <menuitem name='OffsetHexText' action='/Copy/Bytes/OffsetHexText'/>\n" @@ -225,12 +239,12 @@ ProtoTree::ProtoTree(QWidget *parent) : // " </menu>\n" // " </menu>\n" // " <menuitem name='ExportSelectedPacketBytes' action='/ExportSelectedPacketBytes'/>\n" - ctx_menu_.addSeparator(); +// ctx_menu_.addSeparator(); // " <menuitem name='WikiProtocolPage' action='/WikiProtocolPage'/>\n" // " <menuitem name='FilterFieldReference' action='/FilterFieldReference'/>\n" // " <menuitem name='ProtocolHelp' action='/ProtocolHelp'/>\n" // " <menuitem name='ProtocolPreferences' action='/ProtocolPreferences'/>\n" - ctx_menu_.addSeparator(); +// ctx_menu_.addSeparator(); decode_as_ = window()->findChild<QAction *>("actionAnalyzeDecodeAs"); ctx_menu_.addAction(decode_as_); // " <menuitem name='DisableProtocol' action='/DisableProtocol'/>\n" |