Removing bug close on file dialog close.

This commit is contained in:
Sergiotarxz 2024-03-03 12:21:10 +01:00
parent 24d4a6de62
commit 4ce778e10f

View File

@ -97,13 +97,20 @@ sub activate_open {
my $saves = shift;
my $extra = shift;
my $save_as = shift;
my $cancellable = Glib::IO::Cancellable->new;
$cancellable->signal_connect(cancelled => sub {
say 'cancelled';
});
my $dialog = Gtk4::FileDialog->new;
my $curdir = Glib::IO::File::new_for_path('.');
$dialog->set_initial_folder($curdir);
$dialog->open(
$win, undef,
$win, $cancellable,
sub {
my ( $self, $res ) = @_;
if ($res->had_error) {
return;
}
my $file = $dialog->open_finish($res);
return if !defined $file;
$file = path( $file->get_path );
@ -123,6 +130,9 @@ sub activate_save {
$win, undef,
sub {
my ( $self, $res ) = @_;
if ($res->had_error) {
return;
}
my $file = $dialog->open_finish($res);
return if !defined $file;
$file = path( $file->get_path );