From d9baec2850ad06d4f719f8225adf38bf1dbc25c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 25 Aug 2011 11:46:53 +0000 Subject: [PATCH] append $SWISSSURFER_USERAGENT to user agent; refs #88 --- swisssurfer/src/browser.hxx | 13 +- swisssurfer/src/browser.ui | 13 +- swisssurfer/src/qmake.pro.in | 4 +- swisssurfer/src/swisssurfer_de.ts | 178 +++++++------ swisssurfer/src/swisssurfer_en.ts | 178 +++++++------ swisssurfer/src/swisssurfer_fr.ts | 178 +++++++------ swisssurfer/src/swisssurfer_it.ts | 414 +++++++++++++++--------------- swisssurfer/src/webpage.hxx | 5 +- 8 files changed, 545 insertions(+), 438 deletions(-) diff --git a/swisssurfer/src/browser.hxx b/swisssurfer/src/browser.hxx index c620c64..1ff918e 100644 --- a/swisssurfer/src/browser.hxx +++ b/swisssurfer/src/browser.hxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -85,12 +86,12 @@ class Browser: public QMainWindow, protected Ui::Browser { _zoom->setTickPosition(QSlider::TicksAbove); assert(connect(_zoom, SIGNAL(valueChanged(int)), SLOT(zoom(int)))); _url = new QComboBox(_toolbar); + _url->setInsertPolicy(QComboBox::NoInsert); _url->setLineEdit(new ButtonLineEdit(_url)); _url->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred)); _url->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength); _url->setEditable(!_kiosk); - _url->addItems(urls); _toolbar->addWidget(_url); assert(connect(&_errorLog, SIGNAL(reset()), SLOT(errorReset()))); assert(connect(_url, SIGNAL(currentIndexChanged(const QString&)), @@ -121,7 +122,8 @@ class Browser: public QMainWindow, protected Ui::Browser { assert(connect(_url->lineEdit(), SIGNAL(textChanged(QString)), SLOT(goodUrl()))); - dynamic_cast(_url->lineEdit())->add(actionAddBookmark); + dynamic_cast(_url->lineEdit())->add + (actionAddBookmark); dynamic_cast(_url->lineEdit())->add (actionClearLocation); @@ -137,6 +139,8 @@ class Browser: public QMainWindow, protected Ui::Browser { if (!QSslSocket::supportsSsl()) QMessageBox::critical(this, tr("SSL Not Supported"), tr("SSL is not supported on your system")); + _editbookmarks = + std::auto_ptr(new EditBookmarks(_url, this)); } ~Browser() { @@ -470,6 +474,10 @@ class Browser: public QMainWindow, protected Ui::Browser { _url->addItem(_url->currentText()); } + void on_actionEditBookmarks_triggered() { + _editbookmarks->show(); + } + void zoom(int i) { LOG<showMessage(tr("Zoom: %1%").arg(i)); @@ -1341,6 +1349,7 @@ class Browser: public QMainWindow, protected Ui::Browser { LoginCertificate _logincertificate; gui::Proxy _proxy; QPushButton* _showErrorLog; + std::auto_ptr _editbookmarks; }; #endif diff --git a/swisssurfer/src/browser.ui b/swisssurfer/src/browser.ui index bb403f7..bbeeb16 100644 --- a/swisssurfer/src/browser.ui +++ b/swisssurfer/src/browser.ui @@ -68,7 +68,7 @@ 0 0 1009 - 29 + 23 @@ -92,6 +92,8 @@ + + @@ -408,6 +410,15 @@ Ctrl+D + + + + :/icons/addbookmark:/icons/addbookmark + + + &Bookmarks + + diff --git a/swisssurfer/src/qmake.pro.in b/swisssurfer/src/qmake.pro.in index d25b693..b293f28 100644 --- a/swisssurfer/src/qmake.pro.in +++ b/swisssurfer/src/qmake.pro.in @@ -36,10 +36,10 @@ SOURCES = main.cxx webpage.cxx HEADERS = browser.hxx smartcardauth.hxx pinentry.hxx \ downloadmanager.hxx settings.hxx sslclientnetworkmanager.hxx \ authentication.hxx webpage.hxx errorlog.hxx \ - certificate.hxx logincertificate.hxx + certificate.hxx logincertificate.hxx editbookmarks.hxx FORMS = browser.ui settings.ui pinentry.ui authentication.ui errorlog.ui \ - certificate.ui logincertificate.ui + certificate.ui logincertificate.ui editbookmarks.ui RESOURCES = languages.qrc resources.qrc diff --git a/swisssurfer/src/swisssurfer_de.ts b/swisssurfer/src/swisssurfer_de.ts index 7e2362e..1150666 100644 --- a/swisssurfer/src/swisssurfer_de.ts +++ b/swisssurfer/src/swisssurfer_de.ts @@ -54,334 +54,339 @@ - + Info - + History - + neu laden - + F5 - + stoppen - + zurückkehren - + weitergehen - + Startseite - + Ctrl+Home - + &New Browser - + New Browser Window - + Ctrl+N - + &Close - + &Proxy... - + Ctrl+P - + Next Tab - + Shift+Right - + Previous Tab - + Shift+Left - + New Tab - + Add New Tab - + Ctrl+T - + Find - + Close Find - + &About - + &Settings ... - + &Reverse Find - + Ctrl+R - + Error Log - + show error logs - + User Login Certificate - + &Proxy ... - + Clear Location - + clear location bar - + Add Bookmark - + add bookmark to location bar - + Ctrl+D - - + + &Bookmarks + + + + + Esc - + find in page - + Ctrl+F - + Print ... - + Quick &Print &Print - + Print Pre&view ... - + Checking: %1 Opening: %1 - + Reading: %1 Reading: %1% - + Zoom: %1% - + 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 - + SSL Not Supported - + SSL is not supported on your system - + 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 - - - + + + background-color: white neutral find - - + + background-color: #ADA background-color: #7F7 text found - - + + background-color: #F77 background-color: lightred text not found - + About - + %8 Version: %1 Builddate: %2 @@ -401,40 +406,40 @@ openssl-%7 - + %1 - + Save File As ... - + errors show error log - + background-color: #F77 invalid url - + background-color: white valid url - + authentication required - + ssl error @@ -675,6 +680,29 @@ openssl-%7 + + EditBookmarks + + + Edit Bookmarks + + + + + + + + + + + - + + + + + Use Drag/Drop to move, double-click to edit. + + + ErrorLog diff --git a/swisssurfer/src/swisssurfer_en.ts b/swisssurfer/src/swisssurfer_en.ts index c1199db..4822f00 100644 --- a/swisssurfer/src/swisssurfer_en.ts +++ b/swisssurfer/src/swisssurfer_en.ts @@ -53,314 +53,319 @@ - + History - + Info - + neu laden - + F5 - + stoppen - - + + Esc - + zurückkehren - + weitergehen - + Startseite - + Ctrl+Home - + &New Browser - + New Browser Window - + Ctrl+N - + &Close - + &Proxy... - + Print ... - + Print Pre&view ... - + Quick &Print - + Ctrl+P - + Next Tab - + Shift+Right - + Previous Tab - + Shift+Left - + New Tab - + Add New Tab - + Ctrl+T - + Find - + find in page - + Ctrl+F - + Close Find - + &About - + &Settings ... - + &Reverse Find - + Ctrl+R - + Error Log - + show error logs - + User Login Certificate - + &Proxy ... - + Clear Location - + clear location bar - + Add Bookmark - + add bookmark to location bar - + Ctrl+D - + + &Bookmarks + + + + Checking: %1 - + SSL Not Supported - + SSL is not supported on your system - + Forbidden: %1 - + Access Denied - + <p>Access denied due to security considerations.</p><p>You are not allowed to connect to %1. - + Reading: %1 - + Illegal URL: %1 - + Zoom: %1% - + Print Document - + %1 - %2 statusbar actionBack_hovered %1=url %2=title - + %1 - %2 statusbar actionForward_hovered %1=url %2=title - - - + + + background-color: white neutral find - - + + background-color: #ADA background-color: #7F7 text found - - + + background-color: #F77 background-color: lightred text not found - + About - + %8 Version: %1 Builddate: %2 @@ -380,56 +385,56 @@ openssl-%7 - + %1 - + Info: %1 - + done. - + %1 statusbar for hovered link %1=url - + Save File As ... - + errors show error log - + background-color: #F77 invalid url - + background-color: white valid url - + authentication required - + ssl error @@ -667,6 +672,29 @@ openssl-%7 + + EditBookmarks + + + Edit Bookmarks + + + + + + + + + + + - + + + + + Use Drag/Drop to move, double-click to edit. + + + ErrorLog diff --git a/swisssurfer/src/swisssurfer_fr.ts b/swisssurfer/src/swisssurfer_fr.ts index 7e2362e..1150666 100644 --- a/swisssurfer/src/swisssurfer_fr.ts +++ b/swisssurfer/src/swisssurfer_fr.ts @@ -54,334 +54,339 @@ - + Info - + History - + neu laden - + F5 - + stoppen - + zurückkehren - + weitergehen - + Startseite - + Ctrl+Home - + &New Browser - + New Browser Window - + Ctrl+N - + &Close - + &Proxy... - + Ctrl+P - + Next Tab - + Shift+Right - + Previous Tab - + Shift+Left - + New Tab - + Add New Tab - + Ctrl+T - + Find - + Close Find - + &About - + &Settings ... - + &Reverse Find - + Ctrl+R - + Error Log - + show error logs - + User Login Certificate - + &Proxy ... - + Clear Location - + clear location bar - + Add Bookmark - + add bookmark to location bar - + Ctrl+D - - + + &Bookmarks + + + + + Esc - + find in page - + Ctrl+F - + Print ... - + Quick &Print &Print - + Print Pre&view ... - + Checking: %1 Opening: %1 - + Reading: %1 Reading: %1% - + Zoom: %1% - + 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 - + SSL Not Supported - + SSL is not supported on your system - + 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 - - - + + + background-color: white neutral find - - + + background-color: #ADA background-color: #7F7 text found - - + + background-color: #F77 background-color: lightred text not found - + About - + %8 Version: %1 Builddate: %2 @@ -401,40 +406,40 @@ openssl-%7 - + %1 - + Save File As ... - + errors show error log - + background-color: #F77 invalid url - + background-color: white valid url - + authentication required - + ssl error @@ -675,6 +680,29 @@ openssl-%7 + + EditBookmarks + + + Edit Bookmarks + + + + + + + + + + + - + + + + + Use Drag/Drop to move, double-click to edit. + + + ErrorLog diff --git a/swisssurfer/src/swisssurfer_it.ts b/swisssurfer/src/swisssurfer_it.ts index 7e2362e..debf11b 100644 --- a/swisssurfer/src/swisssurfer_it.ts +++ b/swisssurfer/src/swisssurfer_it.ts @@ -1,6 +1,6 @@ - + UTF-8 Authentication @@ -35,7 +35,6 @@ SwissSurfer - SwissSign Browser @@ -54,334 +53,317 @@ - - Info + + History - - History + + Info - + neu laden - + F5 - + stoppen - + + + Esc + + + + zurückkehren - + weitergehen - + Startseite - + Ctrl+Home - + &New Browser - + New Browser Window - + Ctrl+N - + &Close - + &Proxy... - + + Print ... + + + + + Print Pre&view ... + + + + + Quick &Print + + + + Ctrl+P - + Next Tab - + Shift+Right - + Previous Tab - + Shift+Left - + New Tab - + Add New Tab - + Ctrl+T - + Find - + + find in page + + + + + Ctrl+F + + + + Close Find - + &About - + &Settings ... - + &Reverse Find - + Ctrl+R - + Error Log - + show error logs - + User Login Certificate - + &Proxy ... - + Clear Location - + clear location bar - + Add Bookmark - + add bookmark to location bar - + Ctrl+D - - - Esc + + &Bookmarks - - find in page + + SSL Not Supported - - Ctrl+F + + SSL is not supported on your system - - Print ... + + Checking: %1 - - Quick &Print - &Print + + Forbidden: %1 - - Print Pre&view ... + + Access Denied - - Checking: %1 - Opening: %1 + + <p>Access denied due to security considerations.</p><p>You are not allowed to connect to %1. - + Reading: %1 - Reading: %1% - - Zoom: %1% + + Illegal URL: %1 - - Illegal URL: %1 + + Zoom: %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 - - - - - SSL Not Supported - - - - - SSL is not supported on your system - - - - - 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 - - - + + + background-color: white neutral find - - + + background-color: #ADA - background-color: #7F7 text found - - + + background-color: #F77 - background-color: lightred text not found - + About - + %8 Version: %1 Builddate: %2 @@ -390,57 +372,80 @@ Libraries: %4 qt-%5 (%6) openssl-%7 - SwissSurfer -Version: %1 -Builddate: %2 -Libraries: -%3 -%4 -qt-%5 (%6) -openssl-%7 - + + %1 + + + + + Info: %1 + + + + + done. + + + + %1 + statusbar for hovered link %1=url - + Save File As ... - + errors show error log - + background-color: #F77 invalid url - + background-color: white valid url - + authentication required - + ssl error Certificate + + + Form + + + + + Attribute + + + + + Value + + Valid Since @@ -461,11 +466,6 @@ openssl-%7 Version - - - Issuer Info - - Subject Info @@ -476,6 +476,11 @@ openssl-%7 Alternate Subject + + + Issuer Info + + E-Mail @@ -528,21 +533,6 @@ openssl-%7 unknown certificate subject info - - - Form - - - - - Attribute - - - - - Value - - DownloadManager @@ -579,7 +569,6 @@ openssl-%7 The SSL/TLS handshake failed and the encrypted channel could not be established. See SSL-Errors above. - The SSL/TLS handshake failed and the encrypted channel could not be established. The sslErrors() signal should have been emitted. @@ -665,13 +654,34 @@ openssl-%7 <h1>Network Error</h1><dl><dt>URL:</dt><dd>%1</dd><dt>Error Code:</dt><dd>%3</dd><dt>Error Details:</dt><dd>%2</dd></dl> - <h1>Network Error</h2><dl><dt>URL:</dt><dd>%1</dd><dt>Error Code:</dt><dd>%3</dd><dt>Error Details:</dt><dd>%2</dd></dl> <h1>SSL Error</h1><dl><dt>URL:</dt><dd>%1</dd><dt>Error Code:</dt><dd>%3</dd><dt>Error Details:</dt><dd>%2</dd></dl><table><caption>Certificate Issuer</caption><tr><th>Organization:</th><td>%4</td></tr><tr><th>Common Name:</th><td>%5</td></tr><tr><th>Location:</th><td>%6</td></tr><tr><th>Organizational Unit:</th><td>%7</td></tr><tr><th>Country:</th><td>%8</td></tr><tr><th>State or Provive:</th><td>%9</td></tr></table><table><caption>Certificate Subject</caption><tr><th>Organization:</th><td>%10</td></tr><tr><th>Common Name:</th><td>%11</td></tr><tr><th>Location:</th><td>%12</td></tr><tr><th>Organizational Unit:</th><td>%13</td></tr><tr><th>Country:</th><td>%14</td></tr><tr><th>State or Provive:</th><td>%15</td></tr></table> - <h1>SSL Error</h2><dl><dt>URL:</dt><dd>%1</dd><dt>Error Code:</dt><dd>%3</dd><dt>Error Details:</dt><dd>%2</dd></dl><table><caption>Certificate Issuer</caption><tr><th>Organization:</th><td>%4</td></tr><tr><th>Common Name:</th><td>%5</td></tr><tr><th>Location:</th><td>%6</td></tr><tr><th>Organizational Unit:</th><td>%7</td></tr><tr><th>Country:</th><td>%8</td></tr><tr><th>State or Provive:</th><td>%9</td></tr></table><table><caption>Certificate Subject</caption><tr><th>Organization:</th><td>%10</td></tr><tr><th>Common Name:</th><td>%11</td></tr><tr><th>Location:</th><td>%12</td></tr><tr><th>Organizational Unit:</th><td>%13</td></tr><tr><th>Country:</th><td>%14</td></tr><tr><th>State or Provive:</th><td>%15</td></tr></table> + + + + + EditBookmarks + + + Edit Bookmarks + + + + + + + + + + + - + + + + + Use Drag/Drop to move, double-click to edit. @@ -696,13 +706,11 @@ openssl-%7 Certificate PIN Entry - SwissSign Pin Entry Please enter your PIN to unlock Certificate: - Please enter your Certificate PIN to authenticate: @@ -1128,47 +1136,6 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Verdana'; font-size:medium; color:#363534;">Specifies whether locally loaded documents are allowed to access remote urls. </span><span style=" font-family:'Verdana'; font-size:medium; color:#363534;">Local resources are by default restricted from accessing remote content, which means your </span><span style=" font-family:'Courier New,courier'; font-size:medium; color:#363534;">file://</span><span style=" font-family:'Verdana'; font-size:medium; color:#363534;"> will not be able to access </span><span style=" font-family:'Courier New,courier'; font-size:medium; color:#363534;">http://domain.com/foo.html</span><span style=" font-family:'Verdana'; font-size:medium; color:#363534;">. </span></p></body></html> - - - Search Engines - - - - - Scheme - - - - - Query URL - - - - - Use %1 as placeholder for the query, use %2 as placeholder for your system language. - Use <QUERY> as placeholder for the query. - - - - - TBD - - - - - Session Management - - - - - save window state - - - - - close mimetype helper applications on exit - - local content can access remote urls @@ -1229,11 +1196,6 @@ p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'DejaVu Serif'; font-size:11pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">In the <span style=" font-weight:600;">Program</span>-column, enter <span style=" font-weight:600;">%1</span> as file name placeholder.</p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Serif'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">In the <span style=" font-weight:600;">Program</span>-column, enter <span style=" font-weight:600;">&lt;FILENAME&gt;</span> as file name placeholder.</p></body></html> @@ -1248,5 +1210,45 @@ p, li { white-space: pre-wrap; } - + + + Search Engines + + + + + Scheme + + + + + Query URL + + + + + Use %1 as placeholder for the query, use %2 as placeholder for your system language. + + + + + TBD + + + + + Session Management + + + + + save window state + + + + + close mimetype helper applications on exit + + diff --git a/swisssurfer/src/webpage.hxx b/swisssurfer/src/webpage.hxx index efa3feb..bea42a0 100644 --- a/swisssurfer/src/webpage.hxx +++ b/swisssurfer/src/webpage.hxx @@ -19,8 +19,9 @@ class WebPage: public QWebPage { protected: virtual QWebPage* createWindow(WebWindowType type); virtual QString userAgentForUrl(const QUrl& url) const { - return QProcessEnvironment::systemEnvironment() - .value("SWISSSURFER_USERAGENT", QWebPage::userAgentForUrl(url)); + QString add(QProcessEnvironment::systemEnvironment() + .value("SWISSSURFER_USERAGENT")); + return QWebPage::userAgentForUrl(url)+(add.size()?" "+add:QString()); } private: Browser* _browser;