mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
add page history save mode
This commit is contained in:
parent
c2ddd3dba5
commit
64ae36eecf
3 changed files with 32 additions and 2 deletions
|
|
@ -86,7 +86,11 @@
|
|||
},
|
||||
"database":
|
||||
{
|
||||
"enabled":true
|
||||
"enabled":true,
|
||||
"mode":
|
||||
{
|
||||
"renew":true
|
||||
}
|
||||
}
|
||||
},
|
||||
"progressbar":
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -711,7 +711,7 @@ class Page
|
|||
$this->app->history->add(
|
||||
$url,
|
||||
$title,
|
||||
$this->config->history->database->renew
|
||||
$this->config->history->database->mode->renew
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue