diff --git a/src/Entity/Browser/Container/Page.php b/src/Entity/Browser/Container/Page.php index bf9e74d0..feb5f76a 100644 --- a/src/Entity/Browser/Container/Page.php +++ b/src/Entity/Browser/Container/Page.php @@ -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() diff --git a/src/Entity/Browser/Container/Page/Content.php b/src/Entity/Browser/Container/Page/Content.php index fe640dbd..b540a351 100644 --- a/src/Entity/Browser/Container/Page/Content.php +++ b/src/Entity/Browser/Container/Page/Content.php @@ -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(), diff --git a/src/Entity/Browser/Container/Page/Navbar/Request.php b/src/Entity/Browser/Container/Page/Navbar/Request.php index ac9e130b..5198af5b 100644 --- a/src/Entity/Browser/Container/Page/Navbar/Request.php +++ b/src/Entity/Browser/Container/Page/Navbar/Request.php @@ -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 } diff --git a/src/Entity/Browser/Container/Tab.php b/src/Entity/Browser/Container/Tab.php index 694cf79d..6b04201f 100644 --- a/src/Entity/Browser/Container/Tab.php +++ b/src/Entity/Browser/Container/Tab.php @@ -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(); diff --git a/src/Entity/Browser/History/Container/Content/Table.php b/src/Entity/Browser/History/Container/Content/Table.php index f8d0f01e..fa766c09 100644 --- a/src/Entity/Browser/History/Container/Content/Table.php +++ b/src/Entity/Browser/History/Container/Content/Table.php @@ -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() ); } diff --git a/src/Entity/Browser/History/Container/Navbar/Open.php b/src/Entity/Browser/History/Container/Navbar/Open.php index 71c8eee2..29099ec9 100644 --- a/src/Entity/Browser/History/Container/Navbar/Open.php +++ b/src/Entity/Browser/History/Container/Navbar/Open.php @@ -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() ); } diff --git a/src/Entity/Browser/Menu/File/Open.php b/src/Entity/Browser/Menu/File/Open.php index cc9e436f..7a551407 100644 --- a/src/Entity/Browser/Menu/File/Open.php +++ b/src/Entity/Browser/Menu/File/Open.php @@ -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 diff --git a/src/Entity/Browser/Menu/File/Save.php b/src/Entity/Browser/Menu/File/Save.php index 0153f186..7d086404 100644 --- a/src/Entity/Browser/Menu/File/Save.php +++ b/src/Entity/Browser/Menu/File/Save.php @@ -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(), diff --git a/src/Entity/Browser/Menu/Tab/Add.php b/src/Entity/Browser/Menu/Tab/Add.php index 68f89895..276c29bf 100644 --- a/src/Entity/Browser/Menu/Tab/Add.php +++ b/src/Entity/Browser/Menu/Tab/Add.php @@ -33,7 +33,7 @@ class Add 'activate', function() { - $this->tab->menu->browser->container->tab->appendPage( + $this->tab->menu->browser->container->tab->append( null, false );