diff options
author | Matthias Clasen <mclasen@redhat.com> | 2011-11-15 21:12:43 -0500 |
---|---|---|
committer | Rui Matos <tiagomatos@gmail.com> | 2012-05-15 02:17:01 +0200 |
commit | 5e7dc53d9bbdb14149fed6651830410983b9d31e (patch) | |
tree | d2a83d5cbc9d98a0a0aa3150c95364e9009b25d7 | |
parent | 3e7c33f2e1a4e7a0e07fb1bc28bf896bdd10cb6a (diff) | |
download | gnome-control-center-5e7dc53d9bbdb14149fed6651830410983b9d31e.tar.gz |
Region: Add a 'Shortcuts' link to the input sources tab
Now we just need to make the shortcuts page actually provide
previous/next input source shortcuts.
-rw-r--r-- | panels/region/cc-region-panel.c | 2 | ||||
-rw-r--r-- | panels/region/gnome-region-panel-input.c | 24 | ||||
-rw-r--r-- | panels/region/gnome-region-panel-input.h | 4 | ||||
-rw-r--r-- | panels/region/gnome-region-panel.ui | 27 |
4 files changed, 52 insertions, 5 deletions
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c index ee2577a6e..54e4b01f3 100644 --- a/panels/region/cc-region-panel.c +++ b/panels/region/cc-region-panel.c @@ -151,7 +151,7 @@ cc_region_panel_init (CcRegionPanel * self) gtk_widget_reparent (prefs_widget, GTK_WIDGET (self)); - setup_input_tabs (priv->builder); + setup_input_tabs (priv->builder, self); setup_language (priv->builder); setup_formats (priv->builder); setup_system (priv->builder); diff --git a/panels/region/gnome-region-panel-input.c b/panels/region/gnome-region-panel-input.c index 1419fe283..25b586880 100644 --- a/panels/region/gnome-region-panel-input.c +++ b/panels/region/gnome-region-panel-input.c @@ -571,8 +571,27 @@ show_selected_layout (GtkButton *button, gpointer data) /* Main setup {{{1 */ +static gboolean +go_to_shortcuts (GtkLinkButton *button, + CcRegionPanel *panel) +{ + CcShell *shell; + const gchar *argv[] = { "shortcuts", NULL }; + GError *error = NULL; + + shell = cc_panel_get_shell (CC_PANEL (panel)); + if (!cc_shell_set_active_panel_from_id (shell, "keyboard", argv, &error)) + { + g_warning ("Failed to activate Keyboard panel: %s", error->message); + g_error_free (error); + } + + return TRUE; +} + void -setup_input_tabs (GtkBuilder *builder) +setup_input_tabs (GtkBuilder *builder, + CcRegionPanel *panel) { GtkWidget *treeview; GtkTreeViewColumn *column; @@ -632,6 +651,9 @@ setup_input_tabs (GtkBuilder *builder) g_free (previous); g_free (next); + + g_signal_connect (WID("jump-to-shortcuts"), "activate-link", + G_CALLBACK (go_to_shortcuts), panel); } /* Chooser dialog {{{1 */ diff --git a/panels/region/gnome-region-panel-input.h b/panels/region/gnome-region-panel-input.h index a3aa05db6..47a1f52f7 100644 --- a/panels/region/gnome-region-panel-input.h +++ b/panels/region/gnome-region-panel-input.h @@ -24,10 +24,12 @@ #include <gtk/gtk.h> +#include "cc-region-panel.h" G_BEGIN_DECLS -void setup_input_tabs (GtkBuilder *builder); +void setup_input_tabs (GtkBuilder *builder, + CcRegionPanel *self); G_END_DECLS diff --git a/panels/region/gnome-region-panel.ui b/panels/region/gnome-region-panel.ui index 3536a234a..93fd0c7c8 100644 --- a/panels/region/gnome-region-panel.ui +++ b/panels/region/gnome-region-panel.ui @@ -169,6 +169,7 @@ <object class="GtkToolButton" id="language_add"> <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="label" translatable="yes">Add Language</property> <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="icon_name">list-add-symbolic</property> @@ -181,6 +182,7 @@ <child> <object class="GtkToolButton" id="language_remove"> <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">Remove Language</property> <property name="visible">True</property> <property name="sensitive">False</property> <property name="can_focus">False</property> @@ -320,6 +322,7 @@ <child> <object class="GtkToolButton" id="region_add"> <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">Add Region</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_underline">True</property> @@ -334,6 +337,7 @@ <object class="GtkToolButton" id="region_remove"> <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="label" translatable="yes">Remove Region</property> <property name="sensitive">False</property> <property name="can_focus">False</property> <property name="use_underline">True</property> @@ -700,6 +704,7 @@ <child> <object class="GtkToolButton" id="input_source_add"> <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">Add Input Source</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="use_underline">True</property> @@ -713,6 +718,7 @@ <child> <object class="GtkToolButton" id="input_source_remove"> <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">Remove Input Source</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="use_underline">True</property> @@ -726,6 +732,7 @@ <child> <object class="GtkToolButton" id="input_source_move_up"> <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">Move Selected Input Source Up</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="use_underline">True</property> @@ -739,6 +746,7 @@ <child> <object class="GtkToolButton" id="input_source_move_down"> <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">Move Selected Input Source Down</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="use_underline">True</property> @@ -752,6 +760,7 @@ <child> <object class="GtkToolButton" id="input_source_show"> <property name="use_action_appearance">False</property> + <property name="label" translatable="yes">Show Keyboard Layout</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="use_underline">True</property> @@ -815,7 +824,7 @@ <property name="halign">end</property> <property name="hexpand">True</property> <property name="label" translatable="yes">Ctrl+Alt+Space</property> - <property name="selectable">True</property> + <style><class name="dim-label"/></style> </object> <packing> <property name="left_attach">1</property> @@ -845,7 +854,7 @@ <property name="halign">end</property> <property name="hexpand">True</property> <property name="label" translatable="yes">Ctrl+Alt+Shift+Space</property> - <property name="selectable">True</property> + <style><class name="dim-label"/></style> </object> <packing> <property name="left_attach">1</property> @@ -854,6 +863,20 @@ <property name="height">1</property> </packing> </child> + <child> + <object class="GtkLinkButton" id="jump-to-shortcuts"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Shortcut Settings</property> + <property name="halign">end</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> </object> </child> </object> |