diff --git a/swisssurfer/src/browser.hxx b/swisssurfer/src/browser.hxx index 056c191..3dea3f3 100644 --- a/swisssurfer/src/browser.hxx +++ b/swisssurfer/src/browser.hxx @@ -91,9 +91,10 @@ class Browser: public QMainWindow, protected Ui::Browser { _toolbar->addWidget(_url); assert(connect(_url, SIGNAL(currentIndexChanged(const QString&)), SLOT(load(QString)))); + assert(connect(&_networkManager, SIGNAL(finished(QNetworkReply*)), + SLOT(finished(QNetworkReply*)))); 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()), @@ -114,6 +115,8 @@ class Browser: public QMainWindow, protected Ui::Browser { } else { assert(connect(_url->lineEdit(), SIGNAL(returnPressed()), SLOT(load()))); + assert(connect(_url->lineEdit(), SIGNAL(textChanged(QString)), + SLOT(goodUrl()))); _toolbar->addWidget(_clearUrl = new QPushButton("X", _toolbar)); assert(connect(_clearUrl, SIGNAL(clicked(bool)), _url, SLOT(clearEditText()))); @@ -574,6 +577,10 @@ class Browser: public QMainWindow, protected Ui::Browser { _downloadManager.abort(); } + void on__find_textChanged(QString) { + _find->setStyleSheet(tr("background-color: white", "neutral find")); + } + void on_actionFind_triggered() { if (!_find) { statusBar()->addPermanentWidget(_find = new QLineEdit); @@ -584,6 +591,7 @@ class Browser: public QMainWindow, protected Ui::Browser { disconnect(_find, SIGNAL(textEdited(QString)), this, SLOT(rfind())); assert(connect(_find, SIGNAL(returnPressed()), SLOT(find()))); assert(connect(_find, SIGNAL(textEdited(QString)), SLOT(find()))); + _find->setStyleSheet(tr("background-color: white", "neutral find")); _find->setFocus(); } @@ -597,20 +605,27 @@ class Browser: public QMainWindow, protected Ui::Browser { disconnect(_find, SIGNAL(textEdited(QString)), this, SLOT(find())); assert(connect(_find, SIGNAL(returnPressed()), SLOT(rfind()))); assert(connect(_find, SIGNAL(textEdited(QString)), SLOT(rfind()))); + _find->setStyleSheet(tr("background-color: white", "neutral find")); _find->setFocus(); } void find(const QString& txt=QString()) { - qobject_cast(_tabs->currentWidget())->findText - (_find->text(), - QWebPage::FindWrapsAroundDocument); + if (qobject_cast(_tabs->currentWidget())->findText + (_find->text(), + QWebPage::FindWrapsAroundDocument)) + _find->setStyleSheet(tr("background-color: #ADA", "text found")); + else + _find->setStyleSheet(tr("background-color: #F77", "text not found")); } void rfind(const QString& txt=QString()) { - qobject_cast(_tabs->currentWidget())->findText - (_find->text(), - QWebPage::FindWrapsAroundDocument - |QWebPage::FindBackward); + if(qobject_cast(_tabs->currentWidget())->findText + (_find->text(), + QWebPage::FindWrapsAroundDocument + |QWebPage::FindBackward)) + _find->setStyleSheet(tr("background-color: #ADA", "text found")); + else + _find->setStyleSheet(tr("background-color: #F77", "text not found")); } void on_actionUnFind_triggered() { @@ -705,7 +720,7 @@ class Browser: public QMainWindow, protected Ui::Browser { void loadFinished(bool ok) { LOG<<(ok?"success":"error"); - statusBar()->showMessage(ok?tr("done."):tr("page load error.")); + if (ok) statusBar()->showMessage(tr("done.")); activateTab(); } @@ -1145,6 +1160,25 @@ class Browser: public QMainWindow, protected Ui::Browser { _progress->setEnabled(false); } + void finished(QNetworkReply *r) { + LOG; + if (r->error()!=QNetworkReply::NoError && + r->error()!=QNetworkReply::OperationCanceledError) { + statusBar()->showMessage(DownloadManager::networkError(r->error())); + badUrl(); + } + } + + void badUrl() { + _url->lineEdit() + ->setStyleSheet(tr("background-color: #F77", "invalid url")); + } + + void goodUrl() { + _url->lineEdit() + ->setStyleSheet(tr("background-color: white", "valid url")); + } + void downloadError(QString error) { _errorLog.append(error); } diff --git a/swisssurfer/src/swisssurfer_de.ts b/swisssurfer/src/swisssurfer_de.ts index 436e261..e838567 100644 --- a/swisssurfer/src/swisssurfer_de.ts +++ b/swisssurfer/src/swisssurfer_de.ts @@ -246,98 +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. - - page load error. - - - - + %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 @@ -357,22 +376,35 @@ openssl-%7 - + %1 - + Save File As ... - + + background-color: #F77 + background-color: lightred + invalid url + + + + + background-color: white + valid url + + + + authentication required - + ssl error diff --git a/swisssurfer/src/swisssurfer_en.ts b/swisssurfer/src/swisssurfer_en.ts index 01502fb..eae1882 100644 --- a/swisssurfer/src/swisssurfer_en.ts +++ b/swisssurfer/src/swisssurfer_en.ts @@ -244,74 +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 @@ -331,43 +355,51 @@ openssl-%7 - + %1 - + Info: %1 - + done. - - page load error. - - - - + %1 statusbar for hovered link %1=url - + Save File As ... - + + background-color: #F77 + background-color: lightred + invalid url + + + + + background-color: white + valid url + + + + authentication required - + ssl error diff --git a/swisssurfer/src/swisssurfer_fr.ts b/swisssurfer/src/swisssurfer_fr.ts index 436e261..e838567 100644 --- a/swisssurfer/src/swisssurfer_fr.ts +++ b/swisssurfer/src/swisssurfer_fr.ts @@ -246,98 +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. - - page load error. - - - - + %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 @@ -357,22 +376,35 @@ openssl-%7 - + %1 - + Save File As ... - + + background-color: #F77 + background-color: lightred + invalid url + + + + + background-color: white + valid url + + + + authentication required - + ssl error diff --git a/swisssurfer/src/swisssurfer_it.ts b/swisssurfer/src/swisssurfer_it.ts index 436e261..e838567 100644 --- a/swisssurfer/src/swisssurfer_it.ts +++ b/swisssurfer/src/swisssurfer_it.ts @@ -246,98 +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. - - page load error. - - - - + %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 @@ -357,22 +376,35 @@ openssl-%7 - + %1 - + Save File As ... - + + background-color: #F77 + background-color: lightred + invalid url + + + + + background-color: white + valid url + + + + authentication required - + ssl error