summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-08-17 22:48:01 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-08-18 10:47:39 +0300
commitce06956d314dc8d7080ba96b76f4ee8ad851912a (patch)
treec01cd1d1e61acb7ef11cbc439f120d7540f3add5
parentPass command line from secondary to primary instance (diff)
downloadrekonq-ce06956d314dc8d7080ba96b76f4ee8ad851912a.tar.xz
Show main window
- added Task Manager, showing all plugins, windows and view
-rw-r--r--plugins/webengine/webview.cpp1
-rw-r--r--plugins/webengine/webview.h2
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/application.cpp98
-rw-r--r--src/application.hpp23
-rw-r--r--src/application_instance.cpp8
-rw-r--r--src/mainwindow/rekonqwindow.cpp (renamed from src/tabwindow/rekonqwindow.cpp)111
-rw-r--r--src/mainwindow/rekonqwindow.h65
-rw-r--r--src/mainwindow/rekonqwindow.ui91
-rw-r--r--src/mainwindow/taskmanager.cpp62
-rw-r--r--src/mainwindow/taskmanager.h31
-rw-r--r--src/mainwindow/taskmanager.ui168
-rw-r--r--src/plugins/pluginloader.h4
-rw-r--r--src/plugins/rview.hpp2
-rw-r--r--src/tabwindow/rekonqwindow.h89
15 files changed, 498 insertions, 260 deletions
diff --git a/plugins/webengine/webview.cpp b/plugins/webengine/webview.cpp
index 1aef01e2..fab941a9 100644
--- a/plugins/webengine/webview.cpp
+++ b/plugins/webengine/webview.cpp
@@ -23,3 +23,4 @@ WebView::WebView(const QUrl &url, QWidget *parent) : rView(url, parent), view(ne
connect(view, &QWebEngineView::titleChanged, this, [this](const QString &title) { emit titleChanged(title); });
view->load(url);
}
+QString WebView::title() const { return view->title(); }
diff --git a/plugins/webengine/webview.h b/plugins/webengine/webview.h
index 0b8d0dae..5bb90696 100644
--- a/plugins/webengine/webview.h
+++ b/plugins/webengine/webview.h
@@ -20,6 +20,8 @@ public:
explicit WebView(const QUrl &url = QUrl(), QWidget *parent = nullptr);
~WebView() final = default;
+ QString title() const override;
+
private:
QWebEngineView *view;
};
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f1596ceb..e71d4184 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -217,6 +217,9 @@ ADD_DEFINITIONS ( ${KDE4_DEFINITIONS} )
add_executable(rekonq
main.cpp application.cpp application_instance.cpp application.hpp
# ----------------------------------------
+ mainwindow/rekonqwindow.cpp mainwindow/rekonqwindow.h mainwindow/rekonqwindow.ui
+ mainwindow/taskmanager.cpp mainwindow/taskmanager.h mainwindow/taskmanager.ui
+ # ----------------------------------------
plugins/rplugininterface.hpp plugins/rview.hpp
)
diff --git a/src/application.cpp b/src/application.cpp
index f3bb5559..126eb020 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -38,17 +38,13 @@ Application::~Application()
// saveConfiguration();
// Destroy all windows...
- /*Q_FOREACH(QWeakPointer<RekonqWindow> pointer, m_rekonqWindows)
- {
- delete pointer.data();
- pointer.clear();
- }*/
+ for (const auto &window : m_windows) delete window;
// Destroy all web apps
- for (auto *webApp : m_webApps) delete webApp;
+ for (const auto &view : m_views) delete view;
// Unload all plugins
- for (auto *plugin : m_plugins) {
+ for (const auto &plugin : m_plugins) {
plugin->unload();
delete plugin;
}
@@ -322,74 +318,6 @@ void Application::saveConfiguration() const
// --------------------------------------------------------------------------------------------------------------------
-RekonqWindow *Application::rekonqWindow(const QString & activityID)
-{
- RekonqWindow *active = qobject_cast<RekonqWindow*>(QApplication::activeWindow());
-
- if (!active)
- {
- RekonqWindowList wList = m_rekonqWindows;
-#ifdef HAVE_KACTIVITIES
- wList = tabsForActivity(activityID);
-#endif
-
- if (wList.isEmpty())
- return 0;
-
- Q_FOREACH(const QWeakPointer<RekonqWindow> &pointer, wList)
- {
- if (KWindowInfo(pointer.data()->effectiveWinId(), NET::WMDesktop, 0).isOnCurrentDesktop())
- return pointer.data();
- }
- return wList.at(0).data();
- }
- return active;
-}
-
-
-RekonqWindowList Application::tabsForActivity(const QString & activityID)
-{
-#ifdef HAVE_KACTIVITIES
- QString id = activityID;
- if ( id.isEmpty() )
- id = m_activityConsumer->currentActivity();
-
- return m_activityRekonqWindowsMap[id];
-#else
- return m_rekonqWindows;
-#endif
-}
-
-
-bool Application::haveWindowsForActivity(const QString & activityID)
-{
- return (!tabsForActivity(activityID).isEmpty());
-}
-
-
-// -----------------------------------------------------------------------------------------------------------
-
-
-RekonqWindow *Application::newWindow(bool withTab, bool PrivateBrowsingMode)
-{
- RekonqWindow *w = new RekonqWindow(withTab, PrivateBrowsingMode);
- setWindowInfo(w);
- w->show();
-
- return w;
-}
-
-
-RekonqWindow *Application::newWindow(WebPage *pg)
-{
- RekonqWindow *w = new RekonqWindow(pg);
- setWindowInfo(w);
- w->show();
-
- return w;
-}
-
-
void Application::setWindowInfo(RekonqWindow *w)
{
// set object name
@@ -410,10 +338,19 @@ void Application::setWindowInfo(RekonqWindow *w)
// -----------------------------------------------------------------------------------------------------------
// Slots
-rView *Application::newWebApp(const QUrl &url)
+RekonqWindow *Application::newWindow()
+{
+ auto *window = new RekonqWindow;
+ m_windows.append(window);
+
+ window->show();
+ return window;
+}
+
+rView *Application::newView(const QUrl &url, RekonqWindow *window)
{
RekonqPluginInterface *interface = nullptr;
- for (auto *plugin : m_plugins)
+ for (const auto &plugin : m_plugins)
if (plugin->hasScheme(url.scheme())) {
interface = plugin->interface();
break;
@@ -425,9 +362,12 @@ rView *Application::newWebApp(const QUrl &url)
Q_CHECK_PTR(view);
// tab->installEventFilter(this);
- m_webApps.append(view);
+ if (window) window->addView(view);
+ else {
+ m_views.append(view);
+ view->show();
+ }
- view->show();
return view;
}
diff --git a/src/application.hpp b/src/application.hpp
index e74350f1..ce4bbfd1 100644
--- a/src/application.hpp
+++ b/src/application.hpp
@@ -11,7 +11,9 @@
#pragma once
+#include "mainwindow/rekonqwindow.h"
#include "rekonq.hpp"
+#include <QPointer>
#include <QUrl>
#include <QWidget>
#include <SingleApplication>
@@ -19,13 +21,13 @@
// Forward Declarations
class rView;
class PluginLoader;
-// class RekonqWindow;
// class WebTab;
// class WebPage;
-// typedef QList< QWeakPointer<RekonqWindow> > RekonqWindowList;
-// typedef QList<WebTab *> WebAppList;
+typedef QList<QPointer<PluginLoader>> RekonqPluginList;
+typedef QList<QPointer<RekonqWindow>> RekonqWindowList;
+typedef QList<QPointer<rView>> RekonqViewList;
// ---------------------------------------------------------------------------------------------------------------
@@ -40,12 +42,14 @@ public:
~Application() override;
bool registerPlugin(const QString &path);
+ [[nodiscard]] auto pluginList() const { return m_plugins; };
// int newInstance();
- [[deprecated]] static Application *instance() { return (qobject_cast<Application *>(QCoreApplication::instance())); }
+ static Application *instance() { return (qobject_cast<Application *>(QCoreApplication::instance())); }
// RekonqWindow *rekonqWindow(const QString &activityID = QString());
- // RekonqWindowList rekonqWindowList();
+ [[nodiscard]] auto windowList() const { return m_windows; }
+ [[nodiscard]] auto viewList() const { return m_views; }
/**
* @returns the list of windows associated with activity whose id is @param activityID
@@ -90,7 +94,8 @@ public slots:
// RekonqWindow *newWindow(bool withTab = true, bool PrivateBrowsingMode = false);
// RekonqWindow *newWindow(WebPage *pg);
- rView *newWebApp(const QUrl &url = QUrl());
+ RekonqWindow *newWindow();
+ rView *newView(const QUrl &url = QUrl(), RekonqWindow *window = nullptr);
// void createWebAppShortcut(const QString & urlString = QString(), const QString & titleString = QString());
@@ -117,7 +122,7 @@ private slots:
// void pageCreated(WebPage *);
private:
- QList<PluginLoader *> m_plugins;
- // RekonqWindowList m_rekonqWindows;
- QList<rView *> m_webApps;
+ RekonqPluginList m_plugins;
+ RekonqWindowList m_windows;
+ RekonqViewList m_views;
};
diff --git a/src/application_instance.cpp b/src/application_instance.cpp
index c2005acd..42c77dc1 100644
--- a/src/application_instance.cpp
+++ b/src/application_instance.cpp
@@ -45,6 +45,10 @@ void Application::parseCommandLine(int instanceId, const QByteArray &message)
const auto positionalArguments = parser.positionalArguments();
if (parser.isSet(options_webapp))
- positionalArguments.isEmpty() ? this->newWebApp()
- : this->newWebApp(QUrl::fromUserInput(positionalArguments.first()));
+ positionalArguments.isEmpty() ? this->newView() : this->newView(QUrl::fromUserInput(positionalArguments.first()));
+ else {
+ // create main window
+ auto *window = newWindow();
+ for (const auto &url : positionalArguments) newView(QUrl::fromUserInput(url), window);
+ }
}
diff --git a/src/tabwindow/rekonqwindow.cpp b/src/mainwindow/rekonqwindow.cpp
index 98f60f30..d912bf2a 100644
--- a/src/tabwindow/rekonqwindow.cpp
+++ b/src/mainwindow/rekonqwindow.cpp
@@ -1,79 +1,36 @@
/* ============================================================
-*
-* This file is a part of the rekonq project
-*
-* Copyright (C) 2013 by Andrea Diamantini <adjam7 at gmail dot com>
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License as
-* published by the Free Software Foundation; either version 2 of
-* the License or (at your option) version 3 or any later version
-* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
-* defined in Section 14 of version 3 of the license.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* ============================================================ */
-
-
-// Self Includes
-#include "rekonqwindow.h"
-#include "rekonqwindow.moc"
-
-// Auto Includes
-#include "rekonq.h"
-
-// Local Includes
-#include "application.h"
-
-#include "tabwidget.h"
-#include "tabbar.h"
-#include "rekonqfactory.h"
-
-#include "webpage.h"
-#include "webwindow.h"
-
-// KDE Includes
-#include <KUrl>
-#include <KLocalizedString>
-
-// Qt Includes
-#include <QVBoxLayout>
-#include <QSizePolicy>
-#include <QDBusConnection>
-
-
-RekonqWindow::RekonqWindow(bool withTab, bool privateBrowsingMode, QWidget *parent)
- : RWindow(parent)
- , _tabWidget(new TabWidget(withTab, privateBrowsingMode, this))
- , _splitter(new QSplitter(this))
-{
- init();
-}
+ * The rekonq project
+ * ============================================================
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright (C) 2013 by Andrea Diamantini <adjam7 at gmail dot com>
+ * SPDX-License-Identifier: GPL-3.0-only
+ * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
+ * ============================================================
+ * Description: Main Window class
+ * ============================================================ */
+#include "rekonqwindow.h"
+#include "../plugins/rview.hpp"
+#include "application.hpp"
+#include "taskmanager.h"
+#include "ui_rekonqwindow.h"
-RekonqWindow::RekonqWindow(WebPage *pg, QWidget *parent)
- : RWindow(parent)
- , _tabWidget(new TabWidget(pg, this))
- , _splitter(new QSplitter(this))
+RekonqWindow::RekonqWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::RekonqWindow)
{
- init();
+ ui->setupUi(this);
+ connect(ui->actionTaskManager, &QAction::triggered, this, [this]() { (new TaskManager(this))->show(); });
}
+RekonqWindow::~RekonqWindow() { delete ui; }
-RekonqWindow::~RekonqWindow()
+void RekonqWindow::addView(rView *view)
{
+ const auto tabId = ui->tabWidget->addTab(view, view->title());
+ connect(view, &rView::titleChanged, this,
+ [this, tabId](const QString &title) { ui->tabWidget->setTabText(tabId, title); });
}
-
+/*
void RekonqWindow::init()
{
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
@@ -84,7 +41,7 @@ void RekonqWindow::init()
if (ReKonfig::showBookmarksPanel())
showBookmarksPanel(true);
-
+
if (ReKonfig::showHistoryPanel())
showHistoryPanel(true);
@@ -95,21 +52,12 @@ void RekonqWindow::init()
// fix focus handling
setFocusProxy(_tabWidget);
-
+
// signals
connect(_tabWidget, SIGNAL(closeWindow()), this, SLOT(close()));
connect(_tabWidget, SIGNAL(windowTitleChanged(QString)), this, SLOT(setWindowTitle(QString)));
}
-
-void RekonqWindow::registerWindow()
-{
- // This is needed to properly support appmenu-qt feature
- RekonqFactory::createWidget(QL1S("menuBar"), this);
- QDBusConnection::sessionBus().registerObject(QL1S("/rekonq"), this);
-}
-
-
// --------------------------------------------------------------------------------------------------
@@ -168,7 +116,8 @@ void RekonqWindow::showBookmarksPanel(bool on)
if (_bookmarksPanel.isNull())
{
_bookmarksPanel = new BookmarksPanel(i18n("Bookmarks Panel"), this);
- connect(_bookmarksPanel.data(), SIGNAL(openUrl(KUrl,Rekonq::OpenType)), this, SLOT(loadUrl(KUrl,Rekonq::OpenType)));
+ connect(_bookmarksPanel.data(), SIGNAL(openUrl(KUrl,Rekonq::OpenType)), this,
+SLOT(loadUrl(KUrl,Rekonq::OpenType)));
QAction *a = _tabWidget->actionByName(QL1S("show_bookmarks_panel"));
connect(_bookmarksPanel.data(), SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool)));
@@ -192,8 +141,9 @@ void RekonqWindow::showHistoryPanel(bool 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)));
-
+ 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)));
@@ -208,3 +158,4 @@ void RekonqWindow::showHistoryPanel(bool on)
_historyPanel.clear();
}
}
+*/ \ No newline at end of file
diff --git a/src/mainwindow/rekonqwindow.h b/src/mainwindow/rekonqwindow.h
new file mode 100644
index 00000000..73d58c04
--- /dev/null
+++ b/src/mainwindow/rekonqwindow.h
@@ -0,0 +1,65 @@
+/* ============================================================
+ * The rekonq project
+ * ============================================================
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright (C) 2013 by Andrea Diamantini <adjam7 at gmail dot com>
+ * SPDX-License-Identifier: GPL-3.0-only
+ * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
+ * ============================================================
+ * Description: Main Window class
+ * ============================================================ */
+
+#pragma once
+
+#include "rekonq.hpp"
+//#include "rwindow.h"
+//#include "tabwidget.h"
+//#include "bookmarkspanel.h"
+//#include "historypanel.h"
+#include <QMainWindow>
+#include <QSplitter>
+
+// Forward Declarations
+class rView;
+// class TabBar;
+// class WebPage;
+// class WebWindow;
+
+namespace Ui {
+class RekonqWindow;
+}
+
+class RekonqWindow : public QMainWindow {
+ Q_OBJECT
+
+public:
+ explicit RekonqWindow(QWidget *parent = nullptr);
+ // explicit RekonqWindow(WebPage *pg, QWidget *parent = 0);
+ ~RekonqWindow() override;
+
+ // TabWidget *tabWidget();
+ // TabBar *tabBar();
+ // WebWindow *currentWebWindow() const;
+
+ // bool isPrivateBrowsingMode();
+
+private:
+ // void init();
+
+public slots:
+ void addView(rView *view);
+ // void loadUrl(const KUrl &, Rekonq::OpenType type = Rekonq::CurrentTab, TabHistory *history = 0);
+
+private slots:
+ // void showBookmarksPanel(bool);
+ // void showHistoryPanel(bool);
+
+private:
+ Ui::RekonqWindow *ui;
+ // TabWidget *_tabWidget;
+
+ QSplitter *_splitter = nullptr;
+
+ // QWeakPointer<HistoryPanel> _historyPanel;
+ // QWeakPointer<BookmarksPanel> _bookmarksPanel;
+};
diff --git a/src/mainwindow/rekonqwindow.ui b/src/mainwindow/rekonqwindow.ui
new file mode 100644
index 00000000..9df36cf2
--- /dev/null
+++ b/src/mainwindow/rekonqwindow.ui
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RekonqWindow</class>
+ <widget class="QMainWindow" name="RekonqWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>600</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QTabWidget" name="tabWidget"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menurekonq">
+ <property name="title">
+ <string>rekonq</string>
+ </property>
+ <addaction name="actionTaskManager"/>
+ <addaction name="separator"/>
+ <addaction name="actionCloseWindow"/>
+ </widget>
+ <addaction name="menurekonq"/>
+ </widget>
+ <widget class="QStatusBar" name="statusbar"/>
+ <action name="actionTaskManager">
+ <property name="text">
+ <string>Task Manager</string>
+ </property>
+ <property name="shortcut">
+ <string>F12</string>
+ </property>
+ </action>
+ <action name="actionCloseWindow">
+ <property name="text">
+ <string>Close Window</string>
+ </property>
+ </action>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>actionCloseWindow</sender>
+ <signal>triggered()</signal>
+ <receiver>RekonqWindow</receiver>
+ <slot>close()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>399</x>
+ <y>299</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/src/mainwindow/taskmanager.cpp b/src/mainwindow/taskmanager.cpp
new file mode 100644
index 00000000..9025f461
--- /dev/null
+++ b/src/mainwindow/taskmanager.cpp
@@ -0,0 +1,62 @@
+/* ============================================================
+ * The rekonq project
+ * ============================================================
+ * SPDX-License-Identifier: GPL-3.0-only
+ * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
+ * ============================================================
+ * Description: Task Manager
+ * ============================================================ */
+
+#include "taskmanager.h"
+#include "application.hpp"
+#include "plugins/pluginloader.h"
+#include "ui_taskmanager.h"
+
+TaskManager::TaskManager(QWidget *parent) : QDialog(parent), ui(new Ui::TaskManager)
+{
+ ui->setupUi(this);
+ ui->pluginStateBox->setVisible(false);
+
+ auto *app = Application::instance();
+
+ // Plugins Tab
+ auto pluginList = app->pluginList();
+ for (auto &plugin : pluginList) {
+ auto *item = new QListWidgetItem(plugin->fileName(), ui->plugins);
+ item->setData(Qt::UserRole, QVariant::fromValue(plugin));
+ }
+ connect(ui->plugins, &QListWidget::itemClicked, this, &TaskManager::showPluginDetails);
+ connect(ui->pluginState, &QPushButton::clicked, [this](bool checked) {
+ auto *item = ui->plugins->currentItem();
+ auto plugin = item->data(Qt::UserRole).value<QPointer<PluginLoader>>();
+ Q_CHECK_PTR(plugin);
+
+ if (checked) plugin->load();
+ else
+ plugin->unload();
+
+ showPluginDetails(item);
+ });
+
+ // Windows Tab
+ const auto windowList = app->windowList();
+ for (const auto &window : windowList) ui->windows->addItem(window->windowTitle());
+
+ // Views Tab
+ const auto viewList = app->viewList();
+ for (const auto &view : viewList) ui->views->addItem(view->title());
+}
+
+TaskManager::~TaskManager() { delete ui; }
+
+void TaskManager::showPluginDetails(QListWidgetItem *item)
+{
+ auto plugin = item->data(Qt::UserRole).value<QPointer<PluginLoader>>();
+ Q_CHECK_PTR(plugin);
+
+ ui->pluginStateBox->setVisible(true);
+ ui->pluginState->setText(plugin->isLoaded() ? tr("Loaded") : tr("Not loaded"));
+ ui->pluginState->setChecked(plugin->isLoaded());
+ ui->pluginError->setText(plugin->errorString());
+ ui->pluginSchemes->setText(plugin->schemes().join(' '));
+} \ No newline at end of file
diff --git a/src/mainwindow/taskmanager.h b/src/mainwindow/taskmanager.h
new file mode 100644
index 00000000..073464b9
--- /dev/null
+++ b/src/mainwindow/taskmanager.h
@@ -0,0 +1,31 @@
+/* ============================================================
+ * The rekonq project
+ * ============================================================
+ * SPDX-License-Identifier: GPL-3.0-only
+ * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
+ * ============================================================
+ * Description: Task Manager
+ * ============================================================ */
+
+#pragma once
+
+#include <QDialog>
+
+namespace Ui {
+class TaskManager;
+}
+
+class QListWidgetItem;
+class TaskManager : public QDialog {
+ Q_OBJECT
+
+public:
+ explicit TaskManager(QWidget *parent = nullptr);
+ ~TaskManager() override;
+
+private slots:
+ void showPluginDetails(QListWidgetItem *item);
+
+private:
+ Ui::TaskManager *ui;
+};
diff --git a/src/mainwindow/taskmanager.ui b/src/mainwindow/taskmanager.ui
new file mode 100644
index 00000000..8242e43c
--- /dev/null
+++ b/src/mainwindow/taskmanager.ui
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>TaskManager</class>
+ <widget class="QDialog" name="TaskManager">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>600</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Task Manager</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="plugins_tab">
+ <attribute name="title">
+ <string>Plugins</string>
+ </attribute>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QListWidget" name="plugins">
+ <property name="editTriggers">
+ <set>QAbstractItemView::NoEditTriggers</set>
+ </property>
+ <property name="selectionBehavior">
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="pluginStateBox">
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Plugin State</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="pluginState_label">
+ <property name="text">
+ <string>State</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QPushButton" name="pluginState">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="pluginError_label">
+ <property name="text">
+ <string>Error</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="pluginError">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="pluginSchemes_label">
+ <property name="text">
+ <string>Schemes</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="pluginSchemes">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="windows_tab">
+ <attribute name="title">
+ <string>Windows</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QListWidget" name="windows"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="views_tab">
+ <attribute name="title">
+ <string>Views</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QListWidget" name="views"/>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Close</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>TaskManager</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>TaskManager</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/src/plugins/pluginloader.h b/src/plugins/pluginloader.h
index f764da9f..319e985a 100644
--- a/src/plugins/pluginloader.h
+++ b/src/plugins/pluginloader.h
@@ -16,7 +16,9 @@ class PluginLoader : public QPluginLoader {
public:
explicit PluginLoader(const QString &path, QObject *parent = nullptr);
- [[nodiscard]] bool hasScheme(const QString &scheme) { return m_schemes.contains(scheme); }
+
+ [[nodiscard]] auto schemes() const { return m_schemes; }
+ [[nodiscard]] bool hasScheme(const QString &scheme) const { return m_schemes.contains(scheme); }
[[nodiscard]] RekonqPluginInterface *interface() { return qobject_cast<RekonqPluginInterface *>(instance()); }
diff --git a/src/plugins/rview.hpp b/src/plugins/rview.hpp
index 71bf5ddf..6f0652d5 100644
--- a/src/plugins/rview.hpp
+++ b/src/plugins/rview.hpp
@@ -18,6 +18,8 @@ class rView : public QWidget {
public:
explicit rView(const QUrl &url = QUrl(), QWidget *parent = nullptr) : QWidget(parent) {}
+ [[nodiscard]] virtual QString title() const = 0;
+
signals:
void iconChanged(const QIcon &);
void urlChanged(const QUrl &);
diff --git a/src/tabwindow/rekonqwindow.h b/src/tabwindow/rekonqwindow.h
deleted file mode 100644
index 0166d0d0..00000000
--- a/src/tabwindow/rekonqwindow.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ============================================================
-*
-* This file is a part of the rekonq project
-*
-* Copyright (C) 2013 by Andrea Diamantini <adjam7 at gmail dot com>
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License as
-* published by the Free Software Foundation; either version 2 of
-* the License or (at your option) version 3 or any later version
-* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
-* defined in Section 14 of version 3 of the license.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* ============================================================ */
-
-
-
-#ifndef REKONQ_WINDOW_H
-#define REKONQ_WINDOW_H
-
-
-// Rekonq Includes
-#include "rekonq_defines.h"
-
-// Local Includes
-#include "rwindow.h"
-#include "tabwidget.h"
-
-#include "bookmarkspanel.h"
-#include "historypanel.h"
-
-// Qt Includes
-#include <QSplitter>
-#include <QWeakPointer>
-
-// Forward Declarations
-class TabBar;
-
-class WebPage;
-class WebWindow;
-
-
-class RekonqWindow : public RWindow
-{
- Q_OBJECT
-
-public:
- explicit RekonqWindow(bool withTab = true, bool PrivateBrowsingMode = false, QWidget *parent = 0);
- explicit RekonqWindow(WebPage *pg, QWidget *parent = 0);
-
- virtual ~RekonqWindow();
-
- TabWidget *tabWidget();
- TabBar *tabBar();
- WebWindow *currentWebWindow() const;
-
- bool isPrivateBrowsingMode();
-
-private:
- void init();
-
-public Q_SLOTS:
- void loadUrl(const KUrl &, Rekonq::OpenType type = Rekonq::CurrentTab, TabHistory *history = 0);
-
-private Q_SLOTS:
- void showBookmarksPanel(bool);
- void showHistoryPanel(bool);
- void registerWindow();
-
-private:
- TabWidget *_tabWidget;
-
- QSplitter *_splitter;
-
- QWeakPointer<HistoryPanel> _historyPanel;
- QWeakPointer<BookmarksPanel> _bookmarksPanel;
-};
-
-#endif // REKONQ_WINDOW_H