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 781976 - inspector: add popup menu to copy the css path
inspector: add popup menu to copy the css path
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Debugging
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 771950 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-04-30 14:07 UTC by Paolo Borelli
Modified: 2018-05-02 18:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (5.53 KB, patch)
2017-04-30 14:08 UTC, Paolo Borelli
needs-work Details | Review

Description Paolo Borelli 2017-04-30 14:07:48 UTC
Being able to copy the path is a useful starting point to use in the css tab
Comment 1 Paolo Borelli 2017-04-30 14:08:09 UTC
Created attachment 350765 [details] [review]
patch
Comment 2 Daniel Boles 2017-08-04 12:52:55 UTC
Did you mean the tree on the CSS Selector page?

If so, my Bug 771950 is a dupe of this.
Comment 3 Paolo Borelli 2017-08-04 14:13:35 UTC
I guess it is... try my patch and see if it helps :)


IIRC it is very rough, but better than nothing...
Comment 4 Daniel Boles 2017-08-06 18:35:26 UTC
Review of attachment 350765 [details] [review]:

It certainly works! Thanks for this. I haven't found myself wanting this in a while so hope I actually end up needing it in the future, now :)

I wonder if it would be nice also to have a way to copy with newlines and indentation as seen in the tree. However, that might be too much work for a little debugging helper...

I'd point out one functional point and 2 whitespace issues:

::: gtk/inspector/selector.c
@@ +67,3 @@
+
+  menu_item = gtk_menu_item_new_with_label (_("Copy"));
+  g_signal_connect(menu_item, "activate", G_CALLBACK (on_popup_menu_action_copy), oh);

Add a space before the (

@@ +98,3 @@
+                       GtkInspectorSelector *oh)
+{
+  if (event->type == GDK_BUTTON_PRESS && event->button == GDK_BUTTON_SECONDARY)

It's probably simpler and better practice to check if (gdk_event_triggers_context_menu (event))

@@ +130,3 @@
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
+	object_class->dispose = gtk_inspector_selector_dispose;

Use 2 spaces, not a tab
Comment 5 Daniel Boles 2017-08-25 01:05:31 UTC
*** Bug 771950 has been marked as a duplicate of this bug. ***
Comment 6 GNOME Infrastructure Team 2018-05-02 18:25:49 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/811.