From d9f6a5ddb1cdc02a460e0398d591fadaebaaf22b Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 15 Feb 2012 15:20:25 +0100 Subject: Print only supported fileformat in the GUI The "supported formats" dialog now only show format that are really localy supported. --- mat-gui | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/mat-gui b/mat-gui index 1249cd6..a0c560d 100755 --- a/mat-gui +++ b/mat-gui @@ -361,21 +361,24 @@ class GUI: i.set_expanded(False) for item in handler.list: # list of dict : one dict per format - #create one expander per format - title = '%s (%s)' % (item['name'], item['extension']) - support = ('\t%s : %s' % ('support', item['support'])) - metadata = '\n\tmetadata : ' + item['metadata'] - method = '\n\tmethod : ' + item['method'] - content = support + metadata + method - if item['support'] == 'partial': - content += '\n\tremaining : ' + item['remaining'] - - expander = gtk.Expander(title) - vbox.pack_start(expander, False, False, 0) - label = gtk.Label() - label.set_markup(content) - expander.add(label) - expander.connect('activate', expander_callback) + # create one expander per format + # only if the format is supported + if strippers.STRIPPERS.has_key(item['mimetype'].split(',')[0]): + # some format have more than one mimetype + title = '%s (%s)' % (item['name'], item['extension']) + support = ('\t%s : %s' % ('support', item['support'])) + metadata = '\n\tmetadata : ' + item['metadata'] + method = '\n\tmethod : ' + item['method'] + content = support + metadata + method + if item['support'] == 'partial': + content += '\n\tremaining : ' + item['remaining'] + + expander = gtk.Expander(title) + vbox.pack_start(expander, False, False, 0) + label = gtk.Label() + label.set_markup(content) + expander.add(label) + expander.connect('activate', expander_callback) dialog.show_all() click = dialog.run() -- cgit v1.3