[gnome-terminal] accels: Consolidate code to edit and clear shortcuts
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] accels: Consolidate code to edit and clear shortcuts
- Date: Wed, 16 Apr 2014 09:33:46 +0000 (UTC)
commit 1a755116b2b828130a3cbfd4f0712da5327b3b21
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Apr 14 13:43:47 2014 +0200
accels: Consolidate code to edit and clear shortcuts
https://bugzilla.gnome.org/show_bug.cgi?id=728121
src/terminal-accels.c | 46 +++++++++++++++++-----------------------------
1 files changed, 17 insertions(+), 29 deletions(-)
---
diff --git a/src/terminal-accels.c b/src/terminal-accels.c
index 1f8b3ca..a3a8034 100644
--- a/src/terminal-accels.c
+++ b/src/terminal-accels.c
@@ -398,12 +398,11 @@ accel_set_func (GtkTreeViewColumn *tree_column,
}
static void
-accel_edited_callback (GtkCellRendererAccel *cell,
- gchar *path_string,
- guint keyval,
- GdkModifierType mask,
- guint hardware_keycode,
- GtkTreeView *view)
+accel_update (GtkTreeView *view,
+ GtkCellRendererAccel *cell,
+ gchar *path_string,
+ guint keyval,
+ GdkModifierType mask)
{
GtkTreeModel *model;
terminal_free_tree_path GtkTreePath *path = NULL;
@@ -431,33 +430,22 @@ accel_edited_callback (GtkCellRendererAccel *cell,
}
static void
+accel_edited_callback (GtkCellRendererAccel *cell,
+ gchar *path_string,
+ guint keyval,
+ GdkModifierType mask,
+ guint hardware_keycode,
+ GtkTreeView *view)
+{
+ accel_update (view, cell, path_string, keyval, mask);
+}
+
+static void
accel_cleared_callback (GtkCellRendererAccel *cell,
gchar *path_string,
GtkTreeView *view)
{
- GtkTreeModel *model;
- terminal_free_tree_path GtkTreePath *path = NULL;
- GtkTreeIter iter;
- KeyEntry *ke;
- gs_free char *str = NULL;
-
- model = gtk_tree_view_get_model (view);
-
- path = gtk_tree_path_new_from_string (path_string);
- if (!path)
- return;
-
- if (!gtk_tree_model_get_iter (model, &iter, path))
- return;
-
- gtk_tree_model_get (model, &iter, KEYVAL_COLUMN, &ke, -1);
-
- /* sanity check */
- if (ke == NULL)
- return;
-
- str = binding_name (0, 0);
- g_settings_set_string (keybinding_settings, ke->settings_key, str);
+ accel_update (view, cell, path_string, 0, 0);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]