2006-04-29 23:03:57 +00:00
|
|
|
/* capture_file_dlg.h
|
2000-02-12 06:58:42 +00:00
|
|
|
* Definitions for dialog boxes for handling files
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2000-02-12 06:58:42 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2000-02-12 06:58:42 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-02-12 06:58:42 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-02-12 06:58:42 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-02-12 06:58:42 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2000-02-12 06:58:42 +00:00
|
|
|
*/
|
|
|
|
|
2006-04-29 23:18:47 +00:00
|
|
|
#ifndef __CAPTURE_FILE_DLG_H__
|
|
|
|
#define __CAPTURE_FILE_DLG_H__
|
2000-02-12 06:58:42 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** @file
|
|
|
|
* "Open" / "Close" / "Save" / "Save As" / etc dialog boxes.
|
2004-06-04 20:05:31 +00:00
|
|
|
* @ingroup dialog_group
|
2004-06-01 17:33:37 +00:00
|
|
|
*/
|
|
|
|
|
2012-05-25 21:25:55 +00:00
|
|
|
/** If there are unsaved changes, ask the user whether to save them,
|
|
|
|
* discard them, or cancel the operation that would cause the changes
|
|
|
|
* to be lost if not saved.
|
We're an editor now, as we let you add, delete, and edit frame comments,
so "Save" should, for non-temporary files, mean "save the current state
of the capture file on top of the existing file" without prompting for a
file name.
That means we have to do a "safe save" - i.e, write the capture out to a
new file and, if that succeeds, rename the new file on top of the old
file - as the actual packet data to write out is in the file we're
overwriting, not in memory. (We'd want to do that anyway, of
course....)
Update some comments.
Clean up indentation slightly, and get rid of an unnecessary variable
(in all the cases where we use it, we assign it the same value, and that
value isn't modified out from under us before we use it).
Note that after a "Save", or a "Save As" that writes out all captured
packets, we shouldn't have to close the current file and open the new
file and reread it - we should be able to open the new file and update
the frame offsets in the frame_data structures.
Note that we need to do some a better job of reporting rename failures.
svn path=/trunk/; revision=42777
2012-05-22 10:36:40 +00:00
|
|
|
*
|
2012-05-25 21:25:55 +00:00
|
|
|
* @param cf the capture_file structure for the file to be closed
|
|
|
|
* @param from_quit TRUE if this is from a quit operation
|
|
|
|
* @param before_what description of the operation, or a null string
|
|
|
|
* for an explicit close operation
|
2004-06-01 17:33:37 +00:00
|
|
|
*
|
2012-05-25 21:25:55 +00:00
|
|
|
* @return TRUE if the user didn't cancel the operation, FALSE if they did
|
2004-06-01 17:33:37 +00:00
|
|
|
*/
|
2012-05-25 21:25:55 +00:00
|
|
|
gboolean do_file_close(capture_file *cf, gboolean from_quit, const char *before_what);
|
2004-01-29 23:11:38 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** User requested the "Open" dialog box.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
void file_open_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
2004-06-17 21:53:26 +00:00
|
|
|
/** User requested the "Merge" dialog box.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
void file_merge_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** User requested the "Save" dialog box.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
void file_save_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
|
|
|
/** User requested the "Save As" dialog box.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
void file_save_as_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
|
|
|
/** User requested "Close".
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
void file_close_cmd_cb(GtkWidget *widget, gpointer data);
|
2004-01-29 23:11:38 +00:00
|
|
|
|
"Save As" always saves everything and, when the save is done, makes the
new file the current file, as is the case in most if not all other GUI
applications.
A new "Export Specified Packets" menu option allows you to specify which
packets to write out, with the default being the displayed packets (and
those on which the displayed packets depend for, e.g. reassembly), and
never makes the resulting file the current file.
The two operations are conceptually distinct. Lumping them into one
menu item, with the default for "Save As" being "displayed packets only"
and thus making it behave like the latter operation, was causing some
confusion; see, for example, bug 6640.
Make the dialog popped up if you try to "Save As" or "Export Specified
Packets" on top of an existing file ask the "do you want to do this?"
question in the main part of the message, and note in the secondary text
that doing that will overwrite what's in the file; that matches what
TextEdit on OS X and the GNOME text editor say.
svn path=/trunk/; revision=42792
2012-05-22 22:17:57 +00:00
|
|
|
/** User requested the "Export Specified Packets" dialog box.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
void file_export_specified_packets_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
2013-08-21 21:44:48 +00:00
|
|
|
/** User requested the "Export PDUs to file" dialogue box
|
|
|
|
* and pressed OK to start the export
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data pointer to internal data used by the export pdu part
|
|
|
|
*/
|
|
|
|
void file_export_pdu_ok_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** User requested "Reload".
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
void file_reload_cmd_cb(GtkWidget *widget, gpointer data);
|
2000-02-12 06:58:42 +00:00
|
|
|
|
2004-06-01 17:33:37 +00:00
|
|
|
/** User requested "Import". Currently only called from the color dialog.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
void file_color_import_cmd_cb(GtkWidget *widget, gpointer data);
|
|
|
|
|
|
|
|
/** User requested "Export". Currently only called from the color dialog.
|
|
|
|
*
|
|
|
|
* @param widget parent widget
|
|
|
|
* @param data unused
|
|
|
|
*/
|
|
|
|
void file_color_export_cmd_cb(GtkWidget *widget, gpointer data);
|
2003-08-18 21:27:11 +00:00
|
|
|
|
2006-04-29 23:03:57 +00:00
|
|
|
#endif /* capture_file_dlg.h */
|