|
|
@ -14,6 +14,12 @@ class Open |
|
|
|
// Defaults |
|
|
|
// Defaults |
|
|
|
private string $_label = 'Open'; |
|
|
|
private string $_label = 'Open'; |
|
|
|
private bool $_multiple = true; |
|
|
|
private bool $_multiple = true; |
|
|
|
|
|
|
|
private array $_pattern = |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
// pattern:name |
|
|
|
|
|
|
|
'*' => 'All', |
|
|
|
|
|
|
|
'*.gmi' => null |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
public function __construct( |
|
|
|
public function __construct( |
|
|
|
\Yggverse\Yoda\Entity\Browser\Menu\File $file |
|
|
|
\Yggverse\Yoda\Entity\Browser\Menu\File $file |
|
|
@ -53,6 +59,23 @@ class Open |
|
|
|
$this->_multiple |
|
|
|
$this->_multiple |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($this->_pattern as $pattern => $name) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$filter = new \GtkFileFilter; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$filter->set_name( |
|
|
|
|
|
|
|
$name ? $name : $pattern |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$filter->add_pattern( |
|
|
|
|
|
|
|
$pattern |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$dialog->add_filter( |
|
|
|
|
|
|
|
$filter |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (\GtkResponseType::OK == $dialog->run()) |
|
|
|
if (\GtkResponseType::OK == $dialog->run()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
foreach ($dialog->get_filenames() as $filename) |
|
|
|
foreach ($dialog->get_filenames() as $filename) |
|
|
|