Update of /cvsroot/gtkpod/gtkpod/src
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16924/src

Modified Files:
        display_spl.c 
Log Message:
        * display_spl.c (spl_update_rule): don't reactivate the '-'
          button when changing the rule.



Index: display_spl.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_spl.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- display_spl.c       21 May 2006 03:46:44 -0000      1.17
+++ display_spl.c       12 Sep 2006 12:15:21 -0000      1.18
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-05-21 11:51:00 jcs>
+/* Time-stamp: <2006-09-12 01:18:13 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users.sourceforge.net>
 |  Part of the gtkpod project.
@@ -1265,39 +1265,46 @@
     /* ----------- */
     snprintf (name, WNLEN, "spl_buttonhbox%d", row);
     hbox = g_object_get_data (G_OBJECT (table), name);
-    if (hbox)
+    if (!hbox)
     {
-       gtk_widget_destroy (hbox);
-       hbox = NULL;
+       /* create hbox with buttons */
+       hbox = gtk_hbox_new (TRUE, 2);
+       gtk_widget_show (hbox);
+       g_object_set_data (G_OBJECT (table), name, hbox);
+       gtk_table_attach (table, hbox, 3,4, row,row+1,
+                         0,0,   /* expand options */
+                         XPAD,YPAD);  /* padding options */
     }
-    /* create hbox with buttons */
-    hbox = gtk_hbox_new (TRUE, 2);
-    gtk_widget_show (hbox);
-    g_object_set_data (G_OBJECT (table), name, hbox);
 
-    button = gtk_button_new_with_label (_("-"));
-    gtk_widget_show (button);
-    gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0);
-    g_signal_connect (button, "clicked",
-                     G_CALLBACK (spl_button_minus_clicked),
-                     spl_window);
-    g_object_set_data (G_OBJECT (button), "spl_rule", splr);
     snprintf (name, WNLEN, "spl_button-%d", row);
-    g_object_set_data (G_OBJECT (table), name, button);
-
-    button = gtk_button_new_with_label (_("+"));
-    gtk_widget_show (button);
-    gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0);
-    g_signal_connect (button, "clicked",
-                     G_CALLBACK (spl_button_plus_clicked),
-                     spl_window);
+    button = g_object_get_data (G_OBJECT (table), name);
+    if (!button)
+    {
+       button = gtk_button_new_with_label (_("-"));
+       gtk_widget_show (button);
+       gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0);
+       g_signal_connect (button, "clicked",
+                         G_CALLBACK (spl_button_minus_clicked),
+                         spl_window);
+       g_object_set_data (G_OBJECT (table), name, button);
+    }
     g_object_set_data (G_OBJECT (button), "spl_rule", splr);
-    snprintf (name, WNLEN, "spl_button+%d", row);
-    g_object_set_data (G_OBJECT (table), name, button);
 
-    gtk_table_attach (table, hbox, 3,4, row,row+1,
-                     0,0,   /* expand options */
-                     XPAD,YPAD);  /* padding options */
+
+    snprintf (name, WNLEN, "spl_button+%d", row);
+    button = g_object_get_data (G_OBJECT (table), name);
+    if (!button)
+    {
+       button = gtk_button_new_with_label (_("+"));
+       gtk_widget_show (button);
+       gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0);
+       g_signal_connect (button, "clicked",
+                         G_CALLBACK (spl_button_plus_clicked),
+                         spl_window);
+       g_object_set_data (G_OBJECT (table), name, button);
+       snprintf (name, WNLEN, "spl_button+%d", row);
+    }
+    g_object_set_data (G_OBJECT (button), "spl_rule", splr);
 }
 
 /* Display all rules stored in "spl_work" */
@@ -1377,6 +1384,11 @@
        removed =  splremove (table, "spl_fieldcombo", i);
        removed |= splremove (table, "spl_actioncombo", i);
        removed |= splremove (table, "spl_actionhbox", i);
+       /* remove spl_button+/- BEFORE removing spl_buttonhbox, as
+          removing spl_buttonhbox will destroy the buttons as well --
+          we'd have to g_object_set_data(..., NULL) manually. */
+       removed |= splremove (table, "spl_button+", i);
+       removed |= splremove (table, "spl_button-", i);
        removed |= splremove (table, "spl_buttonhbox", i);
     }
 }


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to