/* ============================================================ * The rekonq project * ============================================================ * SPDX-License-Identifier: GPL-2.0-or-later * Copyright (C) 2013 by Andrea Diamantini * SPDX-License-Identifier: GPL-3.0-only * Copyright (C) 2022 aqua * ============================================================ */ #include "rekonqwindow.hpp" #include "application.hpp" #include "ui_rekonqwindow.h" #include #include // -------------------------------------------------------------------------------------------------- int RekonqWindow::addView(RekonqView *view) { Q_CHECK_PTR(view); ui->views->addWidget(view); return ui->tabToolBar->addView(view); } void RekonqWindow::loadDefaultUrl(rekonq::DefaultUrl url, rekonq::OpenType type) { auto *settings = Application::instance()->settings(); switch (url) { case rekonq::NewTabPage: loadRequestedUrl(settings->value("newtab").toUrl(), type); break; case rekonq::HomePage: loadRequestedUrl(settings->value("homepage").toUrl(), type); break; case rekonq::AboutBlank: loadRequestedUrl(QUrl("about:blank"), type); break; } } void RekonqWindow::loadRequestedUrl(const QUrl &url, rekonq::OpenType type) { switch (type) { case rekonq::CurrentTab: ui->tabToolBar->currentView()->load(url); break; case rekonq::NewTab: Application::instance()->newView(url, this); break; case rekonq::NewFocusedTab: ui->tabToolBar->setCurrentView(Application::instance()->newView(url, this)); break; case rekonq::NewBackGroundTab: break; case rekonq::NewWindow: break; case rekonq::NewPrivateWindow: break; case rekonq::WebApp: Application::instance()->newView(url, nullptr); break; } } // -------------------------------------------------------------------------------------------------- /* void RekonqWindow::showHistoryPanel(bool on) { if (on) { if (_historyPanel.isNull()) { _historyPanel = new HistoryPanel(i18n("History Panel"), this); connect(_historyPanel.data(), SIGNAL(openUrl(KUrl,Rekonq::OpenType)), this, SLOT(loadUrl(KUrl,Rekonq::OpenType))); QAction *a = _tabWidget->actionByName(QL1S("show_history_panel")); connect(_historyPanel.data(), SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool))); } _splitter->insertWidget(0, _historyPanel.data()); _historyPanel.data()->show(); } else { _historyPanel.data()->hide(); delete _historyPanel.data(); _historyPanel.clear(); } } */