aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorStephen Fisher <steve@stephen-fisher.com>2011-01-22 17:42:40 +0000
committerStephen Fisher <steve@stephen-fisher.com>2011-01-22 17:42:40 +0000
commit73100c482be894ae66856a6a2b4bb6bf25b3b914 (patch)
tree8a8a7ccbbabc0e312948e26a41746073adcdc2e3 /gtk
parent79342907f3fd75b704a387d58e6ee010b5227bf1 (diff)
Resolve bug #2520 by moving the follow stream direction combo box above the
buttons to make more room for hostnames. svn path=/trunk/; revision=35625
Diffstat (limited to 'gtk')
-rw-r--r--gtk/follow_stream.c68
1 files changed, 36 insertions, 32 deletions
diff --git a/gtk/follow_stream.c b/gtk/follow_stream.c
index 21cf1a6364..c18fa1cf5f 100644
--- a/gtk/follow_stream.c
+++ b/gtk/follow_stream.c
@@ -719,7 +719,7 @@ follow_stream(gchar *title, follow_info_t *follow_info,
{
GtkWidget *streamwindow, *vbox, *txt_scrollw, *text;
GtkWidget *hbox, *bbox, *button, *radio_bt;
- GtkWidget *stream_fr, *stream_vb;
+ GtkWidget *stream_fr, *stream_vb, *direction_hbox;
GtkWidget *stream_cmb;
GtkTooltips *tooltips;
follow_stats_t stats;
@@ -769,6 +769,33 @@ follow_stream(gchar *title, follow_info_t *follow_info,
gtk_container_add(GTK_CONTAINER(txt_scrollw), text);
follow_info->text = text;
+ /* direction hbox */
+ direction_hbox = gtk_hbox_new(FALSE, 1);
+ gtk_box_pack_start(GTK_BOX(stream_vb), direction_hbox, FALSE, FALSE, 0);
+
+ stream_cmb = gtk_combo_box_new_text();
+
+ gtk_combo_box_append_text(GTK_COMBO_BOX(stream_cmb),
+ both_directions_string);
+ follow_info->show_stream = BOTH_HOSTS;
+
+ gtk_combo_box_append_text(GTK_COMBO_BOX(stream_cmb),
+ server_to_client_string);
+
+ gtk_combo_box_append_text(GTK_COMBO_BOX(stream_cmb),
+ client_to_server_string);
+
+ gtk_combo_box_set_active(GTK_COMBO_BOX(stream_cmb), 0); /* Do this before signal_connect */
+ /* so callback not triggered */
+
+ g_signal_connect(stream_cmb, "changed",
+ G_CALLBACK(follow_stream_direction_changed),
+ follow_info);
+
+ gtk_tooltips_set_tip (tooltips, stream_cmb,
+ "Select the stream direction to display", NULL);
+ gtk_box_pack_start(GTK_BOX(direction_hbox), stream_cmb, TRUE, TRUE, 0);
+
/* stream hbox */
hbox = gtk_hbox_new(FALSE, 1);
gtk_box_pack_start(GTK_BOX(stream_vb), hbox, FALSE, FALSE, 0);
@@ -777,54 +804,31 @@ follow_stream(gchar *title, follow_info_t *follow_info,
button = gtk_button_new_from_stock(GTK_STOCK_FIND);
g_signal_connect(button, "clicked", G_CALLBACK(follow_find_cb), follow_info);
gtk_tooltips_set_tip (tooltips, button, "Find text in the displayed content", NULL);
- gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
/* Create Save As Button */
button = gtk_button_new_from_stock(GTK_STOCK_SAVE_AS);
g_signal_connect(button, "clicked", G_CALLBACK(follow_save_as_cmd_cb), follow_info);
gtk_tooltips_set_tip (tooltips, button, "Save the content as currently displayed", NULL);
- gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
/* Create Print Button */
button = gtk_button_new_from_stock(GTK_STOCK_PRINT);
g_signal_connect(button, "clicked", G_CALLBACK(follow_print_stream), follow_info);
gtk_tooltips_set_tip(tooltips, button, "Print the content as currently displayed", NULL);
- gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
/* Stream to show */
follow_stats(&stats);
follow_info->is_ipv6 = stats.is_ipv6;
- stream_cmb = gtk_combo_box_new_text();
-
- gtk_combo_box_append_text(GTK_COMBO_BOX(stream_cmb),
- both_directions_string);
- follow_info->show_stream = BOTH_HOSTS;
-
- gtk_combo_box_append_text(GTK_COMBO_BOX(stream_cmb),
- server_to_client_string);
-
- gtk_combo_box_append_text(GTK_COMBO_BOX(stream_cmb),
- client_to_server_string);
-
- gtk_combo_box_set_active(GTK_COMBO_BOX(stream_cmb), 0); /* Do this before signal_connect */
- /* so callback not triggered */
-
- g_signal_connect(stream_cmb, "changed",
- G_CALLBACK(follow_stream_direction_changed),
- follow_info);
-
- gtk_tooltips_set_tip (tooltips, stream_cmb,
- "Select the stream direction to display", NULL);
- gtk_box_pack_start(GTK_BOX(hbox), stream_cmb, FALSE, FALSE, 0);
-
/* ASCII radio button */
radio_bt = gtk_radio_button_new_with_label(NULL, "ASCII");
gtk_tooltips_set_tip (tooltips, radio_bt, "Stream data output in \"ASCII\" format", NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_bt),
IS_SHOW_TYPE(SHOW_ASCII));
- gtk_box_pack_start(GTK_BOX(hbox), radio_bt, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), radio_bt, TRUE, TRUE, 0);
g_signal_connect(radio_bt, "toggled", G_CALLBACK(follow_charset_toggle_cb),
follow_info);
follow_info->ascii_bt = radio_bt;
@@ -836,7 +840,7 @@ follow_stream(gchar *title, follow_info_t *follow_info,
gtk_tooltips_set_tip (tooltips, radio_bt, "Stream data output in \"EBCDIC\" format", NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_bt),
IS_SHOW_TYPE(SHOW_EBCDIC));
- gtk_box_pack_start(GTK_BOX(hbox), radio_bt, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), radio_bt, TRUE, TRUE, 0);
g_signal_connect(radio_bt, "toggled", G_CALLBACK(follow_charset_toggle_cb),
follow_info);
follow_info->ebcdic_bt = radio_bt;
@@ -848,7 +852,7 @@ follow_stream(gchar *title, follow_info_t *follow_info,
gtk_tooltips_set_tip (tooltips, radio_bt, "Stream data output in \"Hexdump\" format", NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_bt),
IS_SHOW_TYPE(SHOW_HEXDUMP));
- gtk_box_pack_start(GTK_BOX(hbox), radio_bt, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), radio_bt, TRUE, TRUE, 0);
g_signal_connect(radio_bt, "toggled", G_CALLBACK(follow_charset_toggle_cb),
follow_info);
follow_info->hexdump_bt = radio_bt;
@@ -860,7 +864,7 @@ follow_stream(gchar *title, follow_info_t *follow_info,
gtk_tooltips_set_tip (tooltips, radio_bt, "Stream data output in \"C Array\" format", NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_bt),
IS_SHOW_TYPE(SHOW_CARRAY));
- gtk_box_pack_start(GTK_BOX(hbox), radio_bt, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), radio_bt, TRUE, TRUE, 0);
g_signal_connect(radio_bt, "toggled", G_CALLBACK(follow_charset_toggle_cb),
follow_info);
follow_info->carray_bt = radio_bt;
@@ -872,7 +876,7 @@ follow_stream(gchar *title, follow_info_t *follow_info,
gtk_tooltips_set_tip (tooltips, radio_bt, "Stream data output in \"Raw\" (binary) format. As this contains non printable characters, the screen output will be in ASCII format", NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_bt),
IS_SHOW_TYPE(SHOW_RAW));
- gtk_box_pack_start(GTK_BOX(hbox), radio_bt, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), radio_bt, TRUE, TRUE, 0);
g_signal_connect(radio_bt, "toggled", G_CALLBACK(follow_charset_toggle_cb),
follow_info);
follow_info->raw_bt = radio_bt;