static void cc_ua_panel_init_keyboard (CcUaPanel *self) { CcUaPanelPrivate *priv = self->priv; GtkWidget *w; /* Typing assistant (on-screen keyboard) */ w = WID (priv->builder, "typing_assistant_switch"); settings_on_off_editor_new (priv, priv->application_settings, "screen-keyboard-enabled", w, typing_assistant_section); /* enable shortcuts */ w = WID (priv->builder, "typing_keyboard_toggle_checkbox"); g_settings_bind (priv->kb_settings, "enable", w, "active", G_SETTINGS_BIND_DEFAULT); /* sticky keys */ w = WID (priv->builder, "typing_sticky_keys_switch"); settings_on_off_editor_new (priv, priv->kb_settings, "stickykeys-enable", w, sticky_keys_section); w = WID (priv->builder, "typing_sticky_keys_disable_two_keys_checkbutton"); g_settings_bind (priv->kb_settings, "stickykeys-two-key-off", w, "active", G_SETTINGS_BIND_NO_SENSITIVITY); w = WID (priv->builder, "typing_sticky_keys_beep_modifier_checkbutton"); g_settings_bind (priv->kb_settings, "stickykeys-modifier-beep", w, "active", G_SETTINGS_BIND_NO_SENSITIVITY); /* slow keys */ w = WID (priv->builder, "typing_slow_keys_switch"); settings_on_off_editor_new (priv, priv->kb_settings, "slowkeys-enable", w, slow_keys_section); w = WID (priv->builder, "typing_slowkeys_delay_scale"); g_settings_bind (priv->kb_settings, "slowkeys-delay", gtk_range_get_adjustment (GTK_RANGE (w)), "value", G_SETTINGS_BIND_DEFAULT); w = WID (priv->builder, "typing_slow_keys_beep_pressed_checkbutton"); g_settings_bind (priv->kb_settings, "slowkeys-beep-press", w, "active", G_SETTINGS_BIND_DEFAULT); w = WID (priv->builder, "typing_slow_keys_beep_accepted_checkbutton"); g_settings_bind (priv->kb_settings, "slowkeys-beep-accept", w, "active", G_SETTINGS_BIND_DEFAULT); w = WID (priv->builder, "typing_slow_keys_beep_rejected_checkbutton"); g_settings_bind (priv->kb_settings, "slowkeys-beep-reject", w, "active", G_SETTINGS_BIND_DEFAULT); /* bounce keys */ w = WID (priv->builder, "typing_bounce_keys_switch"); settings_on_off_editor_new (priv, priv->kb_settings, "bouncekeys-enable", w, bounce_keys_section); w = WID (priv->builder, "typing_bouncekeys_delay_scale"); g_settings_bind (priv->kb_settings, "bouncekeys-delay", gtk_range_get_adjustment (GTK_RANGE (w)), "value", G_SETTINGS_BIND_DEFAULT); w = WID (priv->builder, "typing_bounce_keys_beep_rejected_checkbutton"); g_settings_bind (priv->kb_settings, "bouncekeys-beep-reject", w, "active", G_SETTINGS_BIND_NO_SENSITIVITY); g_signal_connect (WID (priv->builder, "typing_keyboard_preferences_link"), "activate-link", G_CALLBACK (typing_keyboard_preferences_clicked), self); }
static void cc_ua_panel_init_hearing (CcUaPanel *self) { CcUaPanelPrivate *priv = self->priv; GtkWidget *w; /* set the initial visual bell values */ visual_bell_type_notify_cb (NULL, NULL, self); /* and listen */ w = WID (priv->builder, "hearing_visual_alerts_switch"); settings_on_off_editor_new (priv, priv->wm_settings, "visual-bell", w, visual_alerts_section); g_signal_connect (priv->wm_settings, "changed::visual-bell-type", G_CALLBACK (visual_bell_type_notify_cb), self); g_signal_connect (WID (priv->builder, "hearing_flash_window_title_button"), "toggled", G_CALLBACK (visual_bell_type_toggle_cb), self); /* test flash */ g_signal_connect (WID (priv->builder, "hearing_test_flash_button"), "clicked", G_CALLBACK (gdk_beep), NULL); g_signal_connect (WID (priv->builder, "hearing_sound_preferences_link"), "activate-link", G_CALLBACK (hearing_sound_preferences_clicked), self); }
static void cc_ua_panel_init_mouse (CcUaPanel *self) { CcUaPanelPrivate *priv = self->priv; GtkWidget *w; /* mouse keys */ w = WID (priv->builder, "pointing_mouse_keys_switch"); settings_on_off_editor_new (priv, priv->kb_settings, "mousekeys-enable", w, NULL); /* simulated secondary click */ w = WID (priv->builder, "pointing_second_click_switch"); settings_on_off_editor_new (priv, priv->mouse_settings, "secondary-click-enabled", w, secondary_click_section); w = WID (priv->builder, "pointing_secondary_click_delay_scale"); g_settings_bind (priv->mouse_settings, "secondary-click-time", gtk_range_get_adjustment (GTK_RANGE (w)), "value", G_SETTINGS_BIND_DEFAULT); /* dwell click */ w = WID (priv->builder, "pointing_hover_click_switch"); settings_on_off_editor_new (priv, priv->mouse_settings, "dwell-click-enabled", w, dwell_click_section); w = WID (priv->builder, "pointing_dwell_delay_scale"); g_settings_bind (priv->mouse_settings, "dwell-time", gtk_range_get_adjustment (GTK_RANGE (w)), "value", G_SETTINGS_BIND_DEFAULT); w = WID (priv->builder, "pointing_dwell_threshold_scale"); g_settings_bind (priv->mouse_settings, "dwell-threshold", gtk_range_get_adjustment (GTK_RANGE (w)), "value", G_SETTINGS_BIND_DEFAULT); /* mouse preferences button */ g_signal_connect (WID (priv->builder, "pointing_mouse_preferences_link"), "activate-link", G_CALLBACK (pointing_mouse_preferences_clicked_cb), self); }
static void cc_ua_panel_init_seeing (CcUaPanel *self) { CcUaPanelPrivate *priv = self->priv; g_settings_bind_with_mapping (priv->interface_settings, KEY_GTK_THEME, WID (priv->builder, "seeing_contrast_switch"), "active", G_SETTINGS_BIND_DEFAULT, get_contrast_mapping, set_contrast_mapping, self, NULL); g_settings_bind_with_mapping (priv->interface_settings, KEY_TEXT_SCALING_FACTOR, WID (priv->builder, "seeing_large_text_switch"), "active", G_SETTINGS_BIND_DEFAULT, get_large_text_mapping, set_large_text_mapping, priv->interface_settings, NULL); g_settings_bind (priv->kb_settings, "togglekeys-enable", WID (priv->builder, "seeing_toggle_keys_switch"), "active", G_SETTINGS_BIND_DEFAULT); priv->shell_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION, "org.gnome.Shell", G_BUS_NAME_WATCHER_FLAGS_NONE, (GBusNameAppearedCallback) shell_appeared_cb, (GBusNameVanishedCallback) shell_vanished_cb, self, NULL); g_signal_connect (WID (priv->builder, "seeing_zoom_preferences_button"), "clicked", G_CALLBACK (zoom_options_launch_cb), self); g_settings_bind (priv->application_settings, "screen-magnifier-enabled", WID (priv->builder, "seeing_zoom_switch"), "active", G_SETTINGS_BIND_DEFAULT); settings_on_off_editor_new (priv, priv->application_settings, "screen-reader-enabled", WID (priv->builder, "seeing_reader_switch"), NULL); cc_ua_panel_set_shortcut_label (self, "seeing_zoom_enable_keybinding_label", "magnifier"); cc_ua_panel_set_shortcut_label (self, "seeing_zoom_in_keybinding_label", "magnifier-zoom-in"); cc_ua_panel_set_shortcut_label (self, "seeing_zoom_out_keybinding_label", "magnifier-zoom-out"); cc_ua_panel_set_shortcut_label (self, "seeing_reader_enable_keybinding_label", "screenreader"); }
static void cc_ua_panel_init_seeing (CcUaPanel *self) { CcUaPanelPrivate *priv = self->priv; text_scaling_factor_notify_cb (priv->interface_settings, "text-scaling-factor", self); g_signal_connect (priv->interface_settings, "changed::text-scaling-factor", G_CALLBACK (text_scaling_factor_notify_cb), self); g_signal_connect (WID (priv->builder, "seeing_contrast_combobox"), "changed", G_CALLBACK (contrast_combobox_changed_cb), self); g_signal_connect (WID (priv->builder, "seeing_text_size_combobox"), "changed", G_CALLBACK (text_scaling_factor_combo_box_changed), self); g_settings_bind (priv->kb_settings, "togglekeys-enable", WID (priv->builder, "seeing_enable_toggle_keys_checkbutton"), "active", G_SETTINGS_BIND_DEFAULT); priv->shell_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION, "org.gnome.Shell", G_BUS_NAME_WATCHER_FLAGS_NONE, (GBusNameAppearedCallback) shell_appeared_cb, (GBusNameVanishedCallback) shell_vanished_cb, self, NULL); g_signal_connect (WID (priv->builder, "seeing_zoom_preferences_button"), "clicked", G_CALLBACK (zoom_options_launch_cb), self); g_settings_bind (priv->application_settings, "screen-magnifier-enabled", WID (priv->builder, "seeing_zoom_switch"), "active", G_SETTINGS_BIND_DEFAULT); settings_on_off_editor_new (priv, priv->application_settings, "screen-reader-enabled", WID (priv->builder, "seeing_reader_switch"), NULL); cc_ua_panel_set_shortcut_label (self, "seeing_contrast_toggle_keybinding_label", "toggle-contrast"); cc_ua_panel_set_shortcut_label (self, "seeing_increase_size_keybinding_label", "increase-text-size"); cc_ua_panel_set_shortcut_label (self, "seeing_decrease_size_keybinding_label", "decrease-text-size"); cc_ua_panel_set_shortcut_label (self, "seeing_zoom_enable_keybinding_label", "magnifier"); cc_ua_panel_set_shortcut_label (self, "seeing_zoom_in_keybinding_label", "magnifier-zoom-in"); cc_ua_panel_set_shortcut_label (self, "seeing_zoom_out_keybinding_label", "magnifier-zoom-out"); cc_ua_panel_set_shortcut_label (self, "seeing_reader_enable_keybinding_label", "screenreader"); }