jenkins
Last change
on this file since 6a08e91 was
bc7a483,
checked in by Vadim Troshchinskiy Shmelev <vtroshchinskiy@…>, 16 months ago
|
Fix typos
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[6b6f1ba] | 1 | #include "ogwebpage.h" |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | #include <QWebEnginePage> |
---|
| 5 | #include <QDebug> |
---|
| 6 | |
---|
[bc7a483] | 7 | #include "ogcommandline.h" |
---|
[6b6f1ba] | 8 | #include "mainwindow.h" |
---|
| 9 | #include <QWidget> |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | bool OGWebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame) { |
---|
| 13 | |
---|
| 14 | qInfo() << "Link clicked: URL = " << url << "; type = " << type << "; isMainFrame = " << isMainFrame; |
---|
| 15 | |
---|
| 16 | if ( type == QWebEnginePage::NavigationType::NavigationTypeLinkClicked) { |
---|
| 17 | |
---|
| 18 | } |
---|
| 19 | |
---|
| 20 | return true; |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | QWebEnginePage *OGWebPage::createWindow(QWebEnginePage::WebWindowType type) { |
---|
| 24 | qInfo() << "Create new window: " << type; |
---|
| 25 | |
---|
| 26 | OGCommandLineOptions &options = OGCommandLineOptions::getInstance(); |
---|
| 27 | |
---|
| 28 | switch(options.getNewTabBehavior()) { |
---|
| 29 | case OGCommandLineOptions::NewTabBehavior::NewTab: |
---|
| 30 | qWarning() << "Unimplemented"; |
---|
| 31 | return this; |
---|
| 32 | case OGCommandLineOptions::NewTabBehavior::ReplacePage: |
---|
| 33 | qInfo() << "Replacing page"; |
---|
| 34 | return this; |
---|
| 35 | case OGCommandLineOptions::NewTabBehavior::Ignore: |
---|
| 36 | qInfo() << "Ignoring attempt to open new tab"; |
---|
| 37 | return nullptr; |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | qCritical() << "Unknown new tab behavior, this should be unreachable"; |
---|
| 41 | return this; |
---|
| 42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.