[glade/f17] Backport patches for reverting back to old widget sensitivity code
Kalev Lember
kalev at fedoraproject.org
Fri Nov 9 13:35:37 UTC 2012
commit 645b9127e8831263ba71e325abf20d3b94b0b0ac
Author: Kalev Lember <kalevlember at gmail.com>
Date: Fri Nov 9 14:25:49 2012 +0200
Backport patches for reverting back to old widget sensitivity code
Commits eb427c6e and 48a29e2e from upstream glade-3-12 branch.
glade-3.12.2-action-appearance-revert.patch | 227 +++++++++++++++++++++++++++
glade-3.12.2-button-properties.patch | 123 ---------------
glade.spec | 11 +-
3 files changed, 235 insertions(+), 126 deletions(-)
---
diff --git a/glade-3.12.2-action-appearance-revert.patch b/glade-3.12.2-action-appearance-revert.patch
new file mode 100644
index 0000000..578345d
--- /dev/null
+++ b/glade-3.12.2-action-appearance-revert.patch
@@ -0,0 +1,227 @@
+From eb427c6ea4a15a0c4c0e4d5d8eef5406063f59e0 Mon Sep 17 00:00:00 2001
+From: Juan Pablo Ugarte <juanpablougarte at gmail.com>
+Date: Thu, 1 Nov 2012 21:36:41 -0300
+Subject: [PATCH 1/2] Revert "Removed unneeded function
+ glade_gtk_activatable_parse_finished()"
+
+This reverts commit a41a51ca2754580f6a958287e2407b864319ad1e.
+---
+ plugins/gtk+/glade-gtk-activatable.c | 14 ++++++++++++++
+ plugins/gtk+/glade-gtk-activatable.h | 4 ++++
+ plugins/gtk+/glade-gtk-switch.c | 18 ++++++++++++++++++
+ plugins/gtk+/glade-gtk.c | 22 +++++++++++++++++++++-
+ plugins/gtk+/gtk+.xml.in | 1 +
+ 5 files changed, 58 insertions(+), 1 deletion(-)
+
+diff --git a/plugins/gtk+/glade-gtk-activatable.c b/plugins/gtk+/glade-gtk-activatable.c
+index 31d538f..cb903e5 100644
+--- a/plugins/gtk+/glade-gtk-activatable.c
++++ b/plugins/gtk+/glade-gtk-activatable.c
+@@ -27,6 +27,20 @@
+
+ /* ----------------------------- GtkActivatable ------------------------------ */
+ void
++glade_gtk_activatable_parse_finished (GladeProject *project,
++ GladeWidget *widget)
++{
++ GObject *related_action = NULL;
++
++ glade_widget_property_get (widget, "related-action", &related_action);
++ if (related_action == NULL)
++ {
++ glade_widget_property_set_sensitive (widget, "use-action-appearance", FALSE, ACTION_APPEARANCE_MSG);
++ glade_widget_property_set (widget, "use-action-appearance", FALSE);
++ }
++}
++
++void
+ glade_gtk_activatable_evaluate_property_sensitivity (GObject *object,
+ const gchar *id,
+ const GValue *value)
+diff --git a/plugins/gtk+/glade-gtk-activatable.h b/plugins/gtk+/glade-gtk-activatable.h
+index 1af54a2..9333328 100644
+--- a/plugins/gtk+/glade-gtk-activatable.h
++++ b/plugins/gtk+/glade-gtk-activatable.h
+@@ -31,6 +31,10 @@
+ G_BEGIN_DECLS
+
+ void
++glade_gtk_activatable_parse_finished (GladeProject *project,
++ GladeWidget *widget);
++
++void
+ glade_gtk_activatable_evaluate_property_sensitivity (GObject *object,
+ const gchar *id,
+ const GValue *value);
+diff --git a/plugins/gtk+/glade-gtk-switch.c b/plugins/gtk+/glade-gtk-switch.c
+index 03b6c5a..5dba443 100644
+--- a/plugins/gtk+/glade-gtk-switch.c
++++ b/plugins/gtk+/glade-gtk-switch.c
+@@ -42,6 +42,24 @@ glade_gtk_switch_create_editable (GladeWidgetAdaptor *adaptor,
+ }
+
+ void
++glade_gtk_switch_post_create (GladeWidgetAdaptor *adaptor,
++ GObject *widget,
++ GladeCreateReason reason)
++{
++ GladeWidget *gwidget;
++
++ if (reason != GLADE_CREATE_LOAD) return;
++
++ g_return_if_fail (GTK_IS_SWITCH (widget));
++ gwidget = glade_widget_get_from_gobject (widget);
++ g_return_if_fail (GLADE_IS_WIDGET (gwidget));
++
++ g_signal_connect (glade_widget_get_project (gwidget), "parse-finished",
++ G_CALLBACK (glade_gtk_activatable_parse_finished),
++ gwidget);
++}
++
++void
+ glade_gtk_switch_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
+index 478a4b4..49ac4a6 100644
+--- a/plugins/gtk+/glade-gtk.c
++++ b/plugins/gtk+/glade-gtk.c
+@@ -4350,7 +4350,11 @@ glade_gtk_button_post_create (GladeWidgetAdaptor * adaptor,
+ RESPID_INSENSITIVE_MSG);
+ glade_widget_property_set_enabled (gbutton, "response-id", FALSE);
+
+- if (reason == GLADE_CREATE_USER)
++ if (reason == GLADE_CREATE_LOAD)
++ g_signal_connect (glade_widget_get_project (gbutton), "parse-finished",
++ G_CALLBACK (glade_gtk_activatable_parse_finished),
++ gbutton);
++ else if (reason == GLADE_CREATE_USER)
+ glade_gtk_button_update_stock (gbutton);
+ }
+
+@@ -5367,6 +5371,10 @@ void
+ glade_gtk_menu_item_post_create (GladeWidgetAdaptor * adaptor,
+ GObject * object, GladeCreateReason reason)
+ {
++ GladeWidget *gitem;
++
++ gitem = glade_widget_get_from_gobject (object);
++
+ if (GTK_IS_SEPARATOR_MENU_ITEM (object))
+ return;
+
+@@ -5376,6 +5384,11 @@ glade_gtk_menu_item_post_create (GladeWidgetAdaptor * adaptor,
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_container_add (GTK_CONTAINER (object), label);
+ }
++
++ if (reason == GLADE_CREATE_LOAD)
++ g_signal_connect (G_OBJECT (glade_widget_get_project (gitem)), "parse-finished",
++ G_CALLBACK (glade_gtk_activatable_parse_finished),
++ gitem);
+ }
+
+ GList *
+@@ -6480,12 +6493,19 @@ glade_gtk_tool_item_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+ {
++ GladeWidget *gitem = glade_widget_get_from_gobject (object);
++
+ if (GTK_IS_SEPARATOR_TOOL_ITEM (object))
+ return;
+
+ if (reason == GLADE_CREATE_USER &&
+ gtk_bin_get_child (GTK_BIN (object)) == NULL)
+ gtk_container_add (GTK_CONTAINER (object), glade_placeholder_new ());
++
++ if (reason == GLADE_CREATE_LOAD)
++ g_signal_connect (G_OBJECT (glade_widget_get_project (gitem)), "parse-finished",
++ G_CALLBACK (glade_gtk_activatable_parse_finished),
++ gitem);
+ }
+
+ void
+diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
+index 3f405d1..56cf742 100644
+--- a/plugins/gtk+/gtk+.xml.in
++++ b/plugins/gtk+/gtk+.xml.in
+@@ -1112,6 +1112,7 @@ embedded in another object</_tooltip>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkSwitch" generic-name="switch" _title="Switch">
++ <post-create-function>glade_gtk_switch_post_create</post-create-function>
+ <set-property-function>glade_gtk_switch_set_property</set-property-function>
+ <create-editable-function>glade_gtk_switch_create_editable</create-editable-function>
+ <properties>
+--
+1.8.0
+
+From 48a29e2e139a0e5210adf6ba113b079353d6c2ea Mon Sep 17 00:00:00 2001
+From: Juan Pablo Ugarte <juanpablougarte at gmail.com>
+Date: Thu, 1 Nov 2012 21:20:22 -0300
+Subject: [PATCH 2/2] Fixed Bug #685816 "Widget attributes editing broken" by
+ reverting old fix and setting use-action-appearance
+ default back to false so the old sensitivity code can
+ work as ussual.
+
+---
+ plugins/gtk+/glade-gtk-activatable.c | 1 +
+ plugins/gtk+/gtk+.xml.in | 8 ++++----
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/plugins/gtk+/glade-gtk-activatable.c b/plugins/gtk+/glade-gtk-activatable.c
+index cb903e5..222a3e7 100644
+--- a/plugins/gtk+/glade-gtk-activatable.c
++++ b/plugins/gtk+/glade-gtk-activatable.c
+@@ -87,6 +87,7 @@ glade_gtk_activatable_evaluate_property_sensitivity (GObject *object,
+ glade_widget_property_set_sensitive (gwidget, "stock", sensitivity, msg);
+ //glade_widget_property_set_sensitive (gwidget, "use-stock", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "image", sensitivity, msg);
++ glade_widget_property_set_sensitive (gwidget, "image-position", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "custom-child", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "stock-id", sensitivity, msg);
+ glade_widget_property_set_sensitive (gwidget, "label-widget", sensitivity, msg);
+diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
+index 56cf742..ff20911 100644
+--- a/plugins/gtk+/gtk+.xml.in
++++ b/plugins/gtk+/gtk+.xml.in
+@@ -525,7 +525,7 @@ embedded in another object</_tooltip>
+
+ <!-- GtkActivatable -->
+ <property id="related-action" _name="Related Action" custom-layout="True" since="2.16" save="False" needs-sync="True"/>
+- <property id="use-action-appearance" _name="Use Action Appearance" save="False" custom-layout="True" needs-sync="True" since="2.16"/>
++ <property id="use-action-appearance" _name="Use Action Appearance" save="False" custom-layout="True" needs-sync="True" since="2.16" default="False"/>
+
+ <!-- Atk click property -->
+ <property id="atk-click" _name="Click" ignore="True" atk-property="True" save="False"
+@@ -746,7 +746,7 @@ embedded in another object</_tooltip>
+ <properties>
+ <!-- GtkActivatable -->
+ <property id="related-action" _name="Related Action" custom-layout="True" since="2.16" save="False" needs-sync="True"/>
+- <property id="use-action-appearance" _name="Use Action Appearance" custom-layout="True" save="False" needs-sync="True" since="2.16"/>
++ <property id="use-action-appearance" _name="Use Action Appearance" custom-layout="True" save="False" needs-sync="True" since="2.16" default="False"/>
+ </properties>
+
+ </glade-widget-class>
+@@ -1038,7 +1038,7 @@ embedded in another object</_tooltip>
+
+ <!-- GtkActivatable -->
+ <property id="related-action" _name="Related Action" custom-layout="True" since="2.16" save="False" needs-sync="True"/>
+- <property id="use-action-appearance" _name="Use Action Appearance" custom-layout="True" save="False" needs-sync="True" since="2.16"/>
++ <property id="use-action-appearance" _name="Use Action Appearance" custom-layout="True" save="False" needs-sync="True" since="2.16" default="False"/>
+
+ <!-- Atk click property -->
+ <property id="atk-click" _name="Click" ignore="True" atk-property="True" save="False" multiline="True">
+@@ -1123,7 +1123,7 @@ embedded in another object</_tooltip>
+ <value-type>GtkToggleAction</value-type>
+ </parameter-spec>
+ </property>
+- <property id="use-action-appearance" _name="Use Action Appearance" custom-layout="True" save="False" needs-sync="True"/>
++ <property id="use-action-appearance" _name="Use Action Appearance" custom-layout="True" save="False" needs-sync="True" default="False"/>
+ </properties>
+ </glade-widget-class>
+
+--
+1.8.0
+
diff --git a/glade.spec b/glade.spec
index c2380a0..e900123 100644
--- a/glade.spec
+++ b/glade.spec
@@ -1,6 +1,6 @@
Name: glade
Version: 3.12.2
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: User Interface Designer for GTK+ and GNOME
# - /usr/bin/glade is GPLv2+
@@ -14,8 +14,9 @@ Source0: http://ftp.gnome.org/pub/GNOME/sources/glade/3.12/glade-%{versio
# compared to 3.12.1 release.
# https://bugzilla.gnome.org/show_bug.cgi?id=684455
Patch0: glade-3.12.2-soname.patch
+# Backported patch from upstream glade-3-12 branch
# https://bugzilla.redhat.com/show_bug.cgi?id=863361
-Patch1: glade-3.12.2-button-properties.patch
+Patch1: glade-3.12.2-action-appearance-revert.patch
BuildRequires: chrpath
BuildRequires: desktop-file-utils
@@ -69,7 +70,7 @@ developing applications that use Glade widget library.
%prep
%setup -q
%patch0 -p1 -b .soname
-%patch1 -p1 -b .button_propeties
+%patch1 -p1 -b .action_appearance_revert
%build
@@ -142,6 +143,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%doc %{_datadir}/gtk-doc/
%changelog
+* Fri Nov 09 2012 Kalev Lember <kalevlember at gmail.com> - 3.12.2-4
+- Backport more upstream patches for reverting back to old widget
+ sensitivity code (#863361)
+
* Mon Oct 15 2012 Kalev Lember <kalevlember at gmail.com> - 3.12.2-3
- Backport a patch for GtkButton properties sensitivity (#863361)
More information about the scm-commits
mailing list