@ -15,12 +15,12 @@ class History
@@ -15,12 +15,12 @@ class History
public \Yggverse\Yoda\Entity\Window\Tab\Address\Navbar\History\Back $back;
public \Yggverse\Yoda\Entity\Window\Tab\Address\Navbar\History\Forward $forward;
private \Yggverse\Yoda\Model\History $_hist ory;
public \Yggverse\Yoda\Model\History $mem ory;
public function __construct(
\Yggverse\Yoda\Entity\Window\Tab\Address\Navbar $navbar
) {
$this->_hist ory = new \Yggverse\Yoda\Model\History();
$this->mem ory = new \Yggverse\Yoda\Model\History();
$this->navbar = $navbar;
@ -50,27 +50,32 @@ class History
@@ -50,27 +50,32 @@ class History
}
public function add(
string $url
string $value
): void
{
if (empty($url ))
if (empty($value ))
{
throw new \Exception;
}
if ($url != $this->_hist ory->getCurrent())
if ($value != $this->mem ory->getCurrent())
{
$this->_hist ory->add(
$url
$this->mem ory->add(
$value
);
}
$this->refresh();
}
public function refresh(): void
{
$this->back->gtk->set_sensitive(
(bool) $this->_history->getBack()
(bool) $this->mem ory->getBack()
);
$this->forward->gtk->set_sensitive(
(bool) $this->_hist ory->getForward()
(bool) $this->mem ory->getForward()
);
}
}