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 669272 - Emit a signal to notify signal activation
Emit a signal to notify signal activation
Status: RESOLVED FIXED
Product: glade
Classification: Applications
Component: anjuta integration
3.10.x
Other Linux
: Normal enhancement
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-02 19:33 UTC by Marco Diego Aurélio Mesquita
Modified: 2012-02-17 21:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Emit signal on signal activation (1.91 KB, patch)
2012-02-02 19:33 UTC, Marco Diego Aurélio Mesquita
none Details | Review
Send signal activated signal. (3.96 KB, patch)
2012-02-15 16:03 UTC, Marco Diego Aurélio Mesquita
needs-work Details | Review
Send signal activated signal. (3.46 KB, patch)
2012-02-16 12:07 UTC, Marco Diego Aurélio Mesquita
none Details | Review
Emit signal on signal activation (3.52 KB, patch)
2012-02-16 14:10 UTC, Marco Diego Aurélio Mesquita
accepted-commit_now Details | Review
Send signal activated signal. (3.52 KB, patch)
2012-02-16 21:43 UTC, Marco Diego Aurélio Mesquita
none Details | Review

Description Marco Diego Aurélio Mesquita 2012-02-02 19:33:39 UTC
Created attachment 206659 [details] [review]
Emit signal on signal activation

Anjuta-glade integration can be greatly improved if glade notifies anjuta whenever a signal is activated in the signal editor. Note that this patch mimics closely the inspector behavior. Please review it.
Comment 1 Marco Diego Aurélio Mesquita 2012-02-03 11:58:36 UTC
Please reject this patch for now as it contains some errors and is not good enough. I'll come up with a more appropriate one ASAP.
Comment 2 Marco Diego Aurélio Mesquita 2012-02-15 16:03:27 UTC
Created attachment 207667 [details] [review]
Send signal activated signal.

The attached makes glade signal editor emit a signal when a signal is double-clicked (activated). This will be used for a future feature for glade-anjuta integration. Note that the behavior mimics the one already present in the glade inspector (and used by anjuta[1]) while the emitted data mimics the one used for the signal drop feature of the glade-anjuta integration.

Please review it.

[1] http://git.gnome.org/browse/anjuta/commit?id=5abe8fd3a97d802c50ce7ac036252aba24feba6c
Comment 3 Johannes Schmid 2012-02-15 18:14:48 UTC
Review of attachment 207667 [details] [review]:

In general it seems reasonable to me to have a "signal-activated"-signal whatever we do with it but it should have the following signature:

void on_signal_activated (GladeSignalEditor *editor, GladeSignal *signal, gpointer user_data).

::: gladeui/glade-signal-editor.c
@@ +822,3 @@
+                   0, signal_data, project);
+    g_object_unref (signal);
+    g_free (signal_data);

Using the same data as for the dragging isn't a good idea.

As this is a signal anyway, you can directly pass the GladeSignal pointer to the callback - no need to put all this in a string. The string is just a work-around because with drag&drop it is tricky to pass arbitary data around.
Comment 4 Juan Pablo Ugarte 2012-02-15 20:23:12 UTC
Review of attachment 207667 [details] [review]:

We might need to add a new function  to GladeSignalEditor
glade_signal_editor_get_widget() to give access to the widget, this way we do not even need to pass the GladeProject object.
BTW wont we need a signal-updated signal?

::: gladeui/glade-signal-editor.c
@@ +818,3 @@
+    gchar *signal_data = g_strdup_printf ("%s:%s:%s:%s:%s:%s",
+                            widget_type_name, signal_name, signal_handler, signal_object,
+                            signal_swap?"1":"0", signal_after?"1":"0");

Please define variables in the start of the block, we try to keep it ansi C.

@@ +1047,3 @@
+                    G_SIGNAL_RUN_LAST,
+                    0,
+                    NULL, NULL, NULL, G_TYPE_NONE, 2,

You can use g_cclosure_marshal_VOID__OBJECT here and use the GladeSignal object directly as suggested by Johannes, also update the type accordingly to
GLADE_TYPE_SIGNAL, GladeProject is not needed if we add a new function glade_signal_editor_load_widget()
Comment 5 Marco Diego Aurélio Mesquita 2012-02-16 12:07:06 UTC
Created attachment 207759 [details] [review]
Send signal activated signal.

The attached patch implements changes requested in previous comments. Please review it.
Comment 6 Marco Diego Aurélio Mesquita 2012-02-16 14:10:25 UTC
Created attachment 207776 [details] [review]
Emit signal on signal activation

Attached patch is the same as the previous one but adds a runtime check. Please commit it.
Comment 7 Juan Pablo Ugarte 2012-02-16 14:13:49 UTC
Review of attachment 207776 [details] [review]:

Looks good
Comment 8 Tristan Van Berkom 2012-02-16 14:51:29 UTC
Patch looks fine to me too, as I discussed with Marco, perhaps
he's going to want to listen to signal-added/signal-removed signals
on GladeWidget for the purpose of actually creating and removing 
user code to handle it... the action of actually activating the
signal row in the editor can always also be useful to frontends
like Anjuta... so this added signal is a good thing in any case.

Juan can you get this into master branch since you seem to be
doing some releases ?
Comment 9 Marco Diego Aurélio Mesquita 2012-02-16 21:43:59 UTC
Created attachment 207812 [details] [review]
Send signal activated signal.

The attached patch fixes a check in the previous one. Please commit it.
Comment 10 Juan Pablo Ugarte 2012-02-17 21:24:26 UTC
Commited in master