ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-bugs: [Wireshark-bugs] [Bug 7222] Saving a file may discard comments

Date: Wed, 20 Jun 2012 16:45:24 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7222

--- Comment #21 from Guy Harris <guy@xxxxxxxxxxxx> 2012-06-20 16:45:24 PDT ---
...but it's not fixed in the Windows version, and that's a bit painful to do. 
The "use the Windows file dialog" hack we're using does *not* make that code
easy to modify, especially as the "Save As" logic becomes more complicated now
that Wireshark can edit capture files (by adding, changing, and removing
comments).

We'll probably have to duplicate much of that logic in the Win32 code;
unfortunately, I didn't find anything obvious in the Windows documentation on
msdn.microsoft.com that says how to make a message dialog with arbitrary labels
in the buttons, as many of their own examples in the UI guidelines:

    http://msdn.microsoft.com/en-us/library/aa511268#commitButtons

show.  Unfortunately, "Yes" and "No" aren't exactly appropriate button labels
when offered a choice between "discard comments and save in format X" vs.
"choose another format that supports comments"....

Qt, at least, supports arbitrary button labels:

    https://qt-project.org/doc/qt-4.8/qmessagebox.html#addButton-2

as does wxWidgets 2.9.x (and therefore 3.0, if, as, and when it ever arrives,
will do so):

    http://docs.wxwidgets.org/trunk/classwx_message_dialog.html
   
http://docs.wxwidgets.org/trunk/classwx_message_dialog_1_1_button_label.html

although the "Since: 2.9.0" suggests that they're only *now* getting around to
it.

As I remember, one reason we're using the native file open/save dialogs on
Windows is that they properly handle Windows "shortcuts" (think "userland
symlinks").  I don't see anything in GTK+ 2.24's file chooser to handle them,
but Sylpheed appears to have done their own code for that:

   
http://sylpheed.sraoss.jp/redmine/projects/sylpheed/repository/revisions/3088/diff/src/filesel.c

Another reason might be to make it a little more comfortable for Windows users;
I'm not sure what other reasons we had.

If putting in something similar to what Sylpheed does fixes the shortcut
problem, and if there aren't any other serious problems with going back to the
GTK+ file chooser on Windows, perhaps we should do so; that'd fix bug 1364
("Other Wireshark windows don't redraw if Open File or Save File dialog is
open"), for example.

I'll play with the Sylpheed stuff a bit on my Windows VM.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.