Add a check for a condition that was broken by gtk+ commit
49fa04212b644f19ce576a8011e3f4fcda6a0806 and garbage up the glade files
to work around it.
---
pyanaconda/ui/gui/spokes/advstorage/iscsi.glade | 1 +
pyanaconda/ui/gui/spokes/datetime_spoke.glade | 1 +
pyanaconda/ui/gui/spokes/filter.glade | 4 ++
pyanaconda/ui/gui/spokes/keyboard.glade | 2 +
pyanaconda/ui/gui/spokes/langsupport.glade | 2 +
pyanaconda/ui/gui/spokes/lib/cart.glade | 1 +
pyanaconda/ui/gui/spokes/lib/resize.glade | 1 +
pyanaconda/ui/gui/spokes/source.glade | 2 +
pyanaconda/ui/gui/spokes/welcome.glade | 2 +
tests/glade/bz1102793/check_bz1102793.py | 64 +++++++++++++++++++++++++
10 files changed, 80 insertions(+)
create mode 100755 tests/glade/bz1102793/check_bz1102793.py
diff --git a/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
b/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
index 1c9b9ea..9b5c6f0 100644
--- a/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
+++ b/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
@@ -728,6 +728,7 @@
<object class="GtkTreeViewColumn"
id="nodeSelectedColumn">
<child>
<object class="GtkCellRendererToggle"
id="nodeSelectedRenderer">
+ <property
name="activatable">True</property>
<signal name="toggled"
handler="on_row_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.glade
b/pyanaconda/ui/gui/spokes/datetime_spoke.glade
index d58e2e7..c9bc520 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.glade
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.glade
@@ -204,6 +204,7 @@
<property name="title"
translatable="yes">Use</property>
<child>
<object class="GtkCellRendererToggle"
id="removeRenderer">
+ <property
name="activatable">True</property>
<signal name="toggled"
handler="on_use_server_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/filter.glade
b/pyanaconda/ui/gui/spokes/filter.glade
index 36bc432..f8163c0 100644
--- a/pyanaconda/ui/gui/spokes/filter.glade
+++ b/pyanaconda/ui/gui/spokes/filter.glade
@@ -345,6 +345,7 @@
<object class="GtkTreeViewColumn"
id="searchSelectedCol">
<child>
<object
class="GtkCellRendererToggle" id="searchSelectedRenderer">
+ <property
name="activatable">True</property>
<signal name="toggled"
handler="on_row_toggled" swapped="no"/>
</object>
<attributes>
@@ -726,6 +727,7 @@
<object class="GtkTreeViewColumn"
id="multipathSelectedCol">
<child>
<object
class="GtkCellRendererToggle" id="multipathSelectedRenderer">
+ <property
name="activatable">True</property>
<signal name="toggled"
handler="on_row_toggled" swapped="no"/>
</object>
<attributes>
@@ -1072,6 +1074,7 @@
<object class="GtkTreeViewColumn"
id="otherSelectedCol">
<child>
<object
class="GtkCellRendererToggle" id="otherSelectedRenderer">
+ <property
name="activatable">True</property>
<signal name="toggled"
handler="on_row_toggled" swapped="no"/>
</object>
<attributes>
@@ -1308,6 +1311,7 @@
<object class="GtkTreeViewColumn"
id="zSelectedCol">
<child>
<object
class="GtkCellRendererToggle" id="zSelectedRenderer">
+ <property
name="activatable">True</property>
<signal name="toggled"
handler="on_row_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/keyboard.glade
b/pyanaconda/ui/gui/spokes/keyboard.glade
index 69c8bfc..edaa247 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.glade
+++ b/pyanaconda/ui/gui/spokes/keyboard.glade
@@ -145,6 +145,7 @@
<property
name="search_column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection"
id="layoutSelection">
+ <property
name="mode">single</property>
<signal name="changed"
handler="on_selection_changed" swapped="no"/>
</object>
</child>
@@ -707,6 +708,7 @@
<property name="title"
translatable="yes">use</property>
<child>
<object class="GtkCellRendererToggle"
id="useRenderer">
+ <property
name="activatable">True</property>
<signal name="toggled"
handler="on_use_option_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/langsupport.glade
b/pyanaconda/ui/gui/spokes/langsupport.glade
index 5cf9cad..b595e44 100644
--- a/pyanaconda/ui/gui/spokes/langsupport.glade
+++ b/pyanaconda/ui/gui/spokes/langsupport.glade
@@ -117,6 +117,7 @@
<property
name="search_column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection"
id="languageViewSelection">
+ <property
name="mode">single</property>
<signal name="changed"
handler="on_lang_selection_changed" swapped="no"/>
</object>
</child>
@@ -215,6 +216,7 @@
<property name="title"
translatable="yes">checked</property>
<child>
<object class="GtkCellRendererToggle"
id="checkedRenderer">
+ <property
name="activatable">True</property>
<signal name="toggled"
handler="on_locale_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/lib/cart.glade
b/pyanaconda/ui/gui/spokes/lib/cart.glade
index 9e9af05..cd3ff24 100644
--- a/pyanaconda/ui/gui/spokes/lib/cart.glade
+++ b/pyanaconda/ui/gui/spokes/lib/cart.glade
@@ -98,6 +98,7 @@
<property name="model">disk_store</property>
<child internal-child="selection">
<object class="GtkTreeSelection"
id="disk_selection">
+ <property name="mode">single</property>
<signal name="changed"
handler="on_selection_changed" swapped="no"/>
</object>
</child>
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.glade
b/pyanaconda/ui/gui/spokes/lib/resize.glade
index 147f22e..3413f5e 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.glade
+++ b/pyanaconda/ui/gui/spokes/lib/resize.glade
@@ -144,6 +144,7 @@
<signal name="row-activated"
handler="on_row_clicked" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection"
id="diskView-selection">
+ <property name="mode">single</property>
<signal name="changed"
handler="on_selection_changed" swapped="no"/>
</object>
</child>
diff --git a/pyanaconda/ui/gui/spokes/source.glade
b/pyanaconda/ui/gui/spokes/source.glade
index 38e4d16..2f672b2 100644
--- a/pyanaconda/ui/gui/spokes/source.glade
+++ b/pyanaconda/ui/gui/spokes/source.glade
@@ -960,6 +960,7 @@
<property
name="enable_search">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection"
id="repoSelection">
+ <property
name="mode">single</property>
<signal name="changed"
handler="on_repoSelection_changed" swapped="no"/>
</object>
</child>
@@ -968,6 +969,7 @@
<property name="title"
translatable="yes">Enabled</property>
<child>
<object class="GtkCellRendererToggle"
id="repoEnableRenderer">
+ <property
name="activatable">True</property>
<signal name="toggled"
handler="on_repoEnable_toggled" swapped="no"/>
</object>
<attributes>
diff --git a/pyanaconda/ui/gui/spokes/welcome.glade
b/pyanaconda/ui/gui/spokes/welcome.glade
index ac73bb8..63b59a5 100644
--- a/pyanaconda/ui/gui/spokes/welcome.glade
+++ b/pyanaconda/ui/gui/spokes/welcome.glade
@@ -256,6 +256,7 @@
<property
name="search_column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection"
id="languageViewSelection">
+ <property
name="mode">single</property>
<signal name="changed"
handler="on_lang_selection_changed" swapped="no"/>
</object>
</child>
@@ -354,6 +355,7 @@
<property
name="search_column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection"
id="localeViewSelection">
+ <property
name="mode">single</property>
<signal name="changed"
handler="on_locale_selection_changed" swapped="no"/>
</object>
</child>
diff --git a/tests/glade/bz1102793/check_bz1102793.py
b/tests/glade/bz1102793/check_bz1102793.py
new file mode 100755
index 0000000..54526c6
--- /dev/null
+++ b/tests/glade/bz1102793/check_bz1102793.py
@@ -0,0 +1,64 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2014 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published
+# by the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <
http://www.gnu.org/licenses/>.
+#
+# Author: David Shea <dshea(a)redhat.com>
+
+# Check for objects that contain only a signal element, because GtkBuilder
+# screws these up. This check and its associated changes can be reverted as
+# soon as gtk gets its shit together.
+
+import sys
+import argparse
+
+try:
+ from lxml import etree
+except ImportError:
+ print("You need to install the python-lxml package to run the glade
checks")
+ sys.exit(99)
+
+success = True
+
+def main(argv):
+ global success
+
+ for glade_file in argv:
+ # Look for object elements that contain a single signal child and no other
children
+ glade_tree = etree.parse(glade_file)
+
+ for problem in glade_tree.xpath("//object[count(child::*) = 1 and
local-name(./*) = 'signal']"):
+ print("Problematic signal found at %s:%d" % (glade_file,
problem.sourceline))
+ success = False
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser("Check for glade files affected by bug
1102793")
+
+ # Ignore translation arguments
+ parser.add_argument("-t", "--translate",
action='store_true',
+ help=argparse.SUPPRESS)
+ parser.add_argument("-p", "--podir", action='store',
type=str,
+ metavar='PODIR', help=argparse.SUPPRESS, default='./po')
+
+ parser.add_argument("glade_files", nargs="+",
metavar="GLADE-FILE",
+ help='The glade file to check')
+ args = parser.parse_args(args=sys.argv[1:])
+
+ main(args.glade_files)
+
+ if success:
+ sys.exit(0)
+ else:
+ sys.exit(1)
--
1.9.0