Blame wireshark-0025-Fix-Capture-Dialog-layout.patch

88032f
From: Peter Hatina <phatina@redhat.com>
88032f
Date: Mon, 3 Mar 2014 12:01:36 +0100
88032f
Subject: [PATCH] Reorganize Capture Dialog layout
88032f
88032f
Change-Id: Iafe20f3a8509c83e821ce4abc9bd91bd1bb002dd
88032f
Peter Hatina 9dcc3e
diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c
88032f
index a4ef2dc..700f23a 100644
Peter Hatina 9dcc3e
--- a/ui/gtk/capture_dlg.c
Peter Hatina 9dcc3e
+++ b/ui/gtk/capture_dlg.c
Peter Hatina 9dcc3e
@@ -4637,7 +4637,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
 #endif
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   swindow = gtk_scrolled_window_new (NULL, NULL);
Peter Hatina 9dcc3e
-  gtk_widget_set_size_request(swindow, 676, 180);
Peter Hatina 9dcc3e
+  gtk_widget_set_size_request(swindow, 676, 100);
Peter Hatina 9dcc3e
   gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(swindow), GTK_SHADOW_IN);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   view = gtk_tree_view_new ();
88032f
@@ -5044,30 +5044,6 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   row++;
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
-  /* Files row */
Peter Hatina 9dcc3e
-  stop_files_cb = gtk_check_button_new_with_label("Stop capture after");
Peter Hatina 9dcc3e
-  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop_files_cb),
Peter Hatina 9dcc3e
-                               global_capture_opts.has_autostop_files);
Peter Hatina 9dcc3e
-  g_signal_connect(stop_files_cb, "toggled", G_CALLBACK(capture_prep_adjust_sensitivity), cap_open_w);
Peter Hatina 9dcc3e
-  gtk_widget_set_tooltip_text(stop_files_cb, "Stop capturing after the given number of \"file switches\" have been done.");
Peter Hatina 9dcc3e
-  ws_gtk_grid_attach_extended(GTK_GRID (multi_grid), stop_files_cb, 0, row, 1, 1,
Peter Hatina 9dcc3e
-                              (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
-
Peter Hatina 9dcc3e
-  stop_files_adj = (GtkAdjustment *) gtk_adjustment_new((gfloat)global_capture_opts.autostop_files,
Peter Hatina 9dcc3e
-    1, (gfloat)INT_MAX, 1.0, 10.0, 0.0);
Peter Hatina 9dcc3e
-  stop_files_sb = gtk_spin_button_new (stop_files_adj, 0, 0);
Peter Hatina 9dcc3e
-  gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (stop_files_sb), TRUE);
Peter Hatina 9dcc3e
-  gtk_widget_set_size_request(stop_files_sb, 80, -1);
Peter Hatina 9dcc3e
-  ws_gtk_grid_attach_extended(GTK_GRID (multi_grid), stop_files_sb, 1, row, 1, 1,
Peter Hatina 9dcc3e
-                              (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
-
Peter Hatina 9dcc3e
-  stop_files_lb = gtk_label_new("file(s)");
Peter Hatina 9dcc3e
-  gtk_misc_set_alignment(GTK_MISC(stop_files_lb), 0, 0.5f);
Peter Hatina 9dcc3e
-  ws_gtk_grid_attach_extended(GTK_GRID (multi_grid), stop_files_lb, 2, row, 1, 1,
Peter Hatina 9dcc3e
-                              (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
-
Peter Hatina 9dcc3e
-  row++;
Peter Hatina 9dcc3e
-
Peter Hatina 9dcc3e
   /* Capture limits frame */
Peter Hatina 9dcc3e
   limit_fr = frame_new("Stop Capture Automatically After...");
Peter Hatina 9dcc3e
   gtk_box_pack_start(GTK_BOX (left_vb), limit_fr, TRUE, TRUE, 0);
88032f
@@ -5107,15 +5083,13 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
   ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_packets_lb, 2, row, 1, 1,
Peter Hatina 9dcc3e
                               (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
-  row++;
Peter Hatina 9dcc3e
-
Peter Hatina 9dcc3e
   /* Filesize row */
Peter Hatina 9dcc3e
   stop_filesize_cb = gtk_check_button_new();
Peter Hatina 9dcc3e
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop_filesize_cb),
Peter Hatina 9dcc3e
                                global_capture_opts.has_autostop_filesize);
Peter Hatina 9dcc3e
   g_signal_connect(stop_filesize_cb, "toggled", G_CALLBACK(capture_prep_adjust_sensitivity), cap_open_w);
Peter Hatina 9dcc3e
   gtk_widget_set_tooltip_text(stop_filesize_cb, "Stop capturing after the specified amount of data has been captured.");
Peter Hatina 9dcc3e
-  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_cb, 0, row, 1, 1,
Peter Hatina 9dcc3e
+  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_cb, 3, row, 1, 1,
Peter Hatina 9dcc3e
                               (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   stop_filesize_adj = (GtkAdjustment *) gtk_adjustment_new(0.0,
88032f
@@ -5123,11 +5097,11 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
   stop_filesize_sb = gtk_spin_button_new (stop_filesize_adj, 0, 0);
Peter Hatina 9dcc3e
   gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (stop_filesize_sb), TRUE);
Peter Hatina 9dcc3e
   gtk_widget_set_size_request(stop_filesize_sb, 80, -1);
Peter Hatina 9dcc3e
-  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_sb, 1, row, 1, 1,
Peter Hatina 9dcc3e
+  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_sb, 4, row, 1, 1,
Peter Hatina 9dcc3e
                               (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   stop_filesize_cbx = size_unit_combo_box_new(global_capture_opts.autostop_filesize);
Peter Hatina 9dcc3e
-  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_cbx, 2, row, 1, 1,
Peter Hatina 9dcc3e
+  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_filesize_cbx, 5, row, 1, 1,
Peter Hatina 9dcc3e
                               (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   value = size_unit_combo_box_set_value(global_capture_opts.autostop_filesize);
88032f
@@ -5135,13 +5109,35 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   row++;
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
+  /* Files row */
Peter Hatina 9dcc3e
+  stop_files_cb = gtk_check_button_new();
Peter Hatina 9dcc3e
+  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop_files_cb),
Peter Hatina 9dcc3e
+                               global_capture_opts.has_autostop_files);
Peter Hatina 9dcc3e
+  g_signal_connect(stop_files_cb, "toggled", G_CALLBACK(capture_prep_adjust_sensitivity), cap_open_w);
Peter Hatina 9dcc3e
+  gtk_widget_set_tooltip_text(stop_files_cb, "Stop capturing after the given number of \"file switches\" have been done.");
Peter Hatina 9dcc3e
+  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_files_cb, 0, row, 1, 1,
Peter Hatina 9dcc3e
+                              (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
+
Peter Hatina 9dcc3e
+  stop_files_adj = (GtkAdjustment *) gtk_adjustment_new((gfloat)global_capture_opts.autostop_files,
Peter Hatina 9dcc3e
+    1, (gfloat)INT_MAX, 1.0, 10.0, 0.0);
Peter Hatina 9dcc3e
+  stop_files_sb = gtk_spin_button_new (stop_files_adj, 0, 0);
Peter Hatina 9dcc3e
+  gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (stop_files_sb), TRUE);
Peter Hatina 9dcc3e
+  gtk_widget_set_size_request(stop_files_sb, 80, -1);
Peter Hatina 9dcc3e
+  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_files_sb, 1, row, 1, 1,
Peter Hatina 9dcc3e
+                              (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
+
Peter Hatina 9dcc3e
+  stop_files_lb = gtk_label_new("file(s)");
Peter Hatina 9dcc3e
+  gtk_misc_set_alignment(GTK_MISC(stop_files_lb), 0, 0.5f);
Peter Hatina 9dcc3e
+  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_files_lb, 2, row, 1, 1,
Peter Hatina 9dcc3e
+                              (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
+
Peter Hatina 9dcc3e
   /* Duration row */
Peter Hatina 9dcc3e
   stop_duration_cb = gtk_check_button_new();
Peter Hatina 9dcc3e
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop_duration_cb),
Peter Hatina 9dcc3e
                                global_capture_opts.has_autostop_duration);
Peter Hatina 9dcc3e
   g_signal_connect(stop_duration_cb, "toggled", G_CALLBACK(capture_prep_adjust_sensitivity), cap_open_w);
Peter Hatina 9dcc3e
   gtk_widget_set_tooltip_text(stop_duration_cb, "Stop capturing after the specified amount of time has passed.");
Peter Hatina 9dcc3e
-  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_cb, 0, row, 1, 1,
Peter Hatina 9dcc3e
+  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_cb, 3, row, 1, 1,
Peter Hatina 9dcc3e
                               (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   stop_duration_adj = (GtkAdjustment *) gtk_adjustment_new(0.0,
88032f
@@ -5149,11 +5145,11 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
   stop_duration_sb = gtk_spin_button_new (stop_duration_adj, 0, 0);
Peter Hatina 9dcc3e
   gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (stop_duration_sb), TRUE);
Peter Hatina 9dcc3e
   gtk_widget_set_size_request(stop_duration_sb, 80, -1);
Peter Hatina 9dcc3e
-  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_sb, 1, row, 1, 1,
Peter Hatina 9dcc3e
+  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_sb, 4, row, 1, 1,
Peter Hatina 9dcc3e
                               (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   stop_duration_cbx = time_unit_combo_box_new(global_capture_opts.autostop_duration);
Peter Hatina 9dcc3e
-  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_cbx, 2, row, 1, 1,
Peter Hatina 9dcc3e
+  ws_gtk_grid_attach_extended(GTK_GRID (limit_grid), stop_duration_cbx, 5, row, 1, 1,
Peter Hatina 9dcc3e
                               (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   value = time_unit_combo_box_convert_value(global_capture_opts.autostop_duration);
88032f
@@ -5164,7 +5160,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
   display_fr = frame_new("Display Options");
Peter Hatina 9dcc3e
   gtk_box_pack_start(GTK_BOX (right_vb), display_fr, TRUE, TRUE, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
-  display_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, DLG_UNRELATED_SPACING, FALSE);
Peter Hatina 9dcc3e
+  display_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, DLG_LABEL_SPACING, FALSE);
Peter Hatina 9dcc3e
   gtk_container_set_border_width(GTK_CONTAINER(display_vb), DLG_OUTER_MARGIN);
Peter Hatina 9dcc3e
   gtk_container_add(GTK_CONTAINER(display_fr), display_vb);
Peter Hatina 9dcc3e
 
88032f
@@ -5177,7 +5173,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
   gtk_widget_set_tooltip_text(sync_cb,
Peter Hatina 9dcc3e
     "Using this option will show the captured packets immediately on the main screen. "
Peter Hatina 9dcc3e
     "Please note: this will slow down capturing, so increased packet drops might appear.");
Peter Hatina 9dcc3e
-  gtk_box_pack_start(GTK_BOX (display_vb), sync_cb, TRUE, TRUE, 0);
Peter Hatina 9dcc3e
+  gtk_box_pack_start(GTK_BOX (display_vb), sync_cb, FALSE, TRUE, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   /* "Auto-scroll live update" row */
Peter Hatina 9dcc3e
   auto_scroll_cb = gtk_check_button_new_with_mnemonic("_Automatically scroll during live capture");
88032f
@@ -5185,19 +5181,19 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
   gtk_widget_set_tooltip_text(auto_scroll_cb,
Peter Hatina 9dcc3e
     "This will scroll the \"Packet List\" automatically to the latest captured packet, "
Peter Hatina 9dcc3e
     "when the \"Update List of packets in real time\" option is used.");
Peter Hatina 9dcc3e
-  gtk_box_pack_start(GTK_BOX (display_vb), auto_scroll_cb, TRUE, TRUE, 0);
Peter Hatina 9dcc3e
+  gtk_box_pack_start(GTK_BOX (display_vb), auto_scroll_cb, FALSE, TRUE, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   /* "Hide capture info" row */
Peter Hatina 9dcc3e
   hide_info_cb = gtk_check_button_new_with_mnemonic("_Hide capture info dialog");
Peter Hatina 9dcc3e
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hide_info_cb), !global_capture_opts.show_info);
Peter Hatina 9dcc3e
   gtk_widget_set_tooltip_text(hide_info_cb, "Hide the capture info dialog while capturing.");
Peter Hatina 9dcc3e
-  gtk_box_pack_start(GTK_BOX (display_vb), hide_info_cb, TRUE, TRUE, 0);
Peter Hatina 9dcc3e
+  gtk_box_pack_start(GTK_BOX (display_vb), hide_info_cb, FALSE, TRUE, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   /* Name Resolution frame */
Peter Hatina 9dcc3e
   resolv_fr = frame_new("Name Resolution");
Peter Hatina 9dcc3e
   gtk_box_pack_start(GTK_BOX (right_vb), resolv_fr, TRUE, TRUE, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
-  resolv_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, DLG_UNRELATED_SPACING, FALSE);
Peter Hatina 9dcc3e
+  resolv_vb = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, DLG_LABEL_SPACING, FALSE);
Peter Hatina 9dcc3e
   gtk_container_set_border_width(GTK_CONTAINER(resolv_vb), DLG_OUTER_MARGIN);
Peter Hatina 9dcc3e
   gtk_container_add(GTK_CONTAINER(resolv_fr), resolv_vb);
Peter Hatina 9dcc3e
 
88032f
@@ -5206,14 +5202,14 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_resolv_cb),
Peter Hatina 9dcc3e
                 gbl_resolv_flags.mac_name);
Peter Hatina 9dcc3e
   gtk_widget_set_tooltip_text(m_resolv_cb, "Perform MAC layer name resolution while capturing.");
Peter Hatina 9dcc3e
-  gtk_box_pack_start(GTK_BOX (resolv_vb), m_resolv_cb, TRUE, TRUE, 0);
Peter Hatina 9dcc3e
+  gtk_box_pack_start(GTK_BOX (resolv_vb), m_resolv_cb, FALSE, TRUE, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   n_resolv_cb = gtk_check_button_new_with_mnemonic(
Peter Hatina 9dcc3e
                 "Resolve _network-layer names");
Peter Hatina 9dcc3e
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(n_resolv_cb),
Peter Hatina 9dcc3e
                 gbl_resolv_flags.network_name);
Peter Hatina 9dcc3e
   gtk_widget_set_tooltip_text(n_resolv_cb, "Perform network layer name resolution while capturing.");
Peter Hatina 9dcc3e
-  gtk_box_pack_start(GTK_BOX (resolv_vb), n_resolv_cb, TRUE, TRUE, 0);
Peter Hatina 9dcc3e
+  gtk_box_pack_start(GTK_BOX (resolv_vb), n_resolv_cb, FALSE, TRUE, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   t_resolv_cb = gtk_check_button_new_with_mnemonic(
Peter Hatina 9dcc3e
                 "Resolve _transport-layer name");
88032f
@@ -5221,7 +5217,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
                 gbl_resolv_flags.transport_name);
Peter Hatina 9dcc3e
   gtk_widget_set_tooltip_text(t_resolv_cb,
Peter Hatina 9dcc3e
     "Perform transport layer name resolution while capturing.");
Peter Hatina 9dcc3e
-  gtk_box_pack_start(GTK_BOX (resolv_vb), t_resolv_cb, TRUE, TRUE, 0);
Peter Hatina 9dcc3e
+  gtk_box_pack_start(GTK_BOX (resolv_vb), t_resolv_cb, FALSE, TRUE, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   e_resolv_cb = gtk_check_button_new_with_mnemonic(
Peter Hatina 9dcc3e
                 "Use _external network name resolver");
88032f
@@ -5229,7 +5225,7 @@ capture_prep_cb(GtkWidget *w _U_, gpointer d _U_)
Peter Hatina 9dcc3e
                 gbl_resolv_flags.use_external_net_name_resolver);
Peter Hatina 9dcc3e
   gtk_widget_set_tooltip_text(e_resolv_cb,
Peter Hatina 9dcc3e
                 "Use the (system's) configured name resolver (e.g., DNS) to resolve network names.");
Peter Hatina 9dcc3e
-  gtk_box_pack_start(GTK_BOX (resolv_vb), e_resolv_cb, TRUE, TRUE, 0);
Peter Hatina 9dcc3e
+  gtk_box_pack_start(GTK_BOX (resolv_vb), e_resolv_cb, FALSE, TRUE, 0);
Peter Hatina 9dcc3e
 
Peter Hatina 9dcc3e
   /* Button row: "Start", "Cancel" and "Help" buttons */
Peter Hatina 9dcc3e
   bbox = dlg_button_row_new(WIRESHARK_STOCK_CAPTURE_START, GTK_STOCK_CLOSE, GTK_STOCK_HELP, NULL);