aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/file_dlg.c
AgeCommit message (Collapse)AuthorFilesLines
2006-02-19For the "there's already a file with that name" dialog, use a wordingGuy Harris1-2/+3
more like the one used by gedit. (Note that the file in question might not be a capture file, although it probably is.) svn path=/trunk/; revision=17355
2006-02-16Freeze and thaw the packet list after a merge so that the packet list showsGerald Combs1-0/+2
the correct information. svn path=/trunk/; revision=17320
2006-02-15Have those functions that end up just calling a win32_ routine if we'reGuy Harris1-34/+29
using GTK+ 2.x on Windows just have the call, nothing else (no extra variables). svn path=/trunk/; revision=17308
2006-02-13Copy over the file open/save code from the Win32 native branch.Gerald Combs1-32/+65
The Windows-native routines were integrated by inserting #if GTK_MAJOR_VERSION >= 2 && _WIN32 win32_native_routine(GDK_WINDOW_HWND(top_level->window)); return; #endif at the beginning of each GTK+ file routine. There's probably a prettier way to do this. Some of the sizes need to be tweaked in win32-file-dlg.rc, but everything seems to work. Fix up whitespace. svn path=/trunk/; revision=17285
2006-02-11In "Save As", support only file types we can write to; that simplifiesGuy Harris1-65/+20
the logic, making it easier to get it right (fewer interactions between components of the dialog - the file type doesn't affect whether we can save some but not all packets). It also means we don't offer a file type for saving, only to take it away if you choose anything other than saving all packets. If the capture file is a temporary file from a capture done in the current Ethereal session, it's libpcap format, which we can write to, so you would be able to save it. If it's a saved file we read in, saving the file in its entirety in its own format is just copying the file, and it's not clear supporting that adds enough useful functionality to justify the extra complication. Fix "range_update_dynamics()" to update all the rows of the range button/count table properly (make the button active iff there's a non-zero count in the currently-selected column, make a count active iff the column is selected), to select the "Captured" column if the count of displayed packets goes to zero, and to select the "Save all packets" row if the count of packets in the currently-selected row and column goes to zero. (XXX - we should perhaps do that with the "user-defined range" counts as well, which would involve updating the counts on every change to the range field.) svn path=/trunk/; revision=17251
2005-12-31fix #152Ulf Lamping1-2/+4
set the read filter dialog modal and transient to the parent window if requested. This way, it will receive input signals (solving problems with GTK2's gtk_file_chooser). To do this, add another construct_args flag, so it will be modal only if really needed ... svn path=/trunk/; revision=16926
2005-11-06replace *a lot* of file related calls by their GLib counterparts. This is ↵Ulf Lamping1-4/+0
necessary for the switch to GTK 2.6 (at least on WIN32). to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place. deleted related things from config.h.win32 As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon. svn path=/trunk/; revision=16403
2005-10-26bugfix: don't crash the file open dialog, if the preview gets confused by ↵Ulf Lamping1-8/+12
"invalid" timestamps. The localtime call will return NULL on invalid input which results in a NULL pointer exception. Simply print '?' if localtime returned NULL. svn path=/trunk/; revision=16317
2005-09-23disable gzip output compression for now, as it won't work in some cases (see ↵Ulf Lamping1-1/+5
source commment for details) svn path=/trunk/; revision=15981
2005-09-14added compression support for capture file output. The Save/As dialog now ↵Ulf Lamping1-2/+16
has a checkbox "Compress with gzip" currently limited to Ethereal and all the variants of libpcap filetypes only. We might want to add output compression support to the other tools as well (tethereal, mergecap, ...). We might also want to add support for the other filetypes, but this is only possible if the filetype functions doesn't use special output operations like fseek. One bug is still left: if the input and output filetypes while saving are the same, Ethereal currently optimizes this by simply copy the binary file instead of using wiretap (so it will be faster but it will ignore the compress setting). Don't know a good workaround for this, as I don't know a way to find out if the input file is currently compressed or not. One idea might be to use a heuristic on the filesize (compared to the packet size summmary). Another workaround I see is to remove this optimization, which is of course not the way I like to do it ... svn path=/trunk/; revision=15804
2005-08-24EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry! Ulf Lamping1-9/+3
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ... What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere. As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon. Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way... As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number... svn path=/trunk/; revision=15520
2005-08-20renamed ui_util.c/.h to gui_utils.c/.h to prevent confusion with identical ↵Ulf Lamping1-1/+1
named ui_util.h in / dir svn path=/trunk/; revision=15465
2005-08-19Add APIs to Wiretap to return the file of the size as supplied by the OSGuy Harris1-11/+5
(so if the file's gzipped, it's *NOT* the size of the file after uncompressing), and an approximation of the amount of that data read sequentially so far. Use those for various progress bars and the like. Make the fstat() in the Ascend trace reader directly use wth->fd, as it's inside Wiretap; that gets rid of the last caller of wtap_fd() (as we're no longer directly using fstat() or lseek() in Ethereal), so get rid of wtap_fd(). svn path=/trunk/; revision=15437
2005-08-05More char -> const char warning fixes.Jörg Mayer1-2/+2
Removed (very few) casts that only change the warning message but don't remove it (with gcc-4). svn path=/trunk/; revision=15227
2005-08-02Fix more "no previous declaration" warningsJörg Mayer1-4/+4
svn path=/trunk/; revision=15173
2005-04-19ask for unsaved file when using the new start capture feature,Ulf Lamping1-1/+1
ask for unsaved file when really starting the capture, not already when showing the options dialog, use the start capture icon in the capture options dialog (instead of simply Ok) svn path=/trunk/; revision=14142
2005-04-12Save As: ask user if he wants to overwrite an already existing fileUlf Lamping1-33/+115
svn path=/trunk/; revision=14058
2005-03-26code cleanup: use common prefix for all functions in color_filters.hUlf Lamping1-5/+5
svn path=/trunk/; revision=13910
2005-02-17Have "cf_merge_files()" take a pointer-to-pointer-to-char as the outputGuy Harris1-10/+10
file name argument; if the pointed-to pointer is null, it opens a temporary file, and sets that pointer to a mallocated copy of the pathname of the temporary file. It no longer needs a file descriptor as an argument. svn path=/trunk/; revision=13419
2005-02-15Have "cf_merge_files()" always close "out_fd" before returning; it doesGuy Harris1-1/+0
so if "wtap_dump_fdopen()" succeeds (as a side-effect of calling "wtap_dump_close()"), even if "cf_merge_fails()" after that, so it should do so if it fails. That means we don't need to close it in the callers of "cf_merge_files()". svn path=/trunk/; revision=13407
2005-02-05minor enhancements to Guy's last updateUlf Lamping1-5/+5
svn path=/trunk/; revision=13304
2005-02-05Put "cf_status_t" back.Guy Harris1-6/+6
svn path=/trunk/; revision=13303
2005-02-04huge cleanup of capture file API (functions in file.c/file.h).Ulf Lamping1-11/+11
This includes: all functions in file.h now have a cf_ prefix, will have doxygen tags, will have the capture_file *cf as the first parameter and I tried to generalize the return values for non trivial functions. Hopefully, I didn't introduced any new bugs, as I had to change a lot of files... svn path=/trunk/; revision=13289
2005-01-27We use the range utilities regardless of whether we're built withGuy Harris1-1/+1
libpcap or not. svn path=/trunk/; revision=13182
2005-01-01The right way to check whether a pointer is null and get a Boolean is toGuy Harris1-5/+5
test it against null, not to cast it to a Boolean type - as Boolean types in C89/C90, at least, are just integral types, that cast might just throw away the upper 32 bits; that probably yields the results you want, but the compiler might well justifiably warn about that on an LP64 platform. svn path=/trunk/; revision=12915
2004-12-31"gtk_entry_get_text()" returns a "const char *" - assign the result toGuy Harris1-15/+17
one. "get_basename()" doesn't modify its argument, and its callers don't modify the substring pointed to by the result, so make it take a "const char *" as an argument and return a "const char *". "find_last_pathname_separator()" doesn't modify its argument, so make it a "const char *" - but some of its callers pass a non-"const" "char *" and modify the result, so don't make its return value a "const char *". And, as none of its callers are outside "filesystem.c", make it static. In "about_folders_page_new()", have separate variables for pathnames returned as "const char *" (which are cached by the routine that returns them, so you can't modify them - and can't free them, so get rid of the commented-out "g_free()" calls for them) and pathnames returned as "char *" (which are allocated anew for each call, and can be modified, but have to be freed). Clean up white space. svn path=/trunk/; revision=12881
2004-12-29Make the tone of the error messages a bit less formal, by usingGuy Harris1-1/+1
contractions. (Safari does, at least when you're trying to open a file to which you don't have read access.) svn path=/trunk/; revision=12852
2004-10-27Change some of the merge.c APIs to return more information on failure,Guy Harris1-12/+11
and use that information to provide better error messages. Have "merge_open_outfile()" do all the work of filling in the merge_out_file_t structure, with the values to use passed as arguments. Get rid of some structure members that used to be used solely to pass information to "merge_open_outfile()". Add a "cf_merge_files()" routine to do the merging and reporting of errors. svn path=/trunk/; revision=12420
2004-10-22Change some code that affects g_resolv_flags to set a flag if the checkGuy Harris1-4/+13
box for the flag is active and clear it if it's inactive, rather than clearing all but RESOLV_CONCURRENT and then setting flags if the check box is active - or, in one case, not clearing any flags due to a typo and then setting them, so they never get cleared. This matches what's done with theresolution flags in some other places. svn path=/trunk/; revision=12375
2004-10-17When merging, default to the current file format as the output format.Guy Harris1-0/+3
svn path=/trunk/; revision=12327
2004-10-17From Mark C. Brown: allow the file type for the merge operation to beGuy Harris1-15/+34
specified in the GUI. svn path=/trunk/; revision=12326
2004-10-16Remove the fixed maximum number of subranges in a range_t; dynamicallyGuy Harris1-3/+21
allocate them to be large enough. Add checks that the numbers in the range fit in a guint32. Check the validity of a range before saving or printing, and report errors in an alert box. Clean up white space. svn path=/trunk/; revision=12320
2004-09-27Move prefs.c and prefs.h into the epan subdirectory.Guy Harris1-1/+1
svn path=/trunk/; revision=12115
2004-09-08Fix a minor bug only with GTK2.4: if have a problem while saving a file ↵Ulf Lamping1-0/+8
(e.g. filename already exists) will lead to an unresponding file dialog. The fix will close the dialog, which isn't the best solution, but I don't see a better one. svn path=/trunk/; revision=11943
2004-09-04The packet range stuff knows about capture_file structures, so it'sGuy Harris1-1/+1
really more of an Ethereal/Tethereal component than a libethereal component (nothing else in libethereal knows about capture files); move it back out of libethereal. (The range stuff doesn't; we leave it in libethereal.) svn path=/trunk/; revision=11898
2004-09-04Rename "range.c" and "range.h" to "packet-range.c" and "packet-range.h";Guy Harris1-1/+1
they should ultimately be split into files with routines that handle ranges, which are just subsets of [0,2^32), and packet ranges, which are subsets of the packet list, possibly specified by a range. Move them into epan, so they can be used by, for example, utilities that handle ranges, such editcap. svn path=/trunk/; revision=11890
2004-08-31added a preference setting, to be able to change the preview timeout in the ↵Ulf Lamping1-2/+1
file open dialog (as requested by Ronnie Sahlberg). svn path=/trunk/; revision=11859
2004-08-31Split the preview function into a prepare and a do part, to be able to do ↵Ulf Lamping1-24/+47
some experiments about the preview timeout things. As the FileChooser dialog (GTK2.4) doesn't seem to let pass other GTK events (even with calling gtk_main_iteration()), it's not possible to change the preview behaviour to be more keen. To get a mechanism to update the preview independant from the dialog workings, we would need to start a new thread/task, which is too much effort for this IMHO. So we might use the more simple approach of setting the timeout by a preference setting. svn path=/trunk/; revision=11856
2004-08-25Move the file-reloading code from gtk/file_dlg.c to file.c.Gerald Combs1-46/+1
svn path=/trunk/; revision=11823
2004-08-19As suggested by Guy: Have mark_frame() do nothing if the frame hasGerald Combs1-1/+1
already been marked and have unmark_frame() do likewise. Don't mess with the marked frame count in mark_all_frames(). Be a little more paranoid about the marked frame count in other places. svn path=/trunk/; revision=11775
2004-08-06From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that anGuy Harris1-1/+1
include of <resolv.h> in any system header file gets the system <resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]). svn path=/trunk/; revision=11615
2004-07-24Move color_filters.c and color_filters.h up to the top-level directory,Guy Harris1-1/+1
as they're now (theoretically) toolkit-independent (modulo changes that might be required to the code to update filter lists when a new filter is read in). svn path=/trunk/; revision=11500
2004-07-19renamed filter_prefs to filter_dlg, as the filter settings are (well, for a ↵Ulf Lamping1-1/+1
long time) no longer part of the preferences dialog. svn path=/trunk/; revision=11436
2004-07-18Set the svn:eol-style property on all text files to "native", so thatGuy Harris1-1/+1
they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. svn path=/trunk/; revision=11400
2004-07-13From Daniel Thompson: add additional message/alert box options toGuy Harris1-7/+7
display "Save", "Continue without Saving", and "Cancel", for the "do you want to save?" messages. svn path=/trunk/; revision=11372
2004-06-30Include <unistd.h>, if available, to declare "close()".Guy Harris1-3/+5
svn path=/trunk/; revision=11278
2004-06-30close temporary merge output file, if merging failedUlf Lamping1-1/+7
svn path=/trunk/; revision=11275
2004-06-29avoid using tmpnam() for security reasons.Ulf Lamping1-14/+10
instead of giving the merge stuff a filename, give it an already opened file descriptor svn path=/trunk/; revision=11273
2004-06-29The patch to fix the race condition introduced by using tmpnam replacedJörg Mayer1-2/+2
insecure code by not-working code. As I currently lack the time to fix this properly until Monday as the earliest possible date I undo the patch. Please note that Ethereal should not be used on multiuser systems with untrusted users until a proper fix has been applied. svn path=/trunk/; revision=11263
2004-06-28minor bugfix for merge dialog: use the correct handle for resizingUlf Lamping1-3/+3
svn path=/trunk/; revision=11259