Author: kelnos
Date: 2007-11-17 17:01:57 +0000 (Sat, 17 Nov 2007)
New Revision: 26333

Modified:
   xfce-mcs-plugins/trunk/plugins/keyboard_plugin/keyboard_plugin.c
   xfce-mcs-plugins/trunk/plugins/keyboard_plugin/shortcuts_plugin.h
Log:
redo strings in the keyboard accessibility tab so the options are somewhat
understandable; add tooltips to clarify


Modified: xfce-mcs-plugins/trunk/plugins/keyboard_plugin/keyboard_plugin.c
===================================================================
--- xfce-mcs-plugins/trunk/plugins/keyboard_plugin/keyboard_plugin.c    
2007-11-17 15:55:33 UTC (rev 26332)
+++ xfce-mcs-plugins/trunk/plugins/keyboard_plugin/keyboard_plugin.c    
2007-11-17 17:01:57 UTC (rev 26333)
@@ -408,15 +408,17 @@
 
     sticky_key = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(dialog->checkbutton_sticky));
 
-    gtk_widget_set_sensitive(dialog->checkbutton_sticky_ltl, sticky_key);
+    gtk_widget_set_sensitive(dialog->radiobutton_sticky_latch, sticky_key);
+    gtk_widget_set_sensitive(dialog->radiobutton_sticky_lock, sticky_key);
     gtk_widget_set_sensitive(dialog->checkbutton_sticky_tk, sticky_key);
     if(!sticky_key) 
     {
-        
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->checkbutton_sticky_ltl), 
FALSE);
+        
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->radiobutton_sticky_latch),
 FALSE);
+        
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->radiobutton_sticky_lock),
 FALSE);
         
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->checkbutton_sticky_tk), 
FALSE);
     }
 
