ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/gde/GCE/AttrEdit.pm
(Generate patch)

Comparing deliantra/gde/GCE/AttrEdit.pm (file contents):
Revision 1.25 by elmex, Sun Apr 2 09:54:18 2006 UTC vs.
Revision 1.26 by elmex, Sun Apr 2 10:58:52 2006 UTC

117} 117}
118 118
119sub set_arch { 119sub set_arch {
120 my ($self, $arch, $change_cb) = @_; 120 my ($self, $arch, $change_cb) = @_;
121 121
122 # get current page (to remember it for later)
123 my $pgnum = $self->{ntbook}->get_current_page;
124 my $curwid = $self->{ntbook}->get_nth_page ($pgnum);
125 my $curpage_text = defined $curwid ? $self->{ntbook}->get_tab_label_text ($curwid) : undef;
126
122 $self->{change_cb} = $change_cb; 127 $self->{change_cb} = $change_cb;
123 128
124 $self->{arch} = $arch; 129 $self->{arch} = $arch;
125 130
126 my $ar = Crossfire::arch_attr $arch; 131 my $ar = Crossfire::arch_attr $arch;
171 $tb->set_wrap_mode ('word'); 176 $tb->set_wrap_mode ('word');
172 177
173 $self->{ttip}->enable; 178 $self->{ttip}->enable;
174 179
175 $self->show_all; 180 $self->show_all;
181
182 # reset the current page if found
183 # XXX: it's braindamaged: it has to be done AFTER show all for some reason
184 if (defined $curpage_text) {
185
186 for (my $i = 0; $i <= $self->{ntbook}->get_n_pages; $i++) {
187 my $w = $self->{ntbook}->get_nth_page ($i);
188
189 if ($w && $self->{ntbook}->get_tab_label_text ($w) eq $curpage_text) {
190 $self->{ntbook}->set_current_page ($i);
191 last;
192 }
193 }
194 }
176} 195}
177 196
178sub add_section_edit_widgets { 197sub add_section_edit_widgets {
179 my ($self, $ntbook, $name, $arch, $section) = @_; 198 my ($self, $ntbook, $name, $arch, $section) = @_;
180 199

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines