aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/capture_file_dlg.c
AgeCommit message (Collapse)AuthorFilesLines
2017-01-21Qt: Show merge progress.Gerald Combs1-3/+3
Add "file merge" callback plumbing. Use it to display "Merging files" in the main statusbar. Make sure we have a usable window pointer when we merge files. Change-Id: I236b6edb30685f0b06703ab8304bc88ae592f83c Reviewed-on: https://code.wireshark.org/review/19716 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: Anders Broman <a.broman58@gmail.com>
2016-12-04Have separate merge APIs for regular file/temporary file/standard output.Guy Harris1-4/+3
This is similar to what we have for opening a dump file - one API that uses the file name as specified, one that creates a temporary file and provides the file name, and one that uses the standard output. All of those APIs handle closing the output file. Change-Id: I56beea7be347402773460b9148ab31a8f8bc51e1 Reviewed-on: https://code.wireshark.org/review/19059 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-09Remove name resolution from the file dialogs.Gerald Combs1-71/+19
A single name resolution checkbox was added to the file dialog way back in 2000 in g0f7cf64. At that time it was needed because resolution was synchronous and could drastically affect your load time. Since then we've added asynchronous name resolution and more recently made it mandatory (ge005bc8). We've also added more name resolution checkboxes and other controls. Remove the name resolution checkboxes. You can just as easily change resolution options before or after opening a file and they take up valuable real estate. Combine the size and packets in the Qt and Win32 dialogs and pretty-print the size. Combine the start and elapsed times in the Qt, Win32, and GTK+ dialogs. This lets us shrink the custom areas of the file dialogs even further. Make the default file type combo item more descriptive. Change-Id: Id770adc0f284a4c7f08ee5a7db84f8435f4bf907 Reviewed-on: https://code.wireshark.org/review/17597 Tested-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-06-22Don't close Wireshark (GTK) if user cancels Save on Close.Michael Mann1-13/+18
Bug: 9635 Change-Id: I4a6e3ca676f1c1096521c0a8147a1459777c92fa Reviewed-on: https://code.wireshark.org/review/16075 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-03Accept any users choice on file close CID-703318Jaap Keuter1-1/+1
Whatever do_file_close returns is oke, so explicitly ignore it. Change-Id: Ie241cd204361e10e91bda747530d399ad8587be1 Reviewed-on: https://code.wireshark.org/review/14294 Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-by: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-01No need for toolkit-dependent color initialization.Guy Harris1-1/+1
We're not allocating colors ourselves in GTK+ (and haven't been doing so since at least 1.12), and all color_t values are valid colors, so we don't need any toolkit-specific processing to fill in a color_t. While we're at it, catch read errors when reading color filter files. Change-Id: Ieb520d141cf15e371a31a01459d466c95ba2209b Reviewed-on: https://code.wireshark.org/review/12985 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-28Refactor GUI dependencies out of color_filters.[ch] and move it to epan ↵Michael Mann1-5/+10
directory. This also moved color.h into color_filters.h Change-Id: Ic19e27aa1b3ec67e764aa7ee8bbef7b1187bb12e Reviewed-on: https://code.wireshark.org/review/12831 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-17Qt: Fix a merge crash.Gerald Combs1-1/+1
Update the logic in ui/qt/main_window.cpp:mergeCaptureFile to match ui/gtk/capture_file_dlg.c:file_merge_cmd. This ensures that we don't try to use a stale (and freed) read filter. Call cf_set_rfcode in both. Bug: 11718 Change-Id: I6da65e428bff39e907f45992bac7337880c02ce9 Reviewed-on: https://code.wireshark.org/review/11895 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-07Clean up includes of unistd.h, fcntl.h, and sys/stat.h.Guy Harris1-4/+0
Have wsutil/file_util.h include them on UN*X, just as it includes io.h on Windows, so we can have a rule of "if you do file operations, include <wsutil/file_util.h> and use the routines in it". Remove includes of unistd.h, fcntl.h, and sys/stat.h that aren't necessary (whether because of the addition of them to wsutil/file_util.h or because they weren't needed in the first place). Change-Id: Ie241dd74deff284e39a5f690a297dbb6e1dc485f Reviewed-on: https://code.wireshark.org/review/11619 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18Clean up ftype-conversion and dfilter error message string handling.Guy Harris1-4/+8
Have dfilter_compile() take an additional gchar ** argument, pointing to a gchar * item that, on error, gets set to point to a g_malloc()ed error string. That removes one bit of global state from the display filter parser, and doesn't impose a fixed limit on the error message strings. Have fvalue_from_string() and fvalue_from_unparsed() take a gchar ** argument, pointer to a gchar * item, rather than an error-reporting function, and set the gchar * item to point to a g_malloc()ed error string on an error. Allow either gchar ** argument to be null; if the argument is null, no error message is allocated or provided. Change-Id: Ibd36b8aaa9bf4234aa6efa1e7fb95f7037493b4c Reviewed-on: https://code.wireshark.org/review/6608 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-07capture file dlg (GTK): Nesting level does not match indendation (CID 1159217)Alexis La Goutte1-1/+2
Change-Id: I9ae1862993a3a9d10bd7575295b08c91752cb77f Reviewed-on: https://code.wireshark.org/review/6375 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-24Allow wtap_read() and wtap_seek_read() to return records other than packets.Guy Harris1-3/+3
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be REC_TYPE_PACKET, for a record containing a packet, or REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific data. Modify code that reads packets to be able to handle non-packet records, even if that just means ignoring them. Rename some routines to indicate that they handle more than just packets. We don't yet have any libwiretap code that supplies records other than REC_TYPE_PACKET or that supporting writing records other than REC_TYPE_PACKET, or any code to support plugins for handling REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug 8590. Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813 Reviewed-on: https://code.wireshark.org/review/1773 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."Guy Harris1-20/+15
This reverts commit c0c480d08c175eed4524ea9e73ec86298f468cf4. A better way to do this is to have the record type be part of struct wtap_pkthdr; that keeps the metadata for the record together and requires fewer API changes. That is in-progress. Change-Id: Ic558f163a48e2c6d0df7f55e81a35a5e24b53bc6 Reviewed-on: https://code.wireshark.org/review/1741 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Allow wtap_read() and wtap_seek_read() to return non-packet records.Guy Harris1-15/+20
This is the first step towards implementing the mechanisms requestd in bug 8590; currently, we don't return any records other than packet records from libwiretap, and just ignore non-packet records in the rest of Wireshark, but this at least gets the ball rolling. Change-Id: I34a45b54dd361f69fdad1a758d8ca4f42d67d574 Reviewed-on: https://code.wireshark.org/review/1736 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09Revert "Refactor Wiretap"Guy Harris1-6/+6
This reverts commit 1abeb277f5e6bd27fbaebfecc8184e37ba9d008a. This isn't building, and looks as if it requires significant work to fix. Change-Id: I622b1bb243e353e874883a302ab419532b7601f2 Reviewed-on: https://code.wireshark.org/review/1568 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09Refactor WiretapMichael Mann1-6/+6
Start of refactoring Wiretap and breaking structures down into "generally useful fields for dissection" and "capture specific". Since this in intended as a "base" for Wiretap and Filetap, the "wft" prefix is used for "common" functionality. The "architectural" changes can be found in cfile.h, wtap.h, wtap-int.h and (new file) wftap-int.h. Most of the other (painstaking) changes were really just the result of compiling those new architecture changes. bug:9607 Change-Id: Ife858a61760d7a8a03be073546c0e7e582cab2ae Reviewed-on: https://code.wireshark.org/review/1485 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-21Fix Bug 9903: 'Clicking reload-file ignores selected file format reader'Hadriel Kaplan1-2/+2
There's a relatively new feature in 1.11.3 to select a specific file format reader, instead of relying on magics or heuristics. If you select a file reader and open a file, open it, and then click the reload-file button or go to View->Reload or press the ctrl-R keymap, the file is reloaded but using the magic/heuristics again instead of the file format reader you previously chose. Likewise, the Lua relaod() function has the same issue (which is how I found this problem). I have tested this change by hand, using a Lua script, but I didn't add it to the testsuite because I need another change for my test script to work correctly. (an enhancement rather than a bug fix, which I'll submit separately) Change-Id: I48c2d9ea443e37fd9d41be43d6b6cd5a866d5b01 Reviewed-on: https://code.wireshark.org/review/764 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-11Migrate GTK icon handling to GTK 3.10 APIBalint Reczey1-2/+2
GtkStockItem usage is deprecated with all the GTK_STOCK_.* stock ids. We keep a stock id based approach but without relying on GTK's GtkStockItem system. We create our own internal stock ids for {icon, label} tuples and keep the original GTK stock id #define-s and values to preserve backward compatibility. Change-Id: Ia0b35a5903f079e92c8026e3df21bbf0be2d06b0 Reviewed-on: https://code.wireshark.org/review/302 Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04win32: Implement format type selector in open file dialogMichal Labedzki1-1/+1
Change-Id: Idef1829fcc2b7b08783e5288bb6486ce19c4779b Reviewed-on: https://code.wireshark.org/review/405 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.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>
2014-02-25Use correct macro to really fix MacOSX buildbotEvan Huus1-3/+3
Change-Id: Ibb7b13c0c9c5699642cda48522b34ace34c28b46 Reviewed-on: https://code.wireshark.org/review/377 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-25Include old-gtk-compat.h to fix build.Evan Huus1-0/+1
Change-Id: I3614e11fb0e76625b2b9686be423bf421c295e6f Reviewed-on: https://code.wireshark.org/review/376 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-25Wireshark: Add option to choose format type of capture fileMichal Labedzki1-5/+26
The best heuristic can fail, so add possibility to manually choose capture file format type, so not correctly recognize file format can be loaded in Wireshark. On the other side now it is possible to open capture file as file format to be dissected. Change-Id: I5a9f662b32ff7e042f753a92eaaa86c6e41f400a Reviewed-on: https://code.wireshark.org/review/16 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Evan Huus <eapache@gmail.com>
2014-01-20Split the GUI and the tap part to make it possible to adapt to Qt.Anders Broman1-1/+1
svn path=/trunk/; revision=54850
2013-11-17Move the epan/filesystem.c routines to wsutil; they're not specific toGuy Harris1-1/+1
packet dissection, they're specific to the entire Wireshark suite of programs. svn path=/trunk/; revision=53377
2013-11-09Replace wtap_nstime with nstime_t, remove wtap_nstime_to_sec.Jakub Zawadzki1-1/+1
After r50154 nstime_t is inside wsutil/ so wiretap don't need it's own copy. svn path=/trunk/; revision=53184
2013-11-08The "file types" we have are actually combinations of types andGuy Harris1-9/+10
subtypes, e.g. Network Monitor version 1 and Network Monitor version 2 are separate "file types", even though they both come from Network Monitor. Rename various functions, #defines, and variables appropriately. svn path=/trunk/; revision=53166
2013-10-11Remove GTK+ and global cfile dependencies from file_dlg_win32.c.Gerald Combs1-2/+2
Move the declaration of set_last_open_dir() to ui/util.h. It still has separate GTK+ and Qt implemenations. We might want to move it to ui/util.c at some point. Remove a lot of unnecessary GTK+ includes. Remove most of the references to the global cfile while we're at it. svn path=/trunk/; revision=52542
2013-09-02Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+0
svn path=/trunk/; revision=51681
2013-08-21The export PDU mechanism creates a new capture which contains only theMartin Kaiser1-0/+70
exported PDUs. The currently opened capture file is closed. Make sure that this does not discard any unsaved data. Ask the user for confirmation and save the changes before running the export. svn path=/trunk/; revision=51459
2013-07-16Move merge.{h,c} into wiretap: these modules use wiretap to merge files.Jeff Morriss1-2/+3
svn path=/trunk/; revision=50656
2013-07-11Move some more modules into epan.Jeff Morriss1-1/+0
svn path=/trunk/; revision=50517
2013-05-14Give file_selection_new() an argument to specify the parent window ofGuy Harris1-7/+7
the file selection dialog. Call gtk_file_chooser_set_do_overwrite_confirmation() in file_selection_new() for FILE_SELECTION_SAVE file selection dialogs, rather than doing it in the individual callers of file_selection_new(). Use gtk_dialog_set_alternative_button_order() in file_selection_new() to set the alternative button order, rather than using #ifdefs. Use file_selection_new() and file_selection_run() in the graph analysis code. (We should clean up other code that uses file_selection_new() to use file_selection_run(), and clean up other code that uses gtk_file_chooser_dialog_new() to use file_selection_new() and file_selection_run().) svn path=/trunk/; revision=49308
2013-05-14Fix indentation.Guy Harris1-1/+1
svn path=/trunk/; revision=49295
2013-05-14Use gtk_dialog_set_alternative_button_order() to set the "alternative"Guy Harris1-68/+31
button order (that order is what's used on Windows). Put the affirmative answer on the right by default. svn path=/trunk/; revision=49284
2013-05-13Eliminate some includes of ui/simple_dialog.h by files that don't useGuy Harris1-1/+0
anything from it. svn path=/trunk/; revision=49277
2013-04-02Rename cf_not_saved() to cf_has_unsaved_data() to clarify what itGuy Harris1-2/+2
indicates. (Note: "unsaved data" is more than just "unsaved changes"; it could also mean "temporary file that hasn't been saved anywhere".) svn path=/trunk/; revision=48709
2013-04-01Add routines to file.c to indicate whether:Guy Harris1-7/+6
a save can be done ("can" in the sense of "there's something to save" and in the sense of "we can write that something out"); a "save as" can be done (in the sense of "we can write what we have out"); there's unsaved data to save (which might be unsaved changes or might be a temporary file full of packets); and use them as appropriate. This means that the "unsaved data" indicator in the UI will be turned on for temporary files full of packets as well as for files with unsaved changes; that's what we want. svn path=/trunk/; revision=48693
2013-04-01Add a wtap_dump_can_write() routine that indicates whether WiretapGuy Harris1-12/+2
supports writing files with a given set of encapsulations and comment types. Use it, rather than asking for a list of file formats that support the given set of encapsulation and comment types and checking whether we got back such a list, or duplicating its logic. Having file.c use it means that nobody's using wtap_dump_can_write_encaps() any more; get rid of it. Instead, have a private routine that checks whether a given file format supports a given set of encapsulations *and* comment types, and use that internally. svn path=/trunk/; revision=48690
2013-04-01Define a collection of bits for different types of capture file comments.Guy Harris1-47/+52
For each capture file type, have a bitset of comment types supported by that capture file type. Add a Wiretap routine that, for a given file type, returns the bitset of comment types it supports. Have wtap_get_savable_file_types() take a bitset of comment types that need to be supported by the file types it returns. Replace cf_has_comments() with a routine that returns a bitset of capture file comment types in the capture file. Use those routines in the capture file dialogs; don't wire in the notion that pcap-NG supports all comment types and no other file formats support any comment types. (That's currently true, but we don't want to wire that in as being forever true.) svn path=/trunk/; revision=48689
2013-03-21From beroset:Bill Meier1-6/+6
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10404 Note: The following parts of the patch had been previously done: asn1/snmp/packet-snmp-template.c epan/dissectors/packet-snmp.c epan/dissectors/packet-x11.c Also; hostlist_table.c: code under '#ifdef HAVE_GEOIP' didn't compile and needed a few additional patches. svn path=/trunk/; revision=48447
2013-03-11Remove leftover "//".Bill Meier1-6/+6
svn path=/trunk/; revision=48242
2013-03-11From the proposed patch by Peter Hatina in Bug #8315.Bill Meier1-7/+7
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8315 svn path=/trunk/; revision=48241
2013-03-08Use explicit casts.Anders Broman1-3/+3
svn path=/trunk/; revision=48187
2013-03-04With Jim Young's suggestion, revert r43785. Currently the file->open dialog ↵Chris Maynard1-1/+0
contains a *Read* filter field, not a display filter, so after the packets matching the read filter are loaded, there is no actual display filter applied. This resolves https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8344 svn path=/trunk/; revision=48046
2013-01-10Fix indentation to match editor modelines.Bill Meier1-254/+254
svn path=/trunk/; revision=47009
2013-01-10Fixes:Bill Meier1-19/+35
1. 'File ! Open' changes applied to the 'File ! Merge' window; 2. Small change made so that the GTk2 & Gtk3 behavior are the same (Finally !) 3. window structure picture and notes updated. svn path=/trunk/; revision=47008
2013-01-09Add a picture and some notes about the capture_file-dialog window.Bill Meier1-0/+52
svn path=/trunk/; revision=47007
2013-01-09Use ws_gtk_grid...() in place of gtk_table...().Bill Meier1-136/+142
The Gtk2 vs Gtk3 behavior is not precisely the same when resizing the window hozizontally; IMO it's "good enough" (after several days of playing around trying to make the behaviour identical). svn path=/trunk/; revision=47004
2012-12-22The Wireshark file icon makes more sense than a floppy disk[1]. SwitchGerald Combs1-4/+4
back to it and name it "Save" instead of "File". [1] http://www.hanselman.com/blog/TheFloppyDiskMeansSaveAnd14OtherOldPeopleIconsThatDontMakeSenseAnymore.aspx svn path=/trunk/; revision=46696