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

Comparing deliantra/gde/GCE/MainWindow.pm (file contents):
Revision 1.60 by elmex, Tue Apr 4 13:10:25 2006 UTC vs.
Revision 1.61 by elmex, Tue Apr 4 21:12:08 2006 UTC

203 203
204 $w->show_all; 204 $w->show_all;
205} 205}
206 206
207sub update_attr_editor { 207sub update_attr_editor {
208 my ($self, $arch, $cb) = @_; 208 my ($self, $ar) = @_;
209
210 if (ref ($ar) ne 'GCE::ArchRef') { require Carp; Carp::confess ("$ar no ARCHREF!") }
209 211
210 $self->{attr_edit} 212 $self->{attr_edit}
211 or die "SERIOUS BUG: Couldn't find attribut editor!"; 213 or die "SERIOUS BUG: Couldn't find attribut editor!";
212 214
213 $self->{attr_edit}->set_arch ($arch, $cb); 215 $self->{attr_edit}->set_arch ($ar, 1);
214 $self->{attr_edit_win}->set_title ("gce - edit $arch->{_name}"); 216 $self->{attr_edit_win}->set_title ("gce - edit " . $ar->longname);
215} 217}
216 218
217sub update_stack_view { 219sub update_stack_view {
218 my ($self, $mapedit, $x, $y) = @_; 220 my ($self, $mapedit, $x, $y) = @_;
219 221
425 $self->{edit_tool} = Gtk2::Label->new; 427 $self->{edit_tool} = Gtk2::Label->new;
426 $self->{edit_tool_cont} = Gtk2::VBox->new; 428 $self->{edit_tool_cont} = Gtk2::VBox->new;
427 429
428 $self->add (my $vb = Gtk2::VBox->new); 430 $self->add (my $vb = Gtk2::VBox->new);
429 $vb->pack_start ($self->build_menu, 0, 1, 0); 431 $vb->pack_start ($self->build_menu, 0, 1, 0);
430
431# $vb->pack_start (my $hb = $self->{pick_view_hb} = Gtk2::HBox->new, 0, 1, 0);
432# $hb->pack_start ($self->{pick_view_img} = Gtk2::Image->new, 0, 1, 0);
433# $hb->pack_start ($self->{pick_view_btn} = Gtk2::Button->new, 0, 1, 0);
434# GCE::DragHelper::set_drag_source (
435# $self->{pick_view_btn}, arch => sub { { arch => $self->get_pick } }
436# );
437# GCE::DragHelper::set_drag_sink (
438# $self->{pick_view_btn}, arch => sub { $self->set_pick ($_[0]->{arch}) }
439# );
440# $self->{pick_view_btn}->signal_connect (clicked => sub {
441# $self->update_attr_editor ($self->{pick_arch});
442# });
443# $self->{pick_view_pb} = new_arch_pb ();
444
445# $vb->pack_start (Gtk2::HSeparator->new, 0, 1, 0);
446 $vb->pack_start (my $tbl = $self->build_buttons, 0, 1, 0); 432 $vb->pack_start (my $tbl = $self->build_buttons, 0, 1, 0);
447 433
448 $vb->pack_start (Gtk2::HSeparator->new, 0, 1, 0); 434 $vb->pack_start (Gtk2::HSeparator->new, 0, 1, 0);
449 $vb->pack_start ($self->{edit_tool}, 0, 1, 0); 435 $vb->pack_start ($self->{edit_tool}, 0, 1, 0);
450 436
520 } 506 }
521 507
522 $fc->destroy; 508 $fc->destroy;
523} 509}
524 510
525#sub set_pick {
526# my ($self, $arch) = @_;
527#
528# $self->{pick_arch} = $arch;
529# $self->update_pick_view ($arch);
530#}
531
532sub get_pick { 511sub get_pick {
533 my ($self) = @_; 512 my ($self) = @_;
534 513
535 $self->{attr_edit} 514 $self->{attr_edit}
536 or die "Couldn't find attribute editor! SERIOUS BUG!"; 515 or die "Couldn't find attribute editor! SERIOUS BUG!";
537 516
538 # XXX: This is just to make sure that this function always returns something 517 # XXX: This is just to make sure that this function always returns something
518
519 my $ar = $self->{attr_edit}->get_arch;
520 return { _name => 'platinacoin' } unless defined $ar;
539 return $self->{attr_edit}->get_arch || { _name => 'platinacoin' }; 521 return $ar->getarch || { _name => 'platinacoin' };
540} 522}
541 523
542=head1 AUTHOR 524=head1 AUTHOR
543 525
544 Marc Lehmann <schmorp@schmorp.de> 526 Marc Lehmann <schmorp@schmorp.de>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines