diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2011-02-03 17:41:45 +0000 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2011-02-03 17:41:45 +0000 |
commit | 7d6e4633e33fe3f8bd36a3bc3d55d1654b03f314 (patch) | |
tree | 0c208a5f3f7040a5818c6e4752773a4fcc4aff7e /gtk | |
parent | f0a410b17067fb06cc4991869cdfe734056fcd1b (diff) |
Disable error substring controls when show errors checkbox is disabled.
svn path=/trunk/; revision=35784
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/mac_lte_stat_dlg.c | 18 | ||||
-rw-r--r-- | gtk/rlc_lte_stat_dlg.c | 18 |
2 files changed, 32 insertions, 4 deletions
diff --git a/gtk/mac_lte_stat_dlg.c b/gtk/mac_lte_stat_dlg.c index e3b342034d..793e8a280e 100644 --- a/gtk/mac_lte_stat_dlg.c +++ b/gtk/mac_lte_stat_dlg.c @@ -506,6 +506,7 @@ mac_lte_ue_details(mac_lte_ep_t *mac_stat_ep, mac_lte_stat_t *hs) { int n; gchar buff[32]; + guint8 show_dct_errors; /**********************************/ /* Set data one row at a time */ @@ -590,8 +591,11 @@ mac_lte_ue_details(mac_lte_ep_t *mac_stat_ep, mac_lte_stat_t *hs) gtk_widget_set_sensitive(hs->dl_filter_bt, mac_stat_ep != NULL); gtk_widget_set_sensitive(hs->uldl_filter_bt, mac_stat_ep != NULL); gtk_widget_set_sensitive(hs->show_dct_errors_cb, mac_stat_ep != NULL); - gtk_widget_set_sensitive(hs->dct_error_substring_lb, mac_stat_ep != NULL); - gtk_widget_set_sensitive(hs->dct_error_substring_te, mac_stat_ep != NULL); + + /* Enabling substring control only if errors enabled */ + show_dct_errors = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hs->show_dct_errors_cb)); + gtk_widget_set_sensitive(hs->dct_error_substring_lb, show_dct_errors && (mac_stat_ep != NULL)); + gtk_widget_set_sensitive(hs->dct_error_substring_te, show_dct_errors && (mac_stat_ep != NULL)); } @@ -880,6 +884,15 @@ static void mac_lte_select_cb(GtkTreeSelection *sel, gpointer data) } } +/* When DCT errors check-box is toggled, enable substring controls accordingly */ +static void mac_lte_dct_errors_cb(GtkTreeSelection *sel _U_, gpointer data) +{ + mac_lte_stat_t *hs = (mac_lte_stat_t*)data; + guint8 show_dct_errors = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hs->show_dct_errors_cb)); + + gtk_widget_set_sensitive(hs->dct_error_substring_lb, show_dct_errors); + gtk_widget_set_sensitive(hs->dct_error_substring_te, show_dct_errors); +} /* Destroy the stats window */ @@ -1174,6 +1187,7 @@ static void gtk_mac_lte_stat_init(const char *optarg, void *userdata _U_) hs->show_dct_errors_cb = gtk_check_button_new_with_mnemonic("Show DCT2000 error strings"); gtk_container_add(GTK_CONTAINER(filter_buttons_hb), hs->show_dct_errors_cb); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hs->show_dct_errors_cb), FALSE); + g_signal_connect(hs->show_dct_errors_cb, "toggled", G_CALLBACK(mac_lte_dct_errors_cb), hs); gtk_tooltips_set_tip(tooltips, hs->show_dct_errors_cb, "When checked, generated filters will " "include DCT2000 error strings", NULL); /* Initially disabled */ diff --git a/gtk/rlc_lte_stat_dlg.c b/gtk/rlc_lte_stat_dlg.c index 3ff9197900..6da20f2df0 100644 --- a/gtk/rlc_lte_stat_dlg.c +++ b/gtk/rlc_lte_stat_dlg.c @@ -226,12 +226,16 @@ static int get_channel_selection(rlc_lte_stat_t *hs, /* Show filter controls appropriate to current selection */ static void enable_filter_controls(guint8 enabled, guint8 rlcMode, rlc_lte_stat_t *hs) { + guint8 show_dct_errors = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hs->show_dct_errors_cb)); + gtk_widget_set_sensitive(hs->ul_filter_bt, enabled); gtk_widget_set_sensitive(hs->dl_filter_bt, enabled); gtk_widget_set_sensitive(hs->uldl_filter_bt, enabled); gtk_widget_set_sensitive(hs->show_dct_errors_cb, enabled); - gtk_widget_set_sensitive(hs->dct_error_substring_lb, enabled); - gtk_widget_set_sensitive(hs->dct_error_substring_te, enabled); + + /* Enabling substring control only if errors enabled */ + gtk_widget_set_sensitive(hs->dct_error_substring_lb, enabled && show_dct_errors); + gtk_widget_set_sensitive(hs->dct_error_substring_te, enabled && show_dct_errors); switch (rlcMode) { case RLC_TM_MODE: @@ -818,6 +822,15 @@ rlc_lte_stat_draw(void *phs) } } +/* When DCT errors check-box is toggled, enable substring controls accordingly */ +static void rlc_lte_dct_errors_cb(GtkTreeSelection *sel _U_, gpointer data) +{ + rlc_lte_stat_t *hs = (rlc_lte_stat_t*)data; + guint8 show_dct_errors = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hs->show_dct_errors_cb)); + + gtk_widget_set_sensitive(hs->dct_error_substring_lb, show_dct_errors); + gtk_widget_set_sensitive(hs->dct_error_substring_te, show_dct_errors); +} /* What to do when a UE list item is selected/unselected */ static void rlc_lte_select_ue_cb(GtkTreeSelection *sel, gpointer data) @@ -1441,6 +1454,7 @@ static void gtk_rlc_lte_stat_init(const char *optarg, void *userdata _U_) hs->show_dct_errors_cb = gtk_check_button_new_with_mnemonic("Show DCT2000 error strings..."); gtk_container_add(GTK_CONTAINER(sn_filter_hb), hs->show_dct_errors_cb); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hs->show_dct_errors_cb), FALSE); + g_signal_connect(hs->show_dct_errors_cb, "toggled", G_CALLBACK(rlc_lte_dct_errors_cb), hs); gtk_tooltips_set_tip(tooltips, hs->show_dct_errors_cb, "When checked, generated filters will " "include DCT2000 error strings", NULL); |