[Xfce4-commits] r27315 - in xfce4-settings/trunk: . dialogs/keyboard-settings

Jannis Pohlmann jannis at xfce.org
Wed Jul 16 21:44:27 CEST 2008


Author: jannis
Date: 2008-07-16 19:44:27 +0000 (Wed, 16 Jul 2008)
New Revision: 27315

Modified:
   xfce4-settings/trunk/ChangeLog
   xfce4-settings/trunk/dialogs/keyboard-settings/main.c
Log:
	* dialogs/keyboard-settings/main.c: Save property when a new shortcut
	  is created.
	* dialogs/keyboard-settings/main.c,
	  dialogs/keyboard-settings/command-dialog.c: Fix compilation.

Modified: xfce4-settings/trunk/ChangeLog
===================================================================
--- xfce4-settings/trunk/ChangeLog	2008-07-16 19:44:23 UTC (rev 27314)
+++ xfce4-settings/trunk/ChangeLog	2008-07-16 19:44:27 UTC (rev 27315)
@@ -1,7 +1,7 @@
-2008-07-16	Nick Schermer <nick at xfce.org>
+2008-07-16	Jannis Pohlmann <jannis at xfce.org>
 
-	* dialogs/keyboard-settings/main.c, 
-	  dialogs/keyboard-settings/command-dialog.c: Fix compilation.
+	* dialogs/keyboard-settings/main.c: Save property when a new shortcut
+	  is created.
 
 2008-07-16	Jannis Pohlmann <jannis at xfce.org>
 
@@ -10,6 +10,11 @@
 	  property is removed and grab keys when a new property is added.
 	  Update the shortcuts -> command hash table according to the changes.
 
+2008-07-16	Nick Schermer <nick at xfce.org>
+
+	* dialogs/keyboard-settings/main.c, 
+	  dialogs/keyboard-settings/command-dialog.c: Fix compilation.
+
 2008-07-16	Jannis Pohlmann <jannis at xfce.org>
 
 	* dialogs/keyboard-settings/keyboard-dialog.glade: In the last commit

Modified: xfce4-settings/trunk/dialogs/keyboard-settings/main.c
===================================================================
--- xfce4-settings/trunk/dialogs/keyboard-settings/main.c	2008-07-16 19:44:23 UTC (rev 27314)
+++ xfce4-settings/trunk/dialogs/keyboard-settings/main.c	2008-07-16 19:44:27 UTC (rev 27315)
@@ -210,6 +210,7 @@
   const gchar  *shortcut = NULL;
   gboolean      finished = FALSE;
   gchar        *command = NULL;
+  gchar        *property;
   gint          response;
 
   /* Create command dialog */
@@ -258,6 +259,11 @@
 
       /* Set row values */
       gtk_list_store_set (GTK_LIST_STORE (model), &iter, SHORTCUT_COLUMN, shortcut, ACTION_COLUMN, command, -1);
+
+      /* Save the new shortcut to xfconf */
+      property = g_strdup_printf ("/%s", shortcut);
+      xfconf_channel_set_array (kbd_channel, property, G_TYPE_STRING, "execute", G_TYPE_STRING, command, G_TYPE_INVALID);
+      g_free (property);
     }
 
   /* Destroy the shortcut dialog */
@@ -326,53 +332,7 @@
 }
 
 
-#if 0
 static void
-keyboard_settings_shortcut_action_edited (GtkTreeView *tree_view,
-                                          gchar       *path,
-                                          gchar       *new_text)
-
-{
-  GtkTreeModel  *model;
-  GtkTreeIter    iter;
-  gchar         *shortcut;
-  gchar         *old_text;
-  gchar         *property_name;
-
-  /* Get tree model */
-  model = gtk_tree_view_get_model (tree_view);
-
-  /* Get iter for the edited row */
-  if (G_LIKELY (gtk_tree_model_get_iter_from_string (model, &iter, path)))
-    {
-      /* Read row values */
-      gtk_tree_model_get (model, &iter, SHORTCUT_COLUMN, &shortcut, ACTION_COLUMN, &old_text, -1);
-
-      /* Check whether anything has changed at all */
-      if (G_LIKELY (g_utf8_collate (old_text, new_text) != 0))
-        {
-          /* Upate row data with the new text */
-          gtk_list_store_set (GTK_LIST_STORE (model), &iter, ACTION_COLUMN, new_text, -1);
-
-          /* Build xfconf property name */
-          property_name = g_strdup_printf ("/%s", shortcut);
-
-          /* Save new shortcut settings */
-          xfconf_channel_set_array (kbd_channel, property_name, G_TYPE_STRING, "execute", G_TYPE_STRING, new_text, G_TYPE_INVALID);
-
-          /* Free property name */
-          g_free (property_name);
-        }
-
-      /* Free strings */
-      g_free (shortcut);
-      g_free (old_text);
-    }
-}
-#endif
-
-
-static void
 keyboard_settings_edit_shortcut (GtkTreeView *tree_view,
                                  GtkTreePath *path)
 {



More information about the Xfce4-commits mailing list