From fbf345e75c4b55db273e766a79350d6437856bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Tue, 18 Jan 2011 14:40:19 +0000 Subject: [PATCH] closes #9; closes #10; closes #13 --- swisssurfer/README | 7 +- swisssurfer/src/browser.hxx | 915 ++++++++++++++++------------ swisssurfer/src/browser.ui | 58 +- swisssurfer/src/downloadmanager.hxx | 106 ++++ swisssurfer/src/main.cxx | 29 +- swisssurfer/src/qmake.pro.in | 2 +- swisssurfer/src/swisssurfer_de.ts | 309 +++++----- swisssurfer/src/swisssurfer_en.ts | 309 +++++----- swisssurfer/src/swisssurfer_fr.ts | 309 +++++----- swisssurfer/src/swisssurfer_it.ts | 309 +++++----- 10 files changed, 1337 insertions(+), 1016 deletions(-) create mode 100644 swisssurfer/src/downloadmanager.hxx diff --git a/swisssurfer/README b/swisssurfer/README index 8b28388..b03c32e 100644 --- a/swisssurfer/README +++ b/swisssurfer/README @@ -3,4 +3,9 @@ Zum Konfigurieren muss der Pfad zur Installation des gepatchten Qts angegeben we ./bootstrap.sh && \ QMAKE=/usr/local/Trolltech/Qt-4.6.3/bin/qmake ./configure && \ make - \ No newline at end of file + +Start e.g. with: + +SWISSSIGNER='java -Xmx256M -Dorg.jpedal.jai=true -Dswing.aatext=true -Dch.abacus.swisssigner.incamail.certlogin=false -splash:swisssigner-splash.png -Dch.abacus.pkcs11.configuration=swisssigner-pkcs11.cfg -Duser.language=de -cp /home/marc/downloads/swisssigner/swisssigner.jar:/home/marc/downloads/swisssigner/bc.jar:bcmail.jar:/home/marc/downloads/swisssigner/bcpg.jar:/home/marc/downloads/swisssigner/bctsp.jar:/home/marc/downloads/swisssigner/exml.jar:/home/marc/downloads/swisssigner/itext.jar:/home/marc/downloads/swisssigner/jai_codec.jar:/home/marc/downloads/swisssigner/jai_core.jar:/home/marc/downloads/swisssigner/jai_imageio.jar:/home/marc/downloads/swisssigner/jdic.jar:/home/marc/downloads/swisssigner/jdic_native.jar:/home/marc/downloads/swisssigner/jdic_stub_unix.jar:/home/marc/downloads/swisssigner/jpedal.jar: ch.abacus.hotdog.SwissSigner locale=de document= browser_bin=firefox keystores=pkcs11' + +src/swisssurfer --mime application/pdf pdf "$SWISSSIGNER" --mime application/x-java-jnlp-file jnlp "javaws " http://swisssign.com/de/swisssign-support/ss-faq/7-server-certificates/34-how-to-apache-konfiguration-mit-ssl-zertifikaten diff --git a/swisssurfer/src/browser.hxx b/swisssurfer/src/browser.hxx index 985c668..4ec464a 100644 --- a/swisssurfer/src/browser.hxx +++ b/swisssurfer/src/browser.hxx @@ -25,16 +25,21 @@ #include #include #include - -#include +#include +#include +#include +#include #include +#include #include #include -#include +#include +#ifndef LOG #define LOG qDebug()<<__PRETTY_FUNCTION__ +#endif extern SmartCardAuth _scAuth; @@ -50,6 +55,10 @@ class SslClientAuthNetworkAccessManager: public QNetworkAccessManager { virtual ~SslClientAuthNetworkAccessManager() { LOG; } + + Q_SIGNALS: + + void created(QNetworkReply*); protected: @@ -59,8 +68,8 @@ class SslClientAuthNetworkAccessManager: public QNetworkAccessManager { LOG<url().toString(); + created(rep); + LOG<<"Reply to URL: "<url().toString(); return rep; } @@ -72,31 +81,28 @@ class Browser: public QMainWindow, protected Ui::Browser { public: - Browser(const QString& url, bool kiosk = false, - bool proxydetection = false): - _url(0), _home(url), _proxy(0), - _kiosk(kiosk) { + typedef std::map > MimeTypes; + + public: + + Browser(const QString& url, MimeTypes mimeTypes, bool kiosk = false): + _url(0), _find(0), _home(url), _kiosk(kiosk), _mimetypes(mimeTypes) { LOG<setAttribute + (QWebSettings::PluginsEnabled, true); if (!check(url)) throw std::runtime_error(tr("access to URL %1 not allowed") .arg(url).toStdString()); setupUi(this); - on_actionNewTab_triggered(); - actionProxySettings->setEnabled(proxydetection); - if (proxydetection) { - _proxy = new gui::Proxy(url, this); - assert(connect(_proxy, SIGNAL(proxyFound(const QUrl&, - const QNetworkProxy&)), - SLOT(startDownload(QUrl, const QNetworkProxy&)))); - assert(connect(_proxy, SIGNAL(temporaryError - (QNetworkReply::NetworkError, - QString, QString)), - SLOT(proxy_error(QNetworkReply::NetworkError, - QString, QString)))); - assert(connect(_proxy, SIGNAL(proxyError(QNetworkReply::NetworkError)), - SLOT(proxy_error(QNetworkReply::NetworkError)))); - } + statusBar()->addPermanentWidget(_progress = new QProgressBar()); + statusBar()->addPermanentWidget(_zoom = new QSlider(Qt::Horizontal)); + _zoom->setMinimum(1); + _zoom->setMaximum(100); + _zoom->setValue(10); + assert(connect(_zoom, SIGNAL(valueChanged(int)), SLOT(zoom(int)))); _toolbar->addWidget(_url = new QLineEdit(_toolbar)); + on_actionNewTab_triggered(); _url->setText(url); assert(connect(_url, SIGNAL(returnPressed()), SLOT(load()))); assert(connect(&_networkManager, @@ -105,19 +111,35 @@ class Browser: public QMainWindow, protected Ui::Browser { &_scAuth, SLOT(extendedContextInitialization(ssl_ctx_st*, QSslSocket*)))); + assert(connect(&_networkManager, SIGNAL(created(QNetworkReply*)), + &_downloadManager, SLOT(add(QNetworkReply*)))); + + assert(connect(&_downloadManager, SIGNAL(progress(qint64, qint64)), + SLOT(progress(qint64, qint64)))); + assert(connect(&_downloadManager, SIGNAL(started()), + SLOT(started()))); + assert(connect(&_downloadManager, SIGNAL(finished()), + SLOT(finished()))); + if (_kiosk) { _menu->hide(); _url->setEnabled(false); } - statusBar()->addPermanentWidget(_progress = new QProgressBar()); - statusBar()->addPermanentWidget(_zoom = new QSlider(Qt::Horizontal)); - _zoom->setMinimum(1); - _zoom->setMaximum(100); - _zoom->setValue(10); - assert(connect(_zoom, SIGNAL(valueChanged(int)), SLOT(zoom(int)))); load(url); } + ~Browser() { + LOG; + for (DownloadProcesses::iterator it(_downloadProcesses.begin()); + it!=_downloadProcesses.end(); ++it) { + LOG<<"delete:"<second->fileName(); + delete it->second; + it->second = 0; + it->first->terminate(); + delete it->first; + } + } + QString networkError(QNetworkReply::NetworkError err) { LOG<showMessage(tr("Checking: %1").arg(page.toString())); - try { - if (!check(page)) { - qDebug()<<"########## BLACK LISTED IGNORED ##########"; - statusBar()->showMessage(tr("Forbidden: %1").arg(page.toString())); - QMessageBox::warning(this, tr("Access Denied"), - tr("

Access denied due to security" - " considerations.

You are not" - " allowed to connect to %1.") - .arg(page.toString())); - return; - } - if (_proxy) _proxy->checkUrl(page.toString()); - _progress->setValue(0); - _progress->setMaximum(0); - _progress->show(); - if (!_proxy) startDownload(page); - } catch (...) { - reply_error(QNetworkReply::ProxyNotFoundError); - } // no network + if (!check(page)) { + LOG<<"########## BLACK LISTED IGNORED ##########"; + statusBar()->showMessage(tr("Forbidden: %1").arg(page.toString())); + QMessageBox::warning(this, tr("Access Denied"), + tr("

Access denied due to security" + " considerations.

You are not" + " allowed to connect to %1.") + .arg(page.toString())); + return; + } + startDownload(page); } - void startDownload(QUrl url, const QNetworkProxy& proxy) { - LOG; - QNetworkProxy::setApplicationProxy(proxy); - startDownload(url); - } - void startDownload(QUrl url) { LOG<showMessage(tr("Reading: %1").arg(url.toString())); if (!url.isValid()) { statusBar()->showMessage(tr("Illegal URL: %1").arg(url.errorString())); - _progress->hide(); return; } //if (url.scheme()=="") url.setScheme("http"); dynamic_cast(_tabs->currentWidget())->load(url); } - void reply_error(QNetworkReply::NetworkError err) { - LOG<showMessage(tr("network error")); - _error += tr("

%1

%2

") - .arg(tr("Reply Error")) - .arg(networkError(err)); - } - - //! intermediate proxy error - void proxy_error(QNetworkReply::NetworkError err, - QString errStr, QString proxy) { - LOG<showMessage(tr("proxy error")); - _error += tr("

%1

Proxy: %3

%2

%4

") - .arg(tr("Possible Proxy Failed")) - .arg(networkError(err)) - .arg(proxy) - .arg(errStr); - } - - //! final proxy error - void proxy_error(QNetworkReply::NetworkError err) { - LOG<showMessage(tr("proxy error")); - _error = tr("

%1

%2

") - .arg(tr("Connection Cannot Be Established")) - .arg(networkError(err)) + _error; -// on__browser_loadFinished(false); //! @todo - } - void zoom(int i) { LOG<<100.0*i/10.0; statusBar()->showMessage(tr("Zoom: %1%").arg(100.0*i/10.0)); @@ -290,73 +275,6 @@ class Browser: public QMainWindow, protected Ui::Browser { load(_home); } -// void on__browser_urlChanged(const QUrl& url) { //!@todo -// LOG<setText(url.toString()); -// } - -// void on__browser_linkClicked(const QUrl& url) { //!@todo -// LOG<icon()); -// } - -// void on__browser_titleChanged(const QString& text) { //!@todo -// LOG<showMessage(tr("Info: %1").arg(text)); -// } - -// void on__browser_loadProgress(int i) { -// LOG<setValue(i); -// } - -// void on__browser_loadStarted() { -// LOG; -// _progress->setValue(0); -// _progress->setMaximum(100); -// _progress->show(); -// actionStop->setEnabled(true); -// actionForward->setEnabled(false); -// actionBack->setEnabled(false); -// actionReload->setEnabled(false); -// actionHome->setEnabled(false); -// } - -// void on__browser_loadFinished(bool ok) { -// LOG<<(ok?"success":"error"); -// if (!ok) { -// _browser->setHtml(tr("Page Load Error" -// "

Page Load Error

%1" -// "") -// .arg(_error), -// _errorUrl); -// statusBar()->showMessage(tr("download error")); -// } else { -// statusBar()->showMessage(tr("done.")); -// } -// _error.clear(); -// _progress->hide(); -// on__browser_iconChanged(); -// actionStop->setEnabled(false); -// actionForward->setEnabled(_browser->history()->canGoForward()); -// actionBack->setEnabled(_browser->history()->canGoBack()); -// actionReload->setEnabled(true); -// actionHome->setEnabled(true); -// } - -// //!@todo ^^^ - // void on_actionNew_triggered() { //@!todo exec new process // LOG; // (new Browser(dynamic_cast(_tabs->currentWidget())->url().toString(), _kiosk, false))->show(); @@ -366,166 +284,187 @@ class Browser: public QMainWindow, protected Ui::Browser { 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)))); + assert(connect(browser, SIGNAL(iconChanged()), + SLOT(iconChanged()))); // QWebPage WebAction - connect(browser->pageAction(QWebPage::OpenLink), - SIGNAL(triggered(bool)), - SLOT(triggeredOpenLink(bool))); - connect(browser->pageAction(QWebPage::OpenLinkInNewWindow), - SIGNAL(triggered(bool)), - SLOT(triggeredOpenLinkInNewWindow(bool))); - connect(browser->pageAction(QWebPage::OpenFrameInNewWindow), - SIGNAL(triggered(bool)), - SLOT(triggeredOpenFrameInNewWindow(bool))); - connect(browser->pageAction(QWebPage::DownloadLinkToDisk), - SIGNAL(triggered(bool)), - SLOT(triggeredDownloadLinkToDisk(bool))); - connect(browser->pageAction(QWebPage::CopyLinkToClipboard), - SIGNAL(triggered(bool)), - SLOT(triggeredCopyLinkToClipboard(bool))); - connect(browser->pageAction(QWebPage::OpenImageInNewWindow), - SIGNAL(triggered(bool)), - SLOT(triggeredOpenImageInNewWindow(bool))); - connect(browser->pageAction(QWebPage::DownloadImageToDisk), - SIGNAL(triggered(bool)), - SLOT(triggeredDownloadImageToDisk(bool))); - connect(browser->pageAction(QWebPage::CopyImageToClipboard), - SIGNAL(triggered(bool)), - SLOT(triggeredCopyImageToClipboard(bool))); - connect(browser->pageAction(QWebPage::Back), - SIGNAL(triggered(bool)), - SLOT(triggeredBack(bool))); - connect(browser->pageAction(QWebPage::Forward), - SIGNAL(triggered(bool)), - SLOT(triggeredForward(bool))); - connect(browser->pageAction(QWebPage::Stop), - SIGNAL(triggered(bool)), - SLOT(triggeredStop(bool))); - connect(browser->pageAction(QWebPage::Reload), - SIGNAL(triggered(bool)), - SLOT(triggeredReload(bool))); - connect(browser->pageAction(QWebPage::Cut), - SIGNAL(triggered(bool)), - SLOT(triggeredCut(bool))); - connect(browser->pageAction(QWebPage::Copy), - SIGNAL(triggered(bool)), - SLOT(triggeredCopy(bool))); - connect(browser->pageAction(QWebPage::Paste), - SIGNAL(triggered(bool)), - SLOT(triggeredPaste(bool))); - connect(browser->pageAction(QWebPage::Undo), - SIGNAL(triggered(bool)), - SLOT(triggeredUndo(bool))); - connect(browser->pageAction(QWebPage::Redo), - SIGNAL(triggered(bool)), - SLOT(triggeredRedo(bool))); - connect(browser->pageAction(QWebPage::MoveToNextChar), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToNextChar(bool))); - connect(browser->pageAction(QWebPage::MoveToPreviousChar), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToPreviousChar(bool))); - connect(browser->pageAction(QWebPage::MoveToNextWord), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToNextWord(bool))); - connect(browser->pageAction(QWebPage::MoveToPreviousWord), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToPreviousWord(bool))); - connect(browser->pageAction(QWebPage::MoveToNextLine), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToNextLine(bool))); - connect(browser->pageAction(QWebPage::MoveToPreviousLine), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToPreviousLine(bool))); - connect(browser->pageAction(QWebPage::MoveToStartOfLine), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToStartOfLine(bool))); - connect(browser->pageAction(QWebPage::MoveToEndOfLine), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToEndOfLine(bool))); - connect(browser->pageAction(QWebPage::MoveToStartOfBlock), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToStartOfBlock(bool))); - connect(browser->pageAction(QWebPage::MoveToEndOfBlock), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToEndOfBlock(bool))); - connect(browser->pageAction(QWebPage::MoveToStartOfDocument), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToStartOfDocument(bool))); - connect(browser->pageAction(QWebPage::MoveToEndOfDocument), - SIGNAL(triggered(bool)), - SLOT(triggeredMoveToEndOfDocument(bool))); - connect(browser->pageAction(QWebPage::SelectNextChar), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectNextChar(bool))); - connect(browser->pageAction(QWebPage::SelectPreviousChar), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectPreviousChar(bool))); - connect(browser->pageAction(QWebPage::SelectNextWord), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectNextWord(bool))); - connect(browser->pageAction(QWebPage::SelectPreviousWord), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectPreviousWord(bool))); - connect(browser->pageAction(QWebPage::SelectNextLine), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectNextLine(bool))); - connect(browser->pageAction(QWebPage::SelectPreviousLine), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectPreviousLine(bool))); - connect(browser->pageAction(QWebPage::SelectStartOfLine), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectStartOfLine(bool))); - connect(browser->pageAction(QWebPage::SelectEndOfLine), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectEndOfLine(bool))); - connect(browser->pageAction(QWebPage::SelectStartOfBlock), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectStartOfBlock(bool))); - connect(browser->pageAction(QWebPage::SelectEndOfBlock), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectEndOfBlock(bool))); - connect(browser->pageAction(QWebPage::SelectStartOfDocument), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectStartOfDocument(bool))); - connect(browser->pageAction(QWebPage::SelectEndOfDocument), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectEndOfDocument(bool))); - connect(browser->pageAction(QWebPage::DeleteStartOfWord), - SIGNAL(triggered(bool)), - SLOT(triggeredDeleteStartOfWord(bool))); - connect(browser->pageAction(QWebPage::DeleteEndOfWord), - SIGNAL(triggered(bool)), - SLOT(triggeredDeleteEndOfWord(bool))); - connect(browser->pageAction(QWebPage::SetTextDirectionDefault), - SIGNAL(triggered(bool)), - SLOT(triggeredSetTextDirectionDefault(bool))); - connect(browser->pageAction(QWebPage::SetTextDirectionLeftToRight), - SIGNAL(triggered(bool)), - SLOT(triggeredSetTextDirectionLeftToRight(bool))); - connect(browser->pageAction(QWebPage::SetTextDirectionRightToLeft), - SIGNAL(triggered(bool)), - SLOT(triggeredSetTextDirectionRightToLeft(bool))); - connect(browser->pageAction(QWebPage::ToggleBold), - SIGNAL(triggered(bool)), - SLOT(triggeredToggleBold(bool))); - connect(browser->pageAction(QWebPage::ToggleItalic), - SIGNAL(triggered(bool)), - SLOT(triggeredToggleItalic(bool))); - connect(browser->pageAction(QWebPage::ToggleUnderline), - SIGNAL(triggered(bool)), - SLOT(triggeredToggleUnderline(bool))); - connect(browser->pageAction(QWebPage::InspectElement), - SIGNAL(triggered(bool)), - SLOT(triggeredInspectElement(bool))); - connect(browser->pageAction(QWebPage::InsertParagraphSeparator), - SIGNAL(triggered(bool)), - SLOT(triggeredInsertParagraphSeparator(bool))); - connect(browser->pageAction(QWebPage::InsertLineSeparator), - SIGNAL(triggered(bool)), - SLOT(triggeredInsertLineSeparator(bool))); - connect(browser->pageAction(QWebPage::SelectAll), - SIGNAL(triggered(bool)), - SLOT(triggeredSelectAll(bool))); + 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()))); @@ -540,19 +479,19 @@ class Browser: public QMainWindow, protected Ui::Browser { 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(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(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)))); @@ -575,8 +514,8 @@ class Browser: public QMainWindow, protected Ui::Browser { 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(statusBarMessage(const QString&)), +// SLOT(statusBarMessage(const QString&)))); assert(connect(browser->page(), SIGNAL(statusBarVisibilityChangeRequested(bool)), SLOT(statusBarVisibilityChangeRequested(bool)))); @@ -594,9 +533,6 @@ class Browser: public QMainWindow, protected Ui::Browser { QAuthenticator*)), SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*)))); - assert(connect(browser->page()->networkAccessManager(), - SIGNAL(finished(QNetworkReply*)), - SLOT(finished(QNetworkReply*)))); assert(connect(browser->page()->networkAccessManager(), SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)), @@ -610,9 +546,14 @@ class Browser: public QMainWindow, protected Ui::Browser { } void on__tabs_currentChanged(int index) { + _url->setText(dynamic_cast(_tabs->currentWidget()) + ->url().toString()); + activateTab(); } void on__tabs_tabCloseRequested(int index) { + _error.erase(_tabs->widget(index)); + _errorUrl.erase(_tabs->widget(index)); _tabs->removeTab(index); _tabs->setTabsClosable(_tabs->count()>1); } @@ -641,14 +582,145 @@ class Browser: public QMainWindow, protected Ui::Browser { close(); } - void on_actionProxySettings_triggered() { + void on_actionBack_triggered() { LOG; - if (_proxy) _proxy->show(); + dynamic_cast(_tabs->currentWidget())->history()->back(); } - //@name QWebPage slots - //@{ + void on_actionBack_hovered() { + LOG; + if (!dynamic_cast(_tabs->currentWidget())->history() + ->backItem().isValid()) + return; + actionBack->setStatusTip + (tr("%1 - %2", "statusbar actionBack_hovered %1=url %2=title") + .arg(dynamic_cast(_tabs->currentWidget())->history() + ->backItem().url().toString()) + .arg(dynamic_cast(_tabs->currentWidget())->history() + ->backItem().title())); + actionBack->showStatusText(this); + } + void on_actionForward_triggered() { + LOG; + dynamic_cast(_tabs->currentWidget())->history()->forward(); + } + + void on_actionForward_hovered() { + LOG; + if (!dynamic_cast(_tabs->currentWidget())->history() + ->forwardItem().isValid()) + return; + actionForward->setStatusTip + (tr("%1 - %2", "statusbar actionForward_hovered %1=url %2=title") + .arg(dynamic_cast(_tabs->currentWidget())->history() + ->forwardItem().url().toString()) + .arg(dynamic_cast(_tabs->currentWidget())->history() + ->forwardItem().title())); + actionForward->showStatusText(this); + } + + void on_actionReload_triggered() { + LOG; + dynamic_cast(_tabs->currentWidget())->reload(); + } + + void on_actionStop_triggered() { + LOG; + _downloadManager.abort(); + } + + void on_actionFind_triggered() { + if (!_find) { + statusBar()->addPermanentWidget(_find = new QLineEdit); + _find->setText(dynamic_cast(_tabs->currentWidget()) + ->selectedText()); + assert(connect(_find, SIGNAL(returnPressed()), SLOT(find()))); + } + _find->setFocus(); + } + + void find() { + dynamic_cast(_tabs->currentWidget())->findText(_find->text()); + } + + void on_actionUnFind_triggered() { + delete _find; _find=0; + } + + void on_actionAbout_triggered() { + QMessageBox::aboutQt(this); + } + + //@name QWebView slots + //@{ + + void urlChanged(const QUrl& url) { //!@todo + LOG<currentWidget()) return; + LOG<<"signal on current tab"; + if (_url) _url->setText(url.toString()); + } + + void linkClicked(const QUrl& url) { //!@todo + LOG<currentWidget()) return; + LOG<<"signal on current tab"; + load(url); + } + + void iconChanged() { //!@todo + LOG; + if (sender()!=_tabs->currentWidget()) return; + LOG<<"signal on current tab"; + setWindowIcon(dynamic_cast(_tabs->currentWidget())->icon()); + } + + void titleChanged(const QString& text) { //!@todo + LOG<currentWidget()) return; + LOG<<"signal on current tab"; + _tabs->setTabText(_tabs->indexOf(qobject_cast(sender())), + trUtf8("%1").arg(text)); + } + + void statusBarMessage(const QString& text) { //!@todo + LOG<currentWidget()) return; + LOG<<"signal on current tab"; + if (text.size()) statusBar()->showMessage(tr("Info: %1").arg(text)); + } + + void loadProgress(int i) { + LOG<(sender()) +// ->setHtml(tr("Page Load Error" +// "

Page Load Error

%1" +// "") +// .arg(_error[sender()]), +// _errorUrl[sender()]); +// } + if (sender()!=_tabs->currentWidget()) return; + LOG<<"signal on current tab"; + _error[sender()].clear(); + if (ok) statusBar()->showMessage(tr("done.")); + activateTab(); + } + + //@} + + //@name QWebPage WebAction slots + //@{ + void triggeredOpenLink(bool) { LOG; } @@ -886,9 +958,9 @@ class Browser: public QMainWindow, protected Ui::Browser { LOG; } - void linkClicked(const QUrl& url) { - LOG<showMessage(tr("unsupported content")); - _error += tr("

%1

URL: %3

%2

") - .arg(tr("Unsuported Content")) - .arg(networkError(reply->error())) - .arg(reply->url().toString()); - _errorUrl = reply->url(); + LOG<header(QNetworkRequest::ContentTypeHeader).toString(); + LOG<<"Status:"<error()); + assert(connect(reply, SIGNAL(finished()), SLOT(downloadFinished()))); } + + void downloadFinished() { + QNetworkReply *reply(qobject_cast(sender())); + LOG<<"Location:"<header(QNetworkRequest::LocationHeader) + .toString(); + LOG<<"Content-Type:"<header(QNetworkRequest::ContentTypeHeader) + .toString(); + LOG<<"Status:"<error()); + LOG<<"URL:"<url().toString(); + LOG<<"File:"<url().toLocalFile(); + LOG<<"Path:"<url().path(); + MimeTypes::iterator it + (_mimetypes.find(reply->header(QNetworkRequest::ContentTypeHeader) + .toString())); + if (it!=_mimetypes.end()) { + QTemporaryFile *file = + new QTemporaryFile(QDir::tempPath()+QDir::separator() + +"swisssurferXXXXXX."+it->second.first, this); + file->open(); + file->write(reply->readAll()); + file->close(); + QProcess* process(new QProcess); + _downloadProcesses[process] = file; + assert(connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), + SLOT(processFinished()))); + QStringList args(it->second.second.split(" ") + .replaceInStrings("", file->fileName())); + QString prg(args.takeFirst()); + LOG<<"Running:"<start(prg, args); + } else { + QString saveFile + (QFileDialog::getSaveFileName(this, tr("Save File As ..."), + !reply->url().toLocalFile().isEmpty() + ?reply->url().toLocalFile() + :reply->url().path())); + if (!saveFile.isEmpty()) { + QFile file(saveFile); + file.open(QIODevice::WriteOnly); + file.write(reply->readAll()); + file.close(); + } + } + } + + void processFinished() { + delete _downloadProcesses[qobject_cast(sender())]; + _downloadProcesses.erase(qobject_cast(sender())); + } + + //@} void windowCloseRequested() { LOG; } + //@} + + //@name DownloadManager signals + //@{ + + void progress(qint64 done, qint64 total) { + _progress->setMaximum(total); + _progress->setValue(done); + } + + void started() { + actionStop->setEnabled(true); + _progress->setRange(0, 0); + _progress->setValue(0); + _progress->show(); + } + + void finished() { + LOG; + actionStop->setEnabled(false); + _progress->hide(); + } + //@} //@name QNetworkAccessManager signals @@ -976,22 +1121,11 @@ class Browser: public QMainWindow, protected Ui::Browser { QAuthenticator* authenticator) { LOG; statusBar()->showMessage(tr("authentication required")); - _error += tr("

%1

URL: %3

%2

") - .arg(tr("Authentication Required")) - .arg(networkError(reply->error())) - .arg(reply->url().toString()); - _errorUrl = reply->url(); - } - - void finished(QNetworkReply* reply) { - LOG<<(reply->error()==QNetworkReply::NoError?"success":"error"); - if (reply->error()!=QNetworkReply::NoError) { - _error += tr("

%1

URL: %3

%2

") - .arg(tr("Network Error")) - .arg(networkError(reply->error())) - .arg(reply->url().toString()); - _errorUrl = reply->url(); - } +// _error[sender()] += tr("

%1

URL: %3

%2

") +// .arg(tr("Authentication Required")) +// .arg(networkError(reply->error())) +// .arg(reply->url().toString()); +// _errorUrl[sender()] = reply->url(); } void proxyAuthenticationRequired(const QNetworkProxy& proxy, @@ -1002,35 +1136,48 @@ class Browser: public QMainWindow, protected Ui::Browser { void sslErrors(QNetworkReply* reply, const QList& errors) { LOG; statusBar()->showMessage(tr("ssl error")); - QString e; - for (QList::const_iterator err(errors.begin()); - err!=errors.end(); ++err) - e+=tr("
  • %1
  • ", "single ssl error").arg(err->errorString()); - _error += tr("

    %1

    URL: %4

    %2

    " - "

    SSL Errors

    " - "

      %3

    ") - .arg(tr("SSL Error")) - .arg(networkError(reply->error())) - .arg(e) - .arg(reply->url().toString()); - _errorUrl = reply->url(); +// QString e; +// for (QList::const_iterator err(errors.begin()); +// err!=errors.end(); ++err) +// e+=tr("
  • %1
  • ", "single ssl error").arg(err->errorString()); +// _error[sender()] += tr("

    %1

    URL: %4

    %2

    " +// "

    SSL Errors

    " +// "

      %3

    ") +// .arg(tr("SSL Error")) +// .arg(networkError(reply->error())) +// .arg(e) +// .arg(reply->url().toString()); +// _errorUrl[sender()] = reply->url(); } //@} + + private: + + void activateTab() { + iconChanged(); + actionForward->setEnabled(dynamic_cast(_tabs->currentWidget()) + ->history()->canGoForward()); + actionBack->setEnabled(dynamic_cast(_tabs->currentWidget()) + ->history()->canGoBack()); + } private: QLineEdit* _url; + QLineEdit* _find; QSlider* _zoom; QProgressBar* _progress; QString _home; - gui::Proxy* _proxy; bool _kiosk; - bool _proxydetection; - QString _error; - QUrl _errorUrl; + std::map _error; + std::map _errorUrl; QPrinter _printer; SslClientAuthNetworkAccessManager _networkManager; + DownloadManager _downloadManager; + typedef std::map DownloadProcesses; + DownloadProcesses _downloadProcesses; + MimeTypes _mimetypes; }; diff --git a/swisssurfer/src/browser.ui b/swisssurfer/src/browser.ui index 34ad779..c61e205 100644 --- a/swisssurfer/src/browser.ui +++ b/swisssurfer/src/browser.ui @@ -38,6 +38,9 @@ + + true + toolBar @@ -85,14 +88,28 @@ &Settings - + + + + Edit + + + + + + + Info + + + + - false + true @@ -101,6 +118,9 @@ neu laden + + F5 + @@ -114,7 +134,7 @@ stoppen - Esc + Esc @@ -162,7 +182,7 @@ Startseite - Home + Ctrl+Home Qt::WindowShortcut @@ -183,9 +203,6 @@ &Close - - Ctrl+W - @@ -237,6 +254,33 @@ Ctrl+T + + + Find + + + find in page + + + Ctrl+F + + + + + Close Find + + + Esc + + + + + &About + + + QAction::AboutQtRole + + diff --git a/swisssurfer/src/downloadmanager.hxx b/swisssurfer/src/downloadmanager.hxx new file mode 100644 index 0000000..d6bd225 --- /dev/null +++ b/swisssurfer/src/downloadmanager.hxx @@ -0,0 +1,106 @@ +/*! @file + + @id $Id$ +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +#include +#include + +#include +#include +#ifndef LOG +#define LOG qDebug()<<__PRETTY_FUNCTION__ +#endif + +class DownloadManager: public QObject { + Q_OBJECT; + public: + + DownloadManager& operator+=(QNetworkReply* reply) { + LOG; + add(reply); + return *this; + } + + Q_SIGNALS: + + void progress(qint64 done, qint64 total); + void started(); + void finished(); + + public Q_SLOTS: + + void add(QNetworkReply* reply) { + LOG<url().toString(); + _downloads[reply] = Progress(0, 0); + assert(connect(reply, SIGNAL(downloadProgress(qint64, qint64)), + SLOT(downloadProgress(qint64, qint64)))); + assert(connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), + SLOT(error(QNetworkReply::NetworkError)))); + assert(connect(reply, SIGNAL(finished()), + SLOT(slotFinished()))); + assert(connect(reply, SIGNAL(metaDataChanged()), + SLOT(metaDataChanged()))); + assert(connect(reply, SIGNAL(sslErrors(const QList&)), + SLOT(sslErrors(const QList&)))); + assert(connect(reply, SIGNAL(uploadProgress(qint64, qint64)), + SLOT(uploadProgress(qint64, qint64)))); + if (_downloads.size()==1) started(); + } + + void abort() { + while (_downloads.size()) _downloads.begin()->first->abort(); + } + + private: + + void calcProgress() { + //LOG; + qint64 done(0); + qint64 total(0); + for (Downloads::iterator it(_downloads.begin()); + it!=_downloads.end(); ++it) { + done += it->second.first; + total += it->second.second; + } + progress(done, total); + } + + private Q_SLOTS: + + void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) { + //LOG<(sender())].first = bytesReceived; + _downloads[qobject_cast(sender())].second = bytesTotal; + calcProgress(); + } + void error(QNetworkReply::NetworkError code) { + LOG; + } + void slotFinished() { + LOG; + _downloads.erase(qobject_cast(sender())); + if (_downloads.size()==0) finished(); + } + void metaDataChanged() { + LOG; + } + void sslErrors(const QList & errors) { + LOG; + } + void uploadProgress(qint64 bytesSent, qint64 bytesTotal) { + //LOG<(sender())].first = bytesSent; + _downloads[qobject_cast(sender())].second = bytesTotal; + calcProgress(); + } + + private: + + typedef std::pair Progress; + typedef std::map Downloads; + + Downloads _downloads; +}; diff --git a/swisssurfer/src/main.cxx b/swisssurfer/src/main.cxx index 0e3d8e6..1fc9597 100644 --- a/swisssurfer/src/main.cxx +++ b/swisssurfer/src/main.cxx @@ -24,6 +24,8 @@ #include #include +#include + SmartCardAuth _scAuth; const QByteArray SWISSSIGN_GOLD_CA_G2 @@ -195,7 +197,7 @@ int main(int argv, char** argc) try { //---------------------------------------------------------------------------- QStringList urls; bool silent(false); - bool proxydetection(true); + Browser::MimeTypes mimetypes; QStringList args(app.arguments()); for (QStringList::iterator it(args.begin()); ++it!=args.end();) if (*it=="-h" || *it=="--help" || *it=="-help" || *it=="/?") { @@ -204,9 +206,10 @@ int main(int argv, char** argc) try { "Options:\n" " -h, --help show this help text\n" " -k, --kiosk no url bar\n" - " -p, --no-proxy no proxy detection\n" " -c, --cert load local client certificate from \n" " -y, --key load local certificate key from \n" + " -m, --mime \n" + " start for mimetype \n" " optional full URL\n" "Environment:\n" " LANGUAGE \"de\", \"en\", ... (actual: %5)\n" @@ -221,8 +224,6 @@ int main(int argv, char** argc) try { return 0; } else if ((*it=="-k" || *it=="--kiosk")) { silent=true; - } else if ((*it=="-p" || *it=="--no-proxy")) { - proxydetection = false; } else if ((*it=="-c" || *it=="--cert") && ++it!=args.end()) { QFile file(*it); file.open(QIODevice::ReadOnly); @@ -248,6 +249,12 @@ int main(int argv, char** argc) try { sslConfig.setPrivateKey(k); std::cout<show(); - return app.exec(); + std::list browsers; + for (QStringList::iterator it(urls.begin()); it!=urls.end(); ++it) { + Browser *ptr(new Browser(*it, mimetypes, silent)); + ptr->show(); + browsers.push_back(ptr); + } + int res(app.exec()); + for (std::list::iterator it(browsers.begin()); + it!=browsers.end(); ++it) + delete *it; + return res; } catch (std::exception& x) { std::cerr<<"**** Error: "< - + toolBar - + &File - + &Settings - + + Edit + + + + + Info + + + + neu laden - + + F5 + + + + stoppen - + zurückkehren - + weitergehen - + Startseite - + + Ctrl+Home + + + + &New Browser - + New Browser Window - + Ctrl+N - + &Close - - Ctrl+W - - - - + &Proxy... - + Ctrl+P - + Next Tab - + Shift+Right - + Previous Tab - + Shift+Left - + New Tab - + Add New Tab - + Ctrl+T - + + Find + + + + + Close Find + + + + + &About + + + + + + Esc + + + + + find in page + + + + + Ctrl+F + + + + Print ... - + Quick &Print &Print - + Print Pre&view ... - + 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% - - - <h2>%1</h2><p>%2</p> - - - - - Reply Error - - - - - Network Error - - - - + Zoom: %1% - - - - <h2>%1</h2><p>URL: %3</p><p>%2</p> - - - - - <h2>%1</h2><p>URL: %4</p><p>%2</p><h3>SSL Errors</h3><p><ul>%3</ul></p> - <h2>%1</h2><p>URL: %3</p><p>%2</p><h3>SSL Errors</h3><p><ul>%3</ul></p> - - - - - Unsuported Content - - - - + access to URL %1 not allowed - + 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 - - network error - - - - - - proxy error - - - - - <h2>%1</h2><p>Proxy: %3</p><p>%2</p><p>%4</p> - - - - - Possible Proxy Failed - - - - - Connection Cannot Be Established - - - - + 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 - - unsupported content - - - - + 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 - - Authentication Required - - - - + ssl error - - - <li>%1</li> - single ssl error - - - - - SSL Error - - PinDialog @@ -419,14 +417,15 @@ QObject - + Usage: %1 [OPTIONS...] [<url> ...] Options: -h, --help show this help text -k, --kiosk no url bar - -p, --no-proxy no proxy detection -c, --cert <file> load local client certificate from <file> -y, --key <file> load local certificate key from <file> + -m, --mime <mime> <ext> <tool> + start <tool> for mimetype <mime> <url> optional full URL Environment: LANGUAGE "de", "en", ... (actual: %5) @@ -438,8 +437,10 @@ Environment: Options: -h, --help show this help text -k, --kiosk no url bar - -p, --no-proxy no proxy detection -c, --cert <file> load local client certificate from <file> + -y, --key <file> load local certificate key from <file> + -m, --mime <mime> <tool> + start <tool> for mimetype <mime> <url> optional full URL Environment: LANGUAGE "de", "en", ... (actual: %5) @@ -450,33 +451,33 @@ Environment: - + Cannot read PEM certificate from file: %1 - + Read PEM certificates from file: %1 - + Cannot read PEM RSA key from file: %1 - + Read private key from file: %1 - + Too few arguments. Try: %1 --help - + http://swisssign.com diff --git a/swisssurfer/src/swisssurfer_en.ts b/swisssurfer/src/swisssurfer_en.ts index 52c2cb6..b6df5e0 100644 --- a/swisssurfer/src/swisssurfer_en.ts +++ b/swisssurfer/src/swisssurfer_en.ts @@ -11,392 +11,390 @@ - + toolBar - + &File - + &Settings - + + Edit + + + + + Info + + + + neu laden - + + F5 + + + + stoppen - + zurückkehren - + weitergehen - + Startseite - + + Ctrl+Home + + + + &New Browser - + New Browser Window - + Ctrl+N - + &Close - - Ctrl+W - - - - + &Proxy... - + Ctrl+P - + Next Tab - + Shift+Right - + Previous Tab - + Shift+Left - + New Tab - + Add New Tab - + Ctrl+T - + + Find + + + + + Close Find + + + + + &About + + + + + + Esc + + + + + find in page + + + + + Ctrl+F + + + + Print ... - + Quick &Print &Print - + Print Pre&view ... - + 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% - - - <h2>%1</h2><p>%2</p> - - - - - Reply Error - - - - - Network Error - - - - + Zoom: %1% - - - - <h2>%1</h2><p>URL: %3</p><p>%2</p> - - - - - <h2>%1</h2><p>URL: %4</p><p>%2</p><h3>SSL Errors</h3><p><ul>%3</ul></p> - <h2>%1</h2><p>URL: %3</p><p>%2</p><h3>SSL Errors</h3><p><ul>%3</ul></p> - - - - - Unsuported Content - - - - + access to URL %1 not allowed - + 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 - - network error - - - - - - proxy error - - - - - <h2>%1</h2><p>Proxy: %3</p><p>%2</p><p>%4</p> - - - - - Possible Proxy Failed - - - - - Connection Cannot Be Established - - - - + 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 - - unsupported content - - - - + 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 - - Authentication Required - - - - + ssl error - - - <li>%1</li> - single ssl error - - - - - SSL Error - - PinDialog @@ -419,14 +417,15 @@ QObject - + Usage: %1 [OPTIONS...] [<url> ...] Options: -h, --help show this help text -k, --kiosk no url bar - -p, --no-proxy no proxy detection -c, --cert <file> load local client certificate from <file> -y, --key <file> load local certificate key from <file> + -m, --mime <mime> <ext> <tool> + start <tool> for mimetype <mime> <url> optional full URL Environment: LANGUAGE "de", "en", ... (actual: %5) @@ -438,8 +437,10 @@ Environment: Options: -h, --help show this help text -k, --kiosk no url bar - -p, --no-proxy no proxy detection -c, --cert <file> load local client certificate from <file> + -y, --key <file> load local certificate key from <file> + -m, --mime <mime> <tool> + start <tool> for mimetype <mime> <url> optional full URL Environment: LANGUAGE "de", "en", ... (actual: %5) @@ -450,33 +451,33 @@ Environment: - + Cannot read PEM certificate from file: %1 - + Read PEM certificates from file: %1 - + Cannot read PEM RSA key from file: %1 - + Read private key from file: %1 - + Too few arguments. Try: %1 --help - + http://swisssign.com diff --git a/swisssurfer/src/swisssurfer_fr.ts b/swisssurfer/src/swisssurfer_fr.ts index 52c2cb6..b6df5e0 100644 --- a/swisssurfer/src/swisssurfer_fr.ts +++ b/swisssurfer/src/swisssurfer_fr.ts @@ -11,392 +11,390 @@ - + toolBar - + &File - + &Settings - + + Edit + + + + + Info + + + + neu laden - + + F5 + + + + stoppen - + zurückkehren - + weitergehen - + Startseite - + + Ctrl+Home + + + + &New Browser - + New Browser Window - + Ctrl+N - + &Close - - Ctrl+W - - - - + &Proxy... - + Ctrl+P - + Next Tab - + Shift+Right - + Previous Tab - + Shift+Left - + New Tab - + Add New Tab - + Ctrl+T - + + Find + + + + + Close Find + + + + + &About + + + + + + Esc + + + + + find in page + + + + + Ctrl+F + + + + Print ... - + Quick &Print &Print - + Print Pre&view ... - + 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% - - - <h2>%1</h2><p>%2</p> - - - - - Reply Error - - - - - Network Error - - - - + Zoom: %1% - - - - <h2>%1</h2><p>URL: %3</p><p>%2</p> - - - - - <h2>%1</h2><p>URL: %4</p><p>%2</p><h3>SSL Errors</h3><p><ul>%3</ul></p> - <h2>%1</h2><p>URL: %3</p><p>%2</p><h3>SSL Errors</h3><p><ul>%3</ul></p> - - - - - Unsuported Content - - - - + access to URL %1 not allowed - + 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 - - network error - - - - - - proxy error - - - - - <h2>%1</h2><p>Proxy: %3</p><p>%2</p><p>%4</p> - - - - - Possible Proxy Failed - - - - - Connection Cannot Be Established - - - - + 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 - - unsupported content - - - - + 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 - - Authentication Required - - - - + ssl error - - - <li>%1</li> - single ssl error - - - - - SSL Error - - PinDialog @@ -419,14 +417,15 @@ QObject - + Usage: %1 [OPTIONS...] [<url> ...] Options: -h, --help show this help text -k, --kiosk no url bar - -p, --no-proxy no proxy detection -c, --cert <file> load local client certificate from <file> -y, --key <file> load local certificate key from <file> + -m, --mime <mime> <ext> <tool> + start <tool> for mimetype <mime> <url> optional full URL Environment: LANGUAGE "de", "en", ... (actual: %5) @@ -438,8 +437,10 @@ Environment: Options: -h, --help show this help text -k, --kiosk no url bar - -p, --no-proxy no proxy detection -c, --cert <file> load local client certificate from <file> + -y, --key <file> load local certificate key from <file> + -m, --mime <mime> <tool> + start <tool> for mimetype <mime> <url> optional full URL Environment: LANGUAGE "de", "en", ... (actual: %5) @@ -450,33 +451,33 @@ Environment: - + Cannot read PEM certificate from file: %1 - + Read PEM certificates from file: %1 - + Cannot read PEM RSA key from file: %1 - + Read private key from file: %1 - + Too few arguments. Try: %1 --help - + http://swisssign.com diff --git a/swisssurfer/src/swisssurfer_it.ts b/swisssurfer/src/swisssurfer_it.ts index 52c2cb6..b6df5e0 100644 --- a/swisssurfer/src/swisssurfer_it.ts +++ b/swisssurfer/src/swisssurfer_it.ts @@ -11,392 +11,390 @@ - + toolBar - + &File - + &Settings - + + Edit + + + + + Info + + + + neu laden - + + F5 + + + + stoppen - + zurückkehren - + weitergehen - + Startseite - + + Ctrl+Home + + + + &New Browser - + New Browser Window - + Ctrl+N - + &Close - - Ctrl+W - - - - + &Proxy... - + Ctrl+P - + Next Tab - + Shift+Right - + Previous Tab - + Shift+Left - + New Tab - + Add New Tab - + Ctrl+T - + + Find + + + + + Close Find + + + + + &About + + + + + + Esc + + + + + find in page + + + + + Ctrl+F + + + + Print ... - + Quick &Print &Print - + Print Pre&view ... - + 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% - - - <h2>%1</h2><p>%2</p> - - - - - Reply Error - - - - - Network Error - - - - + Zoom: %1% - - - - <h2>%1</h2><p>URL: %3</p><p>%2</p> - - - - - <h2>%1</h2><p>URL: %4</p><p>%2</p><h3>SSL Errors</h3><p><ul>%3</ul></p> - <h2>%1</h2><p>URL: %3</p><p>%2</p><h3>SSL Errors</h3><p><ul>%3</ul></p> - - - - - Unsuported Content - - - - + access to URL %1 not allowed - + 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 - - network error - - - - - - proxy error - - - - - <h2>%1</h2><p>Proxy: %3</p><p>%2</p><p>%4</p> - - - - - Possible Proxy Failed - - - - - Connection Cannot Be Established - - - - + 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 - - unsupported content - - - - + 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 - - Authentication Required - - - - + ssl error - - - <li>%1</li> - single ssl error - - - - - SSL Error - - PinDialog @@ -419,14 +417,15 @@ QObject - + Usage: %1 [OPTIONS...] [<url> ...] Options: -h, --help show this help text -k, --kiosk no url bar - -p, --no-proxy no proxy detection -c, --cert <file> load local client certificate from <file> -y, --key <file> load local certificate key from <file> + -m, --mime <mime> <ext> <tool> + start <tool> for mimetype <mime> <url> optional full URL Environment: LANGUAGE "de", "en", ... (actual: %5) @@ -438,8 +437,10 @@ Environment: Options: -h, --help show this help text -k, --kiosk no url bar - -p, --no-proxy no proxy detection -c, --cert <file> load local client certificate from <file> + -y, --key <file> load local certificate key from <file> + -m, --mime <mime> <tool> + start <tool> for mimetype <mime> <url> optional full URL Environment: LANGUAGE "de", "en", ... (actual: %5) @@ -450,33 +451,33 @@ Environment: - + Cannot read PEM certificate from file: %1 - + Read PEM certificates from file: %1 - + Cannot read PEM RSA key from file: %1 - + Read private key from file: %1 - + Too few arguments. Try: %1 --help - + http://swisssign.com