summaryrefslogtreecommitdiff
path: root/mat-gui
diff options
context:
space:
mode:
authorjvoisin2012-02-15 13:46:25 +0100
committerjvoisin2012-02-15 13:46:25 +0100
commit2aa1c06b0d280b42293af25f8aaa808649cdd71b (patch)
tree68ccaeb25b772fe56597e6fa65021705e488d4c9 /mat-gui
parent7e27a03b4c5487c0fecaf6f5c39e58d1ae22ccaa (diff)
Usability improvement for "supported formats" popup
Diffstat (limited to 'mat-gui')
-rwxr-xr-xmat-gui7
1 files changed, 7 insertions, 0 deletions
diff --git a/mat-gui b/mat-gui
index cac4a7f..1249cd6 100755
--- a/mat-gui
+++ b/mat-gui
@@ -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()