Browse Source

fix session restore

PHP-GTK3
yggverse 5 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 @@ -94,6 +94,15 @@ class Page
$this->content->refresh();
}
public function init(
?string $request = null
): void
{
$this->navbar->request->setValue(
$request
);
}
public function open(
?string $request = null,
bool $history = true

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

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

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

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

Loading…
Cancel
Save