[gtk] inspector: Add an api to activate an object



commit fbe0db4007575867668ab95ccb225df2cf132c8f
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Feb 13 13:40:40 2019 -0500

    inspector: Add an api to activate an object
    
    This will be used to make object property inspection
    work again.
    
    This will be used to make object property inspection
    work againn

 gtk/inspector/object-tree.c | 10 +++++++++-
 gtk/inspector/object-tree.h |  2 ++
 2 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c
index 8df104f86b..f2a2f13e1b 100644
--- a/gtk/inspector/object-tree.c
+++ b/gtk/inspector/object-tree.c
@@ -686,6 +686,13 @@ gtk_inspector_get_object_title (GObject *object)
     return g_strconcat (G_OBJECT_TYPE_NAME (object), " — ", name, NULL);
 }
 
+void
+gtk_inspector_object_tree_activate_object (GtkInspectorObjectTree *wt,
+                                           GObject                *object)
+{
+  g_signal_emit (wt, signals[OBJECT_ACTIVATED], 0, object);
+}
+
 static void
 on_row_activated (GtkListBox             *box,
                   GtkListBoxRow          *row,
@@ -699,7 +706,7 @@ on_row_activated (GtkListBox             *box,
   item = g_list_model_get_item (G_LIST_MODEL (wt->priv->tree_model), pos);
   object = gtk_tree_list_row_get_item (item);
 
-  g_signal_emit (wt, signals[OBJECT_ACTIVATED], 0, object);
+  gtk_inspector_object_tree_activate_object (wt, object);
 
   g_object_unref (item);
   g_object_unref (object);
@@ -1281,6 +1288,7 @@ gtk_inspector_object_tree_select_object (GtkInspectorObjectTree *wt,
                                               gtk_tree_list_row_get_position (row_item));
   g_return_if_fail (row_widget != NULL);
   gtk_list_box_select_row (wt->priv->list, row_widget);
+  g_signal_emit (wt, signals[OBJECT_SELECTED], 0, object); // FIXME
   g_object_unref (row_item);
 }
 
diff --git a/gtk/inspector/object-tree.h b/gtk/inspector/object-tree.h
index 23c53633a3..ee7cf98f8b 100644
--- a/gtk/inspector/object-tree.h
+++ b/gtk/inspector/object-tree.h
@@ -62,6 +62,8 @@ char *     gtk_inspector_get_object_title                (GObject
 
 void       gtk_inspector_object_tree_select_object       (GtkInspectorObjectTree *wt,
                                                           GObject                *object);
+void       gtk_inspector_object_tree_activate_object     (GtkInspectorObjectTree *wt,
+                                                          GObject                *object);
 
 GObject   *gtk_inspector_object_tree_get_selected        (GtkInspectorObjectTree *wt);
 


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