From 1f192985ef1e18792151c1479be1f3c96c8f4f4c Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 2 Nov 2015 16:44:21 +0100 Subject: [PATCH] keyboard: Remove general tab The cursor blinking and repeat keys configuration options have moved to the Universal Access panel, with the shortcuts panel due for a re-design. See https://bugzilla.gnome.org/show_bug.cgi?id=757486 See https://bugzilla.gnome.org/show_bug.cgi?id=757464 https://bugzilla.gnome.org/show_bug.cgi?id=757489 --- panels/keyboard/Makefile.am | 2 - panels/keyboard/cc-keyboard-panel.c | 5 +- panels/keyboard/gnome-keyboard-panel.ui | 477 +----------------------- panels/keyboard/keyboard-general.c | 126 ------- panels/keyboard/keyboard-general.h | 25 -- 5 files changed, 2 insertions(+), 633 deletions(-) delete mode 100644 panels/keyboard/keyboard-general.c delete mode 100644 panels/keyboard/keyboard-general.h diff --git a/panels/keyboard/Makefile.am b/panels/keyboard/Makefile.am index 05cb860d2..636fed52c 100644 --- a/panels/keyboard/Makefile.am +++ b/panels/keyboard/Makefile.am @@ -17,8 +17,6 @@ libkeyboard_la_SOURCES = \ cc-keyboard-option.h \ wm-common.c \ wm-common.h \ - keyboard-general.c \ - keyboard-general.h \ keyboard-shortcuts.c \ keyboard-shortcuts.h diff --git a/panels/keyboard/cc-keyboard-panel.c b/panels/keyboard/cc-keyboard-panel.c index 1efc7e218..df2ef98af 100644 --- a/panels/keyboard/cc-keyboard-panel.c +++ b/panels/keyboard/cc-keyboard-panel.c @@ -21,7 +21,6 @@ #include "cc-keyboard-panel.h" #include "cc-keyboard-resources.h" -#include "keyboard-general.h" #include "keyboard-shortcuts.h" CC_PANEL_REGISTER (CcKeyboardPanel, cc_keyboard_panel) @@ -129,11 +128,10 @@ cc_keyboard_panel_constructor (GType gtype, self = CC_KEYBOARD_PANEL (obj); priv = self->priv; - keyboard_general_init (CC_PANEL (self), priv->builder); keyboard_shortcuts_init (CC_PANEL (self), priv->builder); widget = (GtkWidget *) gtk_builder_get_object (priv->builder, - "keyboard_notebook"); + "shortcuts_page"); gtk_container_add (GTK_CONTAINER (self), widget); @@ -149,7 +147,6 @@ cc_keyboard_panel_get_help_uri (CcPanel *panel) static void cc_keyboard_panel_dispose (GObject *object) { - keyboard_general_dispose (CC_PANEL (object)); keyboard_shortcuts_dispose (CC_PANEL (object)); G_OBJECT_CLASS (cc_keyboard_panel_parent_class)->dispose (object); diff --git a/panels/keyboard/gnome-keyboard-panel.ui b/panels/keyboard/gnome-keyboard-panel.ui index 3d28f72c6..470ac8501 100644 --- a/panels/keyboard/gnome-keyboard-panel.ui +++ b/panels/keyboard/gnome-keyboard-panel.ui @@ -149,431 +149,6 @@ custom-shortcut-ok-button - - True - True - False - - - True - False - 12 - 18 - - - True - False - 6 - - - True - False - 0 - Repeat Keys - - - - - - False - False - 0 - - - - - True - False - - - True - False - - - - False - False - 0 - - - - - True - False - 6 - - - Key presses _repeat when key is held down - True - True - False - False - True - 0 - True - - - False - False - 0 - - - - - True - False - - - True - False - 0 - _Delay: - True - center - repeat_delay_scale - - - 0 - 0 - - - - - True - False - 0 - _Speed: - True - center - repeat_speed_scale - - - 0 - 1 - - - - - True - False - 1 - 10 - Short - - - - - - 1 - 0 - - - - - True - False - 1 - 10 - Slow - - - - - - 1 - 1 - - - - - True - True - True - repeat_delay_adjustment - False - - - 2 - 0 - - - - - True - True - True - repeat_speed_adjustment - False - - - Repeat keys speed - - - - - 2 - 1 - - - - - True - False - 0 - Long - - - - - - 3 - 0 - - - - - True - False - 0 - Fast - - - - - - 3 - 1 - - - - - True - True - 1 - - - - - True - True - 1 - - - - - False - False - 1 - - - - - False - False - 0 - - - - - True - False - 6 - - - True - False - 0 - Cursor Blinking - - - - - - False - False - 0 - - - - - True - False - - - True - False - - - - False - False - 0 - - - - - True - False - 6 - - - Cursor _blinks in text fields - True - True - False - False - True - 0 - True - - - False - False - 0 - - - - - True - False - - - True - False - 0 - S_peed: - True - center - cursor_blink_time_scale - - - 0 - 0 - - - - - True - False - 1 - 10 - Slow - - - - - - 1 - 0 - - - - - True - True - True - cursor_blink_time_adjustment - False - True - - - Cursor blink speed - - - - - 2 - 0 - - - - - True - False - 0 - Fast - - - - - - 3 - 0 - - - - - True - True - 1 - - - - - True - True - 1 - - - - - False - False - 1 - - - - - False - False - 1 - - - - - True - False - - - Input Sources - True - True - True - False - False - none - region panel - - - False - True - 0 - - - - - - - - False - False - end - 2 - - - - - - - True - False - Typing - - - False - - - True False @@ -724,55 +299,5 @@ - - 1 - - - - - True - False - Shortcuts - - - 1 - False - - - - - - - - - - - - 100 - 2000 - 500 - 10 - 10 - - - 0.5 - 110 - 33.3 - 1 - 1 - - - - - - - - - - - - - - - + diff --git a/panels/keyboard/keyboard-general.c b/panels/keyboard/keyboard-general.c deleted file mode 100644 index 868b5a509..000000000 --- a/panels/keyboard/keyboard-general.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2010 Intel, Inc - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - * Authors: Thomas Wood - * Rodrigo Moya - */ - -#include "keyboard-general.h" - -#define WID(s) GTK_WIDGET (gtk_builder_get_object (builder, s)) - -static GSettings *keyboard_settings = NULL; -static GSettings *interface_settings = NULL; - -static gboolean -get_rate (GValue *value, - GVariant *variant, - gpointer user_data) -{ - int rate; - gdouble fraction; - - rate = g_variant_get_uint32 (variant); - fraction = 1.0 / ((gdouble) rate / 1000.0); - g_value_set_double (value, fraction); - g_debug ("Getting fraction %f for msecs %d", fraction, rate); - return TRUE; -} - -static GVariant * -set_rate (const GValue *value, - const GVariantType *expected_type, - gpointer user_data) -{ - gdouble rate; - int msecs; - - rate = g_value_get_double (value); - msecs = (1 / rate) * 1000; - g_debug ("Setting repeat rate to %d", msecs); - return g_variant_new_uint32 (msecs); -} - -static gboolean -layout_link_clicked (GtkLinkButton *button, - CcPanel *panel) -{ - CcShell *shell; - GError *error = NULL; - - shell = cc_panel_get_shell (panel); - if (cc_shell_set_active_panel_from_id (shell, "region", NULL, &error) == FALSE) - { - g_warning ("Failed to activate Region panel: %s", error->message); - g_error_free (error); - } - return TRUE; -} - -void -keyboard_general_init (CcPanel *panel, GtkBuilder *builder) -{ - if (keyboard_settings == NULL) - keyboard_settings = g_settings_new ("org.gnome.desktop.peripherals.keyboard"); - - if (interface_settings == NULL) - interface_settings = g_settings_new ("org.gnome.desktop.interface"); - - g_settings_bind (keyboard_settings, "repeat", - WID ("repeat_toggle"), "active", - G_SETTINGS_BIND_DEFAULT); - g_settings_bind (keyboard_settings, "repeat", - WID ("repeat_grid"), "sensitive", - G_SETTINGS_BIND_GET); - - g_settings_bind (keyboard_settings, "delay", - gtk_range_get_adjustment (GTK_RANGE (WID ("repeat_delay_scale"))), "value", - G_SETTINGS_BIND_DEFAULT); - g_settings_bind_with_mapping (keyboard_settings, "repeat-interval", - gtk_range_get_adjustment (GTK_RANGE (WID ("repeat_speed_scale"))), "value", - G_SETTINGS_BIND_DEFAULT, - get_rate, set_rate, NULL, NULL); - - g_settings_bind (interface_settings, "cursor-blink", - WID ("cursor_toggle"), "active", - G_SETTINGS_BIND_DEFAULT); - g_settings_bind (interface_settings, "cursor-blink", - WID ("cursor_grid"), "sensitive", - G_SETTINGS_BIND_GET); - - g_settings_bind (interface_settings, "cursor-blink-time", - gtk_range_get_adjustment (GTK_RANGE (WID ("cursor_blink_time_scale"))), "value", - G_SETTINGS_BIND_DEFAULT); - - g_signal_connect (WID ("linkbutton"), "activate-link", - G_CALLBACK (layout_link_clicked), panel); -} - -void -keyboard_general_dispose (CcPanel *panel) -{ - if (keyboard_settings != NULL) - { - g_object_unref (keyboard_settings); - keyboard_settings = NULL; - } - - if (interface_settings != NULL) - { - g_object_unref (interface_settings); - interface_settings = NULL; - } -} diff --git a/panels/keyboard/keyboard-general.h b/panels/keyboard/keyboard-general.h deleted file mode 100644 index e0718786a..000000000 --- a/panels/keyboard/keyboard-general.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2010 Intel, Inc - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - * Authors: Thomas Wood - * Rodrigo Moya - */ - -#include -#include - -void keyboard_general_init (CcPanel *panel, GtkBuilder *builder); -void keyboard_general_dispose (CcPanel *panel);