aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt12
-rw-r--r--lib/navigation/CMakeLists.txt2
-rw-r--r--lib/navigation/navigationbutton.cpp138
-rw-r--r--lib/navigation/navigationbutton.h48
-rw-r--r--src/browser.cpp2
-rw-r--r--src/forms/searchform.cpp2
-rw-r--r--src/main.cpp2
-rw-r--r--src/mainwindow/mainwindow.cpp (renamed from src/mainwindow.cpp)22
-rw-r--r--src/mainwindow/mainwindow.h (renamed from src/mainwindow.h)6
-rw-r--r--src/mainwindow/mainwindow.ui (renamed from src/mainwindow.ui)0
-rw-r--r--src/mainwindow/widgets/loadingbar.cpp50
-rw-r--r--src/mainwindow/widgets/loadingbar.h (renamed from src/widgets/loadingbar.h)13
-rw-r--r--src/mainwindow/widgets/navigationbar.cpp115
-rw-r--r--src/mainwindow/widgets/navigationbar.h55
-rw-r--r--src/webengine/webview.cpp23
-rw-r--r--src/webengine/webview.h7
-rw-r--r--src/widgets/loadingbar.cpp39
-rw-r--r--src/widgets/mainwindowmenubar.cpp2
-rw-r--r--src/widgets/mainwindowtabbar.cpp2
19 files changed, 273 insertions, 267 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 589ccfb..bb0c2ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,11 +66,11 @@ set(SourceCode
# main window
# todo: move all to src/mainwindow
- "src/mainwindow.cpp"
- "src/mainwindow.h"
- "src/mainwindow.ui"
- "src/widgets/loadingbar.cpp"
- "src/widgets/loadingbar.h"
+ src/mainwindow/mainwindow.cpp
+ src/mainwindow/mainwindow.h
+ src/mainwindow/mainwindow.ui
+ src/mainwindow/widgets/loadingbar.cpp
+ src/mainwindow/widgets/loadingbar.h
"src/widgets/mainwindowmenubar.cpp"
"src/widgets/mainwindowmenubar.h"
"src/widgets/mainwindowtabbar.cpp"
@@ -104,7 +104,7 @@ set(SourceCode
# plugin interfaces
plugins/interfaces.h
- )
+ src/mainwindow/widgets/navigationbar.cpp src/mainwindow/widgets/navigationbar.h)
add_executable(poi ${SourceCode})
diff --git a/lib/navigation/CMakeLists.txt b/lib/navigation/CMakeLists.txt
index a81818e..4f0208b 100644
--- a/lib/navigation/CMakeLists.txt
+++ b/lib/navigation/CMakeLists.txt
@@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.1.0)
add_library(navigation
- navigationbutton.cpp
- navigationbutton.h
urllineedit.cpp
urllineedit.h)
diff --git a/lib/navigation/navigationbutton.cpp b/lib/navigation/navigationbutton.cpp
deleted file mode 100644
index 577c291..0000000
--- a/lib/navigation/navigationbutton.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * This file is part of smolbote. It's copyrighted by the contributors recorded
- * in the version control history of the file, available from its original
- * location: git://neueland.iserlohn-fortress.net/smolbote.git
- *
- * SPDX-License-Identifier: GPL-3.0
- */
-
-#include "navigationbutton.h"
-
-#include <QStyle>
-#include <QWebEngineHistory>
-
-NavigationButton::NavigationButton(Type type, QWidget *parent)
- : QToolButton(parent)
-{
- m_type = type;
- menu = new QMenu(this);
-
- switch(type) {
- case BackButton:
- setIcon(style()->standardIcon(QStyle::SP_ArrowBack));
- setMenu(menu);
- connect(menu, &QMenu::aboutToShow, this, &NavigationButton::prepareMenu);
- break;
- case ForwardButton:
- setIcon(style()->standardIcon(QStyle::SP_ArrowForward));
- setMenu(menu);
- connect(menu, &QMenu::aboutToShow, this, &NavigationButton::prepareMenu);
- break;
- case ReloadButton:
- setIcon(style()->standardIcon(QStyle::SP_BrowserReload));
- break;
- case StopButton:
- setIcon(style()->standardIcon(QStyle::SP_BrowserStop));
- break;
- }
-
- connect(this, &NavigationButton::clicked, this, &NavigationButton::doAction);
-}
-
-void NavigationButton::setView(WebView *view)
-{
- disconnect(loadStartedConnection);
- disconnect(loadFinishedConnection);
-
- m_view = view;
- if(m_type == BackButton || m_type == ForwardButton) {
- updateOnLoadFinished();
- }
-
- loadStartedConnection = connect(view, &WebView::loadStarted, this, &NavigationButton::updateOnLoadStarted);
- loadFinishedConnection = connect(view, &WebView::loadFinished, this, &NavigationButton::updateOnLoadFinished);
-}
-
-void NavigationButton::updateOnLoadStarted()
-{
- switch(m_type) {
- case BackButton:
- break;
- case ForwardButton:
- break;
- case ReloadButton:
- m_type = StopButton;
- setIcon(style()->standardIcon(QStyle::SP_BrowserStop));
- break;
- case StopButton:
- break;
- }
-}
-
-void NavigationButton::updateOnLoadFinished()
-{
- switch(m_type) {
- case BackButton:
- if(m_view->history()->canGoBack()) {
- setEnabled(true);
- } else {
- setEnabled(false);
- }
- break;
- case ForwardButton:
- if(m_view->history()->canGoForward()) {
- setEnabled(true);
- } else {
- setEnabled(false);
- }
- break;
- case ReloadButton:
- break;
- case StopButton:
- m_type = ReloadButton;
- setIcon(style()->standardIcon(QStyle::SP_BrowserReload));
- break;
- }
-}
-
-void NavigationButton::doAction()
-{
- switch(m_type) {
- case BackButton:
- m_view->history()->back();
- break;
- case ForwardButton:
- m_view->history()->forward();
- break;
- case ReloadButton:
- m_view->reload();
- break;
- case StopButton:
- m_view->stop();
- break;
- }
-}
-
-void NavigationButton::prepareMenu()
-{
- menu->clear();
-
- QList<QWebEngineHistoryItem> items;
- switch(m_type) {
- case BackButton:
- items = m_view->history()->backItems(10);
- break;
- case ForwardButton:
- items = m_view->history()->forwardItems(10);
- break;
- default:
- break;
- }
-
- for(const QWebEngineHistoryItem &i : qAsConst(items)) {
- QAction *a = menu->addAction(i.title());
- connect(a, &QAction::triggered, this, [i, this]() {
- m_view->history()->goToItem(i);
- });
- }
-}
diff --git a/lib/navigation/navigationbutton.h b/lib/navigation/navigationbutton.h
deleted file mode 100644
index e0d358a..0000000
--- a/lib/navigation/navigationbutton.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is part of smolbote. It's copyrighted by the contributors recorded
- * in the version control history of the file, available from its original
- * location: git://neueland.iserlohn-fortress.net/smolbote.git
- *
- * SPDX-License-Identifier: GPL-3.0
- */
-
-#ifndef NAVIGATIONBUTTON_H
-#define NAVIGATIONBUTTON_H
-
-#include "../../src/webengine/webview.h"
-#include <QToolButton>
-
-class QMenu;
-
-class NavigationButton : public QToolButton
-{
- Q_OBJECT
-public:
- enum Type {
- BackButton,
- ForwardButton,
- ReloadButton,
- StopButton
- };
-
- explicit NavigationButton(Type type, QWidget *parent = nullptr);
-
- void setView(WebView *view);
-
-signals:
-
-private slots:
- void updateOnLoadStarted();
- void updateOnLoadFinished();
- void doAction();
- void prepareMenu();
-
-private:
- Type m_type;
- QMenu *menu;
- WebView *m_view;
-
- QMetaObject::Connection loadStartedConnection, loadFinishedConnection;
-};
-
-#endif // NAVIGATIONBUTTON_H
diff --git a/src/browser.cpp b/src/browser.cpp
index 1e07a95..3d2bec0 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -7,7 +7,7 @@
*/
#include "browser.h"
-#include "mainwindow.h"
+#include "src/mainwindow/mainwindow.h"
#include "webengine/urlinterceptor.h"
#include <QtConcurrent>
#include <bookmarks/bookmarkswidget.h>
diff --git a/src/forms/searchform.cpp b/src/forms/searchform.cpp
index 42e5a1a..bed0dc5 100644
--- a/src/forms/searchform.cpp
+++ b/src/forms/searchform.cpp
@@ -7,7 +7,7 @@
*/
#include "searchform.h"
-#include "../mainwindow.h"
+#include "src/mainwindow/mainwindow.h"
#include "ui_searchform.h"
#include <settings/configuration.h>
diff --git a/src/main.cpp b/src/main.cpp
index 0452fdd..62f6757 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -7,7 +7,7 @@
*/
#include "browser.h"
-#include "mainwindow.h"
+#include "src/mainwindow/mainwindow.h"
#include "version.h"
#include <QCommandLineParser>
#include <QDir>
diff --git a/src/mainwindow.cpp b/src/mainwindow/mainwindow.cpp
index 4306afd..018ff64 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow/mainwindow.cpp
@@ -7,7 +7,6 @@
*/
#include "mainwindow.h"
-#include "browser.h"
#include "forms/aboutdialog.h"
#include "forms/searchform.h"
#include "ui_mainwindow.h"
@@ -57,22 +56,9 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> config, QWidget *parent)
insertToolBarBreak(ui->navigationToolBar);
// page actions
- m_backButton = new NavigationButton(NavigationButton::BackButton, this);
+ m_navigationBar = new NavigationBar(this);
+ m_navigationBar->addWidgetsTo(ui->navigationToolBar);
- m_forwardButton = new NavigationButton(NavigationButton::ForwardButton, this);
-
- m_reloadButton = new NavigationButton(NavigationButton::ReloadButton, this);
-
- QToolButton *homepageButton = new QToolButton(this);
- homepageButton->setIcon(style()->standardIcon(QStyle::SP_DirHomeIcon));
- connect(homepageButton, &QToolButton::clicked, this, [&]() {
- tabBar->currentView()->load(m_profile->homepage());
- });
-
- ui->navigationToolBar->addWidget(m_backButton);
- ui->navigationToolBar->addWidget(m_forwardButton);
- ui->navigationToolBar->addWidget(m_reloadButton);
- ui->navigationToolBar->addWidget(homepageButton);
ui->navigationToolBar->addWidget(m_addressBar);
// connect signals
@@ -282,9 +268,7 @@ void MainWindow::handleTabChanged(WebView *view)
setCentralWidget(view);
// connect signals
- m_backButton->setView(view);
- m_forwardButton->setView(view);
- m_reloadButton->setView(view);
+ m_navigationBar->connectWebView(view);
connect(view, &WebView::urlChanged, m_addressBar, &UrlLineEdit::setUrl);
m_addressBar->setUrl(view->url());
diff --git a/src/mainwindow.h b/src/mainwindow/mainwindow.h
index 79773d3..3f2c3a2 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow/mainwindow.h
@@ -10,9 +10,9 @@
#define MAINWINDOW_H
#include "browser.h"
-#include "lib/navigation/navigationbutton.h"
#include "webengine/webengineprofile.h"
#include "widgets/loadingbar.h"
+#include "widgets/navigationbar.h"
#include "widgets/mainwindowtabbar.h"
#include <QMainWindow>
#include <QUrl>
@@ -42,6 +42,8 @@ class MainWindow : public QMainWindow
friend class MainWindowMenuBar;
+ friend class NavigationBar;
+
public:
explicit MainWindow(std::shared_ptr<Configuration> config, QWidget *parent = nullptr);
Q_DISABLE_COPY(MainWindow)
@@ -82,7 +84,7 @@ private:
MainWindowMenuBar *menuBar;
// navigation
- NavigationButton *m_backButton, *m_forwardButton, *m_reloadButton;
+ NavigationBar *m_navigationBar;
UrlLineEdit *m_addressBar;
LoadingBar *m_progressBar;
diff --git a/src/mainwindow.ui b/src/mainwindow/mainwindow.ui
index 12a3a6c..12a3a6c 100644
--- a/src/mainwindow.ui
+++ b/src/mainwindow/mainwindow.ui
diff --git a/src/mainwindow/widgets/loadingbar.cpp b/src/mainwindow/widgets/loadingbar.cpp
new file mode 100644
index 0000000..99f44d2
--- /dev/null
+++ b/src/mainwindow/widgets/loadingbar.cpp
@@ -0,0 +1,50 @@
+/*
+ * This file is part of smolbote. It's copyrighted by the contributors recorded
+ * in the version control history of the file, available from its original
+ * location: git://neueland.iserlohn-fortress.net/smolbote.git
+ *
+ * SPDX-License-Identifier: GPL-3.0
+ */
+
+#include "loadingbar.h"
+#include <QTimer>
+#include "webengine/webview.h"
+
+LoadingBar::LoadingBar(QWidget *parent)
+ : QProgressBar(parent)
+{
+ setMaximum(100);
+}
+
+void LoadingBar::connectWebView(WebView *view)
+{
+ Q_CHECK_PTR(view);
+
+ disconnect(loadStartedConnection);
+ disconnect(loadProgressConnection);
+ disconnect(loadFinishedConnection);
+
+ if(view->isLoaded()) {
+ this->hide();
+ } else {
+ loadStarted();
+ setValue(view->loadProgress());
+ }
+
+ loadStartedConnection = connect(view, &QWebEngineView::loadStarted, this, &LoadingBar::loadStarted);
+ loadProgressConnection = connect(view, &QWebEngineView::loadProgress, this, &QProgressBar::setValue);
+ loadFinishedConnection = connect(view, &QWebEngineView::loadFinished, this, &LoadingBar::loadFinished);
+}
+
+void LoadingBar::loadStarted()
+{
+ resetFormat();
+ show();
+ setValue(0);
+}
+
+void LoadingBar::loadFinished(bool ok)
+{
+ setFormat(QString("%p% %1").arg(ok ? tr("Finished") : tr("Failed")));
+ QTimer::singleShot(2000, this, SLOT(hide()));
+}
diff --git a/src/widgets/loadingbar.h b/src/mainwindow/widgets/loadingbar.h
index e281628..8ae314e 100644
--- a/src/widgets/loadingbar.h
+++ b/src/mainwindow/widgets/loadingbar.h
@@ -11,19 +11,20 @@
#include <QProgressBar>
-class QWebEngineView;
+class WebView;
class LoadingBar : public QProgressBar
{
Q_OBJECT
public:
- explicit LoadingBar(QWidget *parent = 0);
- void connectWebView(QWebEngineView *view);
+ explicit LoadingBar(QWidget *parent = nullptr);
+ void connectWebView(WebView *view);
-signals:
-
-public slots:
+private slots:
void loadStarted();
void loadFinished(bool ok);
+
+private:
+ QMetaObject::Connection loadStartedConnection, loadProgressConnection, loadFinishedConnection;
};
#endif // LOADINGBAR_H
diff --git a/src/mainwindow/widgets/navigationbar.cpp b/src/mainwindow/widgets/navigationbar.cpp
new file mode 100644
index 0000000..648bb23
--- /dev/null
+++ b/src/mainwindow/widgets/navigationbar.cpp
@@ -0,0 +1,115 @@
+/*
+ * This file is part of smolbote. It's copyrighted by the contributors recorded
+ * in the version control history of the file, available from its original
+ * location: git://neueland.iserlohn-fortress.net/smolbote.git
+ *
+ * SPDX-License-Identifier: GPL-3.0
+ */
+
+#include "navigationbar.h"
+#include "mainwindow/mainwindow.h"
+#include "webengine/webview.h"
+#include <QHBoxLayout>
+#include <QStyle>
+#include <QToolBar>
+#include <QToolButton>
+#include <QWebEngineHistory>
+
+NavigationBar::NavigationBar(MainWindow *parent)
+ : QObject(parent)
+{
+ qStyle = parent->style();
+
+ backButton = new QToolButton(parent);
+ backButton->setIcon(qStyle->standardIcon(QStyle::SP_ArrowBack));
+ connect(backButton, &QToolButton::clicked, this, [this]() {
+ m_view->history()->back();
+ });
+
+ auto *backMenu = new QMenu(backButton);
+ backButton->setMenu(backMenu);
+ connect(backMenu, &QMenu::aboutToShow, this, [this, backMenu]() {
+ backMenu->clear();
+ const QList<QWebEngineHistoryItem> items = m_view->history()->backItems(10);
+ for(const QWebEngineHistoryItem &i : items) {
+ QAction *a = backMenu->addAction(i.title());
+ connect(a, &QAction::triggered, this, [i, this]() {
+ m_view->history()->goToItem(i);
+ });
+ }
+ });
+
+ forwardButton = new QToolButton(parent);
+ forwardButton->setIcon(qStyle->standardIcon(QStyle::SP_ArrowForward));
+ connect(forwardButton, &QToolButton::clicked, this, [this]() {
+ m_view->history()->forward();
+ });
+
+ auto *forwardMenu = new QMenu(forwardButton);
+ forwardButton->setMenu(forwardMenu);
+ connect(forwardMenu, &QMenu::aboutToShow, this, [this, forwardMenu]() {
+ forwardMenu->clear();
+ const QList<QWebEngineHistoryItem> items = m_view->history()->forwardItems(10);
+ for(const QWebEngineHistoryItem &i : items) {
+ QAction *a = forwardMenu->addAction(i.title());
+ connect(a, &QAction::triggered, this, [i, this]() {
+ m_view->history()->goToItem(i);
+ });
+ }
+ });
+
+ stopReloadButton = new QToolButton(parent);
+ stopReloadButton->setIcon(qStyle->standardIcon(QStyle::SP_BrowserReload));
+ connect(stopReloadButton, &QToolButton::clicked, this, [this]() {
+ if(m_view->isLoaded())
+ m_view->reload();
+ else
+ m_view->stop();
+ });
+
+ homeButton = new QToolButton(parent);
+ homeButton->setIcon(qStyle->standardIcon(QStyle::SP_DirHomeIcon));
+ connect(homeButton, &QToolButton::clicked, this, [this, parent]() {
+ m_view->load(parent->m_profile->homepage());
+ });
+}
+
+void NavigationBar::addWidgetsTo(QToolBar *toolBar)
+{
+ toolBar->addWidget(backButton);
+ toolBar->addWidget(forwardButton);
+ toolBar->addWidget(stopReloadButton);
+ toolBar->addWidget(homeButton);
+}
+
+void NavigationBar::connectWebView(WebView *view)
+{
+ Q_CHECK_PTR(view);
+ m_view = view;
+
+ disconnect(loadStartedConnection);
+ disconnect(loadFinishedConnection);
+
+ if(view->isLoaded()) {
+ update_loadFinished();
+ } else {
+ update_loadStarted();
+ }
+
+ loadStartedConnection = connect(view, &QWebEngineView::loadStarted, this, &NavigationBar::update_loadStarted);
+ loadFinishedConnection = connect(view, &QWebEngineView::loadFinished, this, &NavigationBar::update_loadFinished);
+}
+
+void NavigationBar::update_loadStarted()
+{
+ backButton->setEnabled(m_view->history()->canGoForward());
+ forwardButton->setEnabled(m_view->history()->canGoForward());
+ stopReloadButton->setIcon(qStyle->standardIcon(QStyle::SP_BrowserStop));
+}
+
+void NavigationBar::update_loadFinished()
+{
+ backButton->setEnabled(m_view->history()->canGoBack());
+ forwardButton->setEnabled(m_view->history()->canGoForward());
+ stopReloadButton->setIcon(qStyle->standardIcon(QStyle::SP_BrowserReload));
+}
diff --git a/src/mainwindow/widgets/navigationbar.h b/src/mainwindow/widgets/navigationbar.h
new file mode 100644
index 0000000..15a9c7b
--- /dev/null
+++ b/src/mainwindow/widgets/navigationbar.h
@@ -0,0 +1,55 @@
+/*
+ * This file is part of smolbote. It's copyrighted by the contributors recorded
+ * in the version control history of the file, available from its original
+ * location: git://neueland.iserlohn-fortress.net/smolbote.git
+ *
+ * SPDX-License-Identifier: GPL-3.0
+ */
+
+/*
+ * Why is this class a QObject and not a QWidget, and why don't we add the
+ * NavigationBar itself to the toolbar?
+ * That was the original idea: make a NavBar class, friend it from MainWindow
+ * to gain access to the config, but there's a couple of issues:
+ * - adding QToolButtons to a widget that's inside a toolbar makes the buttons
+ * look absolutely hideous: they're smaller and have a border for some reason
+ * - if you stylesheet the border away (which is a pain), they're still not
+ * the same size
+ * And so we ended up having this class only exist to contain all of the logic
+ * for the nav buttons (which cuts down the code in MainWindow).
+ */
+
+#ifndef NAVIGATIONBAR_H
+#define NAVIGATIONBAR_H
+
+#include <QObject>
+
+class QStyle;
+class QToolBar;
+class QToolButton;
+class MainWindow;
+class WebView;
+class NavigationBar : public QObject
+{
+ Q_OBJECT
+public:
+ explicit NavigationBar(MainWindow *parent = nullptr);
+
+ void addWidgetsTo(QToolBar *toolBar);
+ void connectWebView(WebView *view);
+
+private slots:
+ void update_loadStarted();
+ void update_loadFinished();
+
+private:
+ QStyle *qStyle;
+ WebView *m_view;
+ QToolButton *backButton, *forwardButton;
+ QToolButton *stopReloadButton;
+ QToolButton *homeButton;
+
+ QMetaObject::Connection loadStartedConnection, loadFinishedConnection;
+};
+
+#endif //NAVIGATIONBAR_H
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp
index ea0ee26..c924144 100644
--- a/src/webengine/webview.cpp
+++ b/src/webengine/webview.cpp
@@ -26,7 +26,7 @@
#include <QPrinter>
#include <QPrinterInfo>
-#include "mainwindow.h"
+#include "src/mainwindow/mainwindow.h"
#include <QStatusBar>
// ssl errors
@@ -38,6 +38,17 @@ WebView::WebView(MainWindow *parentMainWindow, QWidget *parent)
Q_CHECK_PTR(parentMainWindow);
m_parent = parentMainWindow;
+ // load status and progress
+ connect(this, &QWebEngineView::loadStarted, this, [this]() {
+ m_loaded = false;
+ });
+ connect(this, &QWebEngineView::loadFinished, this, [this]() {
+ m_loaded = true;
+ });
+ connect(this, &QWebEngineView::loadProgress, this, [this](int progress) {
+ m_loadProgress = progress;
+ });
+
m_pageMenu = new QMenu();
m_pageMenu->setMinimumWidth(240);
@@ -137,6 +148,16 @@ void WebView::setPage(WebPage *page)
QWebEngineView::setPage(page);
}
+bool WebView::isLoaded() const
+{
+ return m_loaded;
+}
+
+int WebView::loadProgress() const
+{
+ return m_loadProgress;
+}
+
WebView *WebView::createWindow(QWebEnginePage::WebWindowType type)
{
WebView *view = new WebView(m_parent);
diff --git a/src/webengine/webview.h b/src/webengine/webview.h
index 18a1e02..78b85ce 100644
--- a/src/webengine/webview.h
+++ b/src/webengine/webview.h
@@ -24,12 +24,14 @@ public:
QMenu *pageMenu();
void setPage(WebPage *page);
+ bool isLoaded() const;
+ int loadProgress() const;
signals:
void newBookmark(const QString &title, const QUrl &url);
protected:
- WebView *createWindow(QWebEnginePage::WebWindowType type);
+ WebView *createWindow(QWebEnginePage::WebWindowType type) override;
private slots:
void handleLinkHovered(const QString &url);
@@ -38,6 +40,9 @@ private slots:
private:
MainWindow *m_parent = nullptr;
QMenu *m_pageMenu = nullptr;
+
+ bool m_loaded;
+ int m_loadProgress;
};
#endif // WEBVIEW_H
diff --git a/src/widgets/loadingbar.cpp b/src/widgets/loadingbar.cpp
deleted file mode 100644
index e72c5bb..0000000
--- a/src/widgets/loadingbar.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of smolbote. It's copyrighted by the contributors recorded
- * in the version control history of the file, available from its original
- * location: git://neueland.iserlohn-fortress.net/smolbote.git
- *
- * SPDX-License-Identifier: GPL-3.0
- */
-
-#include "loadingbar.h"
-#include <QTimer>
-#include <QWebEngineView>
-
-LoadingBar::LoadingBar(QWidget *parent)
- : QProgressBar(parent)
-{
- setMaximum(100);
-}
-
-void LoadingBar::connectWebView(QWebEngineView *view)
-{
- disconnect(this);
-
- connect(view, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
- connect(view, SIGNAL(loadProgress(int)), this, SLOT(setValue(int)));
- connect(view, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
-}
-
-void LoadingBar::loadStarted()
-{
- resetFormat();
- show();
- setValue(0);
-}
-
-void LoadingBar::loadFinished(bool ok)
-{
- setFormat(QString("%p% %1").arg(ok ? tr("Finished") : tr("Failed")));
- QTimer::singleShot(2000, this, SLOT(hide()));
-}
diff --git a/src/widgets/mainwindowmenubar.cpp b/src/widgets/mainwindowmenubar.cpp
index f8275c0..bc86e77 100644
--- a/src/widgets/mainwindowmenubar.cpp
+++ b/src/widgets/mainwindowmenubar.cpp
@@ -8,7 +8,7 @@
#include "mainwindowmenubar.h"
#include "downloads/downloadswidget.h"
-#include "mainwindow.h"
+#include "src/mainwindow/mainwindow.h"
#include <QInputDialog>
MainWindowMenuBar::MainWindowMenuBar(std::shared_ptr<Configuration> config, MainWindow *parent)
diff --git a/src/widgets/mainwindowtabbar.cpp b/src/widgets/mainwindowtabbar.cpp
index 5cf360d..e669bf6 100644
--- a/src/widgets/mainwindowtabbar.cpp
+++ b/src/widgets/mainwindowtabbar.cpp
@@ -11,7 +11,7 @@
#include <QShortcut>
#include <settings/configuration.h>
-#include "mainwindow.h"
+#include "src/mainwindow/mainwindow.h"
MainWindowTabBar::MainWindowTabBar(const std::shared_ptr<Configuration> &config, MainWindow *parent)
: QTabBar(parent)