Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: v0.13.0 #2

Draft
wants to merge 65 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
0085138
Remove some features that need a complete rewrite
AaronDewes Sep 9, 2020
9353a23
Remove WebKit Version from AboutDialog
AaronDewes Sep 10, 2020
757953f
First version that compiles with WebEngine
AaronDewes Sep 10, 2020
0937921
Use new Domain
AaronDewes Sep 10, 2020
c9738f6
Update copyright
AaronDewes Sep 10, 2020
0b4c5ab
Add permissionbar
AaronDewes Sep 10, 2020
d6a936d
Optimize code
AaronDewes Sep 10, 2020
8cc38a8
Reduce htmlToXBel depenencies
AaronDewes Sep 10, 2020
a1ce8b7
Minor cleanups in tools
AaronDewes Sep 10, 2020
067b235
Start working on porting the tests to cmake
AaronDewes Sep 11, 2020
58a89c9
Port more tests to WebEngine
AaronDewes Sep 11, 2020
31b4ae7
Update changelog
AaronDewes Sep 11, 2020
009deed
Load new Tab page from GitHub repo
AaronDewes Sep 11, 2020
e86a929
Remove unsupported test
AaronDewes Sep 11, 2020
c623462
Add DevTools back
AaronDewes Sep 12, 2020
c4adfe5
Fix some warnings
AaronDewes Sep 12, 2020
2002f8f
Convert the logo to the latest Inkscape
AaronDewes Sep 12, 2020
680b964
Cleanup CMakeList.txt
AaronDewes Sep 12, 2020
87e9d2c
Port modeltest to QT5
AaronDewes Sep 13, 2020
915ae0b
Using another IDE now
AaronDewes Sep 16, 2020
ec967dd
Port more tests
AaronDewes Sep 16, 2020
e4f83df
Fix license
AaronDewes Sep 16, 2020
1cc3944
Port opensearch to QJSEngine to prepare for QT6
AaronDewes Sep 17, 2020
d50185c
Port all autotests to cmake
AaronDewes Sep 18, 2020
ec84aa3
Delete manualtests
AaronDewes Sep 18, 2020
cc578ca
Remove QMake
AaronDewes Sep 18, 2020
787739d
Run astyle again
AaronDewes Sep 19, 2020
767815c
Rename HistoryCompleter to LocationCompleter
AaronDewes Sep 20, 2020
5637039
Fix a typo
AaronDewes Sep 20, 2020
15f5641
Create a separate license file
AaronDewes Dec 17, 2020
468d3eb
Prepare build system for Qt 6
AaronDewes Dec 17, 2020
852616f
Prepare code for QT6
AaronDewes Dec 17, 2020
b3a272b
Reimplement history & private browsing
AaronDewes Dec 25, 2020
a876994
Move to GitLab
AaronDewes Dec 25, 2020
644a373
Merge branch 'master' into 'webengine'
AaronDewes Dec 28, 2020
29b6ae4
Multiple improvements
AaronDewes Dec 28, 2020
edd15a2
A few improvements
AaronDewes Dec 28, 2020
51713fa
Use htmlToXBel as submodule
AaronDewes Dec 28, 2020
9e11fa4
Update htmlToXBel
AaronDewes Dec 28, 2020
1d32e56
Optimize search
AaronDewes Dec 30, 2020
04d7352
Fix
AaronDewes Jan 10, 2021
9a9d52b
Update copyright to remove companies that no longer own any files in …
AaronDewes Jan 10, 2021
5e77e54
Add window.endorphin wrapper
AaronDewes Jan 15, 2021
9be68d3
Update translations
AaronDewes Jan 16, 2021
a457d9f
Update build system, modernize defaults
AaronDewes Jan 16, 2021
e99ab00
Implement Printing for WebEngine
AaronDewes Jan 17, 2021
ef63cac
Implement DownloadManager
AaronDewes Jan 19, 2021
2053edc
Implement searching
AaronDewes Jan 20, 2021
679daf1
Minor text improvements
AaronDewes Jan 24, 2021
eae374e
Remove unused UiTools
AaronDewes Jan 24, 2021
88361b9
Prepare for adding in new settings
AaronDewes Jan 30, 2021
fe1121f
Make new tab page part of the browser again
AaronDewes Feb 1, 2021
446296b
Refactor the build system (again)
AaronDewes Feb 1, 2021
ea9ae31
About dialog v3
AaronDewes Feb 2, 2021
837d0ea
More UI tweaks
AaronDewes Feb 2, 2021
7851570
Remove header differences
AaronDewes Feb 2, 2021
3953ac6
Minor code improvements
AaronDewes Feb 4, 2021
7cabaed
Start improving this browser again
AaronDewes Feb 16, 2021
72db580
Added Chrome behavior on select all text in LocationBar
Jan 15, 2011
f6f1505
Use icons from theme
AaronDewes Feb 17, 2021
1d3af3d
Small changes in the profile logic
AaronDewes Feb 17, 2021
0afa3ce
Small code improvements/changes
AaronDewes Feb 20, 2021
79143be
Update htmlToXBel
AaronDewes Feb 20, 2021
c361758
Revert "Use icons from theme"
AaronDewes Feb 20, 2021
f3fecee
Scrolling on the tabbar
AaronDewes Feb 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add DevTools back
AaronDewes committed Sep 19, 2020

