Browse Source

add page history save mode

main
yggverse 2 months ago
parent
commit
64ae36eecf
  1. 6
      config.json
  2. 26
      src/Entity/Tab/History.php
  3. 2
      src/Entity/Tab/Page.php

6
config.json

@ -86,7 +86,11 @@ @@ -86,7 +86,11 @@
},
"database":
{
"enabled":true
"enabled":true,
"mode":
{
"renew":true
}
}
},
"progressbar":

26
src/Entity/Tab/History.php

@ -343,6 +343,32 @@ class History @@ -343,6 +343,32 @@ class History
$this->treeview->show_all();
}
public function add(
string $url,
?string $title = null,
bool $renew = false // delete previous records with same URL
): ?int
{
if ($renew)
{
foreach ($this->app->database->getHistory($url) as $record)
{
$this->app->database->deleteHistory(
$record->id
);
}
}
$id = $this->app->database->addHistory(
$url,
$title
);
$this->refresh();
return $id;
}
public function getSelectedColumn(
int $column,
\GtkTreeView $treeview = null

2
src/Entity/Tab/Page.php

@ -711,7 +711,7 @@ class Page @@ -711,7 +711,7 @@ class Page
$this->app->history->add(
$url,
$title,
$this->config->history->database->renew
$this->config->history->database->mode->renew
);
}
}

Loading…
Cancel
Save