… | |
… | |
4 | |
4 | |
5 | GCE::MainWindow - the main window class for gce |
5 | GCE::MainWindow - the main window class for gce |
6 | |
6 | |
7 | =cut |
7 | =cut |
8 | |
8 | |
|
|
9 | use Cwd; |
9 | use Gtk2; |
10 | use Gtk2; |
10 | use Gtk2::Gdk::Keysyms; |
11 | use Gtk2::Gdk::Keysyms; |
11 | use Gtk2::SimpleMenu; |
12 | use Gtk2::SimpleMenu; |
12 | |
13 | |
13 | use Crossfire; |
14 | use Crossfire; |
… | |
… | |
40 | $main::CFG->{main_window} = main::get_pos_and_size ($self); |
41 | $main::CFG->{main_window} = main::get_pos_and_size ($self); |
41 | $main::CFG->{map_window} = main::get_pos_and_size ($self->{last_map_window}) if $self->{last_map_window}; |
42 | $main::CFG->{map_window} = main::get_pos_and_size ($self->{last_map_window}) if $self->{last_map_window}; |
42 | $main::CFG->{stack_view} = main::get_pos_and_size ($self->{sv_win}) if $self->{sv_win}; |
43 | $main::CFG->{stack_view} = main::get_pos_and_size ($self->{sv_win}) if $self->{sv_win}; |
43 | $main::CFG->{attr_view} = main::get_pos_and_size ($self->{attr_edit_win}) if $self->{attr_edit_win}; |
44 | $main::CFG->{attr_view} = main::get_pos_and_size ($self->{attr_edit_win}) if $self->{attr_edit_win}; |
44 | |
45 | |
45 | $main::CFG->{last_folder} = $self->{fc_last_folder}; |
|
|
46 | $main::CFG->{last_folders} = $self->{fc_last_folders}; |
46 | $main::CFG->{last_folders} = $self->{fc_last_folders}; |
47 | |
47 | |
48 | $main::CFG->{open_pickers} = []; |
48 | $main::CFG->{open_pickers} = []; |
49 | |
49 | |
50 | for (@{$self->{open_pick_windows}}) { |
50 | for (@{$self->{open_pick_windows}}) { |
… | |
… | |
61 | } |
61 | } |
62 | |
62 | |
63 | sub load_layout { |
63 | sub load_layout { |
64 | my ($self) = @_; |
64 | my ($self) = @_; |
65 | |
65 | |
66 | $self->{fc_last_folder} = $main::CFG->{last_folder}; |
|
|
67 | $self->{fc_last_folders} = $main::CFG->{last_folders}; |
66 | $self->{fc_last_folders} = $main::CFG->{last_folders}; |
68 | |
67 | |
69 | $main::CFG->{attr_edit_on} |
68 | $main::CFG->{attr_edit_on} |
70 | and $self->show_attr_editor; |
69 | and $self->show_attr_editor; |
71 | |
70 | |
… | |
… | |
494 | $title, undef, $save ? 'save' : 'open', 'gtk-cancel' => 'cancel', 'gtk-ok' => 'ok' |
493 | $title, undef, $save ? 'save' : 'open', 'gtk-cancel' => 'cancel', 'gtk-ok' => 'ok' |
495 | ); |
494 | ); |
496 | |
495 | |
497 | $fc->add_shortcut_folder ($::CFG->{MAPDIR}) if -d $::CFG->{MAPDIR}; |
496 | $fc->add_shortcut_folder ($::CFG->{MAPDIR}) if -d $::CFG->{MAPDIR}; |
498 | $fc->add_shortcut_folder ($_) for grep { $_ && ($_ ne '') } keys %{$self->{fc_last_folders}}; |
497 | $fc->add_shortcut_folder ($_) for grep { $_ && ($_ ne '') } keys %{$self->{fc_last_folders}}; |
499 | $fc->set_current_folder ($self->{fc_last_folder} || $::CFG->{MAPDIR}); |
498 | $fc->set_current_folder (getcwd); |
500 | |
499 | |
501 | if ($filename) { |
500 | if ($filename) { |
502 | $fc->set_filename ($filename); |
501 | $fc->set_filename ($filename); |
503 | } |
502 | } |
504 | |
503 | |