dia r4349 - in trunk: . lib



Author: hans
Date: Sat Mar 28 00:22:45 2009
New Revision: 4349
URL: http://svn.gnome.org/viewvc/dia?rev=4349&view=rev

Log:
2009-03-28  Hans Breuer  <hans breuer org>

	* lib/prop_text.c : for 'multistring' connect to the 'change' signal
	of the TextBuffer rather than to the unreliable 'insert-at-cursor' of
	the TextView -> "Chronogram - line" works again, bug #576905
	* lib/propinternals.h  lib/prop_attr.c lib/prop_geomtypes.c 
	  lib/prop_inttypes.c lib/prop_text.c lib/prop_widgets.c 
	  lib/propdialogs.c : make prophandler_connect() take a GObject* to
	do the above without warnings



Modified:
   trunk/ChangeLog
   trunk/lib/prop_attr.c
   trunk/lib/prop_geomtypes.c
   trunk/lib/prop_inttypes.c
   trunk/lib/prop_text.c
   trunk/lib/prop_widgets.c
   trunk/lib/propdialogs.c
   trunk/lib/propinternals.h

Modified: trunk/lib/prop_attr.c
==============================================================================
--- trunk/lib/prop_attr.c	(original)
+++ trunk/lib/prop_attr.c	Sat Mar 28 00:22:45 2009
@@ -64,7 +64,7 @@
 linestyleprop_get_widget(LinestyleProperty *prop, PropDialog *dialog)
 { 
   GtkWidget *ret = dia_line_style_selector_new();
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"value-changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "value-changed");
   return ret;
 }
 
@@ -178,7 +178,7 @@
 arrowprop_get_widget(ArrowProperty *prop, PropDialog *dialog)
 { 
   GtkWidget *ret = dia_arrow_selector_new();
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"value-changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "value-changed");
   return ret;
 }
 
@@ -295,7 +295,7 @@
 colorprop_get_widget(ColorProperty *prop, PropDialog *dialog)
 { 
   GtkWidget *ret = dia_color_selector_new();
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"value-changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "value-changed");
   return ret;
 }
 
@@ -395,7 +395,7 @@
 fontprop_get_widget(FontProperty *prop, PropDialog *dialog)
 { 
   GtkWidget *ret = dia_font_selector_new();
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"value-changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "value-changed");
   return ret;
 }
 

Modified: trunk/lib/prop_geomtypes.c
==============================================================================
--- trunk/lib/prop_geomtypes.c	(original)
+++ trunk/lib/prop_geomtypes.c	Sat Mar 28 00:22:45 2009
@@ -73,7 +73,7 @@
                                                          0.1, 1.0, 0));
   GtkWidget *ret = gtk_spin_button_new(adj, 1.0, 2);
   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(ret),TRUE);
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"value_changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "value_changed");
   
   return ret;
 }
@@ -183,7 +183,7 @@
                                                          0.1, 1.0, 0));
   GtkWidget *ret = dia_unit_spinner_new(adj, prefs_get_length_unit());
   /*  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(ret),TRUE);*/
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"value-changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "value-changed");
   
   return ret;
 }
@@ -296,7 +296,7 @@
                                                          0.1, 1.0, 0));
   GtkWidget *ret = dia_unit_spinner_new(adj, prefs_get_fontsize_unit());
   /*  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(ret),TRUE);*/
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"value-changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "value-changed");
   /*fontsizeprop_reset_widget(prop, ret);*/
   return ret;
 }

Modified: trunk/lib/prop_inttypes.c
==============================================================================
--- trunk/lib/prop_inttypes.c	(original)
+++ trunk/lib/prop_inttypes.c	Sat Mar 28 00:22:45 2009
@@ -63,7 +63,7 @@
 charprop_get_widget(CharProperty *prop, PropDialog *dialog) 
 { 
   GtkWidget *ret = gtk_entry_new();  
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "changed");
   return ret;
 }
 
@@ -186,7 +186,7 @@
   GtkWidget *ret = gtk_toggle_button_new_with_label(_("No"));
   g_signal_connect(G_OBJECT(ret), "toggled",
                    G_CALLBACK (bool_toggled), NULL);
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"toggled");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "toggled");
   return ret;
 }
 
@@ -283,7 +283,7 @@
                                                          1.0, 10.0, 0));
   GtkWidget *ret = gtk_spin_button_new(adj, 1.0, 0);
   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(ret),TRUE);
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"value_changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "value_changed");
   
   return ret;
 }
