mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
rename method
This commit is contained in:
parent
004861a3d8
commit
de40ed8892
5 changed files with 57 additions and 54 deletions
|
|
@ -104,7 +104,7 @@ void Page::refresh(
|
||||||
void Page::update()
|
void Page::update()
|
||||||
{
|
{
|
||||||
// Update navigation history
|
// Update navigation history
|
||||||
pageNavbar->history_push(
|
pageNavbar->history_add(
|
||||||
pageNavbar->get_request_text()
|
pageNavbar->get_request_text()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,10 +115,10 @@ void Navbar::history_forward()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Navbar::history_push(
|
void Navbar::history_add(
|
||||||
const Glib::ustring & VALUE
|
const Glib::ustring & VALUE
|
||||||
) {
|
) {
|
||||||
navbarHistory->push(
|
navbarHistory->add(
|
||||||
VALUE
|
VALUE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,14 @@ namespace app::browser::main::tab::page
|
||||||
);
|
);
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
void history_back();
|
void history_add(
|
||||||
void history_forward();
|
|
||||||
void history_push(
|
|
||||||
const Glib::ustring & VALUE
|
const Glib::ustring & VALUE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void history_back();
|
||||||
|
void history_forward();
|
||||||
|
|
||||||
|
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,46 @@ History::History()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
void History::add(
|
||||||
|
const Glib::ustring & REQUEST,
|
||||||
|
const bool & FOLLOW
|
||||||
|
) {
|
||||||
|
memory.push_back(
|
||||||
|
{
|
||||||
|
REQUEST,
|
||||||
|
std::time(
|
||||||
|
nullptr
|
||||||
|
),
|
||||||
|
true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (FOLLOW)
|
||||||
|
{
|
||||||
|
index = memory.size(); // @TODO not last index, use iterator
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void History::refresh()
|
||||||
|
{
|
||||||
|
Memory match;
|
||||||
|
|
||||||
|
historyBack->set_sensitive(
|
||||||
|
try_back(
|
||||||
|
match,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
historyForward->set_sensitive(
|
||||||
|
try_forward(
|
||||||
|
match,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool History::try_back(
|
bool History::try_back(
|
||||||
Memory & match,
|
Memory & match,
|
||||||
const bool & FOLLOW
|
const bool & FOLLOW
|
||||||
|
|
@ -71,42 +111,3 @@ bool History::try_forward(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void History::push(
|
|
||||||
const Glib::ustring & REQUEST,
|
|
||||||
const bool & FOLLOW
|
|
||||||
) {
|
|
||||||
memory.push_back(
|
|
||||||
{
|
|
||||||
REQUEST,
|
|
||||||
std::time(
|
|
||||||
nullptr
|
|
||||||
),
|
|
||||||
true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (FOLLOW)
|
|
||||||
{
|
|
||||||
index = memory.size(); // @TODO not last index, use iterator
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void History::refresh()
|
|
||||||
{
|
|
||||||
Memory match;
|
|
||||||
|
|
||||||
historyBack->set_sensitive(
|
|
||||||
try_back(
|
|
||||||
match,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
historyForward->set_sensitive(
|
|
||||||
try_forward(
|
|
||||||
match,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -40,6 +40,15 @@ namespace app::browser::main::tab::page::navbar
|
||||||
History();
|
History();
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
void add(
|
||||||
|
const Glib::ustring & REQUEST,
|
||||||
|
const bool & FOLLOW = true
|
||||||
|
);
|
||||||
|
|
||||||
|
void refresh();
|
||||||
|
|
||||||
|
void save(); // @TODO save history to the permanent storage
|
||||||
|
|
||||||
bool try_back(
|
bool try_back(
|
||||||
Memory & match,
|
Memory & match,
|
||||||
const bool & FOLLOW = true
|
const bool & FOLLOW = true
|
||||||
|
|
@ -49,15 +58,6 @@ namespace app::browser::main::tab::page::navbar
|
||||||
Memory & match,
|
Memory & match,
|
||||||
const bool & FOLLOW = true
|
const bool & FOLLOW = true
|
||||||
);
|
);
|
||||||
|
|
||||||
void push(
|
|
||||||
const Glib::ustring & REQUEST,
|
|
||||||
const bool & FOLLOW = true
|
|
||||||
);
|
|
||||||
|
|
||||||
void save(); // @TODO save history to the permanent storage
|
|
||||||
|
|
||||||
void refresh();
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue