summaryrefslogtreecommitdiff
path: root/ui/qt/preference_editor_frame.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-04-17Qt: Provide both file save and open preferencesAhmad Fatoum1-1/+1
This is a breaking change. prefs_register_filename_preference hasn't been differentiating between files to be saved and ones to be opened. On GTK, a neutral dialog is used, so no problems there. On Qt, a save dialog has been always used, even in dissectors that were reading configuration files without modification. prefs_register_filename_preference now takes an argument to indicate whether UI could be a save dialog with a warning on overwriting a file, or whether it's a general purpose open file dialog. Qt now does this. Previously no warning was shown on overwriting a file, so it may be used for opening files too without irritating the user. This has been changed, as non-destructive reads should now use the open dialog. Dissectors were changed accordingly. Change-Id: I9087fefa5ee7ca58de0775d4fe2c0fdcfa3a3018 Reviewed-on: https://code.wireshark.org/review/21086 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-01-27Qt: Preference editor improvements.Stig Bjørlykke1-9/+4
Use correct disconnect() signature to ensure everything is disconnected before connecting new signals. Without this all previous connects() are still active. This leads to gradually more and more syntax checks being called for each change, and possibility of a wrong syntax check (especially for strings which has no syntax check). Use the textEdited() signal to trigger a syntax check at startup. This gives consistency. Do not clear preferenceLineEdit when done because it looks weird when the preference text disappears while the widget is hiding. The entry is cleared before next show anyway. Change-Id: I21c6fd8ec6bb0ecff1b2c0b66fe97dc3eaecf9b3 Reviewed-on: https://code.wireshark.org/review/19788 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-25Qt: Use preference editor for port number entriesStig Bjørlykke1-0/+4
After converting port preferences to use Decode As entries the preference editor was no longer used when changing port number pereferences from the Packet Details popup menu. Change-Id: Ifeff3b88bfd96a122b6a58d8917304eb69cf0c38 Reviewed-on: https://code.wireshark.org/review/19781 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-01-22Internalize struct preferenceMichael Mann1-20/+13
Move "struct preference" into prefs.c, essentially creating a "private" structure to handle preferences. The 2 motivating factors were: 1. Better memory management so that clients/users of API don't have to worry about it. 2. Hide the ugliness of the union stuff and make it transparent to the API. A few bugs related to preference <-> Decode As integration were fixed while in the neighborhood. Change-Id: I509b9a236235d066b139c98222b701475e0ed365 Reviewed-on: https://code.wireshark.org/review/19578 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-07Refactor range preference.Michael Mann1-6/+2
Refactored so that all handling of ranges in struct preference can be internal to prefs.c Change-Id: I68577909f9c07b23a16ab3443a523355d4645314 Reviewed-on: https://code.wireshark.org/review/19577 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-07Convert range API to always use wmem memory.Michael Mann1-7/+7
This is mostly to address memory leaks in range preferences (the biggest user of range functionality) on shutdown. Now range preferences must use epan scoped memory when referencing internal preference structures to keep consistency. Change-Id: Idc644f59b5b42fa1d46891542b53ff13ea754157 Reviewed-on: https://code.wireshark.org/review/19387 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-1/+16
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-29Qt: Add html_escape to qt_ui_utils.Gerald Combs1-11/+1
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-02-25Qt: Use UTF8_HORIZONTAL_ELLIPSIS for …Stig Bjørlykke1-1/+2
Bug: 12172 Change-Id: Icbb3011ff18fc53c3e77c62692ed977178d1aace Reviewed-on: https://code.wireshark.org/review/14138 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-19Qt: Fix Open protocol preferences button.Stig Bjørlykke1-1/+1
Do showProtocolPreferences before removing the variable which this depends on. The button does not work without at module. Change-Id: I7d31aa5ab19340a4102523b13de961e799cae5e4 Reviewed-on: https://code.wireshark.org/review/14015 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-19Qt: Update AccordionFrame widgets to use common layoutStig Bjørlykke1-2/+8
- Use QPushButton for buttons and set the "Find" button as default in SearchFrame. - Use QPushButton for buttons, added a "Packet:" label, and set the "Go to packet" button as default in GoToFrame. - Set Qt::WA_MacSmallSize in OS X for FilterExpressionFrame and PreferenceEditorFrame. - Removed QFrame::StyledPanel and QFrame::Raised from ColumnEditorFrame. - Update ui files to reflect that AccordionFrame is used for AddressEditorFrame, FilterExpressionFrame and PreferenceEditorFrame. Change-Id: Icfbfff973535317997109a1020dfe24ba932e098 Reviewed-on: https://code.wireshark.org/review/13995 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-01Qt Frames: Use ButtonBox instead of buttonsRoland Knall1-8/+10
In these frames the Ok and Close buttons are implemented as standalone buttons. This leads to the scenario, that they break plattform-ui preferences on the one hand, as well as not being the same order throughout. This patch replaces all Ok/Close buttons with the Qt button box, which handles the plattform-ui internally, and additionally allways enforces the same order. Change-Id: If62b90016b222322f60c0962da04c8277589a57f Reviewed-on: https://code.wireshark.org/review/12335 Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-11-27qt: add initializers (CID 1311487)Dario Lombardo1-0/+2
Change-Id: I3152548aa3237dc76e898986120f662cbe56fa38 Reviewed-on: https://code.wireshark.org/review/12188 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> 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-09-05Qt: fix applying UINT preferences in base 8 or 16Pascal Quantin1-2/+10
While we are at it: - fix a crash when clicking on the cancel button from the preference modification context menu - redissect the packet list when modifying a preference from the context menu Bug: 11502 Change-Id: I7269f7093f1f38c46ec7744fd619ab67f31eb4e7 Reviewed-on: https://code.wireshark.org/review/10386 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-25Qt: use <> for including the generated ui_*.h filesMartin Kaiser1-1/+1
this should make Visual Studio pick up the generated include files from the build directory instead of the source directory (which may contain lefovers from an in-tree build) Change-Id: Ie3de4cdd85a2865e203118a42ab10f443372f03b Reviewed-on: https://code.wireshark.org/review/9129 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-18Add a preferences editor frame.Gerald Combs1-0/+241
This replaces the single preference editor dialog in the GTK+ UI. Change-Id: I10e030981e9f7d1ec121811593586b65cf0797c5 Reviewed-on: https://code.wireshark.org/review/8966 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>