Browse Source

fix session restore

PHP-GTK3
yggverse 4 months ago
parent
commit
e858944de7
  1. 9
      src/Entity/Browser/Container/Page.php
  2. 18
      src/Entity/Browser/Container/Tab.php
  3. 5
      src/Entity/Browser/Menu/Tab/Add.php

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

@ -94,6 +94,15 @@ class Page
$this->content->refresh(); $this->content->refresh();
} }
public function init(
?string $request = null
): void
{
$this->navbar->request->setValue(
$request
);
}
public function open( public function open(
?string $request = null, ?string $request = null,
bool $history = true bool $history = true

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

@ -37,7 +37,13 @@ class Tab
foreach ($this->container->browser->database->getSession() as $session) foreach ($this->container->browser->database->getSession() as $session)
{ {
$this->appendPage( $this->appendPage(
$session->request $session->request,
boolval( // open
parse_url(
$session->request,
PHP_URL_SCHEME
)
)
); );
} }
@ -105,6 +111,7 @@ class Tab
public function appendPage( public function appendPage(
?string $request = null, ?string $request = null,
bool $open = true,
bool $focus = true bool $focus = true
): void ): void
{ {
@ -124,13 +131,20 @@ class Tab
$this->_reorderable $this->_reorderable
); );
if ($request) if ($open)
{ {
$page->open( $page->open(
$request $request
); );
} }
else
{
$page->init(
$request
);
}
if ($focus) if ($focus)
{ {
// Focus on appended tab // Focus on appended tab

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

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

Loading…
Cancel
Save