mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
add tab session menu
This commit is contained in:
parent
817c946270
commit
46582fbe63
@ -151,7 +151,22 @@ Browser::Browser(
|
||||
"<Primary>Right"
|
||||
);
|
||||
|
||||
// Init actions
|
||||
const auto ACTION__MAIN_TAB_SESSION_RESTORE = add_action(
|
||||
"main_tab_session_restore",
|
||||
[this]
|
||||
{
|
||||
browserMain->tab_restore();
|
||||
}
|
||||
);
|
||||
|
||||
const auto ACTION__MAIN_TAB_SESSION_SAVE = add_action(
|
||||
"main_tab_session_save",
|
||||
[this]
|
||||
{
|
||||
browserMain->tab_save();
|
||||
}
|
||||
);
|
||||
|
||||
const auto ACTION__QUIT = add_action(
|
||||
"quit",
|
||||
[this]
|
||||
@ -184,7 +199,9 @@ Browser::Browser(
|
||||
ACTION__MAIN_TAB_CLOSE_ALL,
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE,
|
||||
ACTION__MAIN_TAB_SESSION_RESTORE,
|
||||
ACTION__MAIN_TAB_SESSION_SAVE
|
||||
);
|
||||
|
||||
set_titlebar(
|
||||
|
@ -13,7 +13,9 @@ Header::Header(
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_SESSION_RESTORE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_SESSION_SAVE
|
||||
) {
|
||||
// Init widget
|
||||
set_show_title_buttons(
|
||||
@ -29,7 +31,9 @@ Header::Header(
|
||||
ACTION__MAIN_TAB_CLOSE_ALL,
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE,
|
||||
ACTION__MAIN_TAB_SESSION_RESTORE,
|
||||
ACTION__MAIN_TAB_SESSION_SAVE
|
||||
);
|
||||
|
||||
pack_start(
|
||||
|
@ -36,7 +36,9 @@ namespace app::browser
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_SESSION_RESTORE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_SESSION_SAVE
|
||||
);
|
||||
|
||||
void refresh(
|
||||
|
@ -10,7 +10,9 @@ Menu::Menu(
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_SESSION_RESTORE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_SESSION_SAVE
|
||||
) {
|
||||
// Init widget
|
||||
set_tooltip_text(
|
||||
@ -29,48 +31,69 @@ Menu::Menu(
|
||||
)
|
||||
);
|
||||
|
||||
const auto MENU__MAIN_TAB_PAGE = Gio::Menu::create();
|
||||
const auto MENU__MAIN_TAB_PAGE = Gio::Menu::create();
|
||||
|
||||
const auto MENU__MAIN_TAB_PAGE_NAVIGATION = Gio::Menu::create();
|
||||
const auto MENU__MAIN_TAB_PAGE_NAVIGATION = Gio::Menu::create();
|
||||
|
||||
const auto MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY = Gio::Menu::create();
|
||||
const auto MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY = Gio::Menu::create();
|
||||
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY->append(
|
||||
_("Back"),
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY->append(
|
||||
_("Back"),
|
||||
get_action_detailed_name(
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK
|
||||
)
|
||||
);
|
||||
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY->append(
|
||||
_("Forward"),
|
||||
get_action_detailed_name(
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD
|
||||
)
|
||||
);
|
||||
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION->append_submenu(
|
||||
_("History"),
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY
|
||||
);
|
||||
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION->append(
|
||||
_("Update"),
|
||||
get_action_detailed_name(
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE
|
||||
)
|
||||
);
|
||||
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY->append(
|
||||
_("Forward"),
|
||||
get_action_detailed_name(
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD
|
||||
)
|
||||
);
|
||||
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION->append_submenu(
|
||||
_("History"),
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION_HISTORY
|
||||
MENU__MAIN_TAB_PAGE->append_submenu(
|
||||
_("Navigation"),
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION
|
||||
);
|
||||
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION->append(
|
||||
_("Update"),
|
||||
get_action_detailed_name(
|
||||
ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE
|
||||
)
|
||||
);
|
||||
|
||||
MENU__MAIN_TAB_PAGE->append_submenu(
|
||||
_("Navigation"),
|
||||
MENU__MAIN_TAB_PAGE_NAVIGATION
|
||||
);
|
||||
|
||||
MENU__MAIN_TAB->append_submenu(
|
||||
_("Page"),
|
||||
MENU__MAIN_TAB_PAGE
|
||||
);
|
||||
|
||||
const auto MENU__MAIN_TAB_SESSION = Gio::Menu::create();
|
||||
|
||||
MENU__MAIN_TAB_SESSION->append(
|
||||
_("Restore"),
|
||||
get_action_detailed_name(
|
||||
ACTION__MAIN_TAB_SESSION_RESTORE
|
||||
)
|
||||
);
|
||||
|
||||
MENU__MAIN_TAB_SESSION->append(
|
||||
_("Save"),
|
||||
get_action_detailed_name(
|
||||
ACTION__MAIN_TAB_SESSION_SAVE
|
||||
)
|
||||
);
|
||||
|
||||
MENU__MAIN_TAB->append_submenu(
|
||||
_("Session"),
|
||||
MENU__MAIN_TAB_SESSION
|
||||
);
|
||||
|
||||
const auto MENU__MAIN_TAB_CLOSE = Gio::Menu::create();
|
||||
|
||||
MENU__MAIN_TAB_CLOSE->append(
|
||||
|
@ -25,7 +25,9 @@ namespace app::browser::header
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_CLOSE_ALL,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_PAGE_NAVIGATION_UPDATE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_SESSION_RESTORE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__MAIN_TAB_SESSION_SAVE
|
||||
);
|
||||
};
|
||||
}
|
||||
|
@ -95,6 +95,16 @@ void Main::tab_page_navigation_history_forward()
|
||||
);
|
||||
};
|
||||
|
||||
void Main::tab_restore()
|
||||
{
|
||||
mainTab->restore();
|
||||
};
|
||||
|
||||
void Main::tab_save()
|
||||
{
|
||||
mainTab->save();
|
||||
};
|
||||
|
||||
void Main::shutdown()
|
||||
{
|
||||
mainTab->shutdown();
|
||||
|
@ -49,6 +49,9 @@ namespace app::browser
|
||||
void tab_page_navigation_history_back();
|
||||
void tab_page_navigation_history_forward();
|
||||
|
||||
void tab_restore();
|
||||
void tab_save();
|
||||
|
||||
void shutdown();
|
||||
|
||||
// Getters
|
||||
|
Loading…
x
Reference in New Issue
Block a user