| 1 | package Gapp::FileChooserDialog; | ||
| 2 | { | ||
| 3 | $Gapp::FileChooserDialog::VERSION = '0.60'; | ||
| 4 | } | ||
| 5 | |||
| 6 | use Moose; | ||
| 7 | use MooseX::SemiAffordanceAccessor; | ||
| 8 | use MooseX::Types::Moose qw( ArrayRef ); | ||
| 9 | |||
| 10 | extends 'Gapp::Dialog'; | ||
| 11 | with 'Gapp::Meta::Widget::Native::Role::FileChooser'; | ||
| 12 | |||
| 13 | has '+gclass' => ( | ||
| 14 | default => 'Gtk2::FileChooserDialog', | ||
| 15 | ); | ||
| 16 | |||
| 17 | has '+gobject' => ( | ||
| 18 | handles => ['run'], | ||
| 19 | ); | ||
| 20 | |||
| 21 | has '+parent' => ( | ||
| 22 | is => 'rw', | ||
| 23 | isa => 'Maybe[Object]', | ||
| 24 | default => undef, | ||
| 25 | ); | ||
| 26 | |||
| 27 | |||
| 28 | before '_build_gobject' => sub { | ||
| 29 | my $self = shift; | ||
| 30 | $self->set_args( [ ( $self->properties->{title} ? $self->properties->{title} : '' ) , | ||
| 31 | ( $self->parent ? $self->parent->gobject : undef ), | ||
| 32 | $self->action ] ); | ||
| 33 | }; | ||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | 1; | ||
| 38 | |||
| 39 | __END__ |