summaryrefslogtreecommitdiff
path: root/ui/qt/qt_ui_utils.h
AgeCommit message (Collapse)AuthorFilesLines
2016-09-29Qt: Add html_escape to qt_ui_utils.Gerald Combs1-0/+9
Add an html_escape convenience function, which escapes HTML metacharacters using Qt::escape on Qt4 and QString::toHtmlEscaped on Qt5. Use it where we were previously using #if QT_VERSION and calling the API-specific functions. Change-Id: Ifda3e9634a37fc00bdb46e08d5711f934692fef5 Reviewed-on: https://code.wireshark.org/review/17984 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-03-28Qt: Make conversation menu items static.Gerald Combs1-0/+9
Add a ConversationAction and ColorizeAction classes which respectively handle conversation filtering and colorization. Move conversation menu initialization to initConversationMenus and call it once at startup. This keeps us from leaking quite a bit of memory each time we select a packet or proto tree item. Bug: 12044 Change-Id: I32e8cedaba08a419d5da6a7a9db31c910909f450 Reviewed-on: https://code.wireshark.org/review/14516 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-11-06Make rect_on_screen Qt4-compatible.Gerald Combs1-1/+1
Use QDesktopWidget instead of QGuiApplication + QScreen. The former exists in the Qt 4 API. Ping-Bug: 11568 Change-Id: Icfbe9f78659b28efbc86061f94d946f70ab6dc41 Reviewed-on: https://code.wireshark.org/review/11604 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-11-05Qt: Check for a sane window geometry.Gerald Combs1-0/+9
On Windows (and probably X11) it's possible to set an offscreen window geometry. Add a rect_on_screen function to qt_ui_utils and use it as a sanity check in MainWindow::loadWindowGeometry. If this doesn't work well (e.g. if we end up with dueling Qt and GTK+ geometries) we might want to create separate Qt and GTK+ preferences. Bug: 11568 Change-Id: Icde1181671770356e87f07d584894ec3148e1bd2 Reviewed-on: https://code.wireshark.org/review/11584 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-13Qt: Recent list context menu.Gerald Combs1-0/+8
Add a context menu to the main window recent list. Add items that let the user open each file's containing folder and copy the file path to the clipboard. When opening the folder on Windows and OS X try to highlight the file in Explorer or the Finder. Change-Id: I991e8df8ba9f1f8c6385d1a861eb40223cfdd047 Reviewed-on: https://code.wireshark.org/review/10915 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
2015-08-12Add DCE-RPC and ONC-RPC service response time dialogs.Gerald Combs1-2/+10
Add RpcServiceResponseTimeDialog, which handles DCE-RPC and ONC-RPC service response time statistics. Try to make it as lightweight as possible, since we might want to pull this into the RPC dissectors similar to the other SRT statistics. Allow program names on the command line in place of numbers or UUIDs. Make matches case-insensitive. E.g. the following are equivalent: -z rpc,srt,100003,3 -z rpc,srt,nfs,3 -z rpc,srt,NFS,3 as are the following: -z dcerpc,srt,f5cc5a18-4264-101a-8c59-08002b2f8426,56 -z dcerpc,srt,nspi,56 -z dcerpc,srt,NSPI,56 Change-Id: Ie451c64bf6fbc776f27d81e3bc248435c5cbc9e4 Reviewed-on: https://code.wireshark.org/review/9981 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-06Use int_to_qstring in a few more places.Gerald Combs1-2/+2
Change-Id: Id324fe21f436a233088d106553db2ed6f6e410ac Reviewed-on: https://code.wireshark.org/review/9899 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-06Convert the GSM MAP stats to new "generic stat API".Gerald Combs1-0/+8
Convert both the MAP statistics and summary. As with the GSM A stats this are mostly untested. Change-Id: Ibd3a7346b09d1401e78724c0197ec2a38deb97a3 Reviewed-on: https://code.wireshark.org/review/9883 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-06Add proper base prefixes in display filter expressions.Gerald Combs1-0/+11
When the user selects an enum in the display filter expression dialog make sure we add the proper base prefix Add a Qt UI convenience routine for formatting integers. Because deprecating QString::sprintf was a well-thought-out decision that will be regarded highly for decades to come. Fix search visibility while we're here. Bug: 11421 Change-Id: I1368bc8f464983793bdc90760cf3b7c18b6bd859 Reviewed-on: https://code.wireshark.org/review/9885 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-23qt_ui_utils.h: fix empty paragraph passed to '@return' command [-Wdocumentation]Alexis La Goutte1-1/+0
Try 2... Change-Id: I2809a46a60732cdef26da9e847588dcfe39781ee Reviewed-on: https://code.wireshark.org/review/9590 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-16Add the RTP Stream Analysis dialog.Gerald Combs1-1/+2
Combine the GTK+ RTP Stream Analysis and RTP Graph Analysis dialogs into one. Yell at the user less. Disable the Analyze RTP Stream menu item if we don't have an RTP stream selected. There are a *lot* of moving parts in this dialog. I've tested with the few RTP captures I have but it's by no means complete. "To do" items are listed at the top of rtp_analysis.cpp. Change-Id: Id503977f069bebc46cc68bc749f0c9cbf4d37bf6 Reviewed-on: https://code.wireshark.org/review/9650 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-09qt_ui_utils.h: fix empty paragraph passed to '@return' command [-Wdocumentation]Alexis La Goutte1-1/+1
Change-Id: I120ed85ee88253084646db4817ae77a8c90492f2 Reviewed-on: https://code.wireshark.org/review/9557 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-07qt_ui_utils.h: fix @param command used in a comment that is not attached to ↵Alexis La Goutte1-1/+1
a function declaration [-Wdocumentation] Move class declaration on the top Change-Id: I4ced45f2c677a41cc8f5180d2eb5d211f4c6e6c1 Reviewed-on: https://code.wireshark.org/review/9518 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-03Add ServiceResponseTimeDialog.Gerald Combs1-0/+10
Add ServiceResponseTimeDialog as a subclass of TapParameterDialog, similar to StatsTreeDialog. Add initial plumbing for statistics menu items and command line invocation. Don't append "..." to menu item names. Don't add menu icons. In each case this avoids repetitive UI clutter. Change-Id: I463b95c93090160bb81d2e80b16aad389dc0bd6c Reviewed-on: https://code.wireshark.org/review/8864 Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-20qt_ui_utils: fix parameter 'glib_string' not found in the function declarationAlexis La Goutte1-1/+1
Only a small typo glib_string => glib_gstring Change-Id: Ia3ad0a8086f6c1a47065754dee33eff1e0ad770f Reviewed-on: https://code.wireshark.org/review/8988 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-08Add TapParameterDialog.Gerald Combs1-0/+9
Split StatsTreeDialog into StatsTreeDialog and TapParameterDialog (its base class). This more closely matches the GTK+ UI and paves the way for more statistics dialogs. Change-Id: I2630385534e829d99724673ade372fcb33200d07 Reviewed-on: https://code.wireshark.org/review/8842 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-06-03Add the Display Filter Expression dialog.Gerald Combs1-23/+9
Changes from the GTK+ UI: - The display filter is built on the fly with immediate syntax feedback. - Slightly different layout. - You can search for fields. Make the plain SyntaxLineEdit a bit more plain. Bug: 11128 Change-Id: I06a48cd7b9ba7b9dc193b0199540aede4eb62fa7 Reviewed-on: https://code.wireshark.org/review/8742 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-25Fix out of tree buildsGraham Bloice1-1/+1
Stop out of tree builds picking up the in-tree version and config.h Change-Id: Icadc46cab66db72af2d475eac31b28d0ca10df90 Reviewed-on: https://code.wireshark.org/review/8204 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-10ui uitls (Qt): fix parameter 'val' not found in the function declaration ↵Alexis La Goutte1-2/+2
[-Wdocumentation] Change-Id: I5fb1afca4b412697c56d80a8eb7be4140cd9420f Reviewed-on: https://code.wireshark.org/review/7612 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-05Qt: Show the full file path in the status bar.Gerald Combs1-4/+12
Add file_size_to_qstring and use it to show the file size. Add a "shrinkable" property to LabelStack. Make the info status shrinkable. Elide text so that long file paths don't widen the main window. Change-Id: Ieb1caaf7e016384609d41fcabaa63d8f7a293eff Bug: 10949 Reviewed-on: https://code.wireshark.org/review/7534 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-13Qt: More #include → forward declarations.Gerald Combs1-17/+14
Change-Id: Ib6de71f801cd3053374b6c867370acd594dcd396 Reviewed-on: https://code.wireshark.org/review/7089 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-04Qt: Add the Protocol Hierarchy statistics dialog.Gerald Combs1-0/+8
Change-Id: I6872e323daca4798c638d764873f54c4c0dc0006 Reviewed-on: https://code.wireshark.org/review/6934 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-04Decorate declarations with G_GNUC_PRINTF() as appropriate.Guy Harris1-2/+4
Decorate val_to_qstring() and val_ext_to_qstring() similarly to val_to_str_wmem(); this squelches some compiler warnings. Change-Id: I86e102e7c0a1a135be9492b7d605001c5d922031 Reviewed-on: https://code.wireshark.org/review/6940 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-03Convert val_to_str_ext -> val_to_str_ext_wmem for calls that don't have ↵Michael Mann1-0/+21
valid packet scope (GUI). val_to_str_ext now officially uses wmem_packet_scope(). Removed const from val_to_str[_ext]_wmem return value since it's not really constant. Created utility functions in qt_ui_utils.h to help with the new memory management for its GUI. Change-Id: Idf2ce4a4ce78d628b2269ad23a3a48fbfc9c077c Reviewed-on: https://code.wireshark.org/review/6926 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-29Qt: Add address conversion convenience routinesGerald Combs1-0/+22
Add address_to_qstring and address_to_display_qstring, which wrap address_to_string and address_to_display respectively and return QStrings. Convert most of the instances in ui/qt to the new routines. Fix a some memory leaks in the process. Change-Id: Icda80bbfe0b2df723d54c8da84355255f819af89 Reviewed-on: https://code.wireshark.org/review/6848 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-12-15Fix warning found by doxygenAlexis La Goutte1-1/+1
svn path=/trunk/; revision=54130
2013-10-30Add initial support for geometry settings in the main window.Gerald Combs1-2/+0
In the current Qt startup sequence the main window + splash screen is displayed before the main preferences are loaded which means we can't immediately apply the correct geometry. For now, use an animation to morph from the default to the saved geometry after the prefs are loaded. Get rid of main_do_quit() (Qt) and main_window_exit() (Qt+GTK). It looks like they were unused. Add wsApp->isInitialized() and use it to see if we should exit() when the main window is closed. Otherwise we won't shut the application down and clean up properly. svn path=/trunk/; revision=52988
2013-10-27Try to improve the appearance of the sequence diagram.Gerald Combs1-0/+9
Use integer coordinates for the arrows and text. Add smooth_font_size() to qt_ui_utils which will hopefully adjust the size on Windows to something more readable. svn path=/trunk/; revision=52906
2013-10-11Remove GTK+ and global cfile dependencies from file_dlg_win32.c.Gerald Combs1-2/+0
Move the declaration of set_last_open_dir() to ui/util.h. It still has separate GTK+ and Qt implemenations. We might want to move it to ui/util.c at some point. Remove a lot of unnecessary GTK+ includes. Remove most of the references to the global cfile while we're at it. svn path=/trunk/; revision=52542
2013-08-29Add support for Qt5 (tested with 5.1.1).Gerald Combs1-0/+1
svn path=/trunk/; revision=51580
2013-02-06Add Filter Expressions^WButton^WShortcut^WBookmark preferences. Gerald Combs1-1/+9
Add comments noting that - We might want to do something different when the bookmark button is pressed. - The display filters (dfilters file) and gui.filter_expressions preferences should be merged. - Many buttons on Qt4 + OS X + unifiedTitleAndToolBarOnMac makes the main window really wide. Add a qstring_strdup convenience routine. Add "disabled" display filter edit icons. Fix up whitespace and descriptions in a couple of places. svn path=/trunk/; revision=47522
2013-01-14When the user is editing text or selecting from a combo box, don'tGerald Combs1-0/+11
immediately close the dialog if he or she presses the escape or enter keys. Revert the value if the user presses escape. Properly handle the base for uint preferences. Fix a NULL pointer dereference. Add a gchar_free_to_qstring utility routine which creates a QString from a g_malloced string and frees it. svn path=/trunk/; revision=47083
2012-09-17Restore set_last_open_dir. We need it on Windows.Gerald Combs1-0/+1
svn path=/trunk/; revision=44957
2012-09-17Add a text import dialog. Use libui.Gerald Combs1-1/+0
svn path=/trunk/; revision=44956
2012-09-04Add modelines for Qtshark fileAlexis La Goutte1-0/+14
svn path=/trunk/; revision=44766
2012-08-31Fix compilation on Windows.Gerald Combs1-10/+10
The moc man page says "The moc does not expand #include or #define, it simply skips any preprocessor directives it encounters." This means our signals and slots have to exist everywhere, even if they're empty on some platforms. Remove some duplicate definitions. svn path=/trunk/; revision=44716
2012-08-17More welcome screen layout updates. Instantiate the welcome screenGerald Combs1-1/+0
automatically. Try to make the sparklines resolution independent. svn path=/trunk/; revision=44555
2012-07-12Use win32_open_file in qtshark on Windows.Gerald Combs1-0/+4
svn path=/trunk/; revision=43677
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-01-18Get rid of no-longer-applicable comments.Guy Harris1-8/+0
svn path=/trunk/; revision=40579
2012-01-18Get rid of some redeclarations, include "ui/recent_utils.h" to get thoseGuy Harris1-17/+0
declarations. svn path=/trunk/; revision=40578
2012-01-18Restructure the recent file code so that recent.c is GUI-independent;Guy Harris1-51/+0
move it to the top-level source directory for now, and move ui/gtk/recent.h to the ui directory. svn path=/trunk/; revision=40561
2012-01-15Move gtk to ui/gtk.Jörg Mayer1-1/+1
This looses the last checkin to gtk, will add this manually back. svn path=/trunk/; revision=40518
2012-01-04Add initial support for Qt along with a "ui" subdirectory.Gerald Combs1-0/+149
svn path=/trunk/; revision=40378