mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
update history actions api
This commit is contained in:
parent
9ef5b169d3
commit
0a09de1fdd
12 changed files with 106 additions and 109 deletions
|
|
@ -87,47 +87,11 @@ Navigation::Navigation(
|
|||
}
|
||||
|
||||
// Actions
|
||||
bool Navigation::history_try_back()
|
||||
{
|
||||
navigation::History::Memory match;
|
||||
|
||||
if (navigationHistory->try_back(match))
|
||||
{
|
||||
navigationRequest->set_text(
|
||||
match.request
|
||||
);
|
||||
|
||||
return activate_action(
|
||||
"win.main_tab_page_navigation_update"
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Navigation::history_try_forward()
|
||||
{
|
||||
navigation::History::Memory match;
|
||||
|
||||
if (navigationHistory->try_forward(match))
|
||||
{
|
||||
navigationRequest->set_text(
|
||||
match.request
|
||||
);
|
||||
|
||||
return activate_action(
|
||||
"win.main_tab_page_navigation_update"
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Navigation::history_add(
|
||||
const Glib::ustring & VALUE
|
||||
const Glib::ustring & REQUEST
|
||||
) {
|
||||
navigationHistory->add(
|
||||
VALUE
|
||||
REQUEST
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -187,4 +151,34 @@ Glib::ustring Navigation::get_request_query()
|
|||
Glib::ustring Navigation::get_request_port()
|
||||
{
|
||||
return navigationRequest->get_port();
|
||||
}
|
||||
|
||||
bool Navigation::try_history_back(
|
||||
Glib::ustring & request
|
||||
) {
|
||||
navigation::History::Memory match;
|
||||
|
||||
if (navigationHistory->try_back(match))
|
||||
{
|
||||
request = match.request;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Navigation::try_history_forward(
|
||||
Glib::ustring & request
|
||||
) {
|
||||
navigation::History::Memory match;
|
||||
|
||||
if (navigationHistory->try_forward(match))
|
||||
{
|
||||
request = match.request;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -38,12 +38,9 @@ namespace app::browser::main::tab::page
|
|||
|
||||
// Actions
|
||||
void history_add(
|
||||
const Glib::ustring & VALUE
|
||||
const Glib::ustring & REQUEST
|
||||
);
|
||||
|
||||
bool history_try_back();
|
||||
bool history_try_forward();
|
||||
|
||||
void refresh();
|
||||
|
||||
// Setters
|
||||
|
|
@ -59,6 +56,14 @@ namespace app::browser::main::tab::page
|
|||
Glib::ustring get_request_port();
|
||||
Glib::ustring get_request_path();
|
||||
Glib::ustring get_request_query();
|
||||
|
||||
bool try_history_back(
|
||||
Glib::ustring & request
|
||||
);
|
||||
|
||||
bool try_history_forward(
|
||||
Glib::ustring & request
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using namespace app::browser::main::tab::page::navigation::history;
|
|||
Back::Back()
|
||||
{
|
||||
set_action_name(
|
||||
"win.main_tab_page_navigation_history_try_back"
|
||||
"win.main_tab_page_navigation_history_back"
|
||||
);
|
||||
|
||||
set_icon_name(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using namespace app::browser::main::tab::page::navigation::history;
|
|||
Forward::Forward()
|
||||
{
|
||||
set_action_name(
|
||||
"win.main_tab_page_navigation_history_try_forward"
|
||||
"win.main_tab_page_navigation_history_forward"
|
||||
);
|
||||
|
||||
set_icon_name(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue