* Dialog box for editing or adding packet comments.
* Copyright 2012 Anders Broman <anders.broman@ericsson.com>
*
- * $Id$
- *
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
#include <gtk/gtk.h>
-#include <epan/epan.h>
-#include <wsutil/filesystem.h>
-
#include "ui/main_statusbar.h"
#include "ui/gtk/dlg_utils.h"
#include "ui/gtk/expert_comp_dlg.h"
#include "ui/gtk/gui_utils.h"
-#include "ui/gtk/help_dlg.h"
#include "ui/gtk/main.h"
#include "ui/gtk/packet_list.h"
#include "ui/gtk/edit_packet_comment_dlg.h"
-#include "ui/gtk/old-gtk-compat.h"
-#include "ui/gtk/summary_dlg.h"
+
+#include "globals.h"
static GtkWidget *edit_or_add_pkt_comment_dlg = NULL;
static GtkWidget *edit_or_add_capture_comment_dlg = NULL;
new_capture_comment = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE /* whether to include invisible text */);
/*g_warning("The new comment is '%s'",new_capture_comment);*/
- cf_update_capture_comment(&cfile, new_capture_comment);
+ cf_update_section_comment(&cfile, new_capture_comment);
/* Update the main window as appropriate */
main_update_for_unsaved_changes(&cfile);
}
void
-edit_capture_comment_dlg_launch (void)
+edit_capture_comment_dlg_launch (GtkAction *action _U_, gpointer data _U_)
{
-
GtkWidget *vbox;
GtkWidget *view;
GtkWidget *scroll;
GtkWidget *ok_bt, *cancel_bt, *help_bt;
GtkTextBuffer *buffer = NULL;
const gchar *comment_str = NULL;
- gchar *buf_str;
if (edit_or_add_capture_comment_dlg != NULL) {
/* There's already an "Edit Capture Comment" dialog box; reactivate it. */
gtk_box_pack_start(GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
/* Get the comment */
- comment_str = cf_read_shb_comment(&cfile);
- /*g_warning("Fetched comment '%s'",opt_comment);*/
-
+ comment_str = cf_read_section_comment(&cfile);
if(comment_str != NULL){
- buf_str = g_strdup_printf("%s", comment_str);
- gtk_text_buffer_set_text (buffer, buf_str, -1);
- g_free(buf_str);
+ gtk_text_buffer_set_text (buffer, comment_str, -1);
}
/* Button row. */
gtk_widget_grab_default (ok_bt);
g_signal_connect (edit_or_add_capture_comment_dlg, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
-
gtk_widget_show (edit_or_add_capture_comment_dlg);
-
}
-
+
void
edit_capture_comment_dlg_hide(void)
{
window_destroy(edit_or_add_capture_comment_dlg);
}
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local Variables:
+ * c-basic-offset: 2
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vi: set shiftwidth=2 tabstop=8 expandtab:
+ * :indentSize=2:tabSize=8:noTabs=true:
+ */