aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/qt_ui_utils.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-03-28Qt: Make conversation menu items static.Gerald Combs1-2/+7
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>
2016-01-22Fix warnings for qt_ui_utils.cpp [-Wcast-qual]João Valverde1-4/+4
Change-Id: Ie1d2779d9eaf59c2f440efa096f6707375f11c6f Reviewed-on: https://code.wireshark.org/review/13443 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-11-06Make rect_on_screen Qt4-compatible.Gerald Combs1-4/+5
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/+12
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-13Handle quotes in "Show in Finder".Gerald Combs1-2/+3
Change-Id: I422e4679c86d23363a604e54ef2f91b1ad5b948c Reviewed-on: https://code.wireshark.org/review/10981 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-13Qt: Recent list context menu.Gerald Combs1-0/+37
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-0/+6
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-1/+1
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/+22
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-16Add the RTP Stream Analysis dialog.Gerald Combs1-2/+4
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-03Add ServiceResponseTimeDialog.Gerald Combs1-0/+5
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-08Add TapParameterDialog.Gerald Combs1-0/+7
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-0/+12
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-03-06Qt: Fix a couple of resource leaks found by Coverity.Gerald Combs1-2/+2
Change-Id: Ic3156d8afc2fa237407f3893c34672b1306866fa Reviewed-on: https://code.wireshark.org/review/7420 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-03-05Qt: Show the full file path in the status bar.Gerald Combs1-2/+8
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-4/+6
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/+6
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-03Convert val_to_str_ext -> val_to_str_ext_wmem for calls that don't have ↵Michael Mann1-0/+20
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-1/+25
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-08-09Qt: Fix when build with Qt < 4.8.0Alexis La Goutte1-0/+4
StyleName is not available in Qt < 4.8 Change-Id: Icbfcef7c62b124ce67f1a02ed928a96233ae2d9d Reviewed-on: https://code.wireshark.org/review/3508 Reviewed-by: Christopher Maynard <Christopher.Maynard@gtech.com>
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-10-28More size and position tweaks.Gerald Combs1-4/+7
svn path=/trunk/; revision=52913
2013-10-27Try to improve the appearance of the sequence diagram.Gerald Combs1-0/+15
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-02-06Add Filter Expressions^WButton^WShortcut^WBookmark preferences. Gerald Combs1-0/+6
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-02-02Move the GUI-independent window geometry stuff to ui/recent.c, so weGuy Harris1-128/+0
only have one copy. svn path=/trunk/; revision=47440
2013-01-18Rename the "saved_val" preference element to "stashed_val" in order toGerald Combs1-0/+5
more clearly indicate that it's a copy of a preference value rather than something we've saved in the preferences file. Update prefs_pref_to_str() to handle default, stashed, and current prefs. Create ui/preference_utils.[ch] and move some common routines there. Use prefs_pref_type_name() in the GTK+ preferences dialog. Make the "OK" button in the Qt preferences dialog work. We simply write the prefs and redissect on "OK" and do nothing on "Cancel". This is intentionally different from the Apply/OK/Cancel behavior in the GTK+ version. Add a general "emitAppSignal" method to wsApp and use it for packet dissection and preference changes. Suggest that we might want to create a WsString class to make conversion between QStrings, gchar *s, and GStrings easier. svn path=/trunk/; revision=47139
2013-01-14When the user is editing text or selecting from a combo box, don'tGerald Combs1-0/+6
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-10-19The file set and export object trees are lists. Make them act likeGerald Combs1-2/+9
it. Show human-readable sizes in the file set dialog. Move the format_size_flags_e operator to qt_ui_utils.cpp for lack of a better place. svn path=/trunk/; revision=45661
2012-09-04Add modelines for Qtshark fileAlexis La Goutte1-0/+13
svn path=/trunk/; revision=44766
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-18Reflect the changes to make the recent-file code GUI-independent.Guy Harris1-3/+4
svn path=/trunk/; revision=40563
2012-01-15Move gtk to ui/gtk.Jörg Mayer1-2/+2
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/+157
svn path=/trunk/; revision=40378