GNOME Bugzilla – Bug 156416
copy/paste doesn't work.
Last modified: 2004-12-22 21:47:04 UTC
When a widget is "copied", its only added to the clipboard, and when its pasted, the glade-command code adds it to the new container without duping it or removing it from the old container. I am currently working on this.
Created attachment 33134 [details] [review] Yet another uber patch. Here is a copy of the change log entry: * src/glade-editor.[ch]: Implemented glade_editor_query_popup(), also obsoleted common & packing booleans for a more convenient GladeEditorTableType field. * src/glade-gtk.c: - glade_gtk_table_set_n_common() fixed leak if child list. - Removed all dialogs. - Fixed children are now born with size-request properties enabled. - Removed some `#if 0' code that I trust we dont need. * src/glade-plugin.h: - Added a header to the batch. * src/glade-popup.c: glade_popup_copy_cb() now duplicates the widget in question with glade_widget_dup(). * src/glade-property-class.[ch]: glade_property_class_update_from_node() now flags properties that need a pupop dialog at creation time. * src/glade-property.[ch]: Implemented glade_property_sync() (Sychronizes the object with its glade_property), glade_property_set() now calls glade_property_sync(). * src/glade-widget.[ch]: - Implemented glade_widget_dup(). - Added call to glade_property_sync on appropriate properties that need to be synchronized after a glade_widget_rebuild(). - Added a call to glade_editor_query_popup() in the appropriate situation. * widgets/gtkbox.xml: - Removed reference to obsoleted post_create function. - Changed `ignore' to `empty' for the fill_empty funciton. - Tagged "Size" property as type "Query". * widgets/gtknotebook.xml: - Tagged "pages" property as type "Query". - Removed obsolete (or never implemented) Query section. * widgets/gtktable.xml: - Tagged "n-rows" and "n-columns" properties as type "Query". - Removed obsolete (or never implemented) Query section.
This doesn't seem to work for me. What I tried: * Create a new window * put in a vbox w/ two cells * stick a label in one of them (and set the text to something so you can see it) * select the label & copy * select the empty cell & paste At that point, the vbox APPEARS to scrunch down to only one cell (although checking properties on it claims that it still has two), and I get the following on stdout/stderr: (glade-3:9630): Gtk-CRITICAL **: file gtklabel.c: line 1018 (gtk_label_set_label): assertion `str != NULL' failed (glade-3:9630): Gtk-WARNING **: Attempting to add a widget with type GtkLabel to a container of type GtkVBox, but the widget is already inside a container of type GtkVBox, the GTK+ FAQ at http://www.gtk.org/faq/ explains how to reparent a widget. Also, with the new automagically generated popups asking for properties on creation, it'd be good to add something to the xml so you can specify a default (for instance, creating that vbox, it defaults to 1 cell now, as opposed to 3)
Created attachment 33170 [details] [review] Yet another uber patch replacement. The ChangeLog is essentially the same, except these are added: * src/glade-gtk.c: - Refitted and integrated Mickael Cornet's patch to bug 153823 - glade_gtk_table_set_n_common() now refuses to shrink when it involves orhpaning widgets, Its also been improved to fill in all the blanks. * src/glade-widget.[ch]: - glade_widget_build_object() now takes into account property_class default values * widgets/gtklabel.xml: Added default "" value for pattern property, this works around gtk+ bug 156720 which was causing us segfaults.
Oh yeah, btw, your test case should work now ;-)
Found one last glitch w/ GtkTable, please wait a sec before integrating this...
Created attachment 33173 [details] [review] Yet another uber patch replacement. So, this patch fixes a few more things than the last patch; GtkTable copy/paste was a little broken (some placeholders weren't always transfered), GtkBox behavior was fixed to behave like gtktable (refuse to shrink if it means orphaning/deleting widgets); also the minimum in the editor of "size" property for GtkBox was three, I made the minimum 2. Here are the ChangeLog Additions: * src/glade-gtk.c: - glade_gtk_box_set_size() Adjusted to match gtk_table behaviour * src/glade-widget.[ch]: - glade_widget_new() now calls new function glade_widget_sync_query_props() in popup cases (If properties dont change from there default, a synchronization is needed at this point). * widgets/gtkbox.xml: - Added Default size 3 - Changed Minimum size to 2
Created attachment 33174 [details] [review] Grrrr, Still a replacement. I didn't update the actual changelog in the last patch, this one is exactly the same but with the updated changelog.
applied