1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +00:00

Ladybird/Qt: Remove the standalone JavaScript console

This commit is contained in:
Timothy Flynn 2023-12-01 07:07:01 -05:00 committed by Andreas Kling
parent b385a44f6f
commit c4daaa9902
7 changed files with 2 additions and 223 deletions

View file

@ -8,7 +8,6 @@
*/
#include "BrowserWindow.h"
#include "ConsoleWidget.h"
#include "Icon.h"
#include "Settings.h"
#include "SettingsDialog.h"
@ -174,16 +173,6 @@ BrowserWindow::BrowserWindow(Vector<URL> const& initial_urls, WebView::CookieJar
}
});
auto* js_console_action = new QAction("Show &JS Console", this);
js_console_action->setIcon(load_icon_from_uri("resource://icons/16x16/filetype-javascript.png"sv));
js_console_action->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_J));
inspect_menu->addAction(js_console_action);
QObject::connect(js_console_action, &QAction::triggered, this, [this] {
if (m_current_tab) {
m_current_tab->show_console_window();
}
});
auto* inspector_action = new QAction("Open &Inspector", this);
inspector_action->setIcon(load_icon_from_uri("resource://icons/browser/dom-tree.png"sv));
inspector_action->setShortcut(QKeySequence("Ctrl+Shift+I"));
@ -658,10 +647,7 @@ void BrowserWindow::select_all()
if (!m_current_tab)
return;
if (auto* console = m_current_tab->console(); console && console->isActiveWindow())
console->view().select_all();
else
m_current_tab->view().select_all();
m_current_tab->view().select_all();
}
void BrowserWindow::update_displayed_zoom_level()
@ -676,12 +662,7 @@ void BrowserWindow::copy_selected_text()
if (!m_current_tab)
return;
DeprecatedString text;
if (auto* console = m_current_tab->console(); console && console->isActiveWindow())
text = console->view().selected_text();
else
text = m_current_tab->view().selected_text();
auto text = m_current_tab->view().selected_text();
auto* clipboard = QGuiApplication::clipboard();
clipboard->setText(qstring_from_ak_deprecated_string(text));