forked from osmocom/wireshark
146 lines
5.8 KiB
Text
146 lines
5.8 KiB
Text
0. Abstract
|
|
|
|
Wireshark's user interface is showing its age. While GTK+ is wonderful on
|
|
Linux and BSD its low-tier status on Windows and even-lower-tier status on OS
|
|
X makes it hard to deliver a good product to users on those platforms.
|
|
|
|
The Qt port is an attempt at an updated UI which will better serve our users
|
|
and let us add features more easily.
|
|
|
|
|
|
1. Getting up and running
|
|
|
|
The Qt interface for Wireshark has been compiled and tested on Mac OS X 10.6
|
|
(XCode gcc), Windows 7 x86 (Visual C++ 2010), and Ubuntu 10.04 (gcc).
|
|
Compilation via Qt Creator has been tested but command-line compilation using
|
|
QMake and make or nmake should work.
|
|
|
|
There are several ways of building qtshark:
|
|
|
|
1) Using qtcreator:
|
|
|
|
The ui/qt directory is loosely coupled with the rest of the codebase.
|
|
The main Wireshark sources must be built beforehand using CMake on Linux
|
|
and OS X and nmake on Windows. Autotools + QMake is a basket full of
|
|
crazy that hasn't yet been sorted and folded. (Autotools + Boring Old
|
|
Make, without using QMake at all, might actually be simpler:
|
|
|
|
http://www.mail-archive.com/automake@gnu.org/msg11149.html
|
|
|
|
2) Using cmake:
|
|
set BUILD_qtshark to ON (default: OFF) in CmakeOptions.txt (may be set
|
|
in parallel with BUILD_wireshark).
|
|
Do the normal out-of-tree or in-tree build.
|
|
This has only been tested on a current openSUSE Linux system with fairly
|
|
current QT and cmake. It may be necessary to copy the FindQt4.cmake and
|
|
supporting files from cmake to Wireshark's cmake/modules/
|
|
If using cmake installing qtcreator is not required. Basically almost
|
|
all stuff below can be ignored ;-)
|
|
|
|
Work is in progress on this.)
|
|
|
|
1.1 Prerequisites
|
|
|
|
Before compiling you need the Qt SDK and Qt Creator.
|
|
|
|
1.1.1 OS X
|
|
|
|
Download the latest Qt SDK (currently 1.1.4) from
|
|
http://qt.nokia.com/downloads/ and install it. Build the top-level
|
|
directory using CMake.
|
|
|
|
1.1.2 Windows
|
|
|
|
The default Qt SDK libraries are built using MinGW, which isn't supported
|
|
for Wireshark. Instead of downloading the Qt SDK all-in-one package,
|
|
download the Qt Libraries package from http://qt.nokia.com/downloads/ that
|
|
matches your compiler (VS 2008 or VS 2010) and Qt Creator for Windows.
|
|
|
|
Settings in config.nmake are passed to the Qt environment via
|
|
ui/qt/config.pri. This file should be created automatically when you
|
|
compile Wireshark in the top-level source directory. You can create it by
|
|
hand by running "nmake -f Makefile.nmake ui\qt\config.pri".
|
|
|
|
Qt Creator can be used to compile and run Wireshark. Alternatively qmake
|
|
and nmake at the cmd line can be used.
|
|
|
|
The Windows Qt version of Wireshark will be compiled and linked with
|
|
essentially the same options as that used when building the Gtk version of
|
|
Wireshark.
|
|
|
|
1.1.2.1 Qt Creator
|
|
|
|
Before compiling in Qt Creator select "Projects" in the left toolbar,
|
|
select "Build Settings" and do the following:
|
|
|
|
- In "Edit build configuration" make sure the "Release" build is selected.
|
|
(The "Debug" build won't work unless Wireshark is recompiled to link with a "debug"
|
|
the "debug" C runtime library (using /MDd). See ui\qt\QtShark.pro for details).
|
|
|
|
- Make sure "Qt version" matches your version of Visual Studio.
|
|
- Make sure "Tool chain" matches your Visual C++ version.
|
|
|
|
If you require plugin support select "Run Settings" and add
|
|
"WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1" to the Run Environment.
|
|
|
|
XXX: (WMeier): I've not had too much satisfaction using the "native Windows debugger" (CDB ?)
|
|
accessed via Qt Creator. (In fact, a web search turns up some fairly negative comments
|
|
about the debugger. I've successfully (and pretty easily) been able to use the
|
|
Visual Studio debugger; See below under "Command Line".
|
|
ToDo: Investigate "Qt Visual Studio AddIn":
|
|
http://developer.qt.nokia.com/wiki/QtVSAddin#6112edd2e39a1695c242723d5c764aae
|
|
|
|
1.1.2.2 Command Line
|
|
|
|
- Setup environment:
|
|
c:\qt\4.8.0\bin\qtvars.bat [vsvars] ;;; optional 'vsvars' to also setup VC env vars
|
|
|
|
- [Create and] Switch to a working dir to be used for .obj files, etc for Wireshark-qt compilation
|
|
|
|
- Use qmake to create Windows Makefile (based upon info in ui\qt\QtShark.pro and config.pri)
|
|
qmake -o Makefile.nmake ...\ui\qt\QtShark.pro
|
|
;; (Only needs to be run once;
|
|
;; nmake -f Makefile.nmake will redo qmake if any
|
|
;; dependendencies (e.g., QtShark.pro) change.
|
|
|
|
- Compile & Build
|
|
nmake -f Makefile.nmake ;; Wireshark.exe + all DLL's will be in <working-dir>\wireshark-qt
|
|
- Run:
|
|
<working-dir>\wireshark
|
|
|
|
- Debug (with Visual Studio debugger)
|
|
Start Visual Studio;
|
|
File ! Open ! Project/Solution ! .../<working-dir>/wireshark-qt/wireshark.exe
|
|
(Using Solution Explorer ! Properties ! Environment to
|
|
add PATH=C:\Qt\4.8.0\bin;%PATH% will pobably be required).
|
|
... Debug in the usual manner
|
|
|
|
|
|
1.1.3 Linux
|
|
|
|
Install the Qt libraries and Qt Creator via your package manager or from
|
|
http://qt.nokia.com/downloads/. On Debian and Ubuntu the "qt-sdk" meta-package
|
|
should provide everything you need. Build the top-level directory using CMake
|
|
(see section "Using cmake" above).
|
|
As an alternative do an in-tree build without QT and then inside ui/qt/ do
|
|
"qtcreate QtShark.pro".
|
|
|
|
|
|
2. Going forward
|
|
|
|
DO NOT simply port things over. Every feature, window, and element should be
|
|
re-thought. For example, should the user have to navigate two dialogs to get
|
|
HTTP request statistics?
|
|
|
|
3. Translations (i18n)
|
|
For make your own translation of QtShark ! it is easy !
|
|
|
|
- Add your translation (qtshark_XX.ts) in QtShark.pro and i18n.qrc
|
|
- Launch "lupdate QtShark.pro" to generate/update your translation file
|
|
- Translate with Qt Linguist
|
|
- Launch "lrelease QtShark.pro" to create/update qtshark_xx.qm file
|
|
- Attach your modification ("svn diff") in Wireshark Bug Tracker
|
|
|
|
More information about Qt Linguist
|
|
http://qt-project.org/doc/qt-4.8/linguist-manual.html
|