rename methods, use namespace

This commit is contained in:
yggverse 2024-07-19 20:25:37 +03:00
parent 9cc75a8fcf
commit b8b59e6f56
9 changed files with 20 additions and 20 deletions

View file

@ -197,7 +197,7 @@ class Page
);
// Refresh header by new title if current page is active
if ($this === $this->container->tab->getPage())
if ($this === $this->container->tab->get())
{
$this->container->browser->header->setTitle(
$this->title->getValue(),
@ -231,7 +231,7 @@ class Page
);
// Refresh header by new title if current page is active
if ($this === $this->container->tab->getPage())
if ($this === $this->container->tab->get())
{
$this->container->browser->header->setTitle(
$this->title->getValue(),
@ -264,7 +264,7 @@ class Page
);
// Refresh header by new title if current page is active
if ($this === $this->container->tab->getPage())
if ($this === $this->container->tab->get())
{
$this->container->browser->header->setTitle(
$this->title->getValue()

View file

@ -90,7 +90,7 @@ class Content
);
// Refresh header by new title if current page is active
if ($this->page === $this->page->container->tab->getPage())
if ($this->page === $this->page->container->tab->get())
{
$this->page->container->browser->header->setTitle(
$this->page->title->getValue(),

View file

@ -16,7 +16,7 @@ class Request extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navb
$entry->get_text()
);
$this->navbar->page->container->tab->updateSession();
$this->navbar->page->container->tab->update();
}
protected function _onKeyRelease(
@ -26,7 +26,7 @@ class Request extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navb
{
$this->navbar->refresh();
$this->navbar->page->container->tab->updateSession();
$this->navbar->page->container->tab->update();
}
protected function _onChanged(
@ -40,7 +40,7 @@ class Request extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navb
1000, // wait for one second to apply changes
function()
{
$this->navbar->page->container->tab->updateSession();
$this->navbar->page->container->tab->update();
return false; // stop
}

View file

@ -36,7 +36,7 @@ class Tab
// Restore previous session
foreach ($this->container->browser->database->getSession() as $session)
{
$this->appendPage(
$this->append(
$session->request,
boolval( // open
parse_url(
@ -56,7 +56,7 @@ class Tab
int $page_num
) {
// Update header bar title
if ($page = $this->getPage($page_num))
if ($page = $this->get($page_num))
{
$this->container->browser->header->setTitle(
$page->title->getValue(),
@ -117,7 +117,7 @@ class Tab
);
}
public function appendPage(
public function append(
?string $request = null,
bool $open = true,
bool $focus = true
@ -167,9 +167,9 @@ class Tab
$this->gtk->show();
}
public function getPage(
public function get(
?int $page_num = null
): ?\Yggverse\Yoda\Entity\Browser\Container\Page
): ?Page
{
// Get current page number on $page_num is null
if (is_null($page_num))
@ -197,7 +197,7 @@ class Tab
?int $page_num = null
): void
{
if ($page = $this->getPage($page_num))
if ($page = $this->get($page_num))
{
$this->gtk->remove_page(
$this->gtk->page_num(
@ -246,11 +246,11 @@ class Tab
// Update session
if ($session)
{
$this->updateSession();
$this->update();
}
}
public function updateSession(): void
public function update(): void
{
$pid = pcntl_fork();