|
|
@ -18,47 +18,43 @@ namespace app::browser::main::tab::page::navbar |
|
|
|
|
|
|
|
|
|
|
|
class History : public Gtk::Box |
|
|
|
class History : public Gtk::Box |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Extras
|
|
|
|
|
|
|
|
struct Memory |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Glib::ustring request; |
|
|
|
|
|
|
|
std::time_t time; // event unix time
|
|
|
|
|
|
|
|
bool permanent; // save in database (on application close) @TODO
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Define navigation history storage
|
|
|
|
|
|
|
|
std::vector<Memory> memory; |
|
|
|
|
|
|
|
int index = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Private helpers
|
|
|
|
|
|
|
|
Memory & get_memory_back(); |
|
|
|
|
|
|
|
Memory & get_memory_forward(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Components
|
|
|
|
// Components
|
|
|
|
history::Back * historyBack; |
|
|
|
history::Back * historyBack; |
|
|
|
history::Forward * historyForward; |
|
|
|
history::Forward * historyForward; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int index = 0; |
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Extras
|
|
|
|
|
|
|
|
struct Memory |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Glib::ustring request; |
|
|
|
|
|
|
|
std::time_t time; // event unix time
|
|
|
|
|
|
|
|
bool permanent; // save in database (on application close) @TODO
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Define navigation history storage
|
|
|
|
|
|
|
|
std::vector<Memory> memory; |
|
|
|
|
|
|
|
|
|
|
|
History(); |
|
|
|
History(); |
|
|
|
|
|
|
|
|
|
|
|
// Actions
|
|
|
|
// Actions
|
|
|
|
void back(); |
|
|
|
bool back( |
|
|
|
void forward(); |
|
|
|
Memory & match, |
|
|
|
|
|
|
|
bool follow = true |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool forward( |
|
|
|
|
|
|
|
Memory & match, |
|
|
|
|
|
|
|
bool follow = true |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
void push( |
|
|
|
void push( |
|
|
|
const Glib::ustring & REQUEST |
|
|
|
const Glib::ustring & REQUEST |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
void refresh(); |
|
|
|
void refresh(); |
|
|
|
|
|
|
|
|
|
|
|
// Getters
|
|
|
|
|
|
|
|
bool has_memory_back(); |
|
|
|
|
|
|
|
bool has_memory_forward(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Copying getters (to keep private members encapsulation)
|
|
|
|
|
|
|
|
Glib::ustring make_memory_back_request(); |
|
|
|
|
|
|
|
Glib::ustring make_memory_forward_request(); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|