-    sticky_key_ltl = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(dialog->checkbutton_sticky_ltl));
+    sticky_key_ltl = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(dialog->radiobutton_sticky_lock));
     sticky_key_tk = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(dialog->checkbutton_sticky_tk));
     debounce_delay = (int) gtk_range_get_value (GTK_RANGE 
(dialog->scale_debounce_delay));
     slow_keys_delay = (int) gtk_range_get_value (GTK_RANGE 
(dialog->scale_slow_keys_delay));
@@ -512,84 +514,167 @@
 {
     GtkWidget *frame;
     GtkWidget *label;
-    GtkWidget *vbox;
+    GtkWidget *vbox, *hbox;
     GtkWidget *main_vbox = gtk_vbox_new(FALSE, 5);
+    GtkTooltips *tooltips = gtk_tooltips_new ();
+    
     gtk_widget_show(main_vbox);
 
     vbox = gtk_vbox_new (FALSE, 5);
     gtk_widget_show (vbox);
+    
+    g_object_ref (G_OBJECT (tooltips));
+    gtk_object_sink (GTK_OBJECT (tooltips));
+    g_signal_connect_swapped (G_OBJECT (vbox), "destroy",
+                              G_CALLBACK (g_object_unref), tooltips);
 
-    frame = xfce_create_framebox_with_content (_("Sticky keys"), vbox);
+    frame = xfce_create_framebox_with_content (_("Sticky Keys"), vbox);
     gtk_widget_show (frame);
     gtk_box_pack_start(GTK_BOX(main_vbox), frame, TRUE, TRUE, 0);
 
-    dialog->checkbutton_sticky = gtk_check_button_new_with_mnemonic(_("Enable 
Sticky keys"));
+    dialog->checkbutton_sticky = gtk_check_button_new_with_mnemonic(_("Enable 
_Sticky Keys"));
     gtk_widget_show(dialog->checkbutton_sticky);
     gtk_box_pack_start(GTK_BOX(vbox), dialog->checkbutton_sticky, FALSE, 
FALSE, 0);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(dialog->checkbutton_sticky), sticky_key);
+    gtk_tooltips_set_tip (tooltips, dialog->checkbutton_sticky,
+                          _("Sticky keys allow you to press key combinations 
(for example, Alt+F) in sequence rather than simultaneously."),
+                          NULL);
 
-    dialog->checkbutton_sticky_ltl = 
gtk_check_button_new_with_mnemonic(_("Latch To Lock"));
-    gtk_widget_show(dialog->checkbutton_sticky_ltl);
-    gtk_box_pack_start(GTK_BOX(vbox), dialog->checkbutton_sticky_ltl, FALSE, 
FALSE, 0);
-    gtk_widget_set_sensitive(dialog->checkbutton_sticky_ltl, sticky_key);
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(dialog->checkbutton_sticky_ltl), sticky_key_ltl);
+    hbox = gtk_hbox_new (FALSE, 5);
+    gtk_widget_show (hbox);
+    gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
 
-    dialog->checkbutton_sticky_tk = gtk_check_button_new_with_mnemonic(_("Two 
Keys Disable"));
+    dialog->radiobutton_sticky_latch = gtk_radio_button_new_with_mnemonic(NULL,
+                                                                          
_("_Latch mode"));
+    gtk_widget_show(dialog->radiobutton_sticky_latch);
+    gtk_box_pack_start(GTK_BOX(hbox), dialog->radiobutton_sticky_latch, FALSE, 
FALSE, 0);
+    gtk_widget_set_sensitive(dialog->radiobutton_sticky_latch, sticky_key);
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(dialog->radiobutton_sticky_latch), !sticky_key_ltl);
+    gtk_tooltips_set_tip (tooltips, dialog->radiobutton_sticky_latch,
+                          _("Pressing a modifier key once makes it sticky, and 
it stays sticky until a non-modifier key is pressed."),
+                          NULL);
+
+    dialog->radiobutton_sticky_lock = 
gtk_radio_button_new_with_mnemonic_from_widget 
(GTK_RADIO_BUTTON(dialog->radiobutton_sticky_latch),
+                                                                               
       _("L_ock mode"));
+    gtk_widget_show(dialog->radiobutton_sticky_lock);
+    gtk_box_pack_start(GTK_BOX(hbox), dialog->radiobutton_sticky_lock, FALSE, 
FALSE, 0);
+    gtk_widget_set_sensitive(dialog->radiobutton_sticky_lock, sticky_key);
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(dialog->radiobutton_sticky_lock), sticky_key_ltl);
+    gtk_tooltips_set_tip (tooltips, dialog->radiobutton_sticky_lock,
+                          _("Quickly pressing a modifier key twice makes it 
sticky, and it stays sticky until a the modifier key is pressed again."),
+                          NULL);
+
+    dialog->checkbutton_sticky_tk = 
gtk_check_button_new_with_mnemonic(_("Disable Sticky Keys if _two keys pressed 
together"));
     gtk_widget_show(dialog->checkbutton_sticky_tk);
     gtk_box_pack_start(GTK_BOX(vbox), dialog->checkbutton_sticky_tk, FALSE, 
FALSE, 0);
     gtk_widget_set_sensitive(dialog->checkbutton_sticky_tk, sticky_key);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(dialog->checkbutton_sticky_tk), sticky_key_tk);
+    gtk_tooltips_set_tip (tooltips, dialog->checkbutton_sticky_tk,
+                          _("Sticky Keys can be disabled automatically 
(without using this settings panel) by pressing two keys at the same time."),
+                          NULL);
 
     vbox = gtk_vbox_new (FALSE, 5);
     gtk_widget_show (vbox);
 
-    frame = xfce_create_framebox_with_content (_("Slow keys"), vbox);
+    frame = xfce_create_framebox_with_content (_("Slow Keys"), vbox);
     gtk_widget_show (frame);
     gtk_box_pack_start(GTK_BOX(main_vbox), frame, TRUE, TRUE, 0);
 
-    dialog->checkbutton_slow = gtk_check_button_new_with_mnemonic(_("Enable 
Slow keys"));
+    dialog->checkbutton_slow = gtk_check_button_new_with_mnemonic(_("Enable 
Slow _Keys"));
     gtk_widget_show(dialog->checkbutton_slow);
     gtk_box_pack_start(GTK_BOX(vbox), dialog->checkbutton_slow, FALSE, FALSE, 
0);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(dialog->checkbutton_slow), slow_key);
+    gtk_tooltips_set_tip (tooltips, dialog->checkbutton_slow,
+                          _("Slow Keys causes key presses not to be accepted 
unless the key is held down for a certain period of time."),
+                          NULL);
 
-    label = gtk_label_new (_("Slow keys delay :"));
+    label = gtk_label_new_with_mnemonic (_("Slow keys _delay:"));
     gtk_widget_show (label);
     gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
     gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 0);
     gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+    
+    /* create this first so we can set the mnemonic widget here */
+    dialog->scale_slow_keys_delay = gtk_hscale_new (GTK_ADJUSTMENT 
(gtk_adjustment_new (slow_keys_delay, 10, 500, 10, 10, 0)));
+    gtk_label_set_mnemonic_widget (GTK_LABEL (label), 
dialog->scale_slow_keys_delay);
+    
+    hbox = gtk_hbox_new (FALSE, 5);
+    gtk_widget_show (hbox);
+    gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); 
 
-    dialog->scale_slow_keys_delay = gtk_hscale_new (GTK_ADJUSTMENT 
(gtk_adjustment_new (slow_keys_delay, 10, 500, 10, 10, 0)));
+    label = gtk_label_new("");
+    gtk_label_set_markup (GTK_LABEL (label), _("<span style='italic' 
size='smaller'>Short</span>"));
+    gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+    gtk_widget_show (label);
+    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+
+    /* and now add the scale widget from above */
     gtk_widget_show(dialog->scale_slow_keys_delay);
     gtk_scale_set_draw_value (GTK_SCALE (dialog->scale_slow_keys_delay), 
FALSE);
     gtk_range_set_update_policy (GTK_RANGE (dialog->scale_slow_keys_delay), 
GTK_UPDATE_DISCONTINUOUS);
-    gtk_box_pack_start(GTK_BOX(vbox), dialog->scale_slow_keys_delay, FALSE, 
FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(hbox), dialog->scale_slow_keys_delay, TRUE, 
TRUE, 0);
     gtk_widget_set_sensitive(dialog->scale_slow_keys_delay, slow_key);
+    gtk_tooltips_set_tip (tooltips, dialog->scale_slow_keys_delay,
+                          _("A shorter delay closer approximates behavior when 
Slow Keys is disabled, while a longer delay can help to ignore accidental key 
presses."),
+                          NULL);
+    
+    label = gtk_label_new("");
+    gtk_label_set_markup (GTK_LABEL (label), _("<span style='italic' 
size='smaller'>Long</span>"));
+    gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+    gtk_widget_show (label);
+    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
 
     vbox = gtk_vbox_new (FALSE, 5);
     gtk_widget_show (vbox);
 
-    frame = xfce_create_framebox_with_content (_("Bounce keys"), vbox);
+    frame = xfce_create_framebox_with_content (_("Bounce Keys"), vbox);
     gtk_widget_show (frame);
     gtk_box_pack_start(GTK_BOX(main_vbox), frame, TRUE, TRUE, 0);
 
-    dialog->checkbutton_bounce = gtk_check_button_new_with_mnemonic(_("Enable 
Bounce keys"));
+    dialog->checkbutton_bounce = gtk_check_button_new_with_mnemonic(_("Enable 
_Bounce Keys"));
     gtk_widget_show(dialog->checkbutton_bounce);
     gtk_box_pack_start(GTK_BOX(vbox), dialog->checkbutton_bounce, FALSE, 
FALSE, 0);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(dialog->checkbutton_bounce), bounce_key);
+    gtk_tooltips_set_tip (tooltips, dialog->checkbutton_bounce,
+                          _("Bounce Keys helps avoid repeated key presses by 
not accepting presses of the same key within a certain period of time."),
+                          NULL);
 
-    label = gtk_label_new (_("DeBounce delay :"));
+    label = gtk_label_new_with_mnemonic (_("D_ebounce delay:"));
     gtk_widget_show (label);
     gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
     gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
     gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
 
+    /* create this first so we can set the mnemonic widget here */
     dialog->scale_debounce_delay = gtk_hscale_new (GTK_ADJUSTMENT 
(gtk_adjustment_new (debounce_delay, 10, 500, 10, 10, 0)));
+    gtk_label_set_mnemonic_widget (GTK_LABEL (label), 
dialog->scale_debounce_delay);
+
+    hbox = gtk_hbox_new (FALSE, 5);
+    gtk_widget_show (hbox);
+    gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); 
+
+    label = gtk_label_new("");
+    gtk_label_set_markup (GTK_LABEL (label), _("<span style='italic' 
size='smaller'>Short</span>"));
+    gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+    gtk_widget_show (label);
+    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+
+    /* and now add the scale widget from above */
     gtk_widget_show(dialog->scale_debounce_delay);
     gtk_scale_set_draw_value (GTK_SCALE (dialog->scale_debounce_delay), FALSE);
     gtk_range_set_update_policy (GTK_RANGE (dialog->scale_debounce_delay), 
GTK_UPDATE_DISCONTINUOUS);
-    gtk_box_pack_start(GTK_BOX(vbox), dialog->scale_debounce_delay, FALSE, 
FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(hbox), dialog->scale_debounce_delay, TRUE, 
TRUE, 0);
     gtk_widget_set_sensitive(dialog->scale_debounce_delay, bounce_key);
+    gtk_tooltips_set_tip (tooltips, dialog->scale_debounce_delay,
+                          _("A shorter delay closer approximates behavior when 
Bounce Keys is disabled, while a longer delay can help to ignore accidental 
repeated key presses."),
+                          NULL);
 
+    label = gtk_label_new("");
+    gtk_label_set_markup (GTK_LABEL (label), _("<span style='italic' 
size='smaller'>Long</span>"));
+    gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+    gtk_widget_show (label);
+    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+
     return main_vbox;
 }
 
@@ -665,7 +750,7 @@
     gtk_widget_show (frame);
     gtk_box_pack_start (GTK_BOX (left_vbox), frame, TRUE, TRUE, 0);
 
-    dialog->checkbutton_repeat = gtk_check_button_new_with_mnemonic 
(_("Repeat"));
+    dialog->checkbutton_repeat = gtk_check_button_new_with_mnemonic (_("Enable 
key repeat"));
     gtk_widget_show (dialog->checkbutton_repeat);
     gtk_box_pack_start (GTK_BOX (vbox), dialog->checkbutton_repeat, FALSE, 
FALSE, 0);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(dialog->checkbutton_repeat), repeat_key);
@@ -702,14 +787,14 @@
     gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
     gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
 
-    label = gtk_label_new (_("Delay :"));
+    label = gtk_label_new (_("Delay:"));
     gtk_widget_show (label);
     gtk_table_attach (GTK_TABLE (table), label, 0, 3, 0, 1, 
                       (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 
0, 2);
     gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
     gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
 
-    label = gtk_label_new (_("Speed :"));
+    label = gtk_label_new (_("Speed:"));
     gtk_widget_show (label);
     gtk_table_attach (GTK_TABLE (table), label, 0, 3, 2, 3, 
                       (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 
0, 2);
@@ -749,7 +834,7 @@
     gtk_widget_show (table);
     gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0);
 
-    label = gtk_label_new (_("Speed :"));
+    label = gtk_label_new (_("Speed:"));
     gtk_widget_show (label);
     gtk_table_attach (GTK_TABLE (table), label, 0, 3, 0, 1, 
                       (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 
0, 2);
@@ -817,12 +902,12 @@
         gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), nth++), label);
     gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
 
-    button = gtk_button_new_from_stock ("gtk-help");
+    button = gtk_button_new_from_stock (GTK_STOCK_HELP);
     /* gtk_widget_show (button); */
     gtk_dialog_add_action_widget (GTK_DIALOG (dialog->dialog_keyboard), 
button, GTK_RESPONSE_HELP);
     GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
 
-    button = gtk_button_new_from_stock ("gtk-close");
+    button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
     gtk_widget_show (button);
     gtk_dialog_add_action_widget (GTK_DIALOG (dialog->dialog_keyboard), 
button, GTK_RESPONSE_CLOSE);
     GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
@@ -864,7 +949,8 @@
     g_signal_connect (G_OBJECT (dialog->checkbutton_blink), "toggled", 
G_CALLBACK (cb_checkbutton_blink_changed), dialog);
     g_signal_connect (G_OBJECT (dialog->scale_blink_time), "value_changed", 
(GCallback) cb_blinktime_changed, dialog);
     g_signal_connect (G_OBJECT (dialog->checkbutton_sticky), "toggled", 
G_CALLBACK (cb_checkbutton_accessx_changed), dialog);
-    g_signal_connect (G_OBJECT (dialog->checkbutton_sticky_ltl), "toggled", 
G_CALLBACK (cb_checkbutton_accessx_changed), dialog);
+    g_signal_connect (G_OBJECT (dialog->radiobutton_sticky_latch), "toggled", 
G_CALLBACK (cb_checkbutton_accessx_changed), dialog);
+    g_signal_connect (G_OBJECT (dialog->radiobutton_sticky_lock), "toggled", 
G_CALLBACK (cb_checkbutton_accessx_changed), dialog);
     g_signal_connect (G_OBJECT (dialog->checkbutton_sticky_tk), "toggled", 
G_CALLBACK (cb_checkbutton_accessx_changed), dialog);
     g_signal_connect (G_OBJECT (dialog->checkbutton_bounce), "toggled", 
G_CALLBACK (cb_checkbutton_accessx_changed), dialog);
     g_signal_connect (G_OBJECT (dialog->checkbutton_slow), "toggled", 
G_CALLBACK (cb_checkbutton_accessx_changed), dialog);

Modified: xfce-mcs-plugins/trunk/plugins/keyboard_plugin/shortcuts_plugin.h
===================================================================
--- xfce-mcs-plugins/trunk/plugins/keyboard_plugin/shortcuts_plugin.h   
2007-11-17 15:55:33 UTC (rev 26332)
+++ xfce-mcs-plugins/trunk/plugins/keyboard_plugin/shortcuts_plugin.h   
2007-11-17 17:01:57 UTC (rev 26333)
@@ -30,7 +30,8 @@
     GtkWidget *checkbutton_blink;
     GtkWidget *checkbutton_repeat;
     GtkWidget *checkbutton_sticky;
-    GtkWidget *checkbutton_sticky_ltl;
+    GtkWidget *radiobutton_sticky_latch;
+    GtkWidget *radiobutton_sticky_lock;
     GtkWidget *checkbutton_sticky_tk;
     GtkWidget *checkbutton_bounce;
     GtkWidget *scale_debounce_delay;

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to