After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 156416 - copy/paste doesn't work.
copy/paste doesn't work.
Status: RESOLVED FIXED
Product: glade
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-10-25 19:34 UTC by Tristan Van Berkom
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Yet another uber patch. (36.58 KB, patch)
2004-10-27 17:51 UTC, Tristan Van Berkom
none Details | Review
Yet another uber patch replacement. (44.42 KB, patch)
2004-10-28 15:51 UTC, Tristan Van Berkom
none Details | Review
Yet another uber patch replacement. (47.86 KB, patch)
2004-10-28 17:25 UTC, Tristan Van Berkom
none Details | Review
Grrrr, Still a replacement. (47.87 KB, patch)
2004-10-28 17:36 UTC, Tristan Van Berkom
none Details | Review

Description Tristan Van Berkom 2004-10-25 19:34:06 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.
Comment 1 Tristan Van Berkom 2004-10-27 17:51:27 UTC
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.
Comment 2 David Hoover 2004-10-28 05:56:45 UTC
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)
Comment 3 Tristan Van Berkom 2004-10-28 15:51:06 UTC
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.
Comment 4 Tristan Van Berkom 2004-10-28 15:51:41 UTC
Oh yeah, btw, your test case should work now ;-)
Comment 5 Tristan Van Berkom 2004-10-28 16:06:24 UTC
Found one last glitch w/ GtkTable, please wait a sec before integrating this...
Comment 6 Tristan Van Berkom 2004-10-28 17:25:56 UTC
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
Comment 7 Tristan Van Berkom 2004-10-28 17:36:13 UTC
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.
Comment 8 David Hoover 2004-10-28 18:39:39 UTC
applied