Browse Source

rename methods, use namespace

PHP-GTK3
yggverse 4 months ago
parent
commit
b8b59e6f56
  1. 6
      src/Entity/Browser/Container/Page.php
  2. 2
      src/Entity/Browser/Container/Page/Content.php
  3. 6
      src/Entity/Browser/Container/Page/Navbar/Request.php
  4. 16
      src/Entity/Browser/Container/Tab.php
  5. 2
      src/Entity/Browser/History/Container/Content/Table.php
  6. 2
      src/Entity/Browser/History/Container/Navbar/Open.php
  7. 2
      src/Entity/Browser/Menu/File/Open.php
  8. 2
      src/Entity/Browser/Menu/File/Save.php
  9. 2
      src/Entity/Browser/Menu/Tab/Add.php

6
src/Entity/Browser/Container/Page.php

@ -197,7 +197,7 @@ class Page @@ -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 @@ -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 @@ -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()

2
src/Entity/Browser/Container/Page/Content.php

@ -90,7 +90,7 @@ class Content @@ -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(),

6
src/Entity/Browser/Container/Page/Navbar/Request.php

@ -16,7 +16,7 @@ class Request extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navb @@ -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 @@ -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 @@ -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
}

16
src/Entity/Browser/Container/Tab.php

@ -36,7 +36,7 @@ class Tab @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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();

2
src/Entity/Browser/History/Container/Content/Table.php

@ -77,7 +77,7 @@ class Table @@ -77,7 +77,7 @@ class Table
// Focus on browser
// $this->content->container->history->browser->gtk->present();
$this->content->container->history->browser->container->tab->appendPage(
$this->content->container->history->browser->container->tab->append(
$this->getSelectedUrl()
);
}

2
src/Entity/Browser/History/Container/Navbar/Open.php

@ -12,7 +12,7 @@ class Open extends \Yggverse\Yoda\Abstract\Entity\Browser\History\Container\Navb @@ -12,7 +12,7 @@ class Open extends \Yggverse\Yoda\Abstract\Entity\Browser\History\Container\Navb
\GtkButton $entity
): void
{
$this->navbar->container->history->browser->container->tab->appendPage(
$this->navbar->container->history->browser->container->tab->append(
$this->navbar->container->content->table->getSelectedUrl()
);
}

2
src/Entity/Browser/Menu/File/Open.php

@ -84,7 +84,7 @@ class Open @@ -84,7 +84,7 @@ class Open
{
foreach ($dialog->get_filenames() as $filename)
{
$this->file->menu->browser->container->tab->appendPage(
$this->file->menu->browser->container->tab->append(
sprintf(
'file://%s',
$filename

2
src/Entity/Browser/Menu/File/Save.php

@ -58,7 +58,7 @@ class Save @@ -58,7 +58,7 @@ class Save
if (\GtkResponseType::APPLY == $dialog->run())
{
if ($page = $this->file->menu->browser->container->tab->getPage())
if ($page = $this->file->menu->browser->container->tab->get())
{
file_put_contents(
$dialog->get_filename(),

2
src/Entity/Browser/Menu/Tab/Add.php

@ -33,7 +33,7 @@ class Add @@ -33,7 +33,7 @@ class Add
'activate',
function()
{
$this->tab->menu->browser->container->tab->appendPage(
$this->tab->menu->browser->container->tab->append(
null,
false
);

Loading…
Cancel
Save