var-type-dialog: Reduce redundancy.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 28 Jul 2012 21:18:40 +0000 (14:18 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 31 Jul 2012 05:57:33 +0000 (22:57 -0700)
commit471c983e61d5924356b1428ee87d467536caf395
tree3392429e9dec7571667e970d73d6833e0a68db2f
parent0b2c91ffedd167c861b7ed250e5597aa0f4b0220
var-type-dialog: Reduce redundancy.

var_type_dialog_set_state() and on_toggle_2() had considerable
redundant code.  This reduces it by adding a new function
on_active_button_change() that generalizes the two functions.  I
also personally found the previous way of showing and hiding widgets
to be hard to follow; I think that the bitmap approach used here
is more straightforward.

This also consolidates the two separate signal handlers for each
button into one, and replaces the similar functions
select_treeview_from_format() and select_treeview_from_format_type()
by three functions find_format(), find_format_type(), and
select_treeview_at_index() that total less code.
src/ui/gui/var-type-dialog.c