Save work.
This commit is contained in:
parent
e3635f5394
commit
d2cc973153
3 changed files with 12 additions and 4 deletions
|
|
@ -43,6 +43,10 @@ bool WebViewer::canDecreaseZoom() {
|
||||||
return zoomFactor() >= MIN_ZOOM_FACTOR + ZOOM_FACTOR_STEP;
|
return zoomFactor() >= MIN_ZOOM_FACTOR + ZOOM_FACTOR_STEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WebPage *WebViewer::page() const {
|
||||||
|
return qobject_cast<WebPage*>(QWebEngineView::page());
|
||||||
|
}
|
||||||
|
|
||||||
void WebViewer::displayMessage() {
|
void WebViewer::displayMessage() {
|
||||||
setHtml(m_messageContents, QUrl::fromUserInput(INTERNAL_URL_MESSAGE));
|
setHtml(m_messageContents, QUrl::fromUserInput(INTERNAL_URL_MESSAGE));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ class WebViewer : public QWebEngineView {
|
||||||
return m_messageContents;
|
return m_messageContents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WebPage *page() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// Page zoom modifiers.
|
// Page zoom modifiers.
|
||||||
bool increaseWebPageZoom();
|
bool increaseWebPageZoom();
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@
|
||||||
#include "network-web/adblock/adblocksubscription.h"
|
#include "network-web/adblock/adblocksubscription.h"
|
||||||
#include "miscellaneous/application.h"
|
#include "miscellaneous/application.h"
|
||||||
#include "network-web/webpage.h"
|
#include "network-web/webpage.h"
|
||||||
|
#include "gui/webbrowser.h"
|
||||||
|
#include "gui/webviewer.h"
|
||||||
|
#include "gui/dialogs/formmain.h"
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
@ -58,7 +61,6 @@ void AdBlockIcon::popupBlocked(const QString &ruleString, const QUrl &url) {
|
||||||
pair.second = url;
|
pair.second = url;
|
||||||
m_blockedPopups.append(pair);
|
m_blockedPopups.append(pair);
|
||||||
|
|
||||||
|
|
||||||
qApp->showGuiMessage(tr("Blocked popup window"), tr("AdBlock blocked unwanted popup window."), QSystemTrayIcon::Information);
|
qApp->showGuiMessage(tr("Blocked popup window"), tr("AdBlock blocked unwanted popup window."), QSystemTrayIcon::Information);
|
||||||
|
|
||||||
if (!m_flashTimer) {
|
if (!m_flashTimer) {
|
||||||
|
|
@ -87,7 +89,7 @@ QAction *AdBlockIcon::menuAction() {
|
||||||
return m_menuAction;
|
return m_menuAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdBlockIcon::createMenu(QMenu* menu) {
|
void AdBlockIcon::createMenu(QMenu *menu) {
|
||||||
if (!menu) {
|
if (!menu) {
|
||||||
menu = qobject_cast<QMenu*>(sender());
|
menu = qobject_cast<QMenu*>(sender());
|
||||||
|
|
||||||
|
|
@ -101,10 +103,10 @@ void AdBlockIcon::createMenu(QMenu* menu) {
|
||||||
AdBlockManager* manager = AdBlockManager::instance();
|
AdBlockManager* manager = AdBlockManager::instance();
|
||||||
AdBlockCustomList* customList = manager->customList();
|
AdBlockCustomList* customList = manager->customList();
|
||||||
|
|
||||||
WebPage *page = m_window->weView()->page();
|
WebPage *page = qApp->mainForm()->tabWidget()->currentWidget()->webBrowser()->viewer()->page();
|
||||||
const QUrl pageUrl = page->url();
|
const QUrl pageUrl = page->url();
|
||||||
|
|
||||||
menu->addAction(tr("Show AdBlock &Settings"), manager, SLOT(showDialog()));
|
menu->addAction(tr("Show AdBlock &settings"), manager, SLOT(showDialog()));
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
if (!pageUrl.host().isEmpty() && m_enabled && manager->canRunOnScheme(pageUrl.scheme())) {
|
if (!pageUrl.host().isEmpty() && m_enabled && manager->canRunOnScheme(pageUrl.scheme())) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue