Browse Source

rename methods

CPP-GTK4
yggverse 2 months ago
parent
commit
f834d783ef
  1. 33
      src/app/browser.cpp
  2. 8
      src/app/browser/main.cpp
  3. 4
      src/app/browser/main.hpp
  4. 8
      src/app/browser/main/tab.cpp
  5. 6
      src/app/browser/main/tab.hpp
  6. 4
      src/app/browser/main/tab/page.cpp
  7. 4
      src/app/browser/main/tab/page.hpp
  8. 11
      src/app/browser/main/tab/page/navigation/history/back.cpp
  9. 11
      src/app/browser/main/tab/page/navigation/history/forward.cpp

33
src/app/browser.cpp

@ -83,6 +83,23 @@ Browser::Browser( @@ -83,6 +83,23 @@ Browser::Browser(
}
);
// History
add_action(
"main_tab_page_navigation_history_back",
[this]
{
browserMain->tab_page_navigation_history_back();
}
);
add_action(
"main_tab_page_navigation_history_forward",
[this]
{
browserMain->tab_page_navigation_history_forward();
}
);
// Tool
add_action(
"debug",
@ -111,20 +128,4 @@ Browser::Browser( @@ -111,20 +128,4 @@ Browser::Browser(
);
}
);
add_action(
"tab_history_back", // @TODO rename
[this]
{
browserMain->tab_history_back();
}
);
add_action(
"tab_history_forward", // @TODO rename
[this]
{
browserMain->tab_history_forward();
}
);
}

8
src/app/browser/main.cpp

@ -74,16 +74,16 @@ void Main::tab_close_all() @@ -74,16 +74,16 @@ void Main::tab_close_all()
mainTab->close_all();
};
void Main::tab_history_back()
void Main::tab_page_navigation_history_back()
{
mainTab->back(
mainTab->page_navigation_history_back(
mainTab->get_current_page()
);
};
void Main::tab_history_forward()
void Main::tab_page_navigation_history_forward()
{
mainTab->forward(
mainTab->page_navigation_history_forward(
mainTab->get_current_page()
);
};

4
src/app/browser/main.hpp

@ -35,8 +35,8 @@ namespace app::browser @@ -35,8 +35,8 @@ namespace app::browser
void tab_close_left();
void tab_close_right();
void tab_close();
void tab_history_back();
void tab_history_forward();
void tab_page_navigation_history_back();
void tab_page_navigation_history_forward();
void tab_update();
void refresh();

8
src/app/browser/main/tab.cpp

@ -96,20 +96,20 @@ void Tab::close_all() @@ -96,20 +96,20 @@ void Tab::close_all()
}
}
void Tab::back(
void Tab::page_navigation_history_back(
const int & PAGE_NUMBER
) {
get_tabPage(
PAGE_NUMBER
)->back();
)->navigation_history_back();
}
void Tab::forward(
void Tab::page_navigation_history_forward(
const int & PAGE_NUMBER
) {
get_tabPage(
PAGE_NUMBER
)->forward();
)->navigation_history_forward();
}
void Tab::refresh(

6
src/app/browser/main/tab.hpp

@ -30,6 +30,7 @@ namespace app::browser::main @@ -30,6 +30,7 @@ namespace app::browser::main
Tab();
// Getters
Glib::ustring get_page_title(
const int & PAGE_NUMBER
);
@ -38,6 +39,7 @@ namespace app::browser::main @@ -38,6 +39,7 @@ namespace app::browser::main
const int & PAGE_NUMBER
);
// Actions
void append(
const Glib::ustring & TITLE,
const Glib::ustring & REQUEST = "",
@ -52,11 +54,11 @@ namespace app::browser::main @@ -52,11 +54,11 @@ namespace app::browser::main
void close_right();
void close_all();
void back(
void page_navigation_history_back(
const int & PAGE_NUMBER
);
void forward(
void page_navigation_history_forward(
const int & PAGE_NUMBER
);

4
src/app/browser/main/tab/page.cpp

@ -73,12 +73,12 @@ Glib::ustring Page::get_subtitle() @@ -73,12 +73,12 @@ Glib::ustring Page::get_subtitle()
}
// Actions
void Page::back()
void Page::navigation_history_back()
{
pageNavigation->history_back();
}
void Page::forward()
void Page::navigation_history_forward()
{
pageNavigation->history_forward();
}

4
src/app/browser/main/tab/page.hpp

@ -54,8 +54,8 @@ namespace app::browser::main::tab @@ -54,8 +54,8 @@ namespace app::browser::main::tab
Glib::ustring get_subtitle();
// Actions
void back();
void forward();
void navigation_history_back();
void navigation_history_forward();
void refresh(
const Glib::ustring & TITLE,

11
src/app/browser/main/tab/page/navigation/history/back.cpp

@ -5,7 +5,7 @@ using namespace app::browser::main::tab::page::navigation::history; @@ -5,7 +5,7 @@ using namespace app::browser::main::tab::page::navigation::history;
Back::Back()
{
set_action_name(
"win.tab_history_back"
"win.main_tab_page_navigation_history_back"
);
set_icon_name(
@ -19,13 +19,4 @@ Back::Back() @@ -19,13 +19,4 @@ Back::Back()
set_sensitive(
false // @TODO no effect by set_action_name
);
signal_clicked().connect(
[this]
{
activate_action(
"win.tab_history_back"
);
}
);
}

11
src/app/browser/main/tab/page/navigation/history/forward.cpp

@ -5,7 +5,7 @@ using namespace app::browser::main::tab::page::navigation::history; @@ -5,7 +5,7 @@ using namespace app::browser::main::tab::page::navigation::history;
Forward::Forward()
{
set_action_name(
"win.tab_history_forward"
"win.main_tab_page_navigation_history_forward"
);
set_icon_name(
@ -19,13 +19,4 @@ Forward::Forward() @@ -19,13 +19,4 @@ Forward::Forward()
set_sensitive(
false // @TODO no effect by set_action_name
);
signal_clicked().connect(
[this]
{
activate_action(
"win.tab_history_forward"
);
}
);
}
Loading…
Cancel
Save