Verified

This commit was signed with the committer’s verified signature. The key has expired.
AaronDewes Aaron Dewes
commit c62346260f262a99e88f5ff3b6947970e8008d60
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ set(Endorphin_SRCS
browsermainwindow.cpp
clearprivatedata.cpp
clearbutton.cpp
devtoolswindow.cpp
downloadmanager.cpp
modelmenu.cpp
modeltoolbar.cpp
45 changes: 16 additions & 29 deletions src/browsermainwindow.cpp
Original file line number Diff line number Diff line change
@@ -74,6 +74,7 @@
#include "bookmarkstoolbar.h"
#include "browserapplication.h"
#include "clearprivatedata.h"
#include "devtoolswindow.h"
#include "downloadmanager.h"
#include "history.h"
#include "languagemanager.h"
@@ -201,6 +202,7 @@ BrowserMainWindow::BrowserMainWindow(QWidget *parent, Qt::WindowFlags flags)
m_bookmarksToolbar, SLOT(setVisible(bool)));
connect(m_tabWidget, SIGNAL(lastTabClosed()),
this, SLOT(lastTabClosed()));
connect(m_tabWidget, &TabWidget::devToolsRequested, this, &BrowserMainWindow::handleDevToolsRequested);

updateWindowTitle();
loadDefaultState();
@@ -815,15 +817,6 @@ void BrowserMainWindow::setupMenu()
this, SLOT(clearPrivateData()));
m_toolsMenu->addAction(m_toolsClearPrivateDataAction);

m_toolsEnableInspectorAction = new QAction(m_toolsMenu);
connect(m_toolsEnableInspectorAction, SIGNAL(triggered(bool)),
this, SLOT(toggleInspector(bool)));
m_toolsEnableInspectorAction->setCheckable(true);
QSettings settings;
settings.beginGroup(QLatin1String("websettings"));
m_toolsEnableInspectorAction->setChecked(settings.value(QLatin1String("enableInspector"), false).toBool());
m_toolsMenu->addAction(m_toolsEnableInspectorAction);

m_toolsSearchManagerAction = new QAction(m_toolsMenu);
m_toolsSearchManagerAction->setMenuRole(QAction::NoRole);
connect(m_toolsSearchManagerAction, SIGNAL(triggered()),
@@ -978,7 +971,6 @@ void BrowserMainWindow::retranslate()
m_toolsWebSearchAction->setShortcut(QKeySequence(tr("Ctrl+K", "Web Search")));
m_toolsClearPrivateDataAction->setText(tr("&Clear Private Data"));
m_toolsClearPrivateDataAction->setShortcut(QKeySequence(tr("Ctrl+Shift+Delete", "Clear Private Data")));
m_toolsEnableInspectorAction->setText(tr("Enable Web &Inspector"));
m_toolsPreferencesAction->setText(tr("Options..."));
m_toolsPreferencesAction->setShortcut(tr("Ctrl+,"));
m_toolsSearchManagerAction->setText(tr("Configure Search Engines..."));
@@ -1420,25 +1412,6 @@ void BrowserMainWindow::clearPrivateData()
dialog.exec();
}

void BrowserMainWindow::toggleInspector(bool enable)
{
/*
QWebEngineSettings::globalSettings()->setAttribute(QWebEngineSettings::DeveloperExtrasEnabled, enable);
if (enable) {
int result = QMessageBox::question(this, tr("Web Inspector"),
tr("The web inspector will only work correctly for pages that were loaded after enabling.\n"
"Do you want to reload all pages?"),
QMessageBox::Yes | QMessageBox::No);
if (result == QMessageBox::Yes) {
m_tabWidget->reloadAllTabs();
}
}
*/
QSettings settings;
settings.beginGroup(QLatin1String("websettings"));
settings.setValue(QLatin1String("enableInspector"), enable);
}

void BrowserMainWindow::swapFocus()
{
if (currentTab()->hasFocus()) {
@@ -1583,3 +1556,17 @@ void BrowserMainWindow::geometryChangeRequested(const QRect &geometry)
setGeometry(geometry);
}



DevToolsWindow *BrowserMainWindow::createDevToolsWindow()
{
auto devWindow = new DevToolsWindow(this);
devWindow->show();
return devWindow;
}

void BrowserMainWindow::handleDevToolsRequested(QWebEnginePage *source)
{
source->setDevToolsPage(createDevToolsWindow()->page());
source->triggerAction(QWebEnginePage::InspectElement);
}
5 changes: 3 additions & 2 deletions src/browsermainwindow.h
Original file line number Diff line number Diff line change
@@ -76,6 +76,7 @@ class QFrame;
class HistoryMenu;
class BookmarksMenuBarMenu;
class UserAgentMenu;
class DevToolsWindow;

/*!
The MainWindow of the Browser Application.
@@ -103,6 +104,7 @@ class BrowserMainWindow : public QMainWindow
QAction *searchManagerAction() const {
return m_toolsSearchManagerAction;
}
void handleDevToolsRequested(QWebEnginePage *source);

public slots:
void goHome();
@@ -151,7 +153,6 @@ private slots:

void webSearch();
void clearPrivateData();
void toggleInspector(bool enable);
void aboutApplication();
void downloadManager();
void selectLineEdit();
@@ -177,6 +178,7 @@ private slots:
void setupMenu();
void setupToolBar();
void updateStopReloadActionText(bool loading);
DevToolsWindow *createDevToolsWindow();

private:
QMenu *m_fileMenu;
@@ -235,7 +237,6 @@ private slots:
QMenu *m_toolsMenu;
QAction *m_toolsWebSearchAction;
QAction *m_toolsClearPrivateDataAction;
QAction *m_toolsEnableInspectorAction;
QAction *m_toolsPreferencesAction;
QAction *m_toolsSearchManagerAction;
UserAgentMenu *m_toolsUserAgentMenu;
54 changes: 54 additions & 0 deletions src/devtoolswindow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 2020 Aaron Dewes <[email protected]>
*
* 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) any later version.
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#include "devtoolswindow.h"
#include <QApplication>
#include <QDesktopWidget>
#include <QVBoxLayout>
#include <QWidget>
#include <QWebEngineView>
#include <QWebEnginePage>

DevToolsWindow::DevToolsWindow(QWidget *parent, Qt::WindowFlags flags)
: QMainWindow(parent, flags)
, m_webView(new QWebEngineView())
{
setCentralWidget(m_webView);
}

DevToolsWindow::~DevToolsWindow()
{
}

void DevToolsWindow::geometryChangeRequested(const QRect &geometry)
{
setGeometry(geometry);
}

QWebEnginePage *DevToolsWindow::page()
{
return m_webView->page();
}

QSize DevToolsWindow::sizeHint() const
{
QRect desktopRect = QApplication::desktop()->screenGeometry();
QSize size = desktopRect.size() * 0.4;
return size;
}
50 changes: 50 additions & 0 deletions src/devtoolswindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright 2020 Aaron Dewes <[email protected]>
*
* 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) any later version.
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#ifndef DEVTOOLSWINDOW_H
#define DEVTOOLSWINDOW_H

#include <qmainwindow.h>
#include <QWebEngineView>

class QWebEnginePage;
/*!
The MainWindow of the Browser Application.

Handles the tab widget and all the actions
*/
class DevToolsWindow : public QMainWindow
{
Q_OBJECT

public:
DevToolsWindow(QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr);
~DevToolsWindow();
QWebEnginePage *page();
QSize sizeHint() const;

private slots:
void geometryChangeRequested(const QRect &geometry);

private:
QWebEngineView *m_webView;
};

#endif // DEVTOOLSWINDOW_H

1 change: 1 addition & 0 deletions src/tabwidget.cpp
Original file line number Diff line number Diff line change
@@ -422,6 +422,7 @@ WebView *TabWidget::makeNewTab(bool makeCurrent)
this, SLOT(statusBarVisibilityChangeRequestedCheck(bool)));
connect(webView->page(), SIGNAL(toolBarVisibilityChangeRequested(bool)),
this, SLOT(toolBarVisibilityChangeRequestedCheck(bool)));
connect(webView, &WebView::devToolsRequested, this, &TabWidget::devToolsRequested);

WebViewWithSearch *webViewWithSearch = new WebViewWithSearch(webView, this);
addTab(webViewWithSearch, tr("Untitled"));
1 change: 1 addition & 0 deletions src/tabwidget.h
Original file line number Diff line number Diff line change
@@ -108,6 +108,7 @@ class TabWidget : public QTabWidget
void statusBarVisibilityChangeRequested(bool visible);
void toolBarVisibilityChangeRequested(bool visible);
void printRequested(QWebEnginePage *page);
void devToolsRequested(QWebEnginePage *source);

public:
enum OpenUrlIn {
10 changes: 5 additions & 5 deletions src/webview.cpp
Original file line number Diff line number Diff line change
@@ -278,13 +278,13 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
if (menu->isEmpty()) {
delete menu;
menu = page()->createStandardContextMenu();
} else {
/*
if (page()->settings()->testAttribute(QWebEngineSettings::DeveloperExtrasEnabled))
menu->addAction(pageAction(QWebEnginePage::InspectElement));
*/
}

QAction *action = new QAction(menu);
action->setText("Inspect Element");
connect(action, &QAction::triggered, [this]() { emit devToolsRequested(page()); });
menu->addAction(action);

if (!menu->isEmpty()) {
if (BrowserMainWindow::parentWindow(tabWidget())->menuBar()->isHidden()) {
menu->addSeparator();
1 change: 1 addition & 0 deletions src/webview.h
Original file line number Diff line number Diff line change
@@ -102,6 +102,7 @@ class WebView : public QWebEngineView
signals:
void search(const QUrl &searchUrl, TabWidget::OpenUrlIn openIn);
void notifyRanJavaScript();
void devToolsRequested(QWebEnginePage *source);

public slots:
void zoomIn();