mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
39 lines
899 B
PHP
39 lines
899 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Yggverse\Yoda\Entity\Browser\Bookmark\Container\Navbar;
|
|
|
|
use \GtkButton;
|
|
|
|
use \Yggverse\Yoda\Abstract\Entity\Browser\Bookmark\Container\Navbar\Button;
|
|
|
|
class Delete extends Button
|
|
{
|
|
public const IMAGE = 'edit-delete-symbolic';
|
|
public const LABEL = 'Delete';
|
|
public const TOOLTIP = 'Delete';
|
|
|
|
protected function _onCLick(
|
|
GtkButton $entity
|
|
): void
|
|
{
|
|
if ($id = $this->navbar->container->content->table->getSelectedId())
|
|
{
|
|
$this->navbar->container->bookmark->browser->database->bookmark->delete(
|
|
$id
|
|
);
|
|
}
|
|
|
|
$this->navbar->container->refresh();
|
|
}
|
|
|
|
public function refresh(): void
|
|
{
|
|
$this->gtk->set_sensitive(
|
|
boolval(
|
|
$this->navbar->container->content->table->getSelectedId()
|
|
)
|
|
);
|
|
}
|
|
}
|