Commit Graph

70 Commits

Author SHA1 Message Date
Stig Bjørlykke 44a615e854 Qt: Give a directory to wsApp->setLastOpenDir()
Use wsApp->setLastOpenDirFromFilename() to convert a filename
to a directory name before calling wsApp->setLastOpenDir().

This will ensure to always store a directory instead of a filename
in the recent gui.fileopen_remembered_dir.
2021-06-07 13:52:59 +00:00
Gerald Combs d3f17ee08a Remove modelines in ui/qt.
Remove the editor modeline blocks from most of the source files in ui/qt
by running

    perl -i -p0e 's{ \n+ /[ *\n]+ editor \s+ modelines .* shiftwidth= .* \*/ \s+ } {\n}gsix' $( ag -g '\.(cpp|h)' )

then cleaning up the remaining files by hand.

This *shouldn't* affect anyone since

- All of the source files in ui/qt use 4 space indentation, which
  matches the default in our top-level .editorconfig

- The one notable editor that's likely to be used on these files and
  *doesn't* support EditorConfig (Qt Creator) defaults to 4 space
  indentation.
2021-03-08 18:11:32 +00:00
Roland Knall adb8feee6d Qt: Allow renaming personal profile
If a personal profile has the same name as a global profile (which
is usually the case if it has been copied without changing the name
afterwards), there was a bug where renaming the profile was no longer
possible.

Bug: 16423
Change-Id: Idafd216d007179a4c6221eafc2ff296d277d5b1d
Reviewed-on: https://code.wireshark.org/review/36902
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-04-30 11:19:41 +00:00
Stig Bjørlykke 2e2b537381 Qt: Keep profile selection when renamed
Keep the list selection when renaming a profile in the
Profiles dialog.

Bug: 15966
Change-Id: Ifda223b2286ef49ba46830954872e9303e27a089
Reviewed-on: https://code.wireshark.org/review/36322
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-03-08 11:51:58 +00:00
Tomasz Moń 04a86e99e4 Qt: Fix import profile from directory crash
Do not append separator to import directory path. Calling QFileInfo()
constructor with string ending in directory separator results in
creating QFileInfo instance for file with empty filename.

Bug: 16410
Change-Id: I4fe248fcdb0c0c67843652475ae58c2a473a9fa8
Reviewed-on: https://code.wireshark.org/review/36238
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-01 06:48:21 +00:00
Tomasz Moń c07a48b6d3 Qt: Fix profile zip import on Windows
Do not use QDir::separator() as a directory separator. QT internally
uses "/" as separator on all systems, including Windows. The zip files
were not unzipped into target directory because splitting path on
QDir::separator() in ProfileModel::cleanName() returned only one part
(there weren't any "\' in file name, only "/").

Qt documentation for QDir::separator() mentions:
  "You do not need to use this function to build file paths.
   If you always use "/", Qt will translate your paths to conform to
   the underlying operating system. If you want to display paths to
   the user using their operating system's separator use
   toNativeSeparators()."

Bug: 16410
Change-Id: I9627684f58f4c1da24b6eec8958a2542fe07d915
Reviewed-on: https://code.wireshark.org/review/36237
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-02-29 10:15:29 +00:00
Stig Bjørlykke a51c58fa1b Qt: Cleanup space inside parentheses
Remove randomly used space inside parentheses to make the coding
style uniform. Add space after if, for and while.

Change-Id: I519f5994b6f73d8a57a5004d51ca460276c618fe
Reviewed-on: https://code.wireshark.org/review/35112
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-17 20:43:10 +00:00
Roland Knall 97a19960a1 Qt: Allow deletion of personal system-profile
If a profile is being deleted, but a system profile with the same
name exists, the dialog cannot be closed

Change-Id: I2fbaa999617203816e21a8e4486abaf368b69919
Reviewed-on: https://code.wireshark.org/review/34331
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-20 14:31:09 +00:00
Roland Knall 4b00898a2a Qt: Prevent loop in renames of profiles
This prevents the case, where there are two profiles, and one is
renamed, after which the second one is renamed to the firsts original
name. This could lead to undefined behavior in the underlying data
structure.

Fixes an issue as well, where deleting the identical named duplicate
would delete the original one

Bug: 15975
Change-Id: Ia7112779f2c2ef926c3ea915852b6d7b4497f777
Reviewed-on: https://code.wireshark.org/review/34189
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-13 08:16:12 +00:00
Stig Bjørlykke 686ef87306 Qt: Always store lastdir on profile import
Always store the last used directory when doing profile import,
even if no profiles where imported. A new directory may have been
used and the user may have selected the wrong .zip file.

Change-Id: I7ed9de8b62fa7a57623ffb3e737186f072a82255
Reviewed-on: https://code.wireshark.org/review/34183
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-05 07:33:19 +00:00
Roland Knall a2b4586376 Qt: Guard no minizip build
Change-Id: Ib0e4f8343d4acbdde956e35ac37dcf6a2937421f
Reviewed-on: https://code.wireshark.org/review/34181
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-08-04 21:40:55 +00:00
Roland Knall 6c32251bd6 Qt: Fix minizip guards
Change-Id: I4df6bfe132e61fbc65e1f96044ae949eb08b9df6
Reviewed-on: https://code.wireshark.org/review/34170
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-03 09:54:29 +00:00
Roland Knall f259187803 Qt: Update UI for profiles and handle export/import properly
This patchset ensures a 1:1 replacement of the old 3.0 version of the profiles
dialog. It is a major bugfix for the new version in case of handling creating/
deleting and adding profiles.

Delete can be performed on multiple profiles now, by selecting the profiles
which need to be deleted.

Import/Export functionality has been overhauled to follow these rules:

* No imports while changes are pending, due to datamodel sanity
* Export for Default Profile and Global Profiles is not possible
* Either all personal profiles can be selected or individually choosen ones
* Use last directory and store it properly
* Imports can be cancelled
* Only one import is allowed at a time (but it can contain as many profiles as needed)

Change-Id: Ie2fccd397202ec06976d764734437284f464409a
Reviewed-on: https://code.wireshark.org/review/34123
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-02 21:38:02 +00:00
Stig Bjørlykke 5d0a2ccbb7 Qt: Change from User/System to Personal/Global profile types
Change the Profile types from User/System to Personal/Global in UI
to match the terminology used in About Wireshark -> Folders.

This reverts commit 40af4aa93e.
This reverts commit f0cde7ca34.
This reverts commit c37cabe900.

Change-Id: I9012db6385707754e26a2dadb57f6003f8112f9b
Reviewed-on: https://code.wireshark.org/review/34134
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-07-30 10:11:10 +00:00
Stig Bjørlykke b5c82c51bc Qt: Rename lblInfo to hintLabel
This label is called hintLabel in all other dialogs.

Change-Id: Ia17f29907c71a71f25ac20b3c617cc2d1a079814
Reviewed-on: https://code.wireshark.org/review/34117
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-29 12:09:28 +00:00
Stig Bjørlykke c37cabe900 Qt: Rename profile global to system
It's called system profiles in UI so update function names and
variables to use the same name. This will increase code readability.

Change-Id: I048e9ea85bd6ebab4a2c3ed1c685487ac8f7e40e
Reviewed-on: https://code.wireshark.org/review/34116
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-29 11:07:15 +00:00
Stig Bjørlykke a5d2c5e44c Qt: Improve profile dialog messages
Add correct numerus translation for exported profiles.
Use uniform capitalization in the profile type selection combo box.
Use horizontal ellipsis in "Search for profile …"

Change-Id: I2898685f01a119cac5543fcb9f1dd18ae8fc3e93
Reviewed-on: https://code.wireshark.org/review/34115
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-29 08:36:40 +00:00
Roland Knall 970524e329 Qt: Export profiles
Allow for the export of profiles. The currently selected profile may be
selected, as well as all user-defined profiles

Fixes: Bug, where invalid data has been written into the profiles not
present inside the original file

Change-Id: I7c6310920a1f3a064cfcedc7774b742ff01c9b9e
Reviewed-on: https://code.wireshark.org/review/34077
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-25 18:00:24 +00:00
Roland Knall faf520681a Qt: Various Profile UI Updates
Correct the text for delete and copy profiles, which better
display if they have been copied from a system-profile or
if the original entry has been deleted

Move Import button into the button box, as this seems
to be the consensus with applications and gives the info
label more room

Tooltips now behave the same way as they did before the
refactoring and copying from a new element creates the
correct names

Only one element could be deleted any given time, if the
default element was to be resetted

Change-Id: Ieb902b68627cb9bda5d2483b39de6479ff8d4533
Reviewed-on: https://code.wireshark.org/review/34070
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-25 06:49:47 +00:00
Roland Knall d86f3e5228 Qt: Profile Treeview updates now after importing profiles
The Treeview was not updated after a successful import.

Change-Id: I66d1873f75f1fca1ad1212130deb463a44253083
Reviewed-on: https://code.wireshark.org/review/34059
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-24 22:16:08 +00:00
Roland Knall a96d6c4cea Qt: Stop profile import when action pending
When a reset/delete/add/rename action is pending, profiles
cannot be imported.

Change-Id: I4521b8a265ec4346b7028bc5a7173fd531be24c2
Reviewed-on: https://code.wireshark.org/review/34057
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-22 15:58:35 +00:00
Roland Knall 91ed69488f Qt: Cleanup data() method and interface
Interface resembles the old interface

Change-Id: I7301f8bb6e00d30c20d7e5fdc9252a6a1765ff97
Reviewed-on: https://code.wireshark.org/review/34054
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-22 15:57:48 +00:00
Stig Bjørlykke 4257a8486d Qt: Improve profile import messages
Only show the message "No profiles found for import" when no profiles
actually found, not when found but all are skipped.

Add correct numerus translation for imported and skipped counts.

Change-Id: I0425aafb09fc4722cc765ae4f20ce8248b767c44
Reviewed-on: https://code.wireshark.org/review/34050
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-21 21:07:14 +00:00
Roland Knall 3a62b1bc75 Qt: Allow profile import from directory
To allow for easy import of profiles, one can select a directory
to import profiles from

Change-Id: I12f66e3dc6bd272d34baa76093152dce412b0158
Reviewed-on: https://code.wireshark.org/review/34038
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-21 16:41:13 +00:00
Roland Knall cdac470a60 Qt: Fix iconsize of info label
Fix the icon size of the info label

Change-Id: I46a156f567602f0e2da5a8697b798aa6b238483f
Reviewed-on: https://code.wireshark.org/review/34041
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-21 13:31:15 +00:00
Roland Knall e3dabc38b3 Qt: Improve profiles import UI
This also allows for profile zips to have a different structure,
and only directories containign actual configuration files will
be part of the import

- Choosen path sticks and starts with current application path
- "Default" can no longer be imported as a profile
- skipped profiles count is being displayed

Change-Id: I0549a1ae81229940e573674a84f2912119d6ee21
Reviewed-on: https://code.wireshark.org/review/34013
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-19 11:41:37 +00:00
Roland Knall 375ef27567 Qt: Profile Dialog UI fixed
Enter on dialog closes dialog only if filter textbox is not focused

Change-Id: I2d75c737ab2bd480f353340506be756edad5a9b9
Reviewed-on: https://code.wireshark.org/review/34010
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-18 21:52:19 +00:00
Stig Bjørlykke 7c7d8ee3d7 Qt: Profile import button shall not be small
Don't set attribute Qt::WA_MacSmallSize on the Profile import button.

Also fix a typo: occured -> occurred.

Change-Id: Id14001e71605bab97fe8ac3f14ecbc8242bdda17
Reviewed-on: https://code.wireshark.org/review/34008
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-18 21:30:33 +00:00
Roland Knall 2c7a35bc98 Qt: Fix various issues for profile manager
- Fixing the fact, that the profile did not allways switch to the active profile
when pressing the OK button.
- Adding a new profile can be repeated, if the name "New Profile" is already in
use, a number is incremented and added to subsequently new profiles.
- Copying a profile multiple times, creates individual names each time
- Global profiles should come last in the statusbar popup
- Global profiles should be called "System profiles"
- Fix null-pointer that could happen while querying "DATA_IS_SELECTED"
- Renaming an existing profile was not correctly indicated
- Renaming the currently selected profile works now

Change-Id: Ifa47fd672a6976c07d3e80741cfd61b548a5e1f8
Reviewed-on: https://code.wireshark.org/review/33921
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-18 05:45:29 +00:00
Roland Knall 390071ed0b Qt: Import Profile information
Allow easy import of profiles. Profiles must be stored inside
a zip file, with no additional hierarchy.

Change-Id: I0ae77460c20ef6b3e447906e671b0cefa6b9b032
Reviewed-on: https://code.wireshark.org/review/33881
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-17 18:25:11 +00:00
Roland Knall 5e59d50b46 Qt: Fix profile copy and delete
Delete lead to an issue with the sort model, where indeces where
no longer correctly associated with the source model.

Copy did not check if the name already existed in the dialog

Change-Id: I3668dffb1e1956f04a5b9e21c3fcdac266e0cc0c
Reviewed-on: https://code.wireshark.org/review/33911
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-12 13:23:56 +00:00
Roland Knall 4e7ac431a5 Qt: Move Profile Dialog to Model/View
Move the profile dialog to a model/view based concept. Display and
ordering works now, but nothing much else.

Add possibility to filter for profiles, as well as group filters.

Change-Id: I4740ad5aa10feeb31192f8131fb1204f5dca7232
Reviewed-on: https://code.wireshark.org/review/25141
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-11 04:49:02 +00:00
Gerald Combs 7b557088e9 Qt: Convert the rest of the preference dialog list buttons.
We no longer use the old icon names, so remove their aliases from
stock_icons.qrc.

Ping-Bug: 15511
Change-Id: If3c5e2b95825207a401e12607fcb94cdcc8a51c8
Reviewed-on: https://code.wireshark.org/review/33689
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-21 23:51:49 +00:00
Stig Bjørlykke 54417ed16a Qt: Info label fixes in the Profile dialog
When copying from another profile which has been renamed:
show the new profile name in the info label "Created from".

When copying from another profile which is later deleted:
append "(deleted)" to the info label to indicate that the origin
profile is not in the list.

Do not show "Renamed from" when a profile name if renamed back to
it's original name.

Change-Id: I0bf0c868c5dfd150a23b2ef887e7c70030b48d05
Reviewed-on: https://code.wireshark.org/review/32201
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-02-26 22:02:11 +00:00
Peter Wu 064c09a293 Qt: fix memleak of profile name on copying a profile
add_to_profile_list (via add_profile_entry) clones the name and does not
own it, so free it afterwards. Found by Clang Static Analyzer.

Change-Id: I340c91b65d97b24a52812fd6f4b85933cfb15f89
Reviewed-on: https://code.wireshark.org/review/27343
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-05-09 18:41:28 +00:00
Stig Bjørlykke 14720ace06 Fix comment end after SPDX identifier
Move */ to a separate line below the SPDX identifier.

Change-Id: Id1032215449cfccae0933147b45e04b65e0b727f
Reviewed-on: https://code.wireshark.org/review/27211
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01 06:56:37 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Dario Lombardo e52172c775 Qt: use SPDX identifiers.
Change-Id: I111945c08f99818c249a868c12d9a7b3a3df64b3
Reviewed-on: https://code.wireshark.org/review/25563
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-02 13:39:36 +00:00
Stig Bjørlykke 55e74ba841 Qt: Write recent before applying profile changes
The selected profile may be renamed in apply_profile_changes()
so write the recent file before renaming the directory to ensure that
we reload the latest changes.

Change-Id: I8988a00647926d93b0a1903090aadc8c61f1a34e
Reviewed-on: https://code.wireshark.org/review/25516
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-31 04:53:39 +00:00
Guy Harris 3a93855b05 Make apply_profile_changes() return a non-const pointer.
It returns a pointer to a g_mallocated string, which the caller has to
free, so its return value shouldn't be a const pointer.

Change-Id: I76f288379a5c1eff580c391bdc9019ab7fe8f336
Reviewed-on: https://code.wireshark.org/review/25364
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-18 07:33:42 +00:00
Roland Knall ddfc1d37cc Qt: Move utils to separate utils directory
Following the move for widgets directory, moving utils
to the utils directory. Guidelines for this directory are:

 - Generic use but not a widget
 - Utility functionality used by many classes
 
 Note: additionally all includes affected by this move have been changed
 to absolute path includes, instead of relative ones.

Change-Id: I019ae4b6e6f6d06a5745a63ed195edbd36fb936b
Reviewed-on: https://code.wireshark.org/review/22602
Petri-Dish: Roland Knall <rknall@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-26 10:11:55 +00:00
Guy Harris 357cfd3b03 A bunch of "{Mac} OS X" -> "macOS" changes.
Avoid anachronisms, however; there was no "macOS 10.0" or even "OS X
10.0", for example.  It was "Mac OS X" until 10.8 (although 10.7 was
sometimes called "OS X" and sometimes called "Mac OS X"), and it was "OS
X" from 10.8 to 10.11.

Change-Id: Ie4a848997dcc6c45c2245c1fb84ec526032375c3
Reviewed-on: https://code.wireshark.org/review/20933
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-05 19:16:22 +00:00
Michael Mann 897c750127 Clean up some memory leaks in wsutil/filesystem.c
The fixes involve functions always returning a string that needs to be
freed by the caller.  That way the static string pointers within the functions
don't end up leaking at program end.

Change-Id: I35a8dc37536c2927d88f33217887f62efafcc8ca
Reviewed-on: https://code.wireshark.org/review/20175
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-02-19 01:27:14 +00:00
Stig Bjørlykke 78ce70e908 Qt: Indicate profile created from system provided
Indicate when a profile is created from a system provided profile.

Change-Id: Iaabe5a2dbf17c7baa14e888dfab5f2aeadaedb67
Reviewed-on: https://code.wireshark.org/review/20107
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>
2017-02-15 07:05:41 +00:00
Stig Bjørlykke c01cdd4e47 Qt: Reset Default profile support
Add support for resetting the Default profile by deleting it in
the Profile Dialog.  All profile files will be deleted and all
other files will be kept.

Change-Id: I795a6db3ee7b2c29e7aba461183e6cc411798b75
Reviewed-on: https://code.wireshark.org/review/20097
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>
2017-02-14 18:15:12 +00:00
Stig Bjørlykke 64984b7a59 Qt: Add check for valid profile name
Add check for a valid profile name in the Profile dialog and disable
the Ok button and mark the invalid profile if error.

The GTK dialog does not close on errors but the Qt dialog does, so
ensure the user is informed beforehand.

Change-Id: If31ffe75183066cf49e2b5a082112bfe62d6c06e
Reviewed-on: https://code.wireshark.org/review/19995
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>
2017-02-08 09:07:17 +00:00
Roland Knall 3df81a0550 Qt: Remove unneccessary Q_DECLARE_METATYPE
Remove unnecessary Q_DECLARE_METATYPE macros and replace calls
to QVariant conversions with VariantPointer where necessary

Change-Id: Ia4690590095f930bf94644197de7fa30b00ee7ec
Reviewed-on: https://code.wireshark.org/review/19611
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-01-12 16:04:00 +00:00
Stig Bjørlykke 1a716800e3 Qt: Add dialog geometry restore
Add GeometryStateDialog class to handle load and save dialog geometry.
The QDialog class name will be used as window name.  For shared
classes the UAT name or the statistics title or abbr will be used.

Change-Id: I5a019598307fb3861518f41e733de834788184d8
Reviewed-on: https://code.wireshark.org/review/14139
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-28 18:25:50 +00:00
Stig Bjørlykke 3cc9db57df Qt: No path for created and renamed profiles
The path is not valid for created and renamed profiles because the
directory is not created yet.  Use this label as a info label to
describe where the profile is created from or renamed from instead.

Use correct path for the Default profile.
Removed Bold from the current profile in status bar list.
Added tooltip for system provided profiles.

Change-Id: I61c8b1cc811dd9f9419ff9e373a8d00aa4e30446
Ping-Bug: 11704
Reviewed-on: https://code.wireshark.org/review/12447
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-06 12:33:43 +00:00
Stig Bjørlykke 35e5523dd2 Qt: Improved profiles popup menu
* Don’t add a global profile if having a personal copy.
* Fetch profiles from _current_ profiles list.
* Separate personal and global profiles.
* Use bold and checked for the the current profile.

* Fixed selection of the current profile in the manage profiles dialog.
* Aligned GTK version with Qt version, removed the “New from Global” sub menu.

Change-Id: I2326b39f7d04411000b3c014e3775284392c48c7
Ping-Bug: 11704
Reviewed-on: https://code.wireshark.org/review/12034
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-23 05:45:34 +00:00