From 72661bb34ca27c9b93ed93a765833cfbd1ee6e23 Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Wed, 16 May 2012 15:55:07 +1000 Subject: Readd Ctrl-H accelerator --- src/empathy-roster-window.c | 17 +++++++++++++++++ src/empathy.c | 4 ++++ 2 files changed, 21 insertions(+) (limited to 'src') diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c index 613a654e6..5d9898153 100644 --- a/src/empathy-roster-window.c +++ b/src/empathy-roster-window.c @@ -2128,6 +2128,22 @@ contacts_loaded_cb (EmpathyIndividualManager *manager, hide_contacts_loading (self); } +static void +roster_window_setup_actions (EmpathyRosterWindow *self) +{ + GAction *action; + +#define ADD_GSETTINGS_ACTION(schema, key) \ + action = g_settings_create_action (self->priv->gsettings_##schema, \ + EMPATHY_PREFS_##key); \ + g_action_map_add_action (G_ACTION_MAP (self), action); \ + g_object_unref (action); + + ADD_GSETTINGS_ACTION (ui, UI_SHOW_OFFLINE); + +#undef ADD_GSETTINGS_ACTION +} + static void empathy_roster_window_init (EmpathyRosterWindow *self) { @@ -2194,6 +2210,7 @@ empathy_roster_window_init (EmpathyRosterWindow *self) /* set up menus */ g_action_map_add_action_entries (G_ACTION_MAP (self), menubar_entries, G_N_ELEMENTS (menubar_entries), self); + roster_window_setup_actions (self); filename = empathy_file_lookup ("empathy-roster-window-menubar.ui", "src"); gui = empathy_builder_get_file (filename, diff --git a/src/empathy.c b/src/empathy.c index 9ba923602..e2ae2632f 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -357,6 +357,10 @@ empathy_app_command_line (GApplication *app, gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (self->window)); + gtk_application_add_accelerator (GTK_APPLICATION (app), + "h", + "win." EMPATHY_PREFS_UI_SHOW_OFFLINE, + NULL); /* check if Shell is running */ dbus = tp_dbus_daemon_dup (&error); -- cgit v1.2.3