|
|
@ -51,14 +51,6 @@ class Page |
|
|
|
// Init history |
|
|
|
// Init history |
|
|
|
$this->history = new \Yggverse\Yoda\Model\History; |
|
|
|
$this->history = new \Yggverse\Yoda\Model\History; |
|
|
|
|
|
|
|
|
|
|
|
// Run database cleaner |
|
|
|
|
|
|
|
if ($this->config->history->database->timeout) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$this->app->database->cleanHistory( |
|
|
|
|
|
|
|
$this->config->history->database->timeout |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Compose header |
|
|
|
// Compose header |
|
|
|
$this->header = new \GtkBox( |
|
|
|
$this->header = new \GtkBox( |
|
|
|
\GtkOrientation::HORIZONTAL |
|
|
|
\GtkOrientation::HORIZONTAL |
|
|
@ -84,71 +76,41 @@ class Page |
|
|
|
$this->config->header->margin |
|
|
|
$this->config->header->margin |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Home button |
|
|
|
// Init home button |
|
|
|
$this->home = \GtkButton::new_with_label( |
|
|
|
$this->home = \GtkButton::new_with_label( |
|
|
|
$this->config->header->button->home->label |
|
|
|
$this->config->header->button->home->label |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$this->home->connect( |
|
|
|
|
|
|
|
'clicked', |
|
|
|
|
|
|
|
function ($entry) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$this->history->reset(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->open( |
|
|
|
|
|
|
|
$this->config->header->button->home->url |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($this->config->header->button->home->visible) |
|
|
|
if ($this->config->header->button->home->visible) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$this->home->connect( |
|
|
|
|
|
|
|
'clicked', |
|
|
|
|
|
|
|
function ($entry) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$this->history->reset(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->open( |
|
|
|
|
|
|
|
$this->config->header->button->home->url |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$this->header->add( |
|
|
|
$this->header->add( |
|
|
|
$this->home |
|
|
|
$this->home |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Back button |
|
|
|
// Init back button |
|
|
|
$this->back = \GtkButton::new_with_label( |
|
|
|
$this->back = \GtkButton::new_with_label( |
|
|
|
$this->config->header->button->back->label |
|
|
|
$this->config->header->button->back->label |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$this->back->set_sensitive( |
|
|
|
// Init forward button |
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->back->connect( |
|
|
|
|
|
|
|
'clicked', |
|
|
|
|
|
|
|
function ($entry) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$this->open( |
|
|
|
|
|
|
|
$this->history->goBack(), |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Forward button |
|
|
|
|
|
|
|
$this->forward = \GtkButton::new_with_label( |
|
|
|
$this->forward = \GtkButton::new_with_label( |
|
|
|
$this->config->header->button->forward->label |
|
|
|
$this->config->header->button->forward->label |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$this->forward->set_sensitive( |
|
|
|
// Group back/forward buttons |
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->forward->connect( |
|
|
|
|
|
|
|
'clicked', |
|
|
|
|
|
|
|
function ($entry) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$this->open( |
|
|
|
|
|
|
|
$this->history->goForward(), |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Group buttons |
|
|
|
|
|
|
|
if ($this->config->header->button->back->visible || $this->config->header->button->forward->visible) |
|
|
|
if ($this->config->header->button->back->visible || $this->config->header->button->forward->visible) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$buttonGroup = new \GtkButtonBox( |
|
|
|
$buttonGroup = new \GtkButtonBox( |
|
|
@ -161,6 +123,21 @@ class Page |
|
|
|
|
|
|
|
|
|
|
|
if ($this->config->header->button->back->visible) |
|
|
|
if ($this->config->header->button->back->visible) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$this->back->set_sensitive( |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->back->connect( |
|
|
|
|
|
|
|
'clicked', |
|
|
|
|
|
|
|
function ($entry) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$this->open( |
|
|
|
|
|
|
|
$this->history->goBack(), |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$buttonGroup->add( |
|
|
|
$buttonGroup->add( |
|
|
|
$this->back |
|
|
|
$this->back |
|
|
|
); |
|
|
|
); |
|
|
@ -168,6 +145,21 @@ class Page |
|
|
|
|
|
|
|
|
|
|
|
if ($this->config->header->button->forward->visible) |
|
|
|
if ($this->config->header->button->forward->visible) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$this->forward->set_sensitive( |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->forward->connect( |
|
|
|
|
|
|
|
'clicked', |
|
|
|
|
|
|
|
function ($entry) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$this->open( |
|
|
|
|
|
|
|
$this->history->goForward(), |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$buttonGroup->add( |
|
|
|
$buttonGroup->add( |
|
|
|
$this->forward |
|
|
|
$this->forward |
|
|
|
); |
|
|
|
); |
|
|
@ -189,6 +181,13 @@ class Page |
|
|
|
$this->config->header->entry->request->length->max |
|
|
|
$this->config->header->entry->request->length->max |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->header->pack_start( |
|
|
|
|
|
|
|
$this->request, |
|
|
|
|
|
|
|
true, |
|
|
|
|
|
|
|
true, |
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$this->request->connect( |
|
|
|
$this->request->connect( |
|
|
|
'activate', |
|
|
|
'activate', |
|
|
|
function ($entry) |
|
|
|
function ($entry) |
|
|
@ -199,13 +198,6 @@ class Page |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$this->header->pack_start( |
|
|
|
|
|
|
|
$this->request, |
|
|
|
|
|
|
|
true, |
|
|
|
|
|
|
|
true, |
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Init autocomplete |
|
|
|
// Init autocomplete |
|
|
|
if ($this->config->header->entry->request->autocomplete->enabled) |
|
|
|
if ($this->config->header->entry->request->autocomplete->enabled) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -275,18 +267,18 @@ class Page |
|
|
|
$this->config->header->button->go->label |
|
|
|
$this->config->header->button->go->label |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$this->go->connect( |
|
|
|
|
|
|
|
'clicked', |
|
|
|
|
|
|
|
function ($entry) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$this->open( |
|
|
|
|
|
|
|
$this->request->get_text() |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($this->config->header->button->go->visible) |
|
|
|
if ($this->config->header->button->go->visible) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$this->go->connect( |
|
|
|
|
|
|
|
'clicked', |
|
|
|
|
|
|
|
function ($entry) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$this->open( |
|
|
|
|
|
|
|
$this->request->get_text() |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$this->header->add( |
|
|
|
$this->header->add( |
|
|
|
$this->go |
|
|
|
$this->go |
|
|
|
); |
|
|
|
); |
|
|
|