Browse Source

update methods namespace

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

8
src/app/browser.cpp

@ -85,18 +85,18 @@ Browser::Browser( @@ -85,18 +85,18 @@ Browser::Browser(
// History
add_action(
"main_tab_page_navigation_history_back",
"main_tab_page_navigation_history_try_back",
[this]
{
browserMain->tab_page_navigation_history_back();
browserMain->tab_page_navigation_history_try_back();
}
);
add_action(
"main_tab_page_navigation_history_forward",
"main_tab_page_navigation_history_try_forward",
[this]
{
browserMain->tab_page_navigation_history_forward();
browserMain->tab_page_navigation_history_try_forward();
}
);

32
src/app/browser/main.cpp

@ -74,18 +74,34 @@ void Main::tab_close_all() @@ -74,18 +74,34 @@ void Main::tab_close_all()
mainTab->close_all();
};
void Main::tab_page_navigation_history_back()
bool Main::tab_page_navigation_history_try_back()
{
mainTab->page_navigation_history_back(
mainTab->get_current_page()
);
const int & PAGE_NUMBER = mainTab->get_current_page();
if (PAGE_NUMBER >= 0)
{
return mainTab->page_navigation_history_try_back(
PAGE_NUMBER
);
}
return false;
};
void Main::tab_page_navigation_history_forward()
bool Main::tab_page_navigation_history_try_forward()
{
mainTab->page_navigation_history_forward(
mainTab->get_current_page()
);
const int & PAGE_NUMBER = mainTab->get_current_page();
if (PAGE_NUMBER >= 0)
{
return mainTab->page_navigation_history_try_forward(
PAGE_NUMBER
);
return true;
}
return false;
};
void Main::refresh()

6
src/app/browser/main.hpp

@ -35,10 +35,12 @@ namespace app::browser @@ -35,10 +35,12 @@ namespace app::browser
void tab_close_left();
void tab_close_right();
void tab_close();
void tab_page_navigation_history_back();
void tab_page_navigation_history_forward();
void tab_update();
bool tab_page_navigation_history_try_back();
bool tab_page_navigation_history_try_forward();
void refresh();
};
}

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

@ -96,20 +96,20 @@ void Tab::close_all() @@ -96,20 +96,20 @@ void Tab::close_all()
}
}
void Tab::page_navigation_history_back(
bool Tab::page_navigation_history_try_back(
const int & PAGE_NUMBER
) {
get_tabPage(
return get_tabPage(
PAGE_NUMBER
)->navigation_history_back();
)->navigation_history_try_back();
}
void Tab::page_navigation_history_forward(
bool Tab::page_navigation_history_try_forward(
const int & PAGE_NUMBER
) {
get_tabPage(
return get_tabPage(
PAGE_NUMBER
)->navigation_history_forward();
)->navigation_history_try_forward();
}
void Tab::refresh(

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

@ -54,11 +54,11 @@ namespace app::browser::main @@ -54,11 +54,11 @@ namespace app::browser::main
void close_right();
void close_all();
void page_navigation_history_back(
bool page_navigation_history_try_back(
const int & PAGE_NUMBER
);
void page_navigation_history_forward(
bool page_navigation_history_try_forward(
const int & PAGE_NUMBER
);

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

@ -73,14 +73,14 @@ Glib::ustring Page::get_subtitle() @@ -73,14 +73,14 @@ Glib::ustring Page::get_subtitle()
}
// Actions
void Page::navigation_history_back()
bool Page::navigation_history_try_back()
{
pageNavigation->history_back();
return pageNavigation->history_try_back();
}
void Page::navigation_history_forward()
bool Page::navigation_history_try_forward()
{
pageNavigation->history_forward();
return pageNavigation->history_try_forward();
}
void Page::refresh(

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 navigation_history_back();
void navigation_history_forward();
bool navigation_history_try_back();
bool navigation_history_try_forward();
void refresh(
const Glib::ustring & TITLE,

12
src/app/browser/main/tab/page/navigation.cpp

@ -87,7 +87,7 @@ Navigation::Navigation( @@ -87,7 +87,7 @@ Navigation::Navigation(
}
// Actions
void Navigation::history_back()
bool Navigation::history_try_back()
{
navigation::History::Memory match;
@ -98,10 +98,14 @@ void Navigation::history_back() @@ -98,10 +98,14 @@ void Navigation::history_back()
);
navigationUpdate->activate();
return true;
}
return false;
}
void Navigation::history_forward()
bool Navigation::history_try_forward()
{
navigation::History::Memory match;
@ -112,7 +116,11 @@ void Navigation::history_forward() @@ -112,7 +116,11 @@ void Navigation::history_forward()
);
navigationUpdate->activate();
return true;
}
return false;
}
void Navigation::history_add(

5
src/app/browser/main/tab/page/navigation.hpp

@ -41,9 +41,8 @@ namespace app::browser::main::tab::page @@ -41,9 +41,8 @@ namespace app::browser::main::tab::page
const Glib::ustring & VALUE
);
void history_back();
void history_forward();
bool history_try_back();
bool history_try_forward();
void refresh();

2
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.main_tab_page_navigation_history_back"
"win.main_tab_page_navigation_history_try_back"
);
set_icon_name(

2
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.main_tab_page_navigation_history_forward"
"win.main_tab_page_navigation_history_try_forward"
);
set_icon_name(

Loading…
Cancel
Save