diff options
| author | jvoisin | 2012-02-15 15:20:25 +0100 |
|---|---|---|
| committer | jvoisin | 2012-02-15 15:20:25 +0100 |
| commit | d9f6a5ddb1cdc02a460e0398d591fadaebaaf22b (patch) | |
| tree | aa34e3afc1da4b42f78676a2005b7abdc095296b /mat-gui | |
| parent | 2aa1c06b0d280b42293af25f8aaa808649cdd71b (diff) | |
Print only supported fileformat in the GUI
The "supported formats" dialog now only
show format that are really localy supported.
Diffstat (limited to 'mat-gui')
| -rwxr-xr-x | mat-gui | 31 |
1 files changed, 17 insertions, 14 deletions
| @@ -361,21 +361,24 @@ class GUI: | |||
| 361 | i.set_expanded(False) | 361 | i.set_expanded(False) |
| 362 | 362 | ||
| 363 | for item in handler.list: # list of dict : one dict per format | 363 | for item in handler.list: # list of dict : one dict per format |
| 364 | #create one expander per format | 364 | # create one expander per format |
| 365 | title = '%s (%s)' % (item['name'], item['extension']) | 365 | # only if the format is supported |
| 366 | support = ('\t<b>%s</b> : %s' % ('support', item['support'])) | 366 | if strippers.STRIPPERS.has_key(item['mimetype'].split(',')[0]): |
| 367 | metadata = '\n\t<b>metadata</b> : ' + item['metadata'] | 367 | # some format have more than one mimetype |
| 368 | method = '\n\t<b>method</b> : ' + item['method'] | 368 | title = '%s (%s)' % (item['name'], item['extension']) |
| 369 | content = support + metadata + method | 369 | support = ('\t<b>%s</b> : %s' % ('support', item['support'])) |
| 370 | if item['support'] == 'partial': | 370 | metadata = '\n\t<b>metadata</b> : ' + item['metadata'] |
| 371 | content += '\n\t<b>remaining</b> : ' + item['remaining'] | 371 | method = '\n\t<b>method</b> : ' + item['method'] |
| 372 | content = support + metadata + method | ||
| 373 | if item['support'] == 'partial': | ||
| 374 | content += '\n\t<b>remaining</b> : ' + item['remaining'] | ||
| 372 | 375 | ||
| 373 | expander = gtk.Expander(title) | 376 | expander = gtk.Expander(title) |
| 374 | vbox.pack_start(expander, False, False, 0) | 377 | vbox.pack_start(expander, False, False, 0) |
| 375 | label = gtk.Label() | 378 | label = gtk.Label() |
| 376 | label.set_markup(content) | 379 | label.set_markup(content) |
| 377 | expander.add(label) | 380 | expander.add(label) |
| 378 | expander.connect('activate', expander_callback) | 381 | expander.connect('activate', expander_callback) |
| 379 | 382 | ||
| 380 | dialog.show_all() | 383 | dialog.show_all() |
| 381 | click = dialog.run() | 384 | click = dialog.run() |
