Drop the file attached into ./debian/patches/special-to-self.diff,
 and add it to debian/patches/series.
  et voila.

Steve
--
Index: gtetrinet-0.7.11/src/config.c
===================================================================
--- gtetrinet-0.7.11.orig/src/config.c	2013-09-26 20:14:19.000000000 +0100
+++ gtetrinet-0.7.11/src/config.c	2013-09-26 20:14:22.000000000 +0100
@@ -72,7 +72,8 @@
     GDK_3,
     GDK_4,
     GDK_5,
-    GDK_6
+    GDK_6,
+    GDK_s
 };
 
 guint keys[K_NUM];
@@ -367,6 +368,14 @@
     else
       keys[K_SPECIAL6] = defaultkeys[K_SPECIAL6];
 
+    p = gconf_client_get_string (gconf_client, "/apps/gtetrinet/keys/special_self", NULL);
+    if (p)
+    {
+      keys[K_SPECIAL_SELF] = gdk_keyval_to_lower (gdk_keyval_from_name (p));
+      g_free (p);
+    }
+    else
+      keys[K_SPECIAL_SELF] = defaultkeys[K_SPECIAL_SELF];
 
     /* Get the timestamp option. */
     timestampsenable = gconf_client_get_bool (gconf_client, "/apps/gtetrinet/partyline/enable_timestamps", NULL);
@@ -625,6 +634,18 @@
 }
 
 void
+keys_special_self_changed (GConfClient *client,
+                       guint cnxn_id,
+                       GConfEntry *entry)
+{
+
+  client = client;
+  cnxn_id = cnxn_id;
+
+  keys[K_SPECIAL_SELF] = gdk_keyval_to_lower (gdk_keyval_from_name (gconf_value_get_string (gconf_entry_get_value (entry))));
+}
+
+void
 partyline_enable_timestamps_changed (GConfClient *client,
                                      guint cnxn_id,
                                      GConfEntry *entry)
Index: gtetrinet-0.7.11/src/config.h
===================================================================
--- gtetrinet-0.7.11.orig/src/config.h	2013-09-26 20:14:19.000000000 +0100
+++ gtetrinet-0.7.11/src/config.h	2013-09-26 20:16:06.000000000 +0100
@@ -102,6 +102,11 @@
                    GConfEntry *entry);
 
 void
+keys_special_self_changed (GConfClient *client,
+                   guint cnxn_id,
+                   GConfEntry *entry);
+
+void
 partyline_enable_timestamps_changed (GConfClient *client,
                                      guint cnxn_id,
                                      GConfEntry *entry);
@@ -131,6 +136,7 @@
   K_SPECIAL4,
   K_SPECIAL5,
   K_SPECIAL6,
+  K_SPECIAL_SELF,
 /* not a key but the number of configurable keys */
   K_NUM
 } GTetrinetKeys;
Index: gtetrinet-0.7.11/src/dialogs.c
===================================================================
--- gtetrinet-0.7.11.orig/src/dialogs.c	2013-09-26 20:14:19.000000000 +0100
+++ gtetrinet-0.7.11/src/dialogs.c	2013-09-26 20:14:22.000000000 +0100
@@ -548,6 +548,7 @@
     actions[K_SPECIAL4] = _("Special to field 4");
     actions[K_SPECIAL5] = _("Special to field 5");
     actions[K_SPECIAL6] = _("Special to field 6");
+    actions[K_SPECIAL_SELF] = _("Special to self");
   
     gconf_keys[K_RIGHT]    = g_strdup ("/apps/gtetrinet/keys/right");
     gconf_keys[K_LEFT]     = g_strdup ("/apps/gtetrinet/keys/left");
@@ -563,6 +564,7 @@
     gconf_keys[K_SPECIAL4] = g_strdup ("/apps/gtetrinet/keys/special4");
     gconf_keys[K_SPECIAL5] = g_strdup ("/apps/gtetrinet/keys/special5");
     gconf_keys[K_SPECIAL6] = g_strdup ("/apps/gtetrinet/keys/special6");
+    gconf_keys[K_SPECIAL_SELF] = g_strdup ("/apps/gtetrinet/keys/special_self");
 
     for (i = 0; i < K_NUM; i ++) {
         gtk_list_store_append (keys_store, &iter);
Index: gtetrinet-0.7.11/src/gtetrinet.c
===================================================================
--- gtetrinet-0.7.11.orig/src/gtetrinet.c	2013-09-26 20:14:19.000000000 +0100
+++ gtetrinet-0.7.11/src/gtetrinet.c	2013-09-26 20:14:22.000000000 +0100
@@ -210,6 +210,10 @@
                              (GConfClientNotifyFunc) keys_special6_changed,
 			     NULL, NULL, NULL);
 
+    gconf_client_notify_add (gconf_client, "/apps/gtetrinet/keys/special_self",
+                             (GConfClientNotifyFunc) keys_special_self_changed,
+                            NULL, NULL, NULL);
+
     gconf_client_notify_add (gconf_client, "/apps/gtetrinet/partyline/enable_timestamps",
                              (GConfClientNotifyFunc) partyline_enable_timestamps_changed,
 			     NULL, NULL, NULL);
Index: gtetrinet-0.7.11/src/tetrinet.c
===================================================================
--- gtetrinet-0.7.11.orig/src/tetrinet.c	2013-09-26 20:14:22.000000000 +0100
+++ gtetrinet-0.7.11/src/tetrinet.c	2013-09-26 20:14:22.000000000 +0100
@@ -1811,6 +1811,11 @@
         tetris_drawcurrentblock ();
         return TRUE;
     }
+    else if (gdk_keyval_to_lower (keyval) == keys[K_SPECIAL_SELF]) {
+       tetrinet_specialkey(playernum);
+        tetris_drawcurrentblock ();
+        return TRUE;
+    }
     tetris_drawcurrentblock ();
     return FALSE;
 }

Reply via email to