[Glade-devel] [patch, glade3] cleanup popup menu

Hi Paolo!

I've committed your changes, plus some fixes to cut & paste.

The problems that I was seeing with cut & paste were due to the
finalization function of the cut command.  It was destroying the widget
cutted, but we only do the finalization if we were destroying the cut
command.  To reach this point the user should undo a cut command, and
then do another action (thus removing the upper part of the undo stack).
But if the cut command had been undoed, the cutted widget is again in
use, so we can't destroy it.

There was also a little problem with the paste command, as if you tried
to paste "button1" over "window1", the paste command tried to paste
"window1" (instead of pasting "button1").

Now cut & paste is working flawsely on my system.

Archit, are these the problems that you were experiencing a while ago
with cut & paste?

Paolo, making the menu items insensitive when the action is not allowed
will give you several love points ;-)

Thank you for your work!


P.S.:  Sorry, still no time to look at your close project patch

Paolo wrote:

The patch attached cleans up the popup menu making it saner 
(IMHO before the code worked by chance since the "activate" 
event was connected to functions with different prototypes 
from that of the event handler). Beside the Cut, Copy etc in 
the popup ended up calling different functions from those in 
the main menu bar. Last but not least, after the patch popup 
menu items have stock icons and mnemonics :) .

Here are the changes to make review easier:

- remove glade_widget_copy and friends: some codepaths (e.g. 
the main menu bar) didn't call these, while others (e.g the 
popup menu) did; since they only called glade_command_copy 
etc, which is what was used in the other places, remove them 
and their occurences.

- provide proper callbacks for the popup menu items: e.g. 
glade_popup_cut_cb etc; also move in popup.c the 
placeholder_paste_callback which was only used here.

- improve glade_popup_append_item so that it handles 
mnemonics and icons, beside using g_object_set_data is not 
needed anymore.

hope it makes sense


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