… | |
… | |
3 | use Storable (); |
3 | use Storable (); |
4 | use Scalar::Util (); |
4 | use Scalar::Util (); |
5 | |
5 | |
6 | my $staterc = "$ENV{HOME}/.kgsueme"; |
6 | my $staterc = "$ENV{HOME}/.kgsueme"; |
7 | |
7 | |
8 | my $state = -r $staterc ? Storable::retrieve($staterc) : {}; |
8 | our $state = -r $staterc ? Storable::retrieve($staterc) : {}; |
9 | my @widgets; |
|
|
10 | |
9 | |
11 | $::config = $state->{config} ||= {}; |
10 | $::config = $state->{config} ||= {}; |
12 | |
11 | |
13 | $::config->{speed} = 0;#d# optimize for speed or memory? |
12 | $::config->{speed} = 0;#d# optimize for speed or memory? |
14 | $::config->{conserve_memory} = 0; # try to conserve memory at the expense of speed |
13 | $::config->{conserve_memory} = 0; # try to conserve memory at the expense of speed |
15 | $::config->{randomize} = 0; # randomize placement of stones |
14 | $::config->{randomize} = 0; # randomize placement of stones |
16 | |
15 | |
17 | sub save_config { |
16 | sub save_config { |
18 | gtk::save_state; |
17 | >k::save_state; |
19 | Storable::nstore($state, $staterc); |
18 | Storable::nstore($state, $staterc); |
|
|
19 | appwin::status("save_state", "layout saved"); |
20 | } |
20 | } |
21 | |
21 | |
22 | 1; |
22 | 1; |
23 | |
23 | |