diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2011-02-16 18:27:00 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2011-02-16 18:27:00 +0000 |
commit | 82c78778ae49ea5c09bd1caa237a98ce4b9c79ac (patch) | |
tree | 139e3323a40b4d620b5da0b6b4fd595fd42b0eb3 /gtk/capture_if_dlg.c | |
parent | d3051fa55df8ec9d323c5116a14c4dd1b9cf3eab (diff) |
More cleanup toward being able to compile with GTK+ 3.0. Mostly replacing
deprecated GtkToolTips with new functions.
svn path=/trunk/; revision=35966
Diffstat (limited to 'gtk/capture_if_dlg.c')
-rw-r--r-- | gtk/capture_if_dlg.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gtk/capture_if_dlg.c b/gtk/capture_if_dlg.c index ebb2da1401..a69420240b 100644 --- a/gtk/capture_if_dlg.c +++ b/gtk/capture_if_dlg.c @@ -585,7 +585,9 @@ capture_if_cb(GtkWidget *w _U_, gpointer d _U_) GtkWidget *if_tb; GtkWidget *if_lb; GtkWidget *eb; +#if !GTK_CHECK_VERSION(2,12,0) GtkTooltips *tooltips; +#endif int err; gchar *err_str; GtkRequisition requisition; @@ -672,7 +674,9 @@ capture_if_cb(GtkWidget *w _U_, gpointer d _U_) cap_if_w = dlg_window_new("Wireshark: Capture Interfaces"); /* transient_for top_level */ gtk_window_set_destroy_with_parent (GTK_WINDOW(cap_if_w), TRUE); +#if !GTK_CHECK_VERSION(2,12,0) tooltips = gtk_tooltips_new(); +#endif main_sw = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(main_sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); @@ -718,8 +722,13 @@ capture_if_cb(GtkWidget *w _U_, gpointer d _U_) gtk_table_attach_defaults(GTK_TABLE(if_tb), if_lb, 5, 6, row, row+1); stop_bt = gtk_button_new_from_stock(WIRESHARK_STOCK_CAPTURE_STOP); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(stop_bt, "Stop a running capture."); +#else gtk_tooltips_set_tip(tooltips, stop_bt, "Stop a running capture.", NULL); +#endif + #ifdef _WIN32 gtk_table_attach_defaults(GTK_TABLE(if_tb), stop_bt, 6, 9, row, row+1); #else @@ -826,23 +835,35 @@ capture_if_cb(GtkWidget *w _U_, gpointer d _U_) if_dlg_data->capture_bt = gtk_button_new_from_stock(WIRESHARK_STOCK_CAPTURE_START); g_signal_connect(if_dlg_data->capture_bt, "clicked", G_CALLBACK(capture_do_cb), if_dlg_data); tmp_str = g_strdup_printf("Immediately start a capture from this interface:\n\n%s", if_tool_str->str); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(if_dlg_data->capture_bt, tmp_str); +#else gtk_tooltips_set_tip(tooltips, if_dlg_data->capture_bt, tmp_str, NULL); +#endif g_free(tmp_str); gtk_table_attach_defaults(GTK_TABLE(if_tb), if_dlg_data->capture_bt, 6, 7, row, row+1); /* prepare button */ if_dlg_data->prepare_bt = gtk_button_new_from_stock(WIRESHARK_STOCK_CAPTURE_OPTIONS); g_signal_connect(if_dlg_data->prepare_bt, "clicked", G_CALLBACK(capture_prepare_cb), if_dlg_data); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(if_dlg_data->prepare_bt, "Open the capture options dialog with this interface selected."); +#else gtk_tooltips_set_tip(tooltips, if_dlg_data->prepare_bt, "Open the capture options dialog with this interface selected.", NULL); +#endif gtk_table_attach_defaults(GTK_TABLE(if_tb), if_dlg_data->prepare_bt, 7, 8, row, row+1); /* details button */ #ifdef _WIN32 if_dlg_data->details_bt = gtk_button_new_from_stock(WIRESHARK_STOCK_CAPTURE_DETAILS); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip-text(if_dlg_data->details_bt, "Open the capture details dialog of this interface."); +#else gtk_tooltips_set_tip(tooltips, if_dlg_data->details_bt, "Open the capture details dialog of this interface.", NULL); +#endif gtk_table_attach_defaults(GTK_TABLE(if_tb), if_dlg_data->details_bt, 8, 9, row, row+1); if (capture_if_has_details(if_dlg_data->device)) { g_signal_connect(if_dlg_data->details_bt, "clicked", G_CALLBACK(capture_details_cb), if_dlg_data); @@ -869,7 +890,11 @@ capture_if_cb(GtkWidget *w _U_, gpointer d _U_) close_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE); window_set_cancel_button(cap_if_w, close_bt, window_cancel_button_cb); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(close_bt, "Close this window."); +#else gtk_tooltips_set_tip(tooltips, close_bt, "Close this window.", NULL); +#endif help_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_HELP); g_signal_connect(help_bt, "clicked", G_CALLBACK(topic_cb), (gpointer)(HELP_CAPTURE_INTERFACES_DIALOG)); |