From e9b3ee629eb3929f5ce0347de9addfb65a10a5dc Mon Sep 17 00:00:00 2001 From: Mike Massonnet Date: Sat, 7 Jan 2012 16:40:38 +0100 Subject: [PATCH] Fix commit 11313a: Set label with mnemonics and attach to action widgets --- panel-plugin/netload.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/panel-plugin/netload.c b/panel-plugin/netload.c index 0c596bd..42f1634 100644 --- a/panel-plugin/netload.c +++ b/panel-plugin/netload.c @@ -1003,13 +1003,15 @@ static void monitor_create_options(XfcePanelPlugin *plugin, t_global_monitor *gl gtk_box_pack_start(GTK_BOX(global->monitor->opt_vbox), GTK_WIDGET(net_hbox), FALSE, FALSE, 0); - device_label = gtk_label_new(_("Network _device:")); + device_label = gtk_label_new_with_mnemonic(_("Network _device:")); gtk_misc_set_alignment(GTK_MISC(device_label), 0, 0.5); gtk_widget_show(GTK_WIDGET(device_label)); gtk_box_pack_start(GTK_BOX(net_hbox), GTK_WIDGET(device_label), FALSE, FALSE, 0); global->monitor->net_entry = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(device_label), + global->monitor->net_entry); gtk_entry_set_max_length(GTK_ENTRY(global->monitor->net_entry), MAX_LENGTH); gtk_entry_set_text(GTK_ENTRY(global->monitor->net_entry), @@ -1029,11 +1031,13 @@ static void monitor_create_options(XfcePanelPlugin *plugin, t_global_monitor *gl gtk_box_pack_start(GTK_BOX(global->monitor->opt_vbox), GTK_WIDGET(update_hbox), FALSE, FALSE, 0); - update_label = gtk_label_new(_("Update _interval:")); + update_label = gtk_label_new_with_mnemonic(_("Update _interval:")); gtk_misc_set_alignment(GTK_MISC(update_label), 0, 0.5); gtk_box_pack_start(GTK_BOX(update_hbox), GTK_WIDGET(update_label), FALSE, FALSE, 0); - + global->monitor->update_spinner = gtk_spin_button_new_with_range (0.1, 10.0, 0.05); + gtk_label_set_mnemonic_widget(GTK_LABEL(update_label), + global->monitor->update_spinner); gtk_spin_button_set_digits( GTK_SPIN_BUTTON(global->monitor->update_spinner), 2 ); gtk_spin_button_set_value( GTK_SPIN_BUTTON(global->monitor->update_spinner), global->monitor->options.update_interval / 1000.0 ); @@ -1068,12 +1072,14 @@ static void monitor_create_options(XfcePanelPlugin *plugin, t_global_monitor *gl gtk_box_pack_start(GTK_BOX(global->monitor->opt_vbox), GTK_WIDGET(global->monitor->max_hbox[i]), FALSE, FALSE, 0); - max_label[i] = gtk_label_new(_(maximum_text_label[i])); + max_label[i] = gtk_label_new_with_mnemonic(_(maximum_text_label[i])); gtk_misc_set_alignment(GTK_MISC(max_label[i]), 0, 0.5); gtk_widget_show(GTK_WIDGET(max_label[i])); gtk_box_pack_start(GTK_BOX(global->monitor->max_hbox[i]), GTK_WIDGET(max_label[i]), FALSE, FALSE, 0); global->monitor->max_entry[i] = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(max_label[i]), + global->monitor->max_entry[i]); gtk_entry_set_max_length(GTK_ENTRY(global->monitor->max_entry[i]), MAX_LENGTH); g_snprintf( buffer, BUFSIZ, "%.2f", global->monitor->options.max[i] / 1024.0 ); @@ -1145,13 +1151,15 @@ static void monitor_create_options(XfcePanelPlugin *plugin, t_global_monitor *gl gtk_box_pack_start(GTK_BOX(global->monitor->opt_vbox), GTK_WIDGET(global->monitor->opt_color_hbox[i]), FALSE, FALSE, 0); - color_label[i] = gtk_label_new(_(color_text[i])); + color_label[i] = gtk_label_new_with_mnemonic(_(color_text[i])); gtk_misc_set_alignment(GTK_MISC(color_label[i]), 0, 0.5); gtk_widget_show(GTK_WIDGET(color_label[i])); gtk_box_pack_start(GTK_BOX(global->monitor->opt_color_hbox[i]), GTK_WIDGET(color_label[i]), FALSE, FALSE, 0); global->monitor->opt_button[i] = gtk_button_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(color_label[i]), + global->monitor->opt_button[i]); global->monitor->opt_da[i] = gtk_drawing_area_new(); gtk_widget_modify_bg(global->monitor->opt_da[i], GTK_STATE_NORMAL,