aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrene RĂ¼ngeler <I.Ruengeler@fh-muenster.de>2013-04-05 06:43:38 +0000
committerIrene RĂ¼ngeler <I.Ruengeler@fh-muenster.de>2013-04-05 06:43:38 +0000
commitb34e4d5fee812e7184f3a63dd67f508fc31e87ed (patch)
treefffdf06449202d888834e7f2db05e88c8f683d77
parent352b96d735990e93a6dd94b8917e910f405cb109 (diff)
Add checkbox for the direction indication to the "Import from Hex Dump" dialog.
svn path=/trunk/; revision=48745
-rw-r--r--ui/gtk/file_import_dlg.c17
-rw-r--r--ui/qt/import_text_dialog.cpp5
-rw-r--r--ui/qt/import_text_dialog.h1
-rw-r--r--ui/qt/import_text_dialog.ui17
4 files changed, 40 insertions, 0 deletions
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 @@
</item>
</layout>
</item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="directionIndicationLabel">
+ <property name="toolTip">
+ <string>Whether or not the file contains information indicating the direction (inbound or outbound) of the packet.</string>
+ </property>
+ <property name="text">
+ <string>Direction indication:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QCheckBox" name="directionIndicationCheckBox">
+ <property name="toolTip">
+ <string>Whether or not the file contains information indicating the direction (inbound or outbound) of the packet.</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>