From 2aa1c06b0d280b42293af25f8aaa808649cdd71b Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 15 Feb 2012 13:46:25 +0100 Subject: Usability improvement for "supported formats" popup --- mat-gui | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mat-gui b/mat-gui index cac4a7f..1249cd6 100755 --- a/mat-gui +++ b/mat-gui @@ -354,6 +354,12 @@ class GUI: with open(path, 'r') as xmlfile: parser.parse(xmlfile) + def expander_callback(current): + ''' Close every expander except the current one ''' + for i in vbox.get_children()[1:]: # first child is a gtk.Label + if i != current: + 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']) @@ -369,6 +375,7 @@ class GUI: label = gtk.Label() label.set_markup(content) expander.add(label) + expander.connect('activate', expander_callback) dialog.show_all() click = dialog.run() -- cgit v1.3