universal-access: Replace GObject boilerplace with G_DECLARE_TYPE
This commit is contained in:
parent
58a64323c4
commit
85eeebb5c5
2 changed files with 113 additions and 166 deletions
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include "zoom-options.h"
|
#include "zoom-options.h"
|
||||||
|
|
||||||
#define WID(w) GTK_WIDGET (gtk_builder_get_object (self->priv->builder, w))
|
#define WID(w) GTK_WIDGET (gtk_builder_get_object (self->builder, w))
|
||||||
|
|
||||||
#define DPI_FACTOR_LARGE 1.25
|
#define DPI_FACTOR_LARGE 1.25
|
||||||
#define DPI_FACTOR_NORMAL 1.0
|
#define DPI_FACTOR_NORMAL 1.0
|
||||||
|
@ -99,10 +99,10 @@
|
||||||
|
|
||||||
#define SCROLL_HEIGHT 490
|
#define SCROLL_HEIGHT 490
|
||||||
|
|
||||||
CC_PANEL_REGISTER (CcUaPanel, cc_ua_panel)
|
struct _CcUaPanel
|
||||||
|
|
||||||
struct _CcUaPanelPrivate
|
|
||||||
{
|
{
|
||||||
|
CcPanel parent_instance;
|
||||||
|
|
||||||
GtkBuilder *builder;
|
GtkBuilder *builder;
|
||||||
|
|
||||||
GSettings *wm_settings;
|
GSettings *wm_settings;
|
||||||
|
@ -124,28 +124,30 @@ struct _CcUaPanelPrivate
|
||||||
GSList *toplevels;
|
GSList *toplevels;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CC_PANEL_REGISTER (CcUaPanel, cc_ua_panel)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cc_ua_panel_dispose (GObject *object)
|
cc_ua_panel_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
CcUaPanelPrivate *priv = CC_UA_PANEL (object)->priv;
|
CcUaPanel *self = CC_UA_PANEL (object);
|
||||||
|
|
||||||
g_clear_object (&priv->builder);
|
g_clear_object (&self->builder);
|
||||||
g_slist_free_full (priv->toplevels, (GDestroyNotify)gtk_widget_destroy);
|
g_slist_free_full (self->toplevels, (GDestroyNotify)gtk_widget_destroy);
|
||||||
priv->toplevels = NULL;
|
self->toplevels = NULL;
|
||||||
|
|
||||||
g_clear_object (&priv->wm_settings);
|
g_clear_object (&self->wm_settings);
|
||||||
g_clear_object (&priv->a11y_settings);
|
g_clear_object (&self->a11y_settings);
|
||||||
g_clear_object (&priv->interface_settings);
|
g_clear_object (&self->interface_settings);
|
||||||
g_clear_object (&priv->kb_settings);
|
g_clear_object (&self->kb_settings);
|
||||||
g_clear_object (&priv->mouse_settings);
|
g_clear_object (&self->mouse_settings);
|
||||||
g_clear_object (&priv->kb_desktop_settings);
|
g_clear_object (&self->kb_desktop_settings);
|
||||||
g_clear_object (&priv->application_settings);
|
g_clear_object (&self->application_settings);
|
||||||
g_clear_object (&priv->gsd_mouse_settings);
|
g_clear_object (&self->gsd_mouse_settings);
|
||||||
|
|
||||||
g_clear_object (&priv->zoom_options);
|
g_clear_object (&self->zoom_options);
|
||||||
|
|
||||||
g_clear_pointer (&priv->sections, g_list_free);
|
g_clear_pointer (&self->sections, g_list_free);
|
||||||
g_clear_pointer (&priv->sections_reverse, g_list_free);
|
g_clear_pointer (&self->sections_reverse, g_list_free);
|
||||||
|
|
||||||
G_OBJECT_CLASS (cc_ua_panel_parent_class)->dispose (object);
|
G_OBJECT_CLASS (cc_ua_panel_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
@ -162,8 +164,6 @@ cc_ua_panel_class_init (CcUaPanelClass *klass)
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
CcPanelClass *panel_class = CC_PANEL_CLASS (klass);
|
CcPanelClass *panel_class = CC_PANEL_CLASS (klass);
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (CcUaPanelPrivate));
|
|
||||||
|
|
||||||
panel_class->get_help_uri = cc_ua_panel_get_help_uri;
|
panel_class->get_help_uri = cc_ua_panel_get_help_uri;
|
||||||
|
|
||||||
object_class->dispose = cc_ua_panel_dispose;
|
object_class->dispose = cc_ua_panel_dispose;
|
||||||
|
@ -173,13 +173,13 @@ cc_ua_panel_class_init (CcUaPanelClass *klass)
|
||||||
static void
|
static void
|
||||||
zoom_options_launch (CcUaPanel *self)
|
zoom_options_launch (CcUaPanel *self)
|
||||||
{
|
{
|
||||||
if (self->priv->zoom_options == NULL)
|
if (self->zoom_options == NULL)
|
||||||
{
|
{
|
||||||
GtkWindow *window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self)));
|
GtkWindow *window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self)));
|
||||||
self->priv->zoom_options = zoom_options_new (window);
|
self->zoom_options = zoom_options_new (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_window_present_with_time (GTK_WINDOW (self->priv->zoom_options), GDK_CURRENT_TIME);
|
gtk_window_present_with_time (GTK_WINDOW (self->zoom_options), GDK_CURRENT_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cursor size dialog */
|
/* cursor size dialog */
|
||||||
|
@ -187,14 +187,13 @@ static void
|
||||||
cursor_size_toggled (GtkWidget *button,
|
cursor_size_toggled (GtkWidget *button,
|
||||||
CcUaPanel *self)
|
CcUaPanel *self)
|
||||||
{
|
{
|
||||||
CcUaPanelPrivate *priv = self->priv;
|
|
||||||
guint cursor_size;
|
guint cursor_size;
|
||||||
|
|
||||||
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
|
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cursor_size = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (button), "cursor-size"));
|
cursor_size = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (button), "cursor-size"));
|
||||||
g_settings_set_int (priv->interface_settings, KEY_MOUSE_CURSOR_SIZE, cursor_size);
|
g_settings_set_int (self->interface_settings, KEY_MOUSE_CURSOR_SIZE, cursor_size);
|
||||||
g_debug ("Setting cursor size to %d", cursor_size);
|
g_debug ("Setting cursor size to %d", cursor_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +202,6 @@ cursor_size_setup (CcUaPanel *self)
|
||||||
{
|
{
|
||||||
guint cursor_sizes[] = { 24, 32, 48, 64, 96 };
|
guint cursor_sizes[] = { 24, 32, 48, 64, 96 };
|
||||||
guint current_cursor_size, i;
|
guint current_cursor_size, i;
|
||||||
CcUaPanelPrivate *priv = self->priv;
|
|
||||||
GtkWidget *grid;
|
GtkWidget *grid;
|
||||||
GtkSizeGroup *size_group;
|
GtkSizeGroup *size_group;
|
||||||
GtkWidget *last_radio_button = NULL;
|
GtkWidget *last_radio_button = NULL;
|
||||||
|
@ -211,7 +209,7 @@ cursor_size_setup (CcUaPanel *self)
|
||||||
grid = WID ("cursor_size_grid");
|
grid = WID ("cursor_size_grid");
|
||||||
gtk_style_context_add_class (gtk_widget_get_style_context (grid), "linked");
|
gtk_style_context_add_class (gtk_widget_get_style_context (grid), "linked");
|
||||||
|
|
||||||
current_cursor_size = g_settings_get_int (priv->interface_settings,
|
current_cursor_size = g_settings_get_int (self->interface_settings,
|
||||||
KEY_MOUSE_CURSOR_SIZE);
|
KEY_MOUSE_CURSOR_SIZE);
|
||||||
size_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
|
size_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
|
||||||
|
|
||||||
|
@ -304,23 +302,22 @@ set_contrast_mapping (const GValue *value,
|
||||||
{
|
{
|
||||||
gboolean hc;
|
gboolean hc;
|
||||||
CcUaPanel *self = user_data;
|
CcUaPanel *self = user_data;
|
||||||
CcUaPanelPrivate *priv = self->priv;
|
|
||||||
GVariant *ret = NULL;
|
GVariant *ret = NULL;
|
||||||
|
|
||||||
hc = g_value_get_boolean (value);
|
hc = g_value_get_boolean (value);
|
||||||
if (hc)
|
if (hc)
|
||||||
{
|
{
|
||||||
ret = g_variant_new_string (HIGH_CONTRAST_THEME);
|
ret = g_variant_new_string (HIGH_CONTRAST_THEME);
|
||||||
g_settings_set_string (priv->interface_settings, KEY_ICON_THEME, HIGH_CONTRAST_THEME);
|
g_settings_set_string (self->interface_settings, KEY_ICON_THEME, HIGH_CONTRAST_THEME);
|
||||||
|
|
||||||
g_settings_set_string (priv->wm_settings, KEY_WM_THEME, HIGH_CONTRAST_THEME);
|
g_settings_set_string (self->wm_settings, KEY_WM_THEME, HIGH_CONTRAST_THEME);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_settings_reset (priv->interface_settings, KEY_GTK_THEME);
|
g_settings_reset (self->interface_settings, KEY_GTK_THEME);
|
||||||
g_settings_reset (priv->interface_settings, KEY_ICON_THEME);
|
g_settings_reset (self->interface_settings, KEY_ICON_THEME);
|
||||||
|
|
||||||
g_settings_reset (priv->wm_settings, KEY_WM_THEME);
|
g_settings_reset (self->wm_settings, KEY_WM_THEME);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -388,15 +385,14 @@ add_separators (GtkListBox *list)
|
||||||
static gboolean
|
static gboolean
|
||||||
keynav_failed (GtkWidget *list, GtkDirectionType direction, CcUaPanel *self)
|
keynav_failed (GtkWidget *list, GtkDirectionType direction, CcUaPanel *self)
|
||||||
{
|
{
|
||||||
CcUaPanelPrivate *priv = self->priv;
|
|
||||||
GList *item, *sections;
|
GList *item, *sections;
|
||||||
gdouble value, lower, upper, page;
|
gdouble value, lower, upper, page;
|
||||||
|
|
||||||
/* Find the list in the list of GtkListBoxes */
|
/* Find the list in the list of GtkListBoxes */
|
||||||
if (direction == GTK_DIR_DOWN)
|
if (direction == GTK_DIR_DOWN)
|
||||||
sections = priv->sections;
|
sections = self->sections;
|
||||||
else
|
else
|
||||||
sections = priv->sections_reverse;
|
sections = self->sections_reverse;
|
||||||
|
|
||||||
item = g_list_find (sections, list);
|
item = g_list_find (sections, list);
|
||||||
g_assert (item);
|
g_assert (item);
|
||||||
|
@ -406,19 +402,19 @@ keynav_failed (GtkWidget *list, GtkDirectionType direction, CcUaPanel *self)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = gtk_adjustment_get_value (priv->focus_adjustment);
|
value = gtk_adjustment_get_value (self->focus_adjustment);
|
||||||
lower = gtk_adjustment_get_lower (priv->focus_adjustment);
|
lower = gtk_adjustment_get_lower (self->focus_adjustment);
|
||||||
upper = gtk_adjustment_get_upper (priv->focus_adjustment);
|
upper = gtk_adjustment_get_upper (self->focus_adjustment);
|
||||||
page = gtk_adjustment_get_page_size (priv->focus_adjustment);
|
page = gtk_adjustment_get_page_size (self->focus_adjustment);
|
||||||
|
|
||||||
if (direction == GTK_DIR_UP && value > lower)
|
if (direction == GTK_DIR_UP && value > lower)
|
||||||
{
|
{
|
||||||
gtk_adjustment_set_value (priv->focus_adjustment, lower);
|
gtk_adjustment_set_value (self->focus_adjustment, lower);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if (direction == GTK_DIR_DOWN && value < upper - page)
|
else if (direction == GTK_DIR_DOWN && value < upper - page)
|
||||||
{
|
{
|
||||||
gtk_adjustment_set_value (priv->focus_adjustment, upper - page);
|
gtk_adjustment_set_value (self->focus_adjustment, upper - page);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,24 +424,21 @@ keynav_failed (GtkWidget *list, GtkDirectionType direction, CcUaPanel *self)
|
||||||
static void
|
static void
|
||||||
add_section (GtkWidget *list, CcUaPanel *self)
|
add_section (GtkWidget *list, CcUaPanel *self)
|
||||||
{
|
{
|
||||||
CcUaPanelPrivate *priv = self->priv;
|
|
||||||
|
|
||||||
g_signal_connect (list, "keynav-failed", G_CALLBACK (keynav_failed), self);
|
g_signal_connect (list, "keynav-failed", G_CALLBACK (keynav_failed), self);
|
||||||
|
|
||||||
priv->sections = g_list_append (priv->sections, list);
|
self->sections = g_list_append (self->sections, list);
|
||||||
priv->sections_reverse = g_list_prepend (priv->sections_reverse, list);
|
self->sections_reverse = g_list_prepend (self->sections_reverse, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cc_ua_panel_init_status (CcUaPanel *self)
|
cc_ua_panel_init_status (CcUaPanel *self)
|
||||||
{
|
{
|
||||||
CcUaPanelPrivate *priv = self->priv;
|
|
||||||
GtkWidget *box;
|
GtkWidget *box;
|
||||||
|
|
||||||
box = GTK_WIDGET (gtk_builder_get_object (priv->builder, "section_status"));
|
box = GTK_WIDGET (gtk_builder_get_object (self->builder, "section_status"));
|
||||||
priv->sections_reverse = g_list_prepend (priv->sections_reverse, box);
|
self->sections_reverse = g_list_prepend (self->sections_reverse, box);
|
||||||
|
|
||||||
g_settings_bind (priv->a11y_settings, KEY_ALWAYS_SHOW_STATUS,
|
g_settings_bind (self->a11y_settings, KEY_ALWAYS_SHOW_STATUS,
|
||||||
WID ("switch_status"), "active",
|
WID ("switch_status"), "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
}
|
}
|
||||||
|
@ -512,7 +505,6 @@ activate_row (CcUaPanel *self, GtkListBoxRow *row)
|
||||||
static void
|
static void
|
||||||
cc_ua_panel_init_seeing (CcUaPanel *self)
|
cc_ua_panel_init_seeing (CcUaPanel *self)
|
||||||
{
|
{
|
||||||
CcUaPanelPrivate *priv = self->priv;
|
|
||||||
GtkWidget *list;
|
GtkWidget *list;
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
|
@ -524,7 +516,7 @@ cc_ua_panel_init_seeing (CcUaPanel *self)
|
||||||
g_signal_connect_swapped (list, "row-activated",
|
g_signal_connect_swapped (list, "row-activated",
|
||||||
G_CALLBACK (activate_row), self);
|
G_CALLBACK (activate_row), self);
|
||||||
|
|
||||||
g_settings_bind_with_mapping (priv->interface_settings, KEY_GTK_THEME,
|
g_settings_bind_with_mapping (self->interface_settings, KEY_GTK_THEME,
|
||||||
WID ("value_highcontrast"),
|
WID ("value_highcontrast"),
|
||||||
"active", G_SETTINGS_BIND_DEFAULT,
|
"active", G_SETTINGS_BIND_DEFAULT,
|
||||||
get_contrast_mapping,
|
get_contrast_mapping,
|
||||||
|
@ -534,26 +526,26 @@ cc_ua_panel_init_seeing (CcUaPanel *self)
|
||||||
|
|
||||||
/* large text */
|
/* large text */
|
||||||
|
|
||||||
g_settings_bind_with_mapping (priv->interface_settings, KEY_TEXT_SCALING_FACTOR,
|
g_settings_bind_with_mapping (self->interface_settings, KEY_TEXT_SCALING_FACTOR,
|
||||||
WID ("value_large_text"),
|
WID ("value_large_text"),
|
||||||
"active", G_SETTINGS_BIND_DEFAULT,
|
"active", G_SETTINGS_BIND_DEFAULT,
|
||||||
get_large_text_mapping,
|
get_large_text_mapping,
|
||||||
set_large_text_mapping,
|
set_large_text_mapping,
|
||||||
priv->interface_settings,
|
self->interface_settings,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* cursor size */
|
/* cursor size */
|
||||||
|
|
||||||
cursor_size_setup (self);
|
cursor_size_setup (self);
|
||||||
|
|
||||||
g_settings_bind_with_mapping (priv->interface_settings, KEY_MOUSE_CURSOR_SIZE,
|
g_settings_bind_with_mapping (self->interface_settings, KEY_MOUSE_CURSOR_SIZE,
|
||||||
WID ("value_cursor_size"),
|
WID ("value_cursor_size"),
|
||||||
"label", G_SETTINGS_BIND_GET,
|
"label", G_SETTINGS_BIND_GET,
|
||||||
cursor_size_label_mapping_get,
|
cursor_size_label_mapping_get,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
dialog = WID ("cursor_size_dialog");
|
dialog = WID ("cursor_size_dialog");
|
||||||
priv->toplevels = g_slist_prepend (priv->toplevels, dialog);
|
self->toplevels = g_slist_prepend (self->toplevels, dialog);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (WID ("row_cursor_size")), "dialog", dialog);
|
g_object_set_data (G_OBJECT (WID ("row_cursor_size")), "dialog", dialog);
|
||||||
g_signal_connect (dialog, "delete-event",
|
g_signal_connect (dialog, "delete-event",
|
||||||
|
@ -561,7 +553,7 @@ cc_ua_panel_init_seeing (CcUaPanel *self)
|
||||||
|
|
||||||
/* zoom */
|
/* zoom */
|
||||||
|
|
||||||
g_settings_bind_with_mapping (priv->application_settings, "screen-magnifier-enabled",
|
g_settings_bind_with_mapping (self->application_settings, "screen-magnifier-enabled",
|
||||||
WID ("value_zoom"),
|
WID ("value_zoom"),
|
||||||
"label", G_SETTINGS_BIND_GET,
|
"label", G_SETTINGS_BIND_GET,
|
||||||
on_off_label_mapping_get,
|
on_off_label_mapping_get,
|
||||||
|
@ -571,18 +563,18 @@ cc_ua_panel_init_seeing (CcUaPanel *self)
|
||||||
|
|
||||||
/* screen reader */
|
/* screen reader */
|
||||||
|
|
||||||
g_settings_bind_with_mapping (priv->application_settings, "screen-reader-enabled",
|
g_settings_bind_with_mapping (self->application_settings, "screen-reader-enabled",
|
||||||
WID ("value_screen_reader"), "label",
|
WID ("value_screen_reader"), "label",
|
||||||
G_SETTINGS_BIND_GET,
|
G_SETTINGS_BIND_GET,
|
||||||
on_off_label_mapping_get,
|
on_off_label_mapping_get,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
g_settings_bind (priv->application_settings, "screen-reader-enabled",
|
g_settings_bind (self->application_settings, "screen-reader-enabled",
|
||||||
WID ("screen_reader_switch"), "active",
|
WID ("screen_reader_switch"), "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
dialog = WID ("screen_reader_dialog");
|
dialog = WID ("screen_reader_dialog");
|
||||||
priv->toplevels = g_slist_prepend (priv->toplevels, dialog);
|
self->toplevels = g_slist_prepend (self->toplevels, dialog);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (WID ("row_screen_reader")), "dialog", dialog);
|
g_object_set_data (G_OBJECT (WID ("row_screen_reader")), "dialog", dialog);
|
||||||
g_signal_connect (dialog, "delete-event",
|
g_signal_connect (dialog, "delete-event",
|
||||||
|
@ -590,18 +582,18 @@ cc_ua_panel_init_seeing (CcUaPanel *self)
|
||||||
|
|
||||||
/* sound keys */
|
/* sound keys */
|
||||||
|
|
||||||
g_settings_bind_with_mapping (priv->kb_settings, KEY_TOGGLEKEYS_ENABLED,
|
g_settings_bind_with_mapping (self->kb_settings, KEY_TOGGLEKEYS_ENABLED,
|
||||||
WID ("value_sound_keys"), "label",
|
WID ("value_sound_keys"), "label",
|
||||||
G_SETTINGS_BIND_GET,
|
G_SETTINGS_BIND_GET,
|
||||||
on_off_label_mapping_get,
|
on_off_label_mapping_get,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
g_settings_bind (priv->kb_settings, KEY_TOGGLEKEYS_ENABLED,
|
g_settings_bind (self->kb_settings, KEY_TOGGLEKEYS_ENABLED,
|
||||||
WID ("sound_keys_switch"), "active",
|
WID ("sound_keys_switch"), "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
dialog = WID ("sound_keys_dialog");
|
dialog = WID ("sound_keys_dialog");
|
||||||
priv->toplevels = g_slist_prepend (priv->toplevels, dialog);
|
self->toplevels = g_slist_prepend (self->toplevels, dialog);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (WID ("row_sound_keys")), "dialog", dialog);
|
g_object_set_data (G_OBJECT (WID ("row_sound_keys")), "dialog", dialog);
|
||||||
g_signal_connect (dialog, "delete-event",
|
g_signal_connect (dialog, "delete-event",
|
||||||
|
@ -617,7 +609,7 @@ visual_bell_type_notify_cb (GSettings *settings,
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
GDesktopVisualBellType type;
|
GDesktopVisualBellType type;
|
||||||
|
|
||||||
type = g_settings_get_enum (self->priv->wm_settings, KEY_VISUAL_BELL_TYPE);
|
type = g_settings_get_enum (self->wm_settings, KEY_VISUAL_BELL_TYPE);
|
||||||
|
|
||||||
if (type == G_DESKTOP_VISUAL_BELL_FRAME_FLASH)
|
if (type == G_DESKTOP_VISUAL_BELL_FRAME_FLASH)
|
||||||
widget = WID ("visual_alerts_window_radio");
|
widget = WID ("visual_alerts_window_radio");
|
||||||
|
@ -640,7 +632,7 @@ visual_bell_type_toggle_cb (GtkWidget *button,
|
||||||
type = G_DESKTOP_VISUAL_BELL_FRAME_FLASH;
|
type = G_DESKTOP_VISUAL_BELL_FRAME_FLASH;
|
||||||
else
|
else
|
||||||
type = G_DESKTOP_VISUAL_BELL_FULLSCREEN_FLASH;
|
type = G_DESKTOP_VISUAL_BELL_FULLSCREEN_FLASH;
|
||||||
g_settings_set_enum (panel->priv->wm_settings, KEY_VISUAL_BELL_TYPE, type);
|
g_settings_set_enum (panel->wm_settings, KEY_VISUAL_BELL_TYPE, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -654,7 +646,6 @@ test_flash (GtkButton *button,
|
||||||
static void
|
static void
|
||||||
cc_ua_panel_init_hearing (CcUaPanel *self)
|
cc_ua_panel_init_hearing (CcUaPanel *self)
|
||||||
{
|
{
|
||||||
CcUaPanelPrivate *priv = self->priv;
|
|
||||||
GtkWidget *list;
|
GtkWidget *list;
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
|
@ -670,11 +661,11 @@ cc_ua_panel_init_hearing (CcUaPanel *self)
|
||||||
visual_bell_type_notify_cb (NULL, NULL, self);
|
visual_bell_type_notify_cb (NULL, NULL, self);
|
||||||
|
|
||||||
/* and listen */
|
/* and listen */
|
||||||
g_settings_bind (priv->wm_settings, KEY_VISUAL_BELL_ENABLED,
|
g_settings_bind (self->wm_settings, KEY_VISUAL_BELL_ENABLED,
|
||||||
WID ("visual_alerts_switch"), "active",
|
WID ("visual_alerts_switch"), "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
g_settings_bind_with_mapping (priv->wm_settings, KEY_VISUAL_BELL_ENABLED,
|
g_settings_bind_with_mapping (self->wm_settings, KEY_VISUAL_BELL_ENABLED,
|
||||||
WID ("value_visual_alerts"),
|
WID ("value_visual_alerts"),
|
||||||
"label", G_SETTINGS_BIND_GET,
|
"label", G_SETTINGS_BIND_GET,
|
||||||
on_off_label_mapping_get,
|
on_off_label_mapping_get,
|
||||||
|
@ -687,13 +678,13 @@ cc_ua_panel_init_hearing (CcUaPanel *self)
|
||||||
WID ("visual_alerts_screen_radio"), "sensitive",
|
WID ("visual_alerts_screen_radio"), "sensitive",
|
||||||
G_BINDING_SYNC_CREATE);
|
G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
g_signal_connect (priv->wm_settings, "changed::" KEY_VISUAL_BELL_TYPE,
|
g_signal_connect (self->wm_settings, "changed::" KEY_VISUAL_BELL_TYPE,
|
||||||
G_CALLBACK (visual_bell_type_notify_cb), self);
|
G_CALLBACK (visual_bell_type_notify_cb), self);
|
||||||
g_signal_connect (WID ("visual_alerts_window_radio"),
|
g_signal_connect (WID ("visual_alerts_window_radio"),
|
||||||
"toggled", G_CALLBACK (visual_bell_type_toggle_cb), self);
|
"toggled", G_CALLBACK (visual_bell_type_toggle_cb), self);
|
||||||
|
|
||||||
dialog = WID ("visual_alerts_dialog");
|
dialog = WID ("visual_alerts_dialog");
|
||||||
priv->toplevels = g_slist_prepend (priv->toplevels, dialog);
|
self->toplevels = g_slist_prepend (self->toplevels, dialog);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (WID ("row_visual_alerts")), "dialog", dialog);
|
g_object_set_data (G_OBJECT (WID ("row_visual_alerts")), "dialog", dialog);
|
||||||
|
|
||||||
|
@ -743,7 +734,6 @@ update_accessx_label (GSettings *settings, const gchar *key, CcUaPanel *self)
|
||||||
static void
|
static void
|
||||||
cc_ua_panel_init_keyboard (CcUaPanel *self)
|
cc_ua_panel_init_keyboard (CcUaPanel *self)
|
||||||
{
|
{
|
||||||
CcUaPanelPrivate *priv = self->priv;
|
|
||||||
GtkWidget *list;
|
GtkWidget *list;
|
||||||
GtkWidget *w;
|
GtkWidget *w;
|
||||||
GtkWidget *sw;
|
GtkWidget *sw;
|
||||||
|
@ -759,16 +749,16 @@ cc_ua_panel_init_keyboard (CcUaPanel *self)
|
||||||
|
|
||||||
/* on-screen keyboard */
|
/* on-screen keyboard */
|
||||||
sw = WID ("screen_keyboard_switch");
|
sw = WID ("screen_keyboard_switch");
|
||||||
g_settings_bind (priv->application_settings, KEY_SCREEN_KEYBOARD_ENABLED,
|
g_settings_bind (self->application_settings, KEY_SCREEN_KEYBOARD_ENABLED,
|
||||||
sw, "active",
|
sw, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
/* Repeat keys */
|
/* Repeat keys */
|
||||||
g_signal_connect (priv->kb_desktop_settings, "changed",
|
g_signal_connect (self->kb_desktop_settings, "changed",
|
||||||
G_CALLBACK (on_repeat_keys_toggled), self);
|
G_CALLBACK (on_repeat_keys_toggled), self);
|
||||||
|
|
||||||
dialog = WID ("repeat_keys_dialog");
|
dialog = WID ("repeat_keys_dialog");
|
||||||
priv->toplevels = g_slist_prepend (priv->toplevels, dialog);
|
self->toplevels = g_slist_prepend (self->toplevels, dialog);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (WID ("row_repeat_keys")), "dialog", dialog);
|
g_object_set_data (G_OBJECT (WID ("row_repeat_keys")), "dialog", dialog);
|
||||||
|
|
||||||
|
@ -776,24 +766,24 @@ cc_ua_panel_init_keyboard (CcUaPanel *self)
|
||||||
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
|
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
|
||||||
|
|
||||||
sw = WID ("repeat_keys_switch");
|
sw = WID ("repeat_keys_switch");
|
||||||
g_settings_bind (priv->kb_desktop_settings, KEY_REPEAT_KEYS,
|
g_settings_bind (self->kb_desktop_settings, KEY_REPEAT_KEYS,
|
||||||
sw, "active",
|
sw, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
on_repeat_keys_toggled (priv->kb_desktop_settings, NULL, self);
|
on_repeat_keys_toggled (self->kb_desktop_settings, NULL, self);
|
||||||
|
|
||||||
g_settings_bind (priv->kb_desktop_settings, "delay",
|
g_settings_bind (self->kb_desktop_settings, "delay",
|
||||||
gtk_range_get_adjustment (GTK_RANGE (WID ("repeat_keys_delay_scale"))), "value",
|
gtk_range_get_adjustment (GTK_RANGE (WID ("repeat_keys_delay_scale"))), "value",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
g_settings_bind (priv->kb_desktop_settings, "repeat-interval",
|
g_settings_bind (self->kb_desktop_settings, "repeat-interval",
|
||||||
gtk_range_get_adjustment (GTK_RANGE (WID ("repeat_keys_speed_scale"))), "value",
|
gtk_range_get_adjustment (GTK_RANGE (WID ("repeat_keys_speed_scale"))), "value",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
/* Cursor Blinking */
|
/* Cursor Blinking */
|
||||||
g_signal_connect (priv->interface_settings, "changed",
|
g_signal_connect (self->interface_settings, "changed",
|
||||||
G_CALLBACK (on_cursor_blinking_toggled), self);
|
G_CALLBACK (on_cursor_blinking_toggled), self);
|
||||||
|
|
||||||
dialog = WID ("cursor_blinking_dialog");
|
dialog = WID ("cursor_blinking_dialog");
|
||||||
priv->toplevels = g_slist_prepend (priv->toplevels, dialog);
|
self->toplevels = g_slist_prepend (self->toplevels, dialog);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (WID ("row_cursor_blinking")), "dialog", dialog);
|
g_object_set_data (G_OBJECT (WID ("row_cursor_blinking")), "dialog", dialog);
|
||||||
|
|
||||||
|
@ -801,97 +791,97 @@ cc_ua_panel_init_keyboard (CcUaPanel *self)
|
||||||
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
|
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
|
||||||
|
|
||||||
sw = WID ("cursor_blinking_switch");
|
sw = WID ("cursor_blinking_switch");
|
||||||
g_settings_bind (priv->interface_settings, KEY_CURSOR_BLINKING,
|
g_settings_bind (self->interface_settings, KEY_CURSOR_BLINKING,
|
||||||
sw, "active",
|
sw, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
on_cursor_blinking_toggled (priv->interface_settings, NULL, self);
|
on_cursor_blinking_toggled (self->interface_settings, NULL, self);
|
||||||
|
|
||||||
g_settings_bind (priv->interface_settings, KEY_CURSOR_BLINKING_TIME,
|
g_settings_bind (self->interface_settings, KEY_CURSOR_BLINKING_TIME,
|
||||||
gtk_range_get_adjustment (GTK_RANGE (WID ("cursor_blinking_scale"))), "value",
|
gtk_range_get_adjustment (GTK_RANGE (WID ("cursor_blinking_scale"))), "value",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
|
|
||||||
/* accessx */
|
/* accessx */
|
||||||
g_signal_connect (priv->kb_settings, "changed",
|
g_signal_connect (self->kb_settings, "changed",
|
||||||
G_CALLBACK (update_accessx_label), self);
|
G_CALLBACK (update_accessx_label), self);
|
||||||
update_accessx_label (priv->kb_settings, NULL, self);
|
update_accessx_label (self->kb_settings, NULL, self);
|
||||||
|
|
||||||
/* enable shortcuts */
|
/* enable shortcuts */
|
||||||
sw = WID ("typing_keyboard_toggle_switch");
|
sw = WID ("typing_keyboard_toggle_switch");
|
||||||
g_settings_bind (priv->kb_settings, KEY_KEYBOARD_TOGGLE,
|
g_settings_bind (self->kb_settings, KEY_KEYBOARD_TOGGLE,
|
||||||
sw, "active",
|
sw, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
/* sticky keys */
|
/* sticky keys */
|
||||||
sw = WID ("typing_stickykeys_switch");
|
sw = WID ("typing_stickykeys_switch");
|
||||||
g_settings_bind (priv->kb_settings, KEY_STICKYKEYS_ENABLED,
|
g_settings_bind (self->kb_settings, KEY_STICKYKEYS_ENABLED,
|
||||||
sw, "active",
|
sw, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
w = WID ("typing_stickykeys_disable_two_keys_check");
|
w = WID ("typing_stickykeys_disable_two_keys_check");
|
||||||
g_settings_bind (priv->kb_settings, KEY_STICKYKEYS_TWO_KEY_OFF,
|
g_settings_bind (self->kb_settings, KEY_STICKYKEYS_TWO_KEY_OFF,
|
||||||
w, "active",
|
w, "active",
|
||||||
G_SETTINGS_BIND_NO_SENSITIVITY);
|
G_SETTINGS_BIND_NO_SENSITIVITY);
|
||||||
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
w = WID ("typing_stickykeys_beep_modifier_check");
|
w = WID ("typing_stickykeys_beep_modifier_check");
|
||||||
g_settings_bind (priv->kb_settings, KEY_STICKYKEYS_MODIFIER_BEEP,
|
g_settings_bind (self->kb_settings, KEY_STICKYKEYS_MODIFIER_BEEP,
|
||||||
w, "active",
|
w, "active",
|
||||||
G_SETTINGS_BIND_NO_SENSITIVITY);
|
G_SETTINGS_BIND_NO_SENSITIVITY);
|
||||||
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
/* slow keys */
|
/* slow keys */
|
||||||
sw = WID ("typing_slowkeys_switch");
|
sw = WID ("typing_slowkeys_switch");
|
||||||
g_settings_bind (priv->kb_settings, KEY_SLOWKEYS_ENABLED,
|
g_settings_bind (self->kb_settings, KEY_SLOWKEYS_ENABLED,
|
||||||
sw, "active",
|
sw, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
w = WID ("typing_slowkeys_delay_scale");
|
w = WID ("typing_slowkeys_delay_scale");
|
||||||
g_settings_bind (priv->kb_settings, KEY_SLOWKEYS_DELAY,
|
g_settings_bind (self->kb_settings, KEY_SLOWKEYS_DELAY,
|
||||||
gtk_range_get_adjustment (GTK_RANGE (w)), "value",
|
gtk_range_get_adjustment (GTK_RANGE (w)), "value",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
w = WID ("typing_slowkeys_delay_box");
|
w = WID ("typing_slowkeys_delay_box");
|
||||||
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
w = WID ("typing_slowkeys_beep_pressed_check");
|
w = WID ("typing_slowkeys_beep_pressed_check");
|
||||||
g_settings_bind (priv->kb_settings, KEY_SLOWKEYS_BEEP_PRESS,
|
g_settings_bind (self->kb_settings, KEY_SLOWKEYS_BEEP_PRESS,
|
||||||
w, "active",
|
w, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
w = WID ("typing_slowkeys_beep_accepted_check");
|
w = WID ("typing_slowkeys_beep_accepted_check");
|
||||||
g_settings_bind (priv->kb_settings, KEY_SLOWKEYS_BEEP_ACCEPT,
|
g_settings_bind (self->kb_settings, KEY_SLOWKEYS_BEEP_ACCEPT,
|
||||||
w, "active",
|
w, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
w = WID ("typing_slowkeys_beep_rejected_check");
|
w = WID ("typing_slowkeys_beep_rejected_check");
|
||||||
g_settings_bind (priv->kb_settings, KEY_SLOWKEYS_BEEP_REJECT,
|
g_settings_bind (self->kb_settings, KEY_SLOWKEYS_BEEP_REJECT,
|
||||||
w, "active",
|
w, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
/* bounce keys */
|
/* bounce keys */
|
||||||
sw = WID ("typing_bouncekeys_switch");
|
sw = WID ("typing_bouncekeys_switch");
|
||||||
g_settings_bind (priv->kb_settings, KEY_BOUNCEKEYS_ENABLED,
|
g_settings_bind (self->kb_settings, KEY_BOUNCEKEYS_ENABLED,
|
||||||
sw, "active",
|
sw, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
w = WID ("typing_bouncekeys_delay_scale");
|
w = WID ("typing_bouncekeys_delay_scale");
|
||||||
g_settings_bind (priv->kb_settings, KEY_BOUNCEKEYS_DELAY,
|
g_settings_bind (self->kb_settings, KEY_BOUNCEKEYS_DELAY,
|
||||||
gtk_range_get_adjustment (GTK_RANGE (w)), "value",
|
gtk_range_get_adjustment (GTK_RANGE (w)), "value",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
w = WID ("typing_bouncekeys_delay_box");
|
w = WID ("typing_bouncekeys_delay_box");
|
||||||
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
w = WID ("typing_bouncekeys_beep_rejected_check");
|
w = WID ("typing_bouncekeys_beep_rejected_check");
|
||||||
g_settings_bind (priv->kb_settings, KEY_BOUNCEKEYS_BEEP_REJECT,
|
g_settings_bind (self->kb_settings, KEY_BOUNCEKEYS_BEEP_REJECT,
|
||||||
w, "active",
|
w, "active",
|
||||||
G_SETTINGS_BIND_NO_SENSITIVITY);
|
G_SETTINGS_BIND_NO_SENSITIVITY);
|
||||||
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
dialog = WID ("typing_dialog");
|
dialog = WID ("typing_dialog");
|
||||||
priv->toplevels = g_slist_prepend (priv->toplevels, dialog);
|
self->toplevels = g_slist_prepend (self->toplevels, dialog);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (WID ("row_accessx")), "dialog", dialog);
|
g_object_set_data (G_OBJECT (WID ("row_accessx")), "dialog", dialog);
|
||||||
|
|
||||||
|
@ -915,7 +905,6 @@ update_click_assist_label (GSettings *settings, const gchar *key, CcUaPanel *sel
|
||||||
static void
|
static void
|
||||||
cc_ua_panel_init_mouse (CcUaPanel *self)
|
cc_ua_panel_init_mouse (CcUaPanel *self)
|
||||||
{
|
{
|
||||||
CcUaPanelPrivate *priv = self->priv;
|
|
||||||
GtkWidget *list;
|
GtkWidget *list;
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
GtkWidget *sw;
|
GtkWidget *sw;
|
||||||
|
@ -929,22 +918,22 @@ cc_ua_panel_init_mouse (CcUaPanel *self)
|
||||||
g_signal_connect_swapped (list, "row-activated",
|
g_signal_connect_swapped (list, "row-activated",
|
||||||
G_CALLBACK (activate_row), self);
|
G_CALLBACK (activate_row), self);
|
||||||
|
|
||||||
g_settings_bind (priv->kb_settings, KEY_MOUSEKEYS_ENABLED,
|
g_settings_bind (self->kb_settings, KEY_MOUSEKEYS_ENABLED,
|
||||||
WID ("mouse_keys_switch"), "active",
|
WID ("mouse_keys_switch"), "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
g_signal_connect (priv->mouse_settings, "changed",
|
g_signal_connect (self->mouse_settings, "changed",
|
||||||
G_CALLBACK (update_click_assist_label), self);
|
G_CALLBACK (update_click_assist_label), self);
|
||||||
update_click_assist_label (priv->mouse_settings, NULL, self);
|
update_click_assist_label (self->mouse_settings, NULL, self);
|
||||||
|
|
||||||
/* simulated secondary click */
|
/* simulated secondary click */
|
||||||
sw = WID ("pointing_secondary_click_switch");
|
sw = WID ("pointing_secondary_click_switch");
|
||||||
g_settings_bind (priv->mouse_settings, KEY_SECONDARY_CLICK_ENABLED,
|
g_settings_bind (self->mouse_settings, KEY_SECONDARY_CLICK_ENABLED,
|
||||||
sw, "active",
|
sw, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
w = WID ("pointing_secondary_click_delay_scale");
|
w = WID ("pointing_secondary_click_delay_scale");
|
||||||
g_settings_bind (priv->mouse_settings, KEY_SECONDARY_CLICK_TIME,
|
g_settings_bind (self->mouse_settings, KEY_SECONDARY_CLICK_TIME,
|
||||||
gtk_range_get_adjustment (GTK_RANGE (w)), "value",
|
gtk_range_get_adjustment (GTK_RANGE (w)), "value",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
w = WID ("pointing_secondary_click_delay_box");
|
w = WID ("pointing_secondary_click_delay_box");
|
||||||
|
@ -952,30 +941,30 @@ cc_ua_panel_init_mouse (CcUaPanel *self)
|
||||||
|
|
||||||
/* dwell click */
|
/* dwell click */
|
||||||
sw = WID ("pointing_hover_click_switch");
|
sw = WID ("pointing_hover_click_switch");
|
||||||
g_settings_bind (priv->mouse_settings, KEY_DWELL_CLICK_ENABLED,
|
g_settings_bind (self->mouse_settings, KEY_DWELL_CLICK_ENABLED,
|
||||||
sw, "active",
|
sw, "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
w = WID ("pointing_dwell_delay_scale");
|
w = WID ("pointing_dwell_delay_scale");
|
||||||
g_settings_bind (priv->mouse_settings, KEY_DWELL_TIME,
|
g_settings_bind (self->mouse_settings, KEY_DWELL_TIME,
|
||||||
gtk_range_get_adjustment (GTK_RANGE (w)), "value",
|
gtk_range_get_adjustment (GTK_RANGE (w)), "value",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
w = WID ("pointing_dwell_delay_box");
|
w = WID ("pointing_dwell_delay_box");
|
||||||
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
w = WID ("pointing_dwell_threshold_scale");
|
w = WID ("pointing_dwell_threshold_scale");
|
||||||
g_settings_bind (priv->mouse_settings, KEY_DWELL_THRESHOLD,
|
g_settings_bind (self->mouse_settings, KEY_DWELL_THRESHOLD,
|
||||||
gtk_range_get_adjustment (GTK_RANGE (w)), "value",
|
gtk_range_get_adjustment (GTK_RANGE (w)), "value",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
w = WID ("pointing_dwell_threshold_box");
|
w = WID ("pointing_dwell_threshold_box");
|
||||||
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
dialog = WID ("pointing_dialog");
|
dialog = WID ("pointing_dialog");
|
||||||
priv->toplevels = g_slist_prepend (priv->toplevels, dialog);
|
self->toplevels = g_slist_prepend (self->toplevels, dialog);
|
||||||
|
|
||||||
g_object_set_data (G_OBJECT (WID ("row_click_assist")), "dialog", dialog);
|
g_object_set_data (G_OBJECT (WID ("row_click_assist")), "dialog", dialog);
|
||||||
|
|
||||||
g_settings_bind (priv->gsd_mouse_settings, "double-click",
|
g_settings_bind (self->gsd_mouse_settings, "double-click",
|
||||||
gtk_range_get_adjustment (GTK_RANGE (WID ("scale_double_click_delay"))), "value",
|
gtk_range_get_adjustment (GTK_RANGE (WID ("scale_double_click_delay"))), "value",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
|
@ -988,27 +977,22 @@ cc_ua_panel_init_mouse (CcUaPanel *self)
|
||||||
static void
|
static void
|
||||||
cc_ua_panel_init (CcUaPanel *self)
|
cc_ua_panel_init (CcUaPanel *self)
|
||||||
{
|
{
|
||||||
CcUaPanelPrivate *priv;
|
|
||||||
GtkWidget *panel;
|
GtkWidget *panel;
|
||||||
GtkWidget *content;
|
GtkWidget *content;
|
||||||
|
|
||||||
priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
|
||||||
CC_TYPE_UA_PANEL,
|
|
||||||
CcUaPanelPrivate);
|
|
||||||
|
|
||||||
g_resources_register (cc_universal_access_get_resource ());
|
g_resources_register (cc_universal_access_get_resource ());
|
||||||
|
|
||||||
priv->interface_settings = g_settings_new (INTERFACE_SETTINGS);
|
self->interface_settings = g_settings_new (INTERFACE_SETTINGS);
|
||||||
priv->a11y_settings = g_settings_new (A11Y_SETTINGS);
|
self->a11y_settings = g_settings_new (A11Y_SETTINGS);
|
||||||
priv->wm_settings = g_settings_new (WM_SETTINGS);
|
self->wm_settings = g_settings_new (WM_SETTINGS);
|
||||||
priv->kb_settings = g_settings_new (KEYBOARD_SETTINGS);
|
self->kb_settings = g_settings_new (KEYBOARD_SETTINGS);
|
||||||
priv->kb_desktop_settings = g_settings_new (KEYBOARD_DESKTOP_SETTINGS);
|
self->kb_desktop_settings = g_settings_new (KEYBOARD_DESKTOP_SETTINGS);
|
||||||
priv->mouse_settings = g_settings_new (MOUSE_SETTINGS);
|
self->mouse_settings = g_settings_new (MOUSE_SETTINGS);
|
||||||
priv->gsd_mouse_settings = g_settings_new (GSD_MOUSE_SETTINGS);
|
self->gsd_mouse_settings = g_settings_new (GSD_MOUSE_SETTINGS);
|
||||||
priv->application_settings = g_settings_new (APPLICATION_SETTINGS);
|
self->application_settings = g_settings_new (APPLICATION_SETTINGS);
|
||||||
|
|
||||||
priv->builder = gtk_builder_new ();
|
self->builder = gtk_builder_new ();
|
||||||
gtk_builder_add_from_resource (priv->builder,
|
gtk_builder_add_from_resource (self->builder,
|
||||||
|
|
||||||
"/org/gnome/control-center/universal-access/uap.ui",
|
"/org/gnome/control-center/universal-access/uap.ui",
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -1024,8 +1008,8 @@ cc_ua_panel_init (CcUaPanel *self)
|
||||||
|
|
||||||
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (panel), SCROLL_HEIGHT);
|
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (panel), SCROLL_HEIGHT);
|
||||||
|
|
||||||
priv->focus_adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (panel));
|
self->focus_adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (panel));
|
||||||
gtk_container_set_focus_vadjustment (GTK_CONTAINER (content), priv->focus_adjustment);
|
gtk_container_set_focus_vadjustment (GTK_CONTAINER (content), self->focus_adjustment);
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (self), panel);
|
gtk_container_add (GTK_CONTAINER (self), panel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,45 +27,8 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CC_TYPE_UA_PANEL cc_ua_panel_get_type()
|
#define CC_TYPE_UA_PANEL (cc_ua_panel_get_type ())
|
||||||
|
G_DECLARE_FINAL_TYPE (CcUaPanel, cc_ua_panel, CC, UA_PANEL, CcPanel)
|
||||||
#define CC_UA_PANEL(obj) \
|
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
|
||||||
CC_TYPE_UA_PANEL, CcUaPanel))
|
|
||||||
|
|
||||||
#define CC_UA_PANEL_CLASS(klass) \
|
|
||||||
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
|
||||||
CC_TYPE_UA_PANEL, CcUaPanelClass))
|
|
||||||
|
|
||||||
#define CC_IS_UA_PANEL(obj) \
|
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
|
|
||||||
CC_TYPE_UA_PANEL))
|
|
||||||
|
|
||||||
#define CC_IS_UA_PANEL_CLASS(klass) \
|
|
||||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
|
||||||
CC_TYPE_UA_PANEL))
|
|
||||||
|
|
||||||
#define CC_UA_PANEL_GET_CLASS(obj) \
|
|
||||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
|
|
||||||
CC_TYPE_UA_PANEL, CcUaPanelClass))
|
|
||||||
|
|
||||||
typedef struct _CcUaPanel CcUaPanel;
|
|
||||||
typedef struct _CcUaPanelClass CcUaPanelClass;
|
|
||||||
typedef struct _CcUaPanelPrivate CcUaPanelPrivate;
|
|
||||||
|
|
||||||
struct _CcUaPanel
|
|
||||||
{
|
|
||||||
CcPanel parent;
|
|
||||||
|
|
||||||
CcUaPanelPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _CcUaPanelClass
|
|
||||||
{
|
|
||||||
CcPanelClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
GType cc_ua_panel_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue