Commit Graph

2 Commits

Author SHA1 Message Date
Guy Harris 19f7e572a4 Work around macOS running applications in /.
If an application is launched from the Finder, it appears to get / as
its current directory.  This causes Wireshark open/save dialogs to open
up / if the user hasn't already opened a file in another directory, so
that there's no "last open directory" in the recent file.

Have get_persdatafile_dir(), on UN*X, cache the personal data directory
just as it does on Windows and, if nothing's been cached, have it fetch
the current directory and, if that succeeds *and* it's not the root
directory, use that.  Otherwise, use the user's home directory.

Fixes #9862.

In addition, separate the notion of "last open directory" and "open
dialog initial directory", where the latter is the last open directory
*if* a file has been opened in this session or the recent file has the
last open directory from a previous session, otherwise it's the user's
personal data directory.

Use the latter notion in file open/save dialogs; use the former notion
when reading from and writing to the recent file.

This means we don't need to set the "last open directory" at startup
time.  That way, running Wireshark without opening a file won't cause
the "last open directory" to be set, so that if a user runs it from a
directory, the "open dialog initial directory" won't be the last
directory from which Wireshark was run.
2023-11-12 06:53:36 +00:00
Gerald Combs dee60892fc Qt: Rename the Browser SSL Keylog dialog to SSL Keylog Launcher
We can launch more than browsers.
2023-10-31 09:51:02 +00:00