mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
implement open file action
This commit is contained in:
parent
783d8d067c
commit
3b113ff9cb
1 changed files with 26 additions and 1 deletions
|
|
@ -33,7 +33,32 @@ class Open
|
||||||
'activate',
|
'activate',
|
||||||
function()
|
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();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue