|
|
|
@@ -1,8 +1,6 @@
|
|
|
|
|
Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
===================================================================
|
|
|
|
|
--- libglade-2.6.4.orig/libglade-convert.in
|
|
|
|
|
+++ libglade-2.6.4/libglade-convert.in
|
|
|
|
|
@@ -45,7 +45,7 @@ class WidgetDef:
|
|
|
|
|
--- libglade-convert.in (original)
|
|
|
|
|
+++ libglade-convert.in (refactored)
|
|
|
|
|
@@ -45,7 +45,7 @@
|
|
|
|
|
if name == 'class':
|
|
|
|
|
self.wclass = value
|
|
|
|
|
return
|
|
|
|
@@ -11,7 +9,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
self.property_names.remove(name)
|
|
|
|
|
del self.properties[name]
|
|
|
|
|
if value == 'True': value = 'yes'
|
|
|
|
|
@@ -53,19 +53,19 @@ class WidgetDef:
|
|
|
|
|
@@ -53,19 +53,19 @@
|
|
|
|
|
self.property_names.append(name)
|
|
|
|
|
self.properties[name] = value
|
|
|
|
|
def __delitem__(self, name):
|
|
|
|
@@ -35,7 +33,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
self.property_names.remove(name)
|
|
|
|
|
del self.properties[name]
|
|
|
|
|
|
|
|
|
|
@@ -85,7 +85,7 @@ class WidgetDef:
|
|
|
|
|
@@ -85,7 +85,7 @@
|
|
|
|
|
def __getitem__(self, name):
|
|
|
|
|
return self.properties[name]
|
|
|
|
|
def __setitem__(self, name, value):
|
|
|
|
@@ -44,7 +42,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
self.property_names.remove(name)
|
|
|
|
|
del self.properties[name]
|
|
|
|
|
if value == 'True': value = 'yes'
|
|
|
|
|
@@ -93,19 +93,19 @@ class WidgetDef:
|
|
|
|
|
@@ -93,19 +93,19 @@
|
|
|
|
|
self.property_names.append(name)
|
|
|
|
|
self.properties[name] = value
|
|
|
|
|
def __delitem__(self, name):
|
|
|
|
@@ -68,7 +66,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
self.property_names.remove(name)
|
|
|
|
|
del self.properties[name]
|
|
|
|
|
|
|
|
|
|
@@ -114,27 +114,27 @@ class WidgetDef:
|
|
|
|
|
@@ -114,27 +114,27 @@
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
if self.internal_child:
|
|
|
|
@@ -105,7 +103,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
|
|
|
|
|
def add_child(self, widget, internal_child=None):
|
|
|
|
|
child = self.ChildDef(widget, internal_child)
|
|
|
|
|
@@ -142,7 +142,7 @@ class WidgetDef:
|
|
|
|
|
@@ -142,7 +142,7 @@
|
|
|
|
|
return child
|
|
|
|
|
|
|
|
|
|
def dump(self, indent):
|
|
|
|
@@ -114,7 +112,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
want_newline = 0
|
|
|
|
|
for name in self.property_names:
|
|
|
|
|
attrs = ''
|
|
|
|
|
@@ -154,41 +154,41 @@ class WidgetDef:
|
|
|
|
|
@@ -154,41 +154,41 @@
|
|
|
|
|
attrs += ' translatable="yes"'
|
|
|
|
|
if name[:3] == 'cxx':
|
|
|
|
|
attrs += ' agent="glademm"'
|
|
|
|
@@ -171,7 +169,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
|
|
|
|
|
def handle_signal(widget, signalnode):
|
|
|
|
|
name = None
|
|
|
|
|
@@ -414,7 +414,7 @@ parent_table = {
|
|
|
|
|
@@ -414,7 +414,7 @@
|
|
|
|
|
global_group_map = { }
|
|
|
|
|
|
|
|
|
|
def find_parent(type):
|
|
|
|
@@ -180,7 +178,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
return parent_table[type]
|
|
|
|
|
return ''
|
|
|
|
|
|
|
|
|
|
@@ -585,7 +585,7 @@ stock_menu_items = {
|
|
|
|
|
@@ -585,7 +585,7 @@
|
|
|
|
|
'GNOMEUIINFO_MENU_GAME_TREE': (0, '_Game'),
|
|
|
|
|
}
|
|
|
|
|
def stock_menu_translate(old_name):
|
|
|
|
@@ -189,7 +187,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
return stock_menu_items[old_name]
|
|
|
|
|
else:
|
|
|
|
|
return (0, old_name)
|
|
|
|
|
@@ -598,7 +598,7 @@ def translate_color (color):
|
|
|
|
|
@@ -598,7 +598,7 @@
|
|
|
|
|
def fixup_as_type(widget, type):
|
|
|
|
|
|
|
|
|
|
if verbose:
|
|
|
|
@@ -198,7 +196,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
|
|
|
|
|
# table based property removals/renames
|
|
|
|
|
for name in global_obsolete_props:
|
|
|
|
|
@@ -606,11 +606,11 @@ def fixup_as_type(widget, type):
|
|
|
|
|
@@ -606,11 +606,11 @@
|
|
|
|
|
for old, new in global_renamed_props:
|
|
|
|
|
widget.rename_prop(old, new)
|
|
|
|
|
|
|
|
|
@@ -212,7 +210,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
for old, new in renamed_props[type]:
|
|
|
|
|
widget.rename_prop(old, new)
|
|
|
|
|
|
|
|
|
|
@@ -618,12 +618,12 @@ def fixup_as_type(widget, type):
|
|
|
|
|
@@ -618,12 +618,12 @@
|
|
|
|
|
for childdef in widget.children:
|
|
|
|
|
childdef.rename_prop(old, new)
|
|
|
|
|
|
|
|
|
@@ -227,7 +225,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
for old, new in renamed_child_props[type]:
|
|
|
|
|
for childdef in widget.children:
|
|
|
|
|
childdef.rename_prop(old, new)
|
|
|
|
|
@@ -689,8 +689,8 @@ def fixup_as_type(widget, type):
|
|
|
|
|
@@ -689,8 +689,8 @@
|
|
|
|
|
del childdef.widget['child_name']
|
|
|
|
|
childdef['type'] = 'tab'
|
|
|
|
|
else:
|
|
|
|
@@ -238,7 +236,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
|
|
|
|
|
if type == 'GtkFileSelection':
|
|
|
|
|
for childdef in widget.children:
|
|
|
|
|
@@ -775,8 +775,7 @@ def fixup_as_type(widget, type):
|
|
|
|
|
@@ -775,8 +775,7 @@
|
|
|
|
|
del childdef.widget['child_name']
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
@@ -248,7 +246,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
except IndexError:
|
|
|
|
|
return 0
|
|
|
|
|
childdef.widget['class'] = 'GtkHButtonBox'
|
|
|
|
|
@@ -791,8 +790,7 @@ def fixup_as_type(widget, type):
|
|
|
|
|
@@ -791,8 +790,7 @@
|
|
|
|
|
del childdef.widget['child_name']
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
@@ -258,7 +256,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
except IndexError:
|
|
|
|
|
return 0
|
|
|
|
|
childdef.widget['class'] = 'GtkHButtonBox'
|
|
|
|
|
@@ -881,7 +879,7 @@ def fixup_as_type(widget, type):
|
|
|
|
|
@@ -881,7 +879,7 @@
|
|
|
|
|
# have the glade id of the root group widget.
|
|
|
|
|
if type == 'GtkRadioButton' or type == 'GtkRadioMenuItem':
|
|
|
|
|
if widget.has_prop ('group'):
|
|
|
|
@@ -267,7 +265,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
widget['group'] = global_group_map[widget['group']]
|
|
|
|
|
else:
|
|
|
|
|
global_group_map[widget['group']] = widget['name']
|
|
|
|
|
@@ -898,7 +896,7 @@ def fixup_as_type(widget, type):
|
|
|
|
|
@@ -898,7 +896,7 @@
|
|
|
|
|
elif childdef.widget['class'] == 'GtkRadioButton':
|
|
|
|
|
childdef.widget['class'] = 'radio'
|
|
|
|
|
if childdef.widget.has_prop('group'):
|
|
|
|
@@ -276,7 +274,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
childdef.widget['group'] = global_group_map[childdef.widget['group']]
|
|
|
|
|
else:
|
|
|
|
|
global_group_map[childdef.widget['group']] = childdef.widget['name']
|
|
|
|
|
@@ -1135,8 +1133,8 @@ bad_widgets = {
|
|
|
|
|
@@ -1135,8 +1133,8 @@
|
|
|
|
|
def check_widget(widget, requirelist=[]):
|
|
|
|
|
try:
|
|
|
|
|
error = bad_widgets[widget['class']]
|
|
|
|
@@ -287,7 +285,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
if error == 'removed':
|
|
|
|
|
widget.mark_obsolete ()
|
|
|
|
|
except KeyError:
|
|
|
|
|
@@ -1171,21 +1169,21 @@ def handle_file(filename):
|
|
|
|
|
@@ -1171,21 +1169,21 @@
|
|
|
|
|
fixup_widget(widgetdef)
|
|
|
|
|
check_widget(widgetdef, requireslist)
|
|
|
|
|
|
|
|
|
@@ -316,7 +314,7 @@ Index: libglade-2.6.4/libglade-convert.in
|
|
|
|
|
document.unlink() # only needed for python interpreters without cyclic gc
|
|
|
|
|
|
|
|
|
|
usage = 'usage: libglade-convert [--no-upgrade] [--verbose] oldfile.glade'
|
|
|
|
|
@@ -1201,10 +1199,10 @@ def main():
|
|
|
|
|
@@ -1201,10 +1199,10 @@
|
|
|
|
|
elif opt == '--verbose':
|
|
|
|
|
verbose = 1
|
|
|
|
|
elif opt == '--help':
|
|
|
|
|