diff options
| author | jvoisin | 2012-02-15 13:46:25 +0100 |
|---|---|---|
| committer | jvoisin | 2012-02-15 13:46:25 +0100 |
| commit | 2aa1c06b0d280b42293af25f8aaa808649cdd71b (patch) | |
| tree | 68ccaeb25b772fe56597e6fa65021705e488d4c9 /mat-gui | |
| parent | 7e27a03b4c5487c0fecaf6f5c39e58d1ae22ccaa (diff) | |
Usability improvement for "supported formats" popup
Diffstat (limited to 'mat-gui')
| -rwxr-xr-x | mat-gui | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -354,6 +354,12 @@ class GUI: | |||
| 354 | with open(path, 'r') as xmlfile: | 354 | with open(path, 'r') as xmlfile: |
| 355 | parser.parse(xmlfile) | 355 | parser.parse(xmlfile) |
| 356 | 356 | ||
| 357 | def expander_callback(current): | ||
| 358 | ''' Close every expander except the current one ''' | ||
| 359 | for i in vbox.get_children()[1:]: # first child is a gtk.Label | ||
| 360 | if i != current: | ||
| 361 | i.set_expanded(False) | ||
| 362 | |||
| 357 | 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 |
| 358 | #create one expander per format | 364 | #create one expander per format |
| 359 | title = '%s (%s)' % (item['name'], item['extension']) | 365 | title = '%s (%s)' % (item['name'], item['extension']) |
| @@ -369,6 +375,7 @@ class GUI: | |||
| 369 | label = gtk.Label() | 375 | label = gtk.Label() |
| 370 | label.set_markup(content) | 376 | label.set_markup(content) |
| 371 | expander.add(label) | 377 | expander.add(label) |
| 378 | expander.connect('activate', expander_callback) | ||
| 372 | 379 | ||
| 373 | dialog.show_all() | 380 | dialog.show_all() |
| 374 | click = dialog.run() | 381 | click = dialog.run() |
