|
|
@ -36,43 +36,43 @@ Navbar::Navbar( |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Init components
|
|
|
|
// Init components
|
|
|
|
base = new navbar::Base(); |
|
|
|
navbarBase = new navbar::Base(); |
|
|
|
|
|
|
|
|
|
|
|
append( |
|
|
|
append( |
|
|
|
* base |
|
|
|
* navbarBase |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
history = new navbar::History(); |
|
|
|
navbarHistory = new navbar::History(); |
|
|
|
|
|
|
|
|
|
|
|
append( |
|
|
|
append( |
|
|
|
* history |
|
|
|
* navbarHistory |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
update = new navbar::Update(); |
|
|
|
navbarUpdate = new navbar::Update(); |
|
|
|
|
|
|
|
|
|
|
|
append( |
|
|
|
append( |
|
|
|
* update |
|
|
|
* navbarUpdate |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
request = new navbar::Request( |
|
|
|
navbarRequest = new navbar::Request( |
|
|
|
request_text |
|
|
|
request_text |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
append( |
|
|
|
append( |
|
|
|
* request |
|
|
|
* navbarRequest |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
bookmark = new navbar::Bookmark(); |
|
|
|
navbarBookmark = new navbar::Bookmark(); |
|
|
|
|
|
|
|
|
|
|
|
append( |
|
|
|
append( |
|
|
|
* bookmark |
|
|
|
* navbarBookmark |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Init actions group
|
|
|
|
// Init actions group
|
|
|
|
action_group = Gio::SimpleActionGroup::create(); |
|
|
|
auto GioSimpleActionGroup_RefPtr = Gio::SimpleActionGroup::create(); |
|
|
|
|
|
|
|
|
|
|
|
// Define group actions
|
|
|
|
// Define group actions
|
|
|
|
action_group->add_action( |
|
|
|
GioSimpleActionGroup_RefPtr->add_action( |
|
|
|
"refresh", |
|
|
|
"refresh", |
|
|
|
[this] |
|
|
|
[this] |
|
|
|
{ |
|
|
|
{ |
|
|
@ -82,30 +82,30 @@ Navbar::Navbar( |
|
|
|
|
|
|
|
|
|
|
|
insert_action_group( |
|
|
|
insert_action_group( |
|
|
|
"navbar", |
|
|
|
"navbar", |
|
|
|
action_group |
|
|
|
GioSimpleActionGroup_RefPtr |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Navbar::~Navbar() |
|
|
|
Navbar::~Navbar() |
|
|
|
{ |
|
|
|
{ |
|
|
|
delete base; |
|
|
|
delete navbarBase; |
|
|
|
delete bookmark; |
|
|
|
delete navbarBookmark; |
|
|
|
delete history; |
|
|
|
delete navbarHistory; |
|
|
|
delete request; |
|
|
|
delete navbarRequest; |
|
|
|
delete update; |
|
|
|
delete navbarUpdate; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Actions
|
|
|
|
// Actions
|
|
|
|
void Navbar::refresh() |
|
|
|
void Navbar::refresh() |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Toggle base button sensibility
|
|
|
|
// Toggle base button sensibility
|
|
|
|
base->set_sensitive( |
|
|
|
navbarBase->set_sensitive( |
|
|
|
!request->get_host().empty() && !request->get_path().empty() |
|
|
|
!navbarRequest->get_host().empty() && !navbarRequest->get_path().empty() |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Toggle update button sensibility
|
|
|
|
// Toggle update button sensibility
|
|
|
|
update->set_sensitive( |
|
|
|
navbarUpdate->set_sensitive( |
|
|
|
(bool) request->get_text_length() |
|
|
|
navbarRequest->get_text_length() > 0 |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -113,7 +113,7 @@ void Navbar::refresh() |
|
|
|
void Navbar::set_request_text( |
|
|
|
void Navbar::set_request_text( |
|
|
|
const Glib::ustring & value |
|
|
|
const Glib::ustring & value |
|
|
|
) { |
|
|
|
) { |
|
|
|
request->set_text( |
|
|
|
navbarRequest->set_text( |
|
|
|
value |
|
|
|
value |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
@ -123,30 +123,30 @@ void Navbar::set_request_text( |
|
|
|
// Getters
|
|
|
|
// Getters
|
|
|
|
Glib::ustring Navbar::get_request_text() |
|
|
|
Glib::ustring Navbar::get_request_text() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return request->get_text(); |
|
|
|
return navbarRequest->get_text(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Glib::ustring Navbar::get_request_scheme() |
|
|
|
Glib::ustring Navbar::get_request_scheme() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return request->get_scheme(); |
|
|
|
return navbarRequest->get_scheme(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Glib::ustring Navbar::get_request_host() |
|
|
|
Glib::ustring Navbar::get_request_host() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return request->get_host(); |
|
|
|
return navbarRequest->get_host(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Glib::ustring Navbar::get_request_path() |
|
|
|
Glib::ustring Navbar::get_request_path() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return request->get_path(); |
|
|
|
return navbarRequest->get_path(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Glib::ustring Navbar::get_request_query() |
|
|
|
Glib::ustring Navbar::get_request_query() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return request->get_query(); |
|
|
|
return navbarRequest->get_query(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Glib::ustring Navbar::get_request_port() |
|
|
|
Glib::ustring Navbar::get_request_port() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return request->get_port(); |
|
|
|
return navbarRequest->get_port(); |
|
|
|
} |
|
|
|
} |