From b34e4d5fee812e7184f3a63dd67f508fc31e87ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irene=20R=C3=BCngeler?= Date: Fri, 5 Apr 2013 06:43:38 +0000 Subject: Add checkbox for the direction indication to the "Import from Hex Dump" dialog. svn path=/trunk/; revision=48745 --- ui/gtk/file_import_dlg.c | 17 +++++++++++++++++ ui/qt/import_text_dialog.cpp | 5 +++++ ui/qt/import_text_dialog.h | 1 + ui/qt/import_text_dialog.ui | 17 +++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/ui/gtk/file_import_dlg.c b/ui/gtk/file_import_dlg.c index 85bfad3803..4b7cd5a15d 100644 --- a/ui/gtk/file_import_dlg.c +++ b/ui/gtk/file_import_dlg.c @@ -63,6 +63,8 @@ #define INPUT_TIMEFMT_LBL_KEY "input_timeformat_label" #define INPUT_TIMEFMT_TE_KEY "input_timeformat_entry" +#define INPUT_DIR_CB_KEY "input_direction_indication_checkbox" + #define IMPORT_FRM_KEY "import_frame" #define IMPORT_ENCAP_CO_KEY "import_encap_combo" @@ -575,6 +577,7 @@ setup_file_import(GtkWidget *main_w) GtkWidget *offset_dec_rb = GTK_WIDGET(g_object_get_data(G_OBJECT(input_frm), INPUT_OFFSET_DEC_RB_KEY)); GtkWidget *timefmt_cb = GTK_WIDGET(g_object_get_data(G_OBJECT(input_frm), INPUT_DATETIME_CB_KEY)); GtkWidget *timefmt_te = GTK_WIDGET(g_object_get_data(G_OBJECT(input_frm), INPUT_TIMEFMT_TE_KEY)); + GtkWidget *dir_cb = GTK_WIDGET(g_object_get_data(G_OBJECT(input_frm), INPUT_DIR_CB_KEY)); text_import_info->import_text_filename = g_strdup(gtk_entry_get_text(GTK_ENTRY(filename_te))); @@ -595,6 +598,7 @@ setup_file_import(GtkWidget *main_w) OFFSET_NONE; text_import_info->date_timestamp = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(timefmt_cb)); text_import_info->date_timestamp_format = g_strdup(gtk_entry_get_text(GTK_ENTRY(timefmt_te))); + text_import_info->has_direction = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dir_cb)); } /* Then the import frame controls of interest */ @@ -793,6 +797,7 @@ file_import_dlg_new(void) *offset_lbl, *offset_rb_vb, *offset_hex_rb, *offset_oct_rb, *offset_dec_rb, *timefmt_hb, *timefmt_cb, *timefmt_lbl, *timefmt_te, + *dir_hb, *dir_cb, *import_frm, *import_vb, *encap_hb, *encap_lbl, *encap_co, *header_cb, *header_frm, *header_hb, @@ -907,6 +912,18 @@ file_import_dlg_new(void) g_signal_connect(timefmt_cb, "toggled", G_CALLBACK(timefmt_cb_toggle), NULL); g_signal_emit_by_name(G_OBJECT(timefmt_cb), "toggled", NULL); + /* Direction indication */ + dir_hb = ws_gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 3, FALSE); + gtk_container_set_border_width(GTK_CONTAINER(dir_hb), 3); + gtk_box_pack_start(GTK_BOX(input_vb), dir_hb, FALSE, FALSE, 0); + + dir_cb = gtk_check_button_new_with_label("Direction indication"); + gtk_widget_set_tooltip_text(dir_cb, "Whether or not the file contains information indicating the direction " + " (inbound or outbound) of the packet"); + gtk_box_pack_start(GTK_BOX(dir_hb), dir_cb, FALSE, FALSE, 0); + + g_object_set_data(G_OBJECT(input_frm), INPUT_DIR_CB_KEY, dir_cb); + /* Setup the import frame */ import_frm = gtk_frame_new("Import"); diff --git a/ui/qt/import_text_dialog.cpp b/ui/qt/import_text_dialog.cpp index 4848a916e1..4d96105a87 100644 --- a/ui/qt/import_text_dialog.cpp +++ b/ui/qt/import_text_dialog.cpp @@ -325,6 +325,11 @@ void ImportTextDialog::on_dateTimeLineEdit_textChanged(const QString &time_forma } } +void ImportTextDialog::on_directionIndicationCheckBox_toggled(bool checked) +{ + import_info_.has_direction = checked; +} + void ImportTextDialog::on_noDummyButton_toggled(bool checked) { if (checked) enableHeaderWidgets(); diff --git a/ui/qt/import_text_dialog.h b/ui/qt/import_text_dialog.h index 957c91f2a4..49a460aedf 100644 --- a/ui/qt/import_text_dialog.h +++ b/ui/qt/import_text_dialog.h @@ -71,6 +71,7 @@ private slots: void on_textFileLineEdit_textChanged(const QString &arg1); void on_encapComboBox_currentIndexChanged(int index); void on_dateTimeLineEdit_textChanged(const QString &arg1); + void on_directionIndicationCheckBox_toggled(bool checked); void on_noDummyButton_toggled(bool checked); void on_ethernetButton_toggled(bool checked); void on_ipv4Button_toggled(bool checked); diff --git a/ui/qt/import_text_dialog.ui b/ui/qt/import_text_dialog.ui index dd46b03acc..6ab8661754 100644 --- a/ui/qt/import_text_dialog.ui +++ b/ui/qt/import_text_dialog.ui @@ -173,6 +173,23 @@ + + + + Whether or not the file contains information indicating the direction (inbound or outbound) of the packet. + + + Direction indication: + + + + + + + Whether or not the file contains information indicating the direction (inbound or outbound) of the packet. + + + -- cgit v1.2.3