aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/main.c
AgeCommit message (Collapse)AuthorFilesLines
2006-03-08Use Unicode for all native Win32 calls. Unicode Windows applicationsGerald Combs1-2/+3
use UTF-16 internally and GTK+ 2.x uses UTF-8, which means we have to do a lots of conversions. Add utf_8to16() and utf_16to8 convenience functions to strutil.c. svn path=/trunk/; revision=17534
2006-03-07Fix what Coverity CID 61 was actually complaining about: Don't pass a NULLGerald Combs1-5/+8
value to get_interface_descriptive_name(). svn path=/trunk/; revision=17513
2006-03-07Fix Coverity run 12 CID 61: In main_cf_cb_live_capture_update_started(),Gerald Combs1-0/+1
make sure capture_opts isn't NULL before we try to use it. svn path=/trunk/; revision=17504
2006-02-17remove dependencies to pcap.h, so getting an idea what needs to be done by ↵Ulf Lamping1-1/+0
dumpcap in addition to the things already done now various dumpcap related code cleanup: mainly #include's and capture engine related stuff svn path=/trunk/; revision=17327
2006-02-16Move common control initialization to gtk/main.c where it belongs.Gerald Combs1-70/+90
Remove a MessageBox() call used for debugging. Fixup whitespace. svn path=/trunk/; revision=17319
2006-02-12Send LOG_DOMAIN_CAPTURE_CHILD messages to our log handler, so they don'tGuy Harris1-1/+4
go to the standard output (as is the case for some such messages, including the "child is sending an error message to the parent" message, which shows up if we fail to exec dumpcap). *Anything* other than an official capture-child message written to the standard output by the capture child confuses the heck out of the parent, and can cause it to think the child closed the pipe (resulting, in the case described in the previous parenthetical note, in no dialog box being displayed for dumpcap not being executed). svn path=/trunk/; revision=17274
2006-02-12Add a routine to attempt to get the absolute pathname of the executableGuy Harris1-3/+5
file, strip off the last component to get the pathname of the directory containing the executable file, and save it for future use. On Windows, you can get that from the OS, but, on UN*X, you have to look at argv[0] and derive the absolute path from that (argv[0] is not guaranteed to be an absolute path, or even a path at all). (In addition, if you're running from the build directory, you might have to strip off a ".libs/" added to argv[0] as an artifact of the libtoolizing script.) Use that in the About dialog, and use it to construct the path of dumpcap. Don't put quotes into the path of dumpcap; you don't have to quote strings with spaces in them when handing them to execvp and, in fact, you *mustn't* quote them, as the quotes will be treated as part of the pathname. svn path=/trunk/; revision=17267
2006-02-11various capture child related minor cleanupsUlf Lamping1-20/+5
svn path=/trunk/; revision=17258
2006-02-11font_init don't need to know if running as a capture_child, this will simply ↵Ulf Lamping1-1/+1
no longer happen. svn path=/trunk/; revision=17257
2006-02-11the point of no return ...Ulf Lamping1-73/+5
using dumpcap as the capture child for Ethereal. dumpcap is a plain console application now, even for Win32 (so no WinMain, create_console and special piping stuff reguired). The undocumented command line option -Z will switch dumpcap into "child mode", using binary instead of plain text output messages to communicate with a parent Ethereal. Ethereal's main.c no longer needs to distinguish between child mode or not, so some simplifying here. capture_sync.c has to call dumpcap in a "hidden window" mode using CreateProcess instead of spawnvp, otherwise an uggly console window would appear. The handles created by _pipe doesn't seem to be inheritable for this function, using CreatePipe instead. The file capture_loop.c is only needed by dumpcap, removed from Ethereal link objects. Some debugging aid added and other minor cleanup done. svn path=/trunk/; revision=17256
2006-02-11minor bugfix: restore the Ethereal icon (after capturing) at the right placesUlf Lamping1-13/+26
svn path=/trunk/; revision=17255
2006-02-11Display g_error messages in the console window unconditionally, if ↵Lars Roland1-2/+4
preferences aren't loaded yet. This way we ensure that errors are displayed during protocol registration. Use g_error instead of g_warning, if not allowed characters are used in display filter names for protocols. Extend the error message in this case. svn path=/trunk/; revision=17248
2006-02-10remove all calls to exit() from the capture_opts.c and replace them by ↵Ulf Lamping1-3/+7
status return values (0,1 or 2). This way makes it much easier to debug, e.g. to set a common breakpoint if a command line parameter fails. svn path=/trunk/; revision=17240
2006-02-09Win32 inconvenience: a call to g_error will terminate the program and the ↵Ulf Lamping1-1/+8
user won't see anything. To avoid this, the log handler in the error case: - opens a console window (regardless of the users settings) - waits for a keypress before continuing to terminate the program This way, the user will be notified that there's a problem, instead of simply seeing a terminating program only. svn path=/trunk/; revision=17236
2006-02-07eXtenstion options access to the -X command line optionsLuis Ontanon1-1/+14
svn path=/trunk/; revision=17207
2006-02-06- fix a leakLuis Ontanon1-1/+5
- register the funnel mini-api ASAP svn path=/trunk/; revision=17189
2006-02-06Add code to check whether the app was started with special privilegesGuy Harris1-0/+6
(e.g., set-UID or set-GID), and don't load user plugs if it is. svn path=/trunk/; revision=17174
2006-02-04Paolo AbeniJörg Mayer1-0/+2
I have developed an external plugin to enable ssl decryption in ethereal. Me - Remove unnecessary $Id$ from acinclude.m4 - Added packet-ssl-utils.h to Makefile.common - Fixed a few warnings TODO - Lots of warning fixes (see separate mail) - Reformat function headers to read like the others do (return value<newline>function-name...) - Test on Windows platform - Review the patch to packet-ssl.c and new files packet-ssl-utils.[hc] svn path=/trunk/; revision=17156
2006-01-22show the number of packets captured, if "Update list of packets ..." isn't usedUlf Lamping1-4/+24
svn path=/trunk/; revision=17071
2006-01-17remove an obsolete commentUlf Lamping1-1/+0
svn path=/trunk/; revision=17043
2006-01-17GTK 2.x only: show a slightly different Ethereal main icon while capturing.Ulf Lamping1-4/+77
I very often forget to stop a running capture, so Ethereal keeps capturing packets on and on, leaving me with a lot of unrequired packets. On the other hand (because of the above) I often maximize Ethereal just to see that it's really not capturing any longer. Looking at the window title isn't of much help, as this title changes with every capture file name loaded, so there's no title which can be easily remembered. We probably might use this icon mechanism as well, when Ethereal loads a (huge) file, so the user get's a more visual feedback when the capture loading is finished (and probably for other potential "lengthy" tasks as well). svn path=/trunk/; revision=17042
2006-01-12fix #661Ulf Lamping1-0/+10
Win32: convert filenames coming in from command line parameters from locale (current code page) into utf8 encoding This must also be done for the other command line tools like tethereal, editcap and alike ... svn path=/trunk/; revision=17025
2006-01-12update usage outputUlf Lamping1-24/+62
svn path=/trunk/; revision=17014
2005-12-31fix #152Ulf Lamping1-1/+2
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-12-21Provide not only copyright information, but a GPL blurb, in all theGuy Harris1-6/+18
version/usage messages. Put newlines at the end of various version strings. svn path=/trunk/; revision=16870
2005-12-18use #ifdef SHOW_WELCOME_PAGE for the currently disabled welcome page instead ↵Ulf Lamping1-4/+4
of simply #if 0 svn path=/trunk/; revision=16843
2005-12-15remove a missplaced commentUlf Lamping1-1/+0
svn path=/trunk/; revision=16806
2005-12-13HUGE STEP (hopefully toward the right direction):Ulf Lamping1-71/+21
remove a lot of redundant code from tethereal and use (move) stuff from capture_loop.c instead. concentrate common capture related code in capture_opts.c, e.g. trying to find the right interface to capture from (command line option, preference, first usable) instead of duplicating this code over several files. remove redundant code from dumpcap.c this also implements command line option -D (and indexed interfaces at -i) for Ethereal and Dumpcap (as we have it in Tethereal already for a while) svn path=/trunk/; revision=16787
2005-12-13We should really do quit Ethereal if user asked us to do so with the -Q option!Ulf Lamping1-0/+16
Update the window title, right after the fixed capture finished. This might be required if the loading of the capture file afterwards just fails, leaving the title unchanged. svn path=/trunk/; revision=16772
2005-12-06rename pcap-....c/.h files to capture-pcap-....c/.hUlf Lamping1-1/+1
this way, the capture prefix will "logically" group the files together and file browsers will also group them we may want to move the files into a subdir capture later svn path=/trunk/; revision=16691
2005-12-05move some GTK only function declarations from ui_util.h to the appropriate ↵Ulf Lamping1-1/+2
header files in the gtk dir, as these declarations are obsolete and only confuses (at least me) svn path=/trunk/; revision=16687
2005-12-05add capture_opts_trim(), as this sequence is used three times now (will ↵Ulf Lamping1-14/+1
replace the other appearances later) ... svn path=/trunk/; revision=16683
2005-12-03split capture.h into capture.h, capture_loop.h and capture_opts.h and place ↵Ulf Lamping1-0/+2
the parts into the corresponding files svn path=/trunk/; revision=16664
2005-12-01fix alphabetical order of OPTINIT string, v seems to be a controversial ↵Ulf Lamping1-1/+1
character :-) svn path=/trunk/; revision=16642
2005-11-17Handle "-G" only in Tethereal - it doesn't work in Ethereal, and isn'tGuy Harris1-36/+70
necessary there. Add a "cmdarg_err()" routine to report command-line option errors; it creates a console if necessary, and prints the command name and the trailing newline. Also add "cmdarg_err_cont()", which also creates a console if necessary, and prints a trailing newline but no command name; it's used to continue the message. Use those, rather than "g_warning()", for errors. That means that we no longer need to pass the command name to various command-line argument parsing routines. svn path=/trunk/; revision=16526
2005-11-17Don't list "-B" on UN*X - it's not available there.Guy Harris1-18/+53
On Windows, show it using the same usage-message syntax as other options. Clean up the usage message. When doing the "pre-scan" of command-line arguments, suppress error messages - that suppresses bogus messages for GTK+ command-line flags, and gets rid of double messages for other errors. svn path=/trunk/; revision=16521
2005-11-16hmmm, buggy bugfixUlf Lamping1-2/+2
capture_child isn't initialized already here, so remove the whole error reaction check for now svn path=/trunk/; revision=16517
2005-11-16the "pre-scan" of the command line parameters shouldn't stop the capture ↵Ulf Lamping1-2/+6
child. The child uses a slightly different parameter pattern, so this isn't an error here. Fixes the reported capture problem svn path=/trunk/; revision=16516
2005-11-09Remove comment that no longer applies.Guy Harris1-27/+7
If we get a getopt() error in the pre-scanning, quit - don't do all the GUI stuff and re-scan the arguments (and print the error message twice). svn path=/trunk/; revision=16443
2005-11-06replace *a lot* of file related calls by their GLib counterparts. This is ↵Ulf Lamping1-7/+4
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-17don't show the "stopping currently running capture" dialog, as the packet ↵Ulf Lamping1-0/+7
list seems to have problems updating the screen, so some ugly artefacts remain on the screen. after I've fixed a bug in the Win32 capture stop mechanism some days(?) before (which speeds up that stopping a lot), this dialog isn't really needed svn path=/trunk/; revision=16257
2005-10-12from Richard van der Hoff:Ulf Lamping1-3/+2
Attached is a patch which makes the console log level (warning/message/debug etc) a configurable preference. There's no gui for setting it, but since it's pretty much only going to be useful for developers, I'm sure you'll cope... ---- I've added a small comment to the file output that it has no dialog output svn path=/trunk/; revision=16205
2005-10-07minor bugfix: while closing a capture file, update the packets statusbar ↵Ulf Lamping1-3/+3
*after* closing the file svn path=/trunk/; revision=16150
2005-10-06fix a packet_list_freeze / thaw pair, if a return comes in it's wayUlf Lamping1-0/+18
add a g_warning() call if an error occured while reading from capture file (while doing a live update), usually shouldn't happen but is difficult to debug *if* it happens add a new log domain LOG_DOMAIN_MAIN and the standard log handler for it add some (partly commented out) g_log() calls, useful for GUI sequence debugging svn path=/trunk/; revision=16136
2005-10-05fix 369: we must do some more GUI stuff in capture_update_started(),Ulf Lamping1-0/+14
as GUI state get's cleared while switching to the next "multiple file" because of a call to cf_close() svn path=/trunk/; revision=16134
2005-10-03minor bugfix: hide main widgets, if command line file couldn't be loadedUlf Lamping1-0/+1
svn path=/trunk/; revision=16090
2005-09-21fix 467: when using -k command line option, convert interface name display ↵Ulf Lamping1-1/+1
string ("user_description: devicename" from Preferences) into device name. Hopefully this won't break the UNIX version. svn path=/trunk/; revision=15943
2005-09-21fix #465: replace all fprintf(stderr, ...) with g_warning(...) callsUlf Lamping1-27/+29
svn path=/trunk/; revision=15942
2005-09-21Squelch a compiler warning (the argument might be used later).Guy Harris1-4/+4
Clean up indentation. svn path=/trunk/; revision=15917
2005-09-20add two new callbacks:Ulf Lamping1-1/+59
cf_cb_file_closing (called before closing a capture file) cf_cb_file_closed will be called afterwards, but both only if a file is really closed as cf_close is called more often ... If we are closing large capture files (~20MB), the screen looks ugly while the file is closed. Change this so the screen will immediately go back to initial state and a dialog (without buttons) is shown that the file is currently closed. As the operation which takes most of the time to close the file is a single eth_clist_clear call, we can't use a progress bar here. cf_cb_live_capture_stopping: called when the user wants to stop the capture (toolbar or menu clicked). At least on Win32, the time between this and the actual stop completed can be noticeable (1-2 seconds), so the user doesn't know if the button press did anything at all. Do something similar as above, show a dialog box without buttons to inform that the close is in progress. svn path=/trunk/; revision=15891