diff options
author | Guy Harris <guy@alum.mit.edu> | 2006-10-20 20:05:27 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2006-10-20 20:05:27 +0000 |
commit | 58bbda182ad3d62b1bf1daca4dcaef8f02dd3136 (patch) | |
tree | cc6242c4047917b00b4a935fb598ac236e6d601d /gtk | |
parent | df360ddc8c5ae8573e04c86bbbb876d020dcf56f (diff) |
Don't display the Play button if we're not built with the RTP player.
In tests for whether we're built with the RTP player, test
HAVE_LIBPORTAUDIO first - hopefully we can eventually get rid of the
test for the GTK+ version number.
svn path=/trunk/; revision=19641
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/voip_calls.c | 8 | ||||
-rw-r--r-- | gtk/voip_calls_dlg.c | 31 |
2 files changed, 27 insertions, 12 deletions
diff --git a/gtk/voip_calls.c b/gtk/voip_calls.c index 1a4ca4294a..431a74b0d3 100644 --- a/gtk/voip_calls.c +++ b/gtk/voip_calls.c @@ -65,11 +65,11 @@ #include "alert_box.h" #include "simple_dialog.h" -#if GTK_MAJOR_VERSION >= 2 #ifdef HAVE_LIBPORTAUDIO +#if GTK_MAJOR_VERSION >= 2 #include "rtp_player.h" -#endif /* HAVE_LIBPORTAUDIO */ #endif /* GTK_MAJOR_VERSION >= 2 */ +#endif /* HAVE_LIBPORTAUDIO */ const char *voip_call_state_name[7]={ "CALL SETUP", @@ -130,9 +130,9 @@ void voip_calls_reset(voip_calls_tapinfo_t *tapinfo) GList* list; GList* list2; - /* reset the RTP player */ -#if GTK_MAJOR_VERSION >= 2 #ifdef HAVE_LIBPORTAUDIO +#if GTK_MAJOR_VERSION >= 2 + /* reset the RTP player */ reset_rtp_player(); #endif #endif diff --git a/gtk/voip_calls_dlg.c b/gtk/voip_calls_dlg.c index 6af490015c..5e1480d3c5 100644 --- a/gtk/voip_calls_dlg.c +++ b/gtk/voip_calls_dlg.c @@ -90,7 +90,11 @@ static GtkWidget *label_fwd = NULL; /*static GtkWidet *bt_unselect = NULL;*/ static GtkWidget *bt_filter = NULL; static GtkWidget *bt_graph = NULL; +#ifdef HAVE_LIBPORTAUDIO +#if GTK_MAJOR_VERSION >= 2 static GtkWidget *bt_player = NULL; +#endif +#endif /* HAVE_LIBPORTAUDIO */ static voip_calls_info_t* selected_call_fwd = NULL; /* current selection */ static GList *last_list = NULL; @@ -247,7 +251,11 @@ voip_calls_on_unselect (GtkButton *button _U_, /*gtk_widget_set_sensitive(bt_unselect, FALSE);*/ gtk_widget_set_sensitive(bt_filter, FALSE); gtk_widget_set_sensitive(bt_graph, FALSE); +#ifdef HAVE_LIBPORTAUDIO +#if GTK_MAJOR_VERSION >= 2 gtk_widget_set_sensitive(bt_player, FALSE); +#endif +#endif /* HAVE_LIBPORTAUDIO */ } @@ -411,17 +419,17 @@ on_graph_bt_clicked (GtkButton *button _U_, graph_analysis_update(graph_analysis_data); /* refresh it */ } +#ifdef HAVE_LIBPORTAUDIO +#if GTK_MAJOR_VERSION >= 2 /****************************************************************************/ static void on_player_bt_clicked (GtkButton *button _U_, gpointer user_data _U_) { -#if GTK_MAJOR_VERSION >= 2 -#ifdef HAVE_LIBPORTAUDIO -rtp_player_init(voip_calls_get_info()); -#endif /* HAVE_LIBPORTAUDIO */ -#endif + rtp_player_init(voip_calls_get_info()); } +#endif +#endif /* HAVE_LIBPORTAUDIO */ /****************************************************************************/ /* when the user selects a row in the calls list */ @@ -472,16 +480,19 @@ voip_calls_on_select_row(GtkCList *clist, if (calls_ns > 0) { gtk_widget_set_sensitive(bt_filter, TRUE); gtk_widget_set_sensitive(bt_graph, TRUE); - gtk_widget_set_sensitive(bt_player, FALSE); -#if GTK_MAJOR_VERSION >= 2 #ifdef HAVE_LIBPORTAUDIO +#if GTK_MAJOR_VERSION >= 2 gtk_widget_set_sensitive(bt_player, TRUE); -#endif /* HAVE_LIBPORTAUDIO */ #endif +#endif /* HAVE_LIBPORTAUDIO */ } else { gtk_widget_set_sensitive(bt_filter, FALSE); gtk_widget_set_sensitive(bt_graph, FALSE); +#ifdef HAVE_LIBPORTAUDIO +#if GTK_MAJOR_VERSION >= 2 gtk_widget_set_sensitive(bt_player, FALSE); +#endif +#endif /* HAVE_LIBPORTAUDIO */ } /* TODO: activate other buttons when implemented */ @@ -686,11 +697,15 @@ static void voip_calls_dlg_create (void) SIGNAL_CONNECT(bt_graph, "clicked", on_graph_bt_clicked, NULL); gtk_tooltips_set_tip (tooltips, bt_graph, "Show a flow graph of the selected calls.", NULL); +#ifdef HAVE_LIBPORTAUDIO +#if GTK_MAJOR_VERSION >= 2 bt_player = gtk_button_new_with_label("Player"); gtk_container_add(GTK_CONTAINER(hbuttonbox), bt_player); gtk_widget_show(bt_player); SIGNAL_CONNECT(bt_player, "clicked", on_player_bt_clicked, NULL); gtk_tooltips_set_tip (tooltips, bt_player, "Launch the RTP player to listen the selected calls.", NULL); +#endif +#endif /* HAVE_LIBPORTAUDIO */ bt_close = BUTTON_NEW_FROM_STOCK(GTK_STOCK_CLOSE); gtk_container_add (GTK_CONTAINER (hbuttonbox), bt_close); |