diff --git a/src/Entity/Browser/Menu/File/Open.php b/src/Entity/Browser/Menu/File/Open.php index affdc5af..522e94d5 100644 --- a/src/Entity/Browser/Menu/File/Open.php +++ b/src/Entity/Browser/Menu/File/Open.php @@ -33,7 +33,32 @@ class Open 'activate', function() { - // @TODO + $dialog = new \GtkFileChooserDialog( + 'Open file', + $this->file->menu->browser->gtk, + \GtkFileChooserAction::OPEN, + [ + 'Cancel', + \GtkResponseType::CANCEL, + 'Open', + \GtkResponseType::OK + ] + ); + + /* @TODO keep last path + $dialog->set_current_folder();*/ + + if (\GtkResponseType::OK == $dialog->run()) + { + $this->file->menu->browser->container->tab->append( + sprintf( + 'file://%s', + $dialog->get_filename() + ) + ); + } + + $dialog->destroy(); } ); }