[glade] Revert "* plugins/gtk+/glade-gtk.c, plugins/gtk+/glade-cell-renderer-editor.c, plugins/gtk+/gtk+.x
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] Revert "* plugins/gtk+/glade-gtk.c, plugins/gtk+/glade-cell-renderer-editor.c, plugins/gtk+/gtk+.x
- Date: Mon, 4 Apr 2011 10:41:59 +0000 (UTC)
commit b95c6ad7e2ffe1aa84fa9af94e3beed3ce0c45e6
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Mon Apr 4 07:40:57 2011 -0300
Revert "* plugins/gtk+/glade-gtk.c,
plugins/gtk+/glade-cell-renderer-editor.c,
plugins/gtk+/gtk+.xml.in:
Added support to edit cell renderers in GtkEntryCompletion"
This reverts commit edb4857b9b25e7ed5ce1856cdade49238553a3b4.
Conflicts:
ChangeLog
ChangeLog | 7 ---
plugins/gtk+/glade-cell-renderer-editor.c | 58 +++++++++++++++--------------
plugins/gtk+/glade-gtk.c | 32 +++++++--------
plugins/gtk+/gtk+.xml.in | 19 +--------
4 files changed, 47 insertions(+), 69 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index cafbec1..2f3acb0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,6 @@
2011-04-03 Cosimo Cecchi <cosimoc gnome org>
* doc/Makefile.am: don't use gtk+-2.0 for scanning the docs
-2011-04-01 Juan Pablo Ugarte <juanpablougarte gmail com>
-
- * plugins/gtk+/glade-gtk.c,
- plugins/gtk+/glade-cell-renderer-editor.c,
- plugins/gtk+/gtk+.xml.in:
- Added support to edit cell renderers in GtkEntryCompletion
-
2011-03-31 Juan Pablo Ugarte <juanpablougarte gmail com>
* gladeui/glade-base-editor.c,
diff --git a/plugins/gtk+/glade-cell-renderer-editor.c b/plugins/gtk+/glade-cell-renderer-editor.c
index 71f8de7..8371bca 100644
--- a/plugins/gtk+/glade-cell-renderer-editor.c
+++ b/plugins/gtk+/glade-cell-renderer-editor.c
@@ -429,43 +429,45 @@ GLADE_MAKE_EPROP (GladeEPropCellAttribute, glade_eprop_cell_attribute)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
-static GladeWidget *
-glade_cell_renderer_parent_get_model (GladeWidget *widget)
-{
- GtkTreeModel *real_model = NULL;
-
- glade_widget_property_get (widget, "model", &real_model);
-
- if (real_model)
- return glade_widget_get_from_gobject (real_model);
-
- return NULL;
-}
-
GladeWidget *
glade_cell_renderer_get_model (GladeWidget * renderer)
{
- GladeWidget *gparent;
- GObject *parent;
+ GladeWidget *model = NULL;
+ GladeWidget *parent = glade_widget_get_parent (renderer);
- if ((gparent = glade_widget_get_parent (renderer)) == NULL)
- return NULL;
-
- parent = glade_widget_get_object (gparent);
-
/* Keep inline with all new cell layouts !!! */
- if (GTK_IS_TREE_VIEW_COLUMN (parent))
+ if (parent && GTK_IS_TREE_VIEW_COLUMN (glade_widget_get_object (parent)))
{
- GladeWidget *treeview = glade_widget_get_parent (gparent);
+ GladeWidget *column = parent;
+ GladeWidget *column_parent = glade_widget_get_parent (column);
- if (treeview && GTK_IS_TREE_VIEW (glade_widget_get_object (treeview)))
- return glade_cell_renderer_parent_get_model (treeview);
+ if (column_parent && GTK_IS_TREE_VIEW (glade_widget_get_object (column_parent)))
+ {
+ GladeWidget *view = column_parent;
+ GtkTreeModel *real_model = NULL;
+ glade_widget_property_get (view, "model", &real_model);
+ if (real_model)
+ model = glade_widget_get_from_gobject (real_model);
+ }
+ }
+ else if (parent && GTK_IS_ICON_VIEW (glade_widget_get_object (parent)))
+ {
+ GladeWidget *view = parent;
+ GtkTreeModel *real_model = NULL;
+ glade_widget_property_get (view, "model", &real_model);
+ if (real_model)
+ model = glade_widget_get_from_gobject (real_model);
+ }
+ else if (parent && GTK_IS_COMBO_BOX (glade_widget_get_object (parent)))
+ {
+ GladeWidget *combo = parent;
+ GtkTreeModel *real_model = NULL;
+ glade_widget_property_get (combo, "model", &real_model);
+ if (real_model)
+ model = glade_widget_get_from_gobject (real_model);
}
- else if (GTK_IS_ICON_VIEW (parent) || GTK_IS_COMBO_BOX (parent) ||
- GTK_IS_ENTRY_COMPLETION (parent))
- return glade_cell_renderer_parent_get_model (gparent);
- return NULL;
+ return model;
}
static void
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index ae578bb..7216261 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -10559,7 +10559,7 @@ glade_gtk_cell_layout_move_child (GladeBaseEditor * editor,
}
static void
-glade_gtk_cell_layout_launch_editor (GObject *layout, gchar *window_name)
+glade_gtk_cell_layout_launch_editor (GObject * layout)
{
GladeWidget *widget = glade_widget_get_from_gobject (layout);
GladeWidgetAdaptor *adaptor = glade_widget_get_adaptor (widget);
@@ -10573,14 +10573,14 @@ glade_gtk_cell_layout_launch_editor (GObject *layout, gchar *window_name)
/* Editor */
editor = glade_base_editor_new (layout, layout_editor,
_("Text"), GTK_TYPE_CELL_RENDERER_TEXT,
- _("Accelerator"), GTK_TYPE_CELL_RENDERER_ACCEL,
- _("Combo"), GTK_TYPE_CELL_RENDERER_COMBO,
- _("Spin"), GTK_TYPE_CELL_RENDERER_SPIN,
- _("Pixbuf"), GTK_TYPE_CELL_RENDERER_PIXBUF,
- _("Progress"), GTK_TYPE_CELL_RENDERER_PROGRESS,
- _("Toggle"), GTK_TYPE_CELL_RENDERER_TOGGLE,
- _("Spinner"), GTK_TYPE_CELL_RENDERER_SPINNER,
- NULL);
+ _("Accelerator"),
+ GTK_TYPE_CELL_RENDERER_ACCEL, _("Combo"),
+ GTK_TYPE_CELL_RENDERER_COMBO, _("Spin"),
+ GTK_TYPE_CELL_RENDERER_SPIN, _("Pixbuf"),
+ GTK_TYPE_CELL_RENDERER_PIXBUF, _("Progress"),
+ GTK_TYPE_CELL_RENDERER_PROGRESS, _("Toggle"),
+ GTK_TYPE_CELL_RENDERER_TOGGLE, _("Spinner"),
+ GTK_TYPE_CELL_RENDERER_SPINNER, NULL);
g_signal_connect (editor, "get-display-name",
G_CALLBACK (glade_gtk_cell_layout_get_display_name), NULL);
@@ -10591,7 +10591,10 @@ glade_gtk_cell_layout_launch_editor (GObject *layout, gchar *window_name)
gtk_widget_show (GTK_WIDGET (editor));
- window = glade_base_editor_pack_new_window (editor, window_name, NULL);
+ window = glade_base_editor_pack_new_window (editor,
+ GTK_IS_ICON_VIEW (layout) ?
+ _("Icon View Editor") :
+ _("Combo Editor"), NULL);
gtk_widget_show (window);
}
@@ -10612,17 +10615,12 @@ glade_gtk_cell_layout_launch_editor_action (GObject * object)
}
else if (GTK_IS_ICON_VIEW (obj))
{
- glade_gtk_cell_layout_launch_editor (obj, _("Icon View Editor"));
+ glade_gtk_cell_layout_launch_editor (obj);
break;
}
else if (GTK_IS_COMBO_BOX (obj))
{
- glade_gtk_cell_layout_launch_editor (obj, _("Combo Editor"));
- break;
- }
- else if (GTK_IS_ENTRY_COMPLETION (obj))
- {
- glade_gtk_cell_layout_launch_editor (obj, _("Entry Completion Editor"));
+ glade_gtk_cell_layout_launch_editor (obj);
break;
}
}
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index 8ae2497..6aa444d 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -961,8 +961,6 @@ embedded in another object</_tooltip>
<property id="im-module" disabled="True"/>
- <property id="completion" since="3.2"/>
-
<!-- Virtual edit mode properties -->
<property id="use-entry-buffer" visible="False" save="False" default="False">
<parameter-spec>
@@ -2101,21 +2099,8 @@ embedded in another object</_tooltip>
</actions>
</glade-widget-class>
- <glade-widget-class name="GtkEntryCompletion" generic-name="entrycompletion" _title="Entry Completion" toplevel="True">
- <add-child-verify-function>glade_gtk_cell_layout_add_verify</add-child-verify-function>
- <add-child-function>glade_gtk_cell_layout_add_child</add-child-function>
- <remove-child-function>glade_gtk_cell_layout_remove_child</remove-child-function>
- <get-children-function>glade_gtk_cell_layout_get_children</get-children-function>
- <read-child-function>glade_gtk_cell_layout_read_child</read-child-function>
- <write-child-function>glade_gtk_cell_layout_write_child</write-child-function>
- <action-activate-function>glade_gtk_cell_layout_action_activate</action-activate-function>
- <child-set-property-function>glade_gtk_cell_layout_set_child_property</child-set-property-function>
- <child-get-property-function>glade_gtk_cell_layout_get_child_property</child-get-property-function>
-
- <actions>
- <action id="launch_editor" _name="Edit…" stock="gtk-edit" important="True"/>
- </actions>
- </glade-widget-class>
+ <glade-widget-class name="GtkEntryCompletion" generic-name="entrycompletion" _title="Entry Completion"
+ toplevel="True"/>
<glade-widget-class name="GtkIconFactory" generic-name="iconfactory" _title="Icon Factory"
toplevel="True">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]