@@ -493,7 +493,7 @@
     ret = gtk_combo_box_new_text ();
     for (i = 0; enumdata[i].name != NULL; i++)
       gtk_combo_box_append_text (GTK_COMBO_BOX (ret), _(enumdata[i].name)); 
-    prophandler_connect(&prop->common, GTK_OBJECT (ret), "changed");
+    prophandler_connect(&prop->common, G_OBJECT (ret), "changed");
   } else {
     ret = gtk_entry_new(); /* should use spin button/option menu */
   }  

Modified: trunk/lib/prop_text.c
==============================================================================
--- trunk/lib/prop_text.c	(original)
+++ trunk/lib/prop_text.c	Sat Mar 28 00:22:45 2009
@@ -86,7 +86,7 @@
 stringprop_get_widget(StringProperty *prop, PropDialog *dialog) 
 { 
   GtkWidget *ret = gtk_entry_new();
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "changed");
   return ret;
 }
 
@@ -121,13 +121,14 @@
 multistringprop_get_widget(StringProperty *prop, PropDialog *dialog) 
 { 
   GtkWidget *ret = gtk_text_view_new();
+  GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(ret));
   GtkWidget *frame = gtk_frame_new(NULL);
   gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
   gtk_container_add(GTK_CONTAINER(frame), ret);
   g_signal_connect(G_OBJECT(ret), "key-release-event", 
 		   G_CALLBACK(multistringprop_handle_key), NULL);
   gtk_widget_show(ret);
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"insert-at-cursor");
+  prophandler_connect(&prop->common, G_OBJECT(buffer), "changed");
   return frame;
 }
 
@@ -156,7 +157,7 @@
 fileprop_get_widget(StringProperty *prop, PropDialog *dialog) 
 { 
   GtkWidget *ret = dia_file_selector_new();
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"value-changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "value-changed");
   return ret;
 }
 

Modified: trunk/lib/prop_widgets.c
==============================================================================
--- trunk/lib/prop_widgets.c	(original)
+++ trunk/lib/prop_widgets.c	Sat Mar 28 00:22:45 2009
@@ -76,7 +76,7 @@
   if (!prop->common.descr) return NULL;
 
   ret = gtk_button_new_with_label(_(prop->common.descr->tooltip));
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"clicked");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "clicked");
 
   return ret;
 }
@@ -460,7 +460,7 @@
   gtk_signal_connect(GTK_OBJECT(ret), "select-child",
                      GTK_SIGNAL_FUNC(listprop_select_child_signal), prop);
 
-  prophandler_connect(&prop->common,GTK_OBJECT(ret),"selection-changed");
+  prophandler_connect(&prop->common, G_OBJECT(ret), "selection-changed");
   return ret;
 }
 

Modified: trunk/lib/propdialogs.c
==============================================================================
--- trunk/lib/propdialogs.c	(original)
+++ trunk/lib/propdialogs.c	Sat Mar 28 00:22:45 2009
@@ -209,7 +209,7 @@
 
 void 
 prophandler_connect(const Property *prop,
-                    GtkObject *object,
+                    GObject *object,
                     const gchar *signal)
 {
   if (0==strcmp(signal,"FIXME")) {

Modified: trunk/lib/propinternals.h
==============================================================================
--- trunk/lib/propinternals.h	(original)
+++ trunk/lib/propinternals.h	Sat Mar 28 00:22:45 2009
@@ -37,9 +37,6 @@
 gboolean propdescs_can_be_merged(const PropDescription *p1, 
                                  const PropDescription *p2);
 
-void prophandler_connect(const Property *prop, GtkObject *object,
-                         const gchar *signal);
-
 /* returns FALSE if error is set cause of meesed up format */
 gboolean prop_list_load(GPtrArray *props, DataNode data, GError **err);
 void prop_list_save(GPtrArray *props, DataNode data);
@@ -70,7 +67,7 @@
 void prop_get_data_from_widgets(PropDialog *dialog);
 WIDGET *prop_dialog_get_widget(const PropDialog *dialog);
 
-void prophandler_connect(const Property *prop, GtkObject *object, 
+void prophandler_connect(const Property *prop, GObject *object, 
                          const gchar *signal);
 
 /* Stuff in propoffsets.c: */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]