UI/Qt: Add a debug menu item to dump RequestServer connection info

This commit is contained in:
Timothy Flynn 2024-08-03 13:28:07 -04:00 committed by Tim Flynn
parent b1433a8097
commit 96bb8fe944
Notes: github-actions[bot] 2024-08-03 19:54:02 +00:00
5 changed files with 15 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

View file

@ -432,6 +432,11 @@ BrowserWindow::BrowserWindow(Vector<URL::URL> const& initial_urls, WebView::Cook
debug_request("dump-local-storage");
});
auto* dump_connection_info = new QAction("Dump Co&nnection Info", this);
dump_connection_info->setIcon(load_icon_from_uri("resource://icons/16x16/network.png"sv));
debug_menu->addAction(dump_connection_info);
QObject::connect(dump_connection_info, &QAction::triggered, this, &BrowserWindow::dump_connection_info);
debug_menu->addSeparator();
m_show_line_box_borders_action = new QAction("Show Line Box Borders", this);
@ -1227,4 +1232,10 @@ void BrowserWindow::closeEvent(QCloseEvent* event)
QMainWindow::closeEvent(event);
}
void BrowserWindow::dump_connection_info()
{
if (auto& application = static_cast<Application&>(WebView::Application::the()); application.request_server_client)
application.request_server_client->dump_connection_info();
}
}

View file

@ -183,6 +183,8 @@ private:
Web::CSS::PreferredColorScheme m_preferred_color_scheme;
void set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_scheme);
static void dump_connection_info();
QTabWidget* m_tabs_container { nullptr };
Tab* m_current_tab { nullptr };
QMenu* m_zoom_menu { nullptr };

View file

@ -23,6 +23,7 @@ set(16x16_ICONS
history.png
layers.png
layout.png
network.png
new-tab.png
open-parent-directory.png
paste.png

View file

@ -226,6 +226,7 @@ icons_16x16 = [
"//Base/res/icons/16x16/history.png",
"//Base/res/icons/16x16/layers.png",
"//Base/res/icons/16x16/layout.png",
"//Base/res/icons/16x16/network.png",
"//Base/res/icons/16x16/new-tab.png",
"//Base/res/icons/16x16/open-parent-directory.png",
"//Base/res/icons/16x16/paste.png",