diff --git a/swisssurfer/src/authentication.hxx b/swisssurfer/src/authentication.hxx new file mode 100644 index 0000000..6d1eef4 --- /dev/null +++ b/swisssurfer/src/authentication.hxx @@ -0,0 +1,35 @@ +/*! @file + + @id $Id$ +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +#ifndef __AUTHENTICATION_HXX__ +#define __AUTHENTICATION_HXX__ + +#include +#include +#include + +class Authentication: public QDialog, protected Ui::Authentication { + Q_OBJECT; + public: + Authentication(QAuthenticator* auth, QWidget* p=0): + QDialog(p), _auth(auth) { + setupUi(this); + _realm->setText(_auth->realm()); + _user->setText(_auth->user()); + _password->setText(_auth->password()); + } + public Q_SLOTS: + virtual void accept() { + _auth->setUser(_user->text()); + _auth->setPassword(_password->text()); + QDialog::accept(); + } + private: + QAuthenticator* _auth; +}; + +#endif diff --git a/swisssurfer/src/authentication.ui b/swisssurfer/src/authentication.ui new file mode 100644 index 0000000..d08ddfa --- /dev/null +++ b/swisssurfer/src/authentication.ui @@ -0,0 +1,132 @@ + + + Authentication + + + + 0 + 0 + 277 + 172 + + + + Authorization + + + + + + + + Authentication required for: + + + false + + + + + + + realm + + + false + + + + + + + + + + + Username: + + + + + + + + + + Password: + + + + + + + QLineEdit::Password + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + true + + + + + + + + + buttonBox + accepted() + Authentication + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Authentication + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/swisssurfer/src/browser.hxx b/swisssurfer/src/browser.hxx index 70d37b3..a734a40 100644 --- a/swisssurfer/src/browser.hxx +++ b/swisssurfer/src/browser.hxx @@ -32,6 +32,8 @@ #include #include +#include +#include #include #include @@ -201,6 +203,271 @@ class Browser: public QMainWindow, protected Ui::Browser { return true; } + QWebView* newTab() { + QWebView* browser(new QWebView); + browser->setPage(new WebPage(this, browser)); + browser->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); + browser->page()->setNetworkAccessManager(&_networkManager); + browser->page()->setForwardUnsupportedContent(true); + _url->setFocus(); + // QWebView + assert(connect(browser, SIGNAL(urlChanged(const QUrl&)), + SLOT(urlChanged(const QUrl&)))); + assert(connect(browser, SIGNAL(linkClicked(const QUrl&)), + SLOT(linkClicked(const QUrl&)))); + assert(connect(browser, SIGNAL(iconChanged()), + SLOT(iconChanged()))); + assert(connect(browser, SIGNAL(titleChanged(const QString&)), + SLOT(titleChanged(const QString&)))); + assert(connect(browser, SIGNAL(statusBarMessage(const QString&)), + SLOT(statusBarMessage(const QString&)))); + assert(connect(browser, SIGNAL(loadProgress(int)), + SLOT(loadProgress(int)))); + assert(connect(browser, SIGNAL(loadStarted()), + SLOT(loadStarted()))); + assert(connect(browser, SIGNAL(loadFinished(bool)), + SLOT(loadFinished(bool)))); + // QWebPage WebAction + assert(connect(browser->pageAction(QWebPage::OpenLink), + SIGNAL(triggered(bool)), + SLOT(triggeredOpenLink(bool)))); + assert(connect(browser->pageAction(QWebPage::OpenLinkInNewWindow), + SIGNAL(triggered(bool)), + SLOT(triggeredOpenLinkInNewWindow(bool)))); + assert(connect(browser->pageAction(QWebPage::OpenFrameInNewWindow), + SIGNAL(triggered(bool)), + SLOT(triggeredOpenFrameInNewWindow(bool)))); + assert(connect(browser->pageAction(QWebPage::DownloadLinkToDisk), + SIGNAL(triggered(bool)), + SLOT(triggeredDownloadLinkToDisk(bool)))); + assert(connect(browser->pageAction(QWebPage::CopyLinkToClipboard), + SIGNAL(triggered(bool)), + SLOT(triggeredCopyLinkToClipboard(bool)))); + assert(connect(browser->pageAction(QWebPage::OpenImageInNewWindow), + SIGNAL(triggered(bool)), + SLOT(triggeredOpenImageInNewWindow(bool)))); + assert(connect(browser->pageAction(QWebPage::DownloadImageToDisk), + SIGNAL(triggered(bool)), + SLOT(triggeredDownloadImageToDisk(bool)))); + assert(connect(browser->pageAction(QWebPage::CopyImageToClipboard), + SIGNAL(triggered(bool)), + SLOT(triggeredCopyImageToClipboard(bool)))); + assert(connect(browser->pageAction(QWebPage::Back), + SIGNAL(triggered(bool)), + SLOT(triggeredBack(bool)))); + assert(connect(browser->pageAction(QWebPage::Forward), + SIGNAL(triggered(bool)), + SLOT(triggeredForward(bool)))); + assert(connect(browser->pageAction(QWebPage::Stop), + SIGNAL(triggered(bool)), + SLOT(triggeredStop(bool)))); + assert(connect(browser->pageAction(QWebPage::Reload), + SIGNAL(triggered(bool)), + SLOT(triggeredReload(bool)))); + assert(connect(browser->pageAction(QWebPage::Cut), + SIGNAL(triggered(bool)), + SLOT(triggeredCut(bool)))); + assert(connect(browser->pageAction(QWebPage::Copy), + SIGNAL(triggered(bool)), + SLOT(triggeredCopy(bool)))); + assert(connect(browser->pageAction(QWebPage::Paste), + SIGNAL(triggered(bool)), + SLOT(triggeredPaste(bool)))); + assert(connect(browser->pageAction(QWebPage::Undo), + SIGNAL(triggered(bool)), + SLOT(triggeredUndo(bool)))); + assert(connect(browser->pageAction(QWebPage::Redo), + SIGNAL(triggered(bool)), + SLOT(triggeredRedo(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToNextChar), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToNextChar(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToPreviousChar), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToPreviousChar(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToNextWord), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToNextWord(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToPreviousWord), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToPreviousWord(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToNextLine), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToNextLine(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToPreviousLine), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToPreviousLine(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToStartOfLine), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToStartOfLine(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToEndOfLine), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToEndOfLine(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToStartOfBlock), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToStartOfBlock(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToEndOfBlock), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToEndOfBlock(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToStartOfDocument), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToStartOfDocument(bool)))); + assert(connect(browser->pageAction(QWebPage::MoveToEndOfDocument), + SIGNAL(triggered(bool)), + SLOT(triggeredMoveToEndOfDocument(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectNextChar), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectNextChar(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectPreviousChar), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectPreviousChar(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectNextWord), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectNextWord(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectPreviousWord), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectPreviousWord(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectNextLine), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectNextLine(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectPreviousLine), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectPreviousLine(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectStartOfLine), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectStartOfLine(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectEndOfLine), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectEndOfLine(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectStartOfBlock), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectStartOfBlock(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectEndOfBlock), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectEndOfBlock(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectStartOfDocument), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectStartOfDocument(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectEndOfDocument), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectEndOfDocument(bool)))); + assert(connect(browser->pageAction(QWebPage::DeleteStartOfWord), + SIGNAL(triggered(bool)), + SLOT(triggeredDeleteStartOfWord(bool)))); + assert(connect(browser->pageAction(QWebPage::DeleteEndOfWord), + SIGNAL(triggered(bool)), + SLOT(triggeredDeleteEndOfWord(bool)))); + assert(connect(browser->pageAction(QWebPage::SetTextDirectionDefault), + SIGNAL(triggered(bool)), + SLOT(triggeredSetTextDirectionDefault(bool)))); + assert(connect(browser->pageAction(QWebPage::SetTextDirectionLeftToRight), + SIGNAL(triggered(bool)), + SLOT(triggeredSetTextDirectionLeftToRight(bool)))); + assert(connect(browser->pageAction(QWebPage::SetTextDirectionRightToLeft), + SIGNAL(triggered(bool)), + SLOT(triggeredSetTextDirectionRightToLeft(bool)))); + assert(connect(browser->pageAction(QWebPage::ToggleBold), + SIGNAL(triggered(bool)), + SLOT(triggeredToggleBold(bool)))); + assert(connect(browser->pageAction(QWebPage::ToggleItalic), + SIGNAL(triggered(bool)), + SLOT(triggeredToggleItalic(bool)))); + assert(connect(browser->pageAction(QWebPage::ToggleUnderline), + SIGNAL(triggered(bool)), + SLOT(triggeredToggleUnderline(bool)))); + assert(connect(browser->pageAction(QWebPage::InspectElement), + SIGNAL(triggered(bool)), + SLOT(triggeredInspectElement(bool)))); + assert(connect(browser->pageAction(QWebPage::InsertParagraphSeparator), + SIGNAL(triggered(bool)), + SLOT(triggeredInsertParagraphSeparator(bool)))); + assert(connect(browser->pageAction(QWebPage::InsertLineSeparator), + SIGNAL(triggered(bool)), + SLOT(triggeredInsertLineSeparator(bool)))); + assert(connect(browser->pageAction(QWebPage::SelectAll), + SIGNAL(triggered(bool)), + SLOT(triggeredSelectAll(bool)))); + // QWebPage + assert(connect(browser->page(), SIGNAL(contentsChanged()), + SLOT(contentsChanged()))); + assert(connect(browser->page(), + SIGNAL(databaseQuotaExceeded(QWebFrame*, QString)), + SLOT(databaseQuotaExceeded(QWebFrame*, QString)))); + assert(connect(browser->page(), + SIGNAL(downloadRequested(const QNetworkRequest&)), + SLOT(downloadRequested(const QNetworkRequest&)))); + assert(connect(browser->page(), SIGNAL(frameCreated(QWebFrame*)), + SLOT(frameCreated(QWebFrame*)))); + assert(connect(browser->page(), + SIGNAL(geometryChangeRequested(const QRect&)), + SLOT(geometryChangeRequested(const QRect&)))); +// assert(connect(browser->page(), SIGNAL(linkClicked(const QUrl&)), +// SLOT(linkClicked(const QUrl&)))); + assert(connect(browser->page(), + SIGNAL(linkHovered(const QString&, const QString&, + const QString&)), + SLOT(linkHovered(const QString&, const QString&, + const QString&)))); +// assert(connect(browser->page(), SIGNAL(loadFinished(bool)), +// SLOT(loadFinished(bool)))); +// assert(connect(browser->page(), SIGNAL(loadProgress(int)), +// SLOT(loadProgress(int)))); +// assert(connect(browser->page(), SIGNAL(loadStarted()), +// SLOT(loadStarted()))); + assert(connect(browser->page(), + SIGNAL(menuBarVisibilityChangeRequested(bool)), + SLOT(menuBarVisibilityChangeRequested(bool)))); + assert(connect(browser->page(), SIGNAL(microFocusChanged()), + SLOT(microFocusChanged()))); + assert(connect(browser->page(), SIGNAL(printRequested(QWebFrame*)), + SLOT(printRequested(QWebFrame*)))); + assert(connect(browser->page(), SIGNAL(repaintRequested(const QRect&)), + SLOT(repaintRequested(const QRect&)))); + assert(connect(browser->page(), + SIGNAL(restoreFrameStateRequested(QWebFrame*)), + SLOT(restoreFrameStateRequested(QWebFrame*)))); + assert(connect(browser->page(), + SIGNAL(saveFrameStateRequested(QWebFrame*, + QWebHistoryItem*)), + SLOT(saveFrameStateRequested(QWebFrame*, + QWebHistoryItem*)))); + assert(connect(browser->page(), + SIGNAL(scrollRequested(int, int, const QRect&)), + SLOT(scrollRequested(int, int, const QRect&)))); + assert(connect(browser->page(), SIGNAL(selectionChanged()), + SLOT(selectionChanged()))); +// assert(connect(browser->page(), SIGNAL(statusBarMessage(const QString&)), +// SLOT(statusBarMessage(const QString&)))); + assert(connect(browser->page(), + SIGNAL(statusBarVisibilityChangeRequested(bool)), + SLOT(statusBarVisibilityChangeRequested(bool)))); + assert(connect(browser->page(), + SIGNAL(toolBarVisibilityChangeRequested(bool)), + SLOT(toolBarVisibilityChangeRequested(bool)))); + assert(connect(browser->page(), + SIGNAL(unsupportedContent(QNetworkReply*)), + SLOT(unsupportedContent(QNetworkReply*)))); + assert(connect(browser->page(), SIGNAL(windowCloseRequested()), + SLOT(windowCloseRequested()))); + // QNetworkAccessManager + assert(connect(browser->page()->networkAccessManager(), + SIGNAL(authenticationRequired(QNetworkReply*, + QAuthenticator*)), + SLOT(authenticationRequired(QNetworkReply*, + QAuthenticator*)))); + assert(connect(browser->page()->networkAccessManager(), + SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, + QAuthenticator*)), + SLOT(proxyAuthenticationRequired(const QNetworkProxy&, + QAuthenticator*)))); + assert(connect(browser->page()->networkAccessManager(), + SIGNAL(sslErrors(QNetworkReply*, const QList&)), + SLOT(sslErrors(QNetworkReply*, const QList&)))); + _tabs->setCurrentIndex(_tabs->addTab(browser, "*empty*")); + _tabs->setTabsClosable(_tabs->count()>1); + return browser; + } + protected: void closeEvent(QCloseEvent *event) { @@ -472,215 +739,215 @@ class Browser: public QMainWindow, protected Ui::Browser { //@{ void triggeredOpenLink(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredOpenLinkInNewWindow(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredOpenFrameInNewWindow(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredDownloadLinkToDisk(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredCopyLinkToClipboard(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredOpenImageInNewWindow(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredDownloadImageToDisk(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredCopyImageToClipboard(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredBack(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredForward(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredStop(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredReload(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredCut(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredCopy(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredPaste(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredUndo(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredRedo(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToNextChar(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToPreviousChar(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToNextWord(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToPreviousWord(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToNextLine(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToPreviousLine(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToStartOfLine(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToEndOfLine(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToStartOfBlock(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToEndOfBlock(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToStartOfDocument(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredMoveToEndOfDocument(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectNextChar(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectPreviousChar(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectNextWord(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectPreviousWord(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectNextLine(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectPreviousLine(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectStartOfLine(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectEndOfLine(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectStartOfBlock(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectEndOfBlock(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectStartOfDocument(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectEndOfDocument(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredDeleteStartOfWord(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredDeleteEndOfWord(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSetTextDirectionDefault(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSetTextDirectionLeftToRight(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSetTextDirectionRightToLeft(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredToggleBold(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredToggleItalic(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredToggleUnderline(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredInspectElement(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredInsertParagraphSeparator(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredInsertLineSeparator(bool) { - LOG; + LOG<(sender())->data().toString(); } void triggeredSelectAll(bool) { - LOG; + LOG<(sender())->data().toString(); } //@} @@ -872,11 +1139,8 @@ class Browser: public QMainWindow, protected Ui::Browser { QAuthenticator* authenticator) { LOG; statusBar()->showMessage(tr("authentication required")); -// _error[sender()] += tr("

%1

URL: %3

%2

") -// .arg(tr("Authentication Required")) -// .arg(networkError(reply->error())) -// .arg(reply->url().toString()); -// _errorUrl[sender()] = reply->url(); + Authentication auth(authenticator, this); + auth.exec(); } void proxyAuthenticationRequired(const QNetworkProxy& proxy, @@ -944,270 +1208,6 @@ class Browser: public QMainWindow, protected Ui::Browser { ->history()->canGoBack()); } - QWebView* newTab() { - QWebView* browser(new QWebView); - browser->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); - browser->page()->setNetworkAccessManager(&_networkManager); - browser->page()->setForwardUnsupportedContent(true); - _url->setFocus(); - // QWebView - assert(connect(browser, SIGNAL(urlChanged(const QUrl&)), - SLOT(urlChanged(const QUrl&)))); - assert(connect(browser, SIGNAL(linkClicked(const QUrl&)), - SLOT(linkClicked(const QUrl&)))); - assert(connect(browser, SIGNAL(iconChanged()), - SLOT(iconChanged()))); - assert(connect(browser, SIGNAL(titleChanged(const QString&)), - SLOT(titleChanged(const QString&)))); - assert(connect(browser, SIGNAL(statusBarMessage(const QString&)), - SLOT(statusBarMessage(const QString&)))); - assert(connect(browser, SIGNAL(loadProgress(int)), - SLOT(loadProgress(int)))); - assert(connect(browser, SIGNAL(loadStarted()), - SLOT(loadStarted()))); - assert(connect(browser, SIGNAL(loadFinished(bool)), - SLOT(loadFinished(bool)))); - // QWebPage WebAction - assert(connect(browser->pageAction(QWebPage::OpenLink), - SIGNAL(triggered(bool)), - SLOT(triggeredOpenLink(bool)))); - assert(connect(browser->pageAction(QWebPage::OpenLinkInNewWindow), - SIGNAL(triggered(bool)), - SLOT(triggeredOpenLinkInNewWindow(bool)))); - assert(connect(browser->pageAction(QWebPage::OpenFrameInNewWindow), - SIGNAL(triggered(bool)), - SLOT(triggeredOpenFrameInNewWindow(bool)))); - assert(connect(browser->pageAction(QWebPage::DownloadLinkToDisk), - SIGNAL(triggered(bool)), - SLOT(triggeredDownloadLinkToDisk(bool)))); - assert(connect(browser->pageAction(QWebPage::CopyLinkToClipboard), - SIGNAL(triggered(bool)), - SLOT(triggeredCopyLinkToClipboard(bool)))); - assert(connect(browser->pageAction(QWebPage::OpenImageInNewWindow), - SIGNAL(triggered(bool)), - SLOT(triggeredOpenImageInNewWindow(bool)))); - assert(connect(browser->pageAction(QWebPage::DownloadImageToDisk), - SIGNAL(triggered(bool)), - SLOT(triggeredDownloadImageToDisk(bool)))); - assert(connect(browser->pageAction(QWebPage::CopyImageToClipboard), - SIGNAL(triggered(bool)), - SLOT(triggeredCopyImageToClipboard(bool)))); - assert(connect(browser->pageAction(QWebPage::Back), - SIGNAL(triggered(bool)), - SLOT(triggeredBack(bool)))); - assert(connect(browser->pageAction(QWebPage::Forward), - SIGNAL(triggered(bool)), - SLOT(triggeredForward(bool)))); - assert(connect(browser->pageAction(QWebPage::Stop), - SIGNAL(triggered(bool)), - SLOT(triggeredStop(bool)))); - assert(connect(browser->pageAction(QWebPage::Reload), - SIGNAL(triggered(bool)), - SLOT(triggeredReload(bool)))); - assert(connect(browser->pageAction(QWebPage::Cut), - SIGNAL(triggered(bool)), - SLOT(triggeredCut(bool)))); - assert(connect(browser->pageAction(QWebPage::Copy), - SIGNAL(triggered(bool)), - SLOT(triggeredCopy(bool)))); - assert(connect(browser->pageAction(QWebPage::Paste), - SIGNAL(triggered(bool)), - SLOT(triggeredPaste(bool)))); - assert(connect(browser->pageAction(QWebPage::Undo), - SIGNAL(triggered(bool)), - SLOT(triggeredUndo(bool)))); - assert(connect(browser->pageAction(QWebPage::Redo), - SIGNAL(triggered(bool)), - SLOT(triggeredRedo(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToNextChar), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToNextChar(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToPreviousChar), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToPreviousChar(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToNextWord), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToNextWord(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToPreviousWord), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToPreviousWord(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToNextLine), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToNextLine(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToPreviousLine), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToPreviousLine(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToStartOfLine), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToStartOfLine(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToEndOfLine), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToEndOfLine(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToStartOfBlock), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToStartOfBlock(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToEndOfBlock), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToEndOfBlock(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToStartOfDocument), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToStartOfDocument(bool)))); - assert(connect(browser->pageAction(QWebPage::MoveToEndOfDocument), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToEndOfDocument(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectNextChar), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectNextChar(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectPreviousChar), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectPreviousChar(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectNextWord), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectNextWord(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectPreviousWord), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectPreviousWord(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectNextLine), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectNextLine(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectPreviousLine), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectPreviousLine(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectStartOfLine), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectStartOfLine(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectEndOfLine), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectEndOfLine(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectStartOfBlock), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectStartOfBlock(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectEndOfBlock), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectEndOfBlock(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectStartOfDocument), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectStartOfDocument(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectEndOfDocument), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectEndOfDocument(bool)))); - assert(connect(browser->pageAction(QWebPage::DeleteStartOfWord), - SIGNAL(triggered(bool)), - SLOT(triggeredDeleteStartOfWord(bool)))); - assert(connect(browser->pageAction(QWebPage::DeleteEndOfWord), - SIGNAL(triggered(bool)), - SLOT(triggeredDeleteEndOfWord(bool)))); - assert(connect(browser->pageAction(QWebPage::SetTextDirectionDefault), - SIGNAL(triggered(bool)), - SLOT(triggeredSetTextDirectionDefault(bool)))); - assert(connect(browser->pageAction(QWebPage::SetTextDirectionLeftToRight), - SIGNAL(triggered(bool)), - SLOT(triggeredSetTextDirectionLeftToRight(bool)))); - assert(connect(browser->pageAction(QWebPage::SetTextDirectionRightToLeft), - SIGNAL(triggered(bool)), - SLOT(triggeredSetTextDirectionRightToLeft(bool)))); - assert(connect(browser->pageAction(QWebPage::ToggleBold), - SIGNAL(triggered(bool)), - SLOT(triggeredToggleBold(bool)))); - assert(connect(browser->pageAction(QWebPage::ToggleItalic), - SIGNAL(triggered(bool)), - SLOT(triggeredToggleItalic(bool)))); - assert(connect(browser->pageAction(QWebPage::ToggleUnderline), - SIGNAL(triggered(bool)), - SLOT(triggeredToggleUnderline(bool)))); - assert(connect(browser->pageAction(QWebPage::InspectElement), - SIGNAL(triggered(bool)), - SLOT(triggeredInspectElement(bool)))); - assert(connect(browser->pageAction(QWebPage::InsertParagraphSeparator), - SIGNAL(triggered(bool)), - SLOT(triggeredInsertParagraphSeparator(bool)))); - assert(connect(browser->pageAction(QWebPage::InsertLineSeparator), - SIGNAL(triggered(bool)), - SLOT(triggeredInsertLineSeparator(bool)))); - assert(connect(browser->pageAction(QWebPage::SelectAll), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectAll(bool)))); - // QWebPage - assert(connect(browser->page(), SIGNAL(contentsChanged()), - SLOT(contentsChanged()))); - assert(connect(browser->page(), - SIGNAL(databaseQuotaExceeded(QWebFrame*, QString)), - SLOT(databaseQuotaExceeded(QWebFrame*, QString)))); - assert(connect(browser->page(), - SIGNAL(downloadRequested(const QNetworkRequest&)), - SLOT(downloadRequested(const QNetworkRequest&)))); - assert(connect(browser->page(), SIGNAL(frameCreated(QWebFrame*)), - SLOT(frameCreated(QWebFrame*)))); - assert(connect(browser->page(), - SIGNAL(geometryChangeRequested(const QRect&)), - SLOT(geometryChangeRequested(const QRect&)))); -// assert(connect(browser->page(), SIGNAL(linkClicked(const QUrl&)), -// SLOT(linkClicked(const QUrl&)))); - assert(connect(browser->page(), - SIGNAL(linkHovered(const QString&, const QString&, - const QString&)), - SLOT(linkHovered(const QString&, const QString&, - const QString&)))); -// assert(connect(browser->page(), SIGNAL(loadFinished(bool)), -// SLOT(loadFinished(bool)))); -// assert(connect(browser->page(), SIGNAL(loadProgress(int)), -// SLOT(loadProgress(int)))); -// assert(connect(browser->page(), SIGNAL(loadStarted()), -// SLOT(loadStarted()))); - assert(connect(browser->page(), - SIGNAL(menuBarVisibilityChangeRequested(bool)), - SLOT(menuBarVisibilityChangeRequested(bool)))); - assert(connect(browser->page(), SIGNAL(microFocusChanged()), - SLOT(microFocusChanged()))); - assert(connect(browser->page(), SIGNAL(printRequested(QWebFrame*)), - SLOT(printRequested(QWebFrame*)))); - assert(connect(browser->page(), SIGNAL(repaintRequested(const QRect&)), - SLOT(repaintRequested(const QRect&)))); - assert(connect(browser->page(), - SIGNAL(restoreFrameStateRequested(QWebFrame*)), - SLOT(restoreFrameStateRequested(QWebFrame*)))); - assert(connect(browser->page(), - SIGNAL(saveFrameStateRequested(QWebFrame*, - QWebHistoryItem*)), - SLOT(saveFrameStateRequested(QWebFrame*, - QWebHistoryItem*)))); - assert(connect(browser->page(), - SIGNAL(scrollRequested(int, int, const QRect&)), - SLOT(scrollRequested(int, int, const QRect&)))); - assert(connect(browser->page(), SIGNAL(selectionChanged()), - SLOT(selectionChanged()))); -// assert(connect(browser->page(), SIGNAL(statusBarMessage(const QString&)), -// SLOT(statusBarMessage(const QString&)))); - assert(connect(browser->page(), - SIGNAL(statusBarVisibilityChangeRequested(bool)), - SLOT(statusBarVisibilityChangeRequested(bool)))); - assert(connect(browser->page(), - SIGNAL(toolBarVisibilityChangeRequested(bool)), - SLOT(toolBarVisibilityChangeRequested(bool)))); - assert(connect(browser->page(), - SIGNAL(unsupportedContent(QNetworkReply*)), - SLOT(unsupportedContent(QNetworkReply*)))); - assert(connect(browser->page(), SIGNAL(windowCloseRequested()), - SLOT(windowCloseRequested()))); - // QNetworkAccessManager - assert(connect(browser->page()->networkAccessManager(), - SIGNAL(authenticationRequired(QNetworkReply*, - QAuthenticator*)), - SLOT(authenticationRequired(QNetworkReply*, - QAuthenticator*)))); - assert(connect(browser->page()->networkAccessManager(), - SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, - QAuthenticator*)), - SLOT(proxyAuthenticationRequired(const QNetworkProxy&, - QAuthenticator*)))); - assert(connect(browser->page()->networkAccessManager(), - SIGNAL(sslErrors(QNetworkReply*, const QList&)), - SLOT(sslErrors(QNetworkReply*, const QList&)))); - _tabs->setCurrentIndex(_tabs->addTab(browser, "*empty*")); - _tabs->setTabsClosable(_tabs->count()>1); - return browser; - } - private: QComboBox* _url; diff --git a/swisssurfer/src/qmake.pro.in b/swisssurfer/src/qmake.pro.in index 419839f..0b3c397 100644 --- a/swisssurfer/src/qmake.pro.in +++ b/swisssurfer/src/qmake.pro.in @@ -20,12 +20,13 @@ TRANSLATIONS = @PACKAGENAME@_en.ts \ @PACKAGENAME@_fr.ts \ @PACKAGENAME@_it.ts -SOURCES = main.cxx smartcardauth.cxx pindialog.cxx +SOURCES = main.cxx smartcardauth.cxx pindialog.cxx webpage.cxx HEADERS = browser.hxx smartcardauth.hxx pindialog.hxx \ - downloadmanager.hxx settings.hxx sslclientnetworkmanager.hxx + downloadmanager.hxx settings.hxx sslclientnetworkmanager.hxx \ + authentication.hxx webpage.hxx -FORMS = browser.ui settings.ui pinentry.ui +FORMS = browser.ui settings.ui pinentry.ui authentication.ui RESOURCES = languages.qrc resources.qrc diff --git a/swisssurfer/src/smartcardauth.cxx b/swisssurfer/src/smartcardauth.cxx index f395801..27d83b1 100644 --- a/swisssurfer/src/smartcardauth.cxx +++ b/swisssurfer/src/smartcardauth.cxx @@ -59,6 +59,7 @@ std::map sockets; int client_cert_cb(SSL* ssl, X509 **x509, EVP_PKEY **pkey) { if (!e) return 0; + while (!_mutex.tryLock()) QCoreApplication::processEvents(); static std::set allowedUrls; std::map::iterator it(sockets.find(ssl->ctx)); if (it!=sockets.end()) { @@ -76,7 +77,6 @@ int client_cert_cb(SSL* ssl, X509 **x509, EVP_PKEY **pkey) { sockets.erase(it); } - while (!_mutex.tryLock()) QCoreApplication::processEvents(); // NB: Keep in mind that this function is called for EVERY SSL connection to be opened. for(size_t i=certs_found->num_certs;i--;) diff --git a/swisssurfer/src/swisssurfer_de.ts b/swisssurfer/src/swisssurfer_de.ts index 12cba98..860797e 100644 --- a/swisssurfer/src/swisssurfer_de.ts +++ b/swisssurfer/src/swisssurfer_de.ts @@ -2,6 +2,34 @@ UTF-8 + + Authentication + + + Authorization + + + + + Authentication required for: + + + + + realm + + + + + Username: + + + + + Password: + + + Browser @@ -193,210 +221,210 @@ - + The connection to the proxy server was refused (the proxy server is not accepting requests). the connection to the proxy timed out or the proxy did not reply in time to the request sent - + The proxy requires authentication in order to honour the request but did not accept any credentials offered (if any). the Network Access API cannot honor the request because the protocol is not known - + Checking: %1 Opening: %1 - + Reading: %1 Reading: %1% - + Zoom: %1% - + Network connection successful, remote host can be reached. - + The remote server refused the connection (the server is not accepting requests). - + The remote server closed the connection prematurely, before the entire reply was received and processed. - + The remote host name was not found (invalid hostname). - + The connection to the remote server timed out. - + The operation was canceled via calls to abort() or close() before it was finished. - + The SSL/TLS handshake failed and the encrypted channel could not be established. The sslErrors() signal should have been emitted. - + The proxy server closed the connection prematurely, before the entire reply was received and processed. - + The proxy host name was not found (invalid proxy hostname). - + The connection to the proxy timed out or the proxy did not reply in time to the request sent. - + The access to the remote content was denied (similar to HTTP error 401). - + The operation requested on the remote content is not permitted. - + The remote content was not found at the server (similar to HTTP error 404). - + The remote server requires authentication to serve the content but the credentials provided were not accepted (if any). - + The Network Access API cannot honor the request because the protocol is not known. - + The requested operation is invalid for this protocol. - + An unknown network-related error was detected. - + An unknown proxy-related error was detected. - + An unknonwn error related to the remote content was detected. - + A breakdown in protocol was detected (parsing error, invalid or unexpected responses, etc.). - + <strong>Unknown network error (code: %1).</string> - + Illegal URL: %1 - + Print Document - + %1 - %2 Back to %1 - %2 statusbar actionBack_hovered %1=url %2=title - + Info: %1 - + done. - + %1 statusbar for hovered link %1=url - + Forbidden: %1 - + Access Denied - + <p>Access denied due to security considerations.</p><p>You are not allowed to connect to %1. - + %1 - %2 statusbar actionForward_hovered %1=url %2=title - + %1 - + Save File As ... - + authentication required - + ssl error @@ -505,12 +533,12 @@ Try: %1 --help - + Send Authentication? - + Do you want to authenticate yourself to %1? diff --git a/swisssurfer/src/swisssurfer_en.ts b/swisssurfer/src/swisssurfer_en.ts index 12cba98..860797e 100644 --- a/swisssurfer/src/swisssurfer_en.ts +++ b/swisssurfer/src/swisssurfer_en.ts @@ -2,6 +2,34 @@ UTF-8 + + Authentication + + + Authorization + + + + + Authentication required for: + + + + + realm + + + + + Username: + + + + + Password: + + + Browser @@ -193,210 +221,210 @@ - + The connection to the proxy server was refused (the proxy server is not accepting requests). the connection to the proxy timed out or the proxy did not reply in time to the request sent - + The proxy requires authentication in order to honour the request but did not accept any credentials offered (if any). the Network Access API cannot honor the request because the protocol is not known - + Checking: %1 Opening: %1 - + Reading: %1 Reading: %1% - + Zoom: %1% - + Network connection successful, remote host can be reached. - + The remote server refused the connection (the server is not accepting requests). - + The remote server closed the connection prematurely, before the entire reply was received and processed. - + The remote host name was not found (invalid hostname). - + The connection to the remote server timed out. - + The operation was canceled via calls to abort() or close() before it was finished. - + The SSL/TLS handshake failed and the encrypted channel could not be established. The sslErrors() signal should have been emitted. - + The proxy server closed the connection prematurely, before the entire reply was received and processed. - + The proxy host name was not found (invalid proxy hostname). - + The connection to the proxy timed out or the proxy did not reply in time to the request sent. - + The access to the remote content was denied (similar to HTTP error 401). - + The operation requested on the remote content is not permitted. - + The remote content was not found at the server (similar to HTTP error 404). - + The remote server requires authentication to serve the content but the credentials provided were not accepted (if any). - + The Network Access API cannot honor the request because the protocol is not known. - + The requested operation is invalid for this protocol. - + An unknown network-related error was detected. - + An unknown proxy-related error was detected. - + An unknonwn error related to the remote content was detected. - + A breakdown in protocol was detected (parsing error, invalid or unexpected responses, etc.). - + <strong>Unknown network error (code: %1).</string> - + Illegal URL: %1 - + Print Document - + %1 - %2 Back to %1 - %2 statusbar actionBack_hovered %1=url %2=title - + Info: %1 - + done. - + %1 statusbar for hovered link %1=url - + Forbidden: %1 - + Access Denied - + <p>Access denied due to security considerations.</p><p>You are not allowed to connect to %1. - + %1 - %2 statusbar actionForward_hovered %1=url %2=title - + %1 - + Save File As ... - + authentication required - + ssl error @@ -505,12 +533,12 @@ Try: %1 --help - + Send Authentication? - + Do you want to authenticate yourself to %1? diff --git a/swisssurfer/src/swisssurfer_fr.ts b/swisssurfer/src/swisssurfer_fr.ts index 12cba98..860797e 100644 --- a/swisssurfer/src/swisssurfer_fr.ts +++ b/swisssurfer/src/swisssurfer_fr.ts @@ -2,6 +2,34 @@ UTF-8 + + Authentication + + + Authorization + + + + + Authentication required for: + + + + + realm + + + + + Username: + + + + + Password: + + + Browser @@ -193,210 +221,210 @@ - + The connection to the proxy server was refused (the proxy server is not accepting requests). the connection to the proxy timed out or the proxy did not reply in time to the request sent - + The proxy requires authentication in order to honour the request but did not accept any credentials offered (if any). the Network Access API cannot honor the request because the protocol is not known - + Checking: %1 Opening: %1 - + Reading: %1 Reading: %1% - + Zoom: %1% - + Network connection successful, remote host can be reached. - + The remote server refused the connection (the server is not accepting requests). - + The remote server closed the connection prematurely, before the entire reply was received and processed. - + The remote host name was not found (invalid hostname). - + The connection to the remote server timed out. - + The operation was canceled via calls to abort() or close() before it was finished. - + The SSL/TLS handshake failed and the encrypted channel could not be established. The sslErrors() signal should have been emitted. - + The proxy server closed the connection prematurely, before the entire reply was received and processed. - + The proxy host name was not found (invalid proxy hostname). - + The connection to the proxy timed out or the proxy did not reply in time to the request sent. - + The access to the remote content was denied (similar to HTTP error 401). - + The operation requested on the remote content is not permitted. - + The remote content was not found at the server (similar to HTTP error 404). - + The remote server requires authentication to serve the content but the credentials provided were not accepted (if any). - + The Network Access API cannot honor the request because the protocol is not known. - + The requested operation is invalid for this protocol. - + An unknown network-related error was detected. - + An unknown proxy-related error was detected. - + An unknonwn error related to the remote content was detected. - + A breakdown in protocol was detected (parsing error, invalid or unexpected responses, etc.). - + <strong>Unknown network error (code: %1).</string> - + Illegal URL: %1 - + Print Document - + %1 - %2 Back to %1 - %2 statusbar actionBack_hovered %1=url %2=title - + Info: %1 - + done. - + %1 statusbar for hovered link %1=url - + Forbidden: %1 - + Access Denied - + <p>Access denied due to security considerations.</p><p>You are not allowed to connect to %1. - + %1 - %2 statusbar actionForward_hovered %1=url %2=title - + %1 - + Save File As ... - + authentication required - + ssl error @@ -505,12 +533,12 @@ Try: %1 --help - + Send Authentication? - + Do you want to authenticate yourself to %1? diff --git a/swisssurfer/src/swisssurfer_it.ts b/swisssurfer/src/swisssurfer_it.ts index 12cba98..860797e 100644 --- a/swisssurfer/src/swisssurfer_it.ts +++ b/swisssurfer/src/swisssurfer_it.ts @@ -2,6 +2,34 @@ UTF-8 + + Authentication + + + Authorization + + + + + Authentication required for: + + + + + realm + + + + + Username: + + + + + Password: + + + Browser @@ -193,210 +221,210 @@ - + The connection to the proxy server was refused (the proxy server is not accepting requests). the connection to the proxy timed out or the proxy did not reply in time to the request sent - + The proxy requires authentication in order to honour the request but did not accept any credentials offered (if any). the Network Access API cannot honor the request because the protocol is not known - + Checking: %1 Opening: %1 - + Reading: %1 Reading: %1% - + Zoom: %1% - + Network connection successful, remote host can be reached. - + The remote server refused the connection (the server is not accepting requests). - + The remote server closed the connection prematurely, before the entire reply was received and processed. - + The remote host name was not found (invalid hostname). - + The connection to the remote server timed out. - + The operation was canceled via calls to abort() or close() before it was finished. - + The SSL/TLS handshake failed and the encrypted channel could not be established. The sslErrors() signal should have been emitted. - + The proxy server closed the connection prematurely, before the entire reply was received and processed. - + The proxy host name was not found (invalid proxy hostname). - + The connection to the proxy timed out or the proxy did not reply in time to the request sent. - + The access to the remote content was denied (similar to HTTP error 401). - + The operation requested on the remote content is not permitted. - + The remote content was not found at the server (similar to HTTP error 404). - + The remote server requires authentication to serve the content but the credentials provided were not accepted (if any). - + The Network Access API cannot honor the request because the protocol is not known. - + The requested operation is invalid for this protocol. - + An unknown network-related error was detected. - + An unknown proxy-related error was detected. - + An unknonwn error related to the remote content was detected. - + A breakdown in protocol was detected (parsing error, invalid or unexpected responses, etc.). - + <strong>Unknown network error (code: %1).</string> - + Illegal URL: %1 - + Print Document - + %1 - %2 Back to %1 - %2 statusbar actionBack_hovered %1=url %2=title - + Info: %1 - + done. - + %1 statusbar for hovered link %1=url - + Forbidden: %1 - + Access Denied - + <p>Access denied due to security considerations.</p><p>You are not allowed to connect to %1. - + %1 - %2 statusbar actionForward_hovered %1=url %2=title - + %1 - + Save File As ... - + authentication required - + ssl error @@ -505,12 +533,12 @@ Try: %1 --help - + Send Authentication? - + Do you want to authenticate yourself to %1? diff --git a/swisssurfer/src/webpage.cxx b/swisssurfer/src/webpage.cxx new file mode 100644 index 0000000..bea9427 --- /dev/null +++ b/swisssurfer/src/webpage.cxx @@ -0,0 +1,20 @@ +/*! @file + + @id $Id$ +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +#include +#include + +QWebPage* WebPage::createWindow(WebWindowType type) { + switch (type) { + case QWebPage::WebBrowserWindow: + case QWebPage::WebModalDialog: { + return _browser->newTab()->page(); + } break; + } + return 0; +} + diff --git a/swisssurfer/src/webpage.hxx b/swisssurfer/src/webpage.hxx new file mode 100644 index 0000000..2f7456b --- /dev/null +++ b/swisssurfer/src/webpage.hxx @@ -0,0 +1,24 @@ +/*! @file + + @id $Id$ +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +#ifndef __WEBPAGE_HXX__ +#define __WEBPAGE_HXX__ + +#include + +class Browser; + +class WebPage: public QWebPage { + public: + WebPage(Browser* b, QObject *parent = 0): QWebPage(parent), _browser(b) {} + protected: + QWebPage* createWindow(WebWindowType type); + private: + Browser* _browser; +}; + +#endif