From ec19a77f440bea05747ca4c99c83929bc0fe8cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 30 Jun 2011 07:45:08 +0000 Subject: [PATCH] even smarter error notification; refs #68 --- swisssurfer/src/browser.hxx | 20 +++++- swisssurfer/src/errorlog.hxx | 14 ++++ swisssurfer/src/errorlog.ui | 8 +-- swisssurfer/src/resources.qrc | 1 + swisssurfer/src/resources/icons/error.svg | 68 +++++++++++++++++++ swisssurfer/src/swisssurfer_de.ts | 82 +++++++++++------------ swisssurfer/src/swisssurfer_en.ts | 82 +++++++++++------------ swisssurfer/src/swisssurfer_fr.ts | 82 +++++++++++------------ swisssurfer/src/swisssurfer_it.ts | 82 +++++++++++------------ 9 files changed, 265 insertions(+), 174 deletions(-) create mode 100644 swisssurfer/src/resources/icons/error.svg diff --git a/swisssurfer/src/browser.hxx b/swisssurfer/src/browser.hxx index 268e1e4..087cbfb 100644 --- a/swisssurfer/src/browser.hxx +++ b/swisssurfer/src/browser.hxx @@ -62,7 +62,8 @@ class Browser: public QMainWindow, protected Ui::Browser { _kiosk(kiosk), _settings(mimeTypes, this, settings, !kiosk), _errorLog(this), _logincertificate(this), - _proxy("http://swisssign.com", this) { + _proxy("http://swisssign.com", this), + _showErrorLog(0) { LOG<setEditable(!_kiosk); _url->addItems(urls); _toolbar->addWidget(_url); + assert(connect(&_errorLog, SIGNAL(reset()), SLOT(errorReset()))); assert(connect(_url, SIGNAL(currentIndexChanged(const QString&)), SLOT(load(QString)))); assert(connect(&_networkManager, SIGNAL(finished(QNetworkReply*)), @@ -1169,10 +1171,23 @@ class Browser: public QMainWindow, protected Ui::Browser { r->error()!=QNetworkReply::OperationCanceledError) { statusBar()->showMessage(DownloadManager::networkError(r->error())); badUrl(); + if (!_showErrorLog) { + statusBar()->addPermanentWidget + ((_showErrorLog = new QPushButton(QIcon(":/icons/error"), + tr("errors", "show error log")))); + assert(connect(_showErrorLog, SIGNAL(clicked(bool)), + actionErrorLog, SLOT(trigger()))); + } + _showErrorLog->show(); } } - void badUrl() { + void errorReset() { + LOG; + _showErrorLog->hide(); + } + + void badUrl() { _url->lineEdit() ->setStyleSheet(tr("background-color: #F77", "invalid url")); } @@ -1278,6 +1293,7 @@ class Browser: public QMainWindow, protected Ui::Browser { ErrorLog _errorLog; LoginCertificate _logincertificate; gui::Proxy _proxy; + QPushButton* _showErrorLog; }; #endif diff --git a/swisssurfer/src/errorlog.hxx b/swisssurfer/src/errorlog.hxx index d52ae1d..fee9587 100644 --- a/swisssurfer/src/errorlog.hxx +++ b/swisssurfer/src/errorlog.hxx @@ -12,6 +12,10 @@ #include class ErrorLog: public QDialog, protected Ui::ErrorLog { + public: + Q_OBJECT; + Q_SIGNALS: + void reset(); public: ErrorLog(QWidget* p): QDialog(p) { setupUi(this); @@ -19,6 +23,16 @@ class ErrorLog: public QDialog, protected Ui::ErrorLog { void append(QString text) { _errors->append(text); } + protected Q_SLOTS: + void on__buttons_clicked(QAbstractButton* button) { + switch (_buttons->buttonRole(button)) { + case QDialogButtonBox::ResetRole: { + _errors->clear(); + reset(); + } break; + default:; + } + } }; #endif diff --git a/swisssurfer/src/errorlog.ui b/swisssurfer/src/errorlog.ui index e9f13f6..83ffd46 100644 --- a/swisssurfer/src/errorlog.ui +++ b/swisssurfer/src/errorlog.ui @@ -18,12 +18,12 @@ - + Qt::Horizontal - QDialogButtonBox::Close + QDialogButtonBox::Close|QDialogButtonBox::Reset @@ -32,7 +32,7 @@ - buttonBox + _buttons accepted() ErrorLog accept() @@ -48,7 +48,7 @@ - buttonBox + _buttons rejected() ErrorLog reject() diff --git a/swisssurfer/src/resources.qrc b/swisssurfer/src/resources.qrc index c3c19ca..53df884 100644 --- a/swisssurfer/src/resources.qrc +++ b/swisssurfer/src/resources.qrc @@ -7,5 +7,6 @@ resources/icons/gohome.png resources/icons/reload.png resources/icons/stop.png + resources/icons/error.svg diff --git a/swisssurfer/src/resources/icons/error.svg b/swisssurfer/src/resources/icons/error.svg new file mode 100644 index 0000000..98a72a7 --- /dev/null +++ b/swisssurfer/src/resources/icons/error.svg @@ -0,0 +1,68 @@ + + + + + + + + + + unsorted + + + + + Open Clip Art Library, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors + + + + + + + + + + + + + + image/svg+xml + + + en + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swisssurfer/src/swisssurfer_de.ts b/swisssurfer/src/swisssurfer_de.ts index b949120..1b2d74d 100644 --- a/swisssurfer/src/swisssurfer_de.ts +++ b/swisssurfer/src/swisssurfer_de.ts @@ -246,117 +246,117 @@ - + 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 @@ -376,35 +376,41 @@ openssl-%7 - + %1 - + Save File As ... + errors + show error log + + + + background-color: #F77 background-color: lightred invalid url - + background-color: white valid url - + authentication required - + ssl error @@ -741,39 +747,31 @@ Environment: PROXY_PORT proxy port number (actual: %3) PROXY_HOST proxy host name (actual: %4) SWISSSURFER_USERAGENT fake user agent (actual: %6) - %Platform% and %Subplatform% are expanded - to the windowing system and the operation - system. %Security% expands to U if SSL is - available, otherwise N. %Locale% is - replaced with locale name. %WebKitVersion% - is the version of WebKit the application - was compiled against. %AppVersion% expands - to application name/version - + 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 diff --git a/swisssurfer/src/swisssurfer_en.ts b/swisssurfer/src/swisssurfer_en.ts index 1b6886d..8f10314 100644 --- a/swisssurfer/src/swisssurfer_en.ts +++ b/swisssurfer/src/swisssurfer_en.ts @@ -244,98 +244,98 @@ - + 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 @@ -355,51 +355,57 @@ openssl-%7 - + %1 - + Info: %1 - + done. - + %1 statusbar for hovered link %1=url - + Save File As ... + errors + show error log + + + + background-color: #F77 background-color: lightred invalid url - + background-color: white valid url - + authentication required - + ssl error @@ -731,39 +737,31 @@ Environment: PROXY_PORT proxy port number (actual: %3) PROXY_HOST proxy host name (actual: %4) SWISSSURFER_USERAGENT fake user agent (actual: %6) - %Platform% and %Subplatform% are expanded - to the windowing system and the operation - system. %Security% expands to U if SSL is - available, otherwise N. %Locale% is - replaced with locale name. %WebKitVersion% - is the version of WebKit the application - was compiled against. %AppVersion% expands - to application name/version - + 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 diff --git a/swisssurfer/src/swisssurfer_fr.ts b/swisssurfer/src/swisssurfer_fr.ts index b949120..1b2d74d 100644 --- a/swisssurfer/src/swisssurfer_fr.ts +++ b/swisssurfer/src/swisssurfer_fr.ts @@ -246,117 +246,117 @@ - + 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 @@ -376,35 +376,41 @@ openssl-%7 - + %1 - + Save File As ... + errors + show error log + + + + background-color: #F77 background-color: lightred invalid url - + background-color: white valid url - + authentication required - + ssl error @@ -741,39 +747,31 @@ Environment: PROXY_PORT proxy port number (actual: %3) PROXY_HOST proxy host name (actual: %4) SWISSSURFER_USERAGENT fake user agent (actual: %6) - %Platform% and %Subplatform% are expanded - to the windowing system and the operation - system. %Security% expands to U if SSL is - available, otherwise N. %Locale% is - replaced with locale name. %WebKitVersion% - is the version of WebKit the application - was compiled against. %AppVersion% expands - to application name/version - + 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 diff --git a/swisssurfer/src/swisssurfer_it.ts b/swisssurfer/src/swisssurfer_it.ts index b949120..1b2d74d 100644 --- a/swisssurfer/src/swisssurfer_it.ts +++ b/swisssurfer/src/swisssurfer_it.ts @@ -246,117 +246,117 @@ - + 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 @@ -376,35 +376,41 @@ openssl-%7 - + %1 - + Save File As ... + errors + show error log + + + + background-color: #F77 background-color: lightred invalid url - + background-color: white valid url - + authentication required - + ssl error @@ -741,39 +747,31 @@ Environment: PROXY_PORT proxy port number (actual: %3) PROXY_HOST proxy host name (actual: %4) SWISSSURFER_USERAGENT fake user agent (actual: %6) - %Platform% and %Subplatform% are expanded - to the windowing system and the operation - system. %Security% expands to U if SSL is - available, otherwise N. %Locale% is - replaced with locale name. %WebKitVersion% - is the version of WebKit the application - was compiled against. %AppVersion% expands - to application name/version - + 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