new option --debug to enable debugging and debug window in info; refs #153
This commit is contained in:
+117
-115
@@ -8,6 +8,7 @@
|
||||
#ifndef BROWSER_HXX
|
||||
#define BROWSER_HXX
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <smartcardauth.hxx>
|
||||
#include <logincertificate.hxx>
|
||||
#include <errorlog.hxx>
|
||||
@@ -47,11 +48,6 @@
|
||||
#include <cassert>
|
||||
#include <memory>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
extern QString TMP;
|
||||
|
||||
//! @addtogroup browser
|
||||
@@ -81,10 +77,11 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
_searchEngines(new QComboBox),
|
||||
_bookmarkfile(bookmarkfile),
|
||||
_executor(&_settings) {
|
||||
LOG<<urls;
|
||||
TRC; LOG<<urls;
|
||||
_home = "about:blank";
|
||||
if (urls.size()) _home = urls.at(0);
|
||||
setupUi(this);
|
||||
actionDebugLog->setVisible(qbrowserlib::Log::DEBUG);
|
||||
actionStop->setVisible(false);
|
||||
actionReload->setVisible(false);
|
||||
show();
|
||||
@@ -239,7 +236,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
~Browser() {
|
||||
LOG;
|
||||
TRC;
|
||||
QWebSettings::clearIconDatabase();
|
||||
}
|
||||
|
||||
@@ -260,7 +257,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
protected:
|
||||
|
||||
void closeEvent(QCloseEvent *event) {
|
||||
LOG;
|
||||
TRC;
|
||||
if (!_kiosk &&
|
||||
((!_startUrl && _settings.flag("SaveWindowState") && _settings()) ||
|
||||
_bookmarkfile.writeable()))
|
||||
@@ -280,7 +277,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
private Q_SLOTS:
|
||||
|
||||
void load() {
|
||||
LOG;
|
||||
TRC;
|
||||
if (qobject_cast<QComboBox*>(_url))
|
||||
load(qobject_cast<QComboBox*>(_url)->currentText());
|
||||
else
|
||||
@@ -298,7 +295,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void load(QUrl page, QWebView* view=0) {
|
||||
LOG<<page.toString();
|
||||
TRC; LOG<<page.toString();
|
||||
statusBar()->showMessage(tr("Checking: %1").arg(page.toString()));
|
||||
if (!check(page)) {
|
||||
LOG<<"########## BLACK LISTED IGNORED ##########";
|
||||
@@ -618,7 +615,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void zoom(int i) {
|
||||
LOG<<i;
|
||||
TRC; LOG<<i;
|
||||
statusBar()->showMessage(tr("Zoom: %1%").arg(i));
|
||||
qobject_cast<QWebView*>(_tabs->currentWidget())->setZoomFactor(i/100.0);
|
||||
}
|
||||
@@ -628,12 +625,12 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void on_actionHome_activated() {
|
||||
LOG;
|
||||
TRC;
|
||||
load(_home);
|
||||
}
|
||||
|
||||
void on_actionNew_triggered() {
|
||||
LOG;
|
||||
TRC;
|
||||
QStringList args(QCoreApplication::arguments());
|
||||
QString prg(args.takeFirst());
|
||||
statusBar()->showMessage(tr("opening new window"), 5000);
|
||||
@@ -688,17 +685,17 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void on_actionClose_triggered() {
|
||||
LOG;
|
||||
TRC;
|
||||
close();
|
||||
}
|
||||
|
||||
void on_actionBack_triggered() {
|
||||
LOG;
|
||||
TRC;
|
||||
qobject_cast<QWebView*>(_tabs->currentWidget())->history()->back();
|
||||
}
|
||||
|
||||
void on_actionBack_hovered() {
|
||||
LOG;
|
||||
TRC;
|
||||
if (!qobject_cast<QWebView*>(_tabs->currentWidget())->history()
|
||||
->backItem().isValid())
|
||||
return;
|
||||
@@ -712,12 +709,12 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void on_actionForward_triggered() {
|
||||
LOG;
|
||||
TRC;
|
||||
qobject_cast<QWebView*>(_tabs->currentWidget())->history()->forward();
|
||||
}
|
||||
|
||||
void on_actionForward_hovered() {
|
||||
LOG;
|
||||
TRC;
|
||||
if (!qobject_cast<QWebView*>(_tabs->currentWidget())->history()
|
||||
->forwardItem().isValid())
|
||||
return;
|
||||
@@ -731,12 +728,12 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void on_actionReload_triggered() {
|
||||
LOG;
|
||||
TRC;
|
||||
qobject_cast<QWebView*>(_tabs->currentWidget())->reload();
|
||||
}
|
||||
|
||||
void on_actionStop_triggered() {
|
||||
LOG;
|
||||
TRC;
|
||||
for (int i(0); i<_tabs->count(); ++i)
|
||||
qobject_cast<QWebView*>(_tabs->widget(i))->stop();
|
||||
_downloadManager->abort();
|
||||
@@ -845,6 +842,10 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
.arg(SHLIB_VERSION_NUMBER)
|
||||
.arg(QApplication::applicationName()));
|
||||
}
|
||||
|
||||
void on_actionDebugLog_triggered() {
|
||||
qbrowserlib::Log::show(this);
|
||||
}
|
||||
|
||||
void on_actionSettings_triggered() {
|
||||
_settings.show();
|
||||
@@ -859,7 +860,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void saveWin() {
|
||||
LOG<<"Save Window State";
|
||||
TRC; LOG<<"Save Window State";
|
||||
saveBookmarks();
|
||||
if (!_settings()) return;
|
||||
QStringList tabs;
|
||||
@@ -872,7 +873,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void saveBookmarks() {
|
||||
LOG<<"Saving Bookmarks ...";
|
||||
TRC; LOG<<"Saving Bookmarks ...";
|
||||
QStringList urls;
|
||||
if (qobject_cast<QComboBox*>(_url))
|
||||
for (int i(0); i<qobject_cast<QComboBox*>(_url)->count(); ++i)
|
||||
@@ -887,7 +888,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void loadWin() {
|
||||
LOG;
|
||||
TRC;
|
||||
loadBookmarks();
|
||||
if (!_settings()) return;
|
||||
QStringList tabs(_settings()->value("Window/Tabs").toStringList());
|
||||
@@ -905,7 +906,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void loadBookmarks() {
|
||||
LOG<<"Loading Bookmarks ...";
|
||||
TRC; LOG<<"Loading Bookmarks ...";
|
||||
QStringList urls;
|
||||
if (_bookmarkfile.readable()) {
|
||||
LOG<<"load from file";
|
||||
@@ -934,7 +935,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
//@{
|
||||
|
||||
void urlChanged(const QUrl& url) {
|
||||
LOG<<url.toString();
|
||||
TRC; LOG<<url.toString();
|
||||
if (sender()!=_tabs->currentWidget()) return;
|
||||
LOG<<"signal on current tab";
|
||||
if (qobject_cast<QComboBox*>(_url)) {
|
||||
@@ -947,12 +948,12 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void linkClicked(const QUrl& url) {
|
||||
LOG<<url.toString();
|
||||
TRC; LOG<<url.toString();
|
||||
load(url, qobject_cast<QWebView*>(sender()));
|
||||
}
|
||||
|
||||
void iconChanged() {
|
||||
LOG;
|
||||
TRC;
|
||||
QWebView* view(qobject_cast<QWebView*>(sender()));
|
||||
int index = _tabs->indexOf(view);
|
||||
if (index<0) return;
|
||||
@@ -965,26 +966,26 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void titleChanged(const QString& text) {
|
||||
LOG<<text;
|
||||
TRC; LOG<<text;
|
||||
_tabs->setTabText(_tabs->indexOf(qobject_cast<QWidget*>(sender())),
|
||||
trUtf8("%1").arg(text));
|
||||
}
|
||||
|
||||
void statusBarMessage(const QString& text) {
|
||||
LOG<<text;
|
||||
TRC; LOG<<text;
|
||||
if (text.size()) statusBar()->showMessage(tr("Info: %1").arg(text));
|
||||
}
|
||||
|
||||
void loadProgress(int i) {
|
||||
LOG<<i;
|
||||
TRC; LOG<<i;
|
||||
}
|
||||
|
||||
void loadStarted() {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void loadFinished(bool ok) {
|
||||
LOG<<(ok?"success":"error");
|
||||
TRC; LOG<<(ok?"success":"error");
|
||||
QSize sz(qobject_cast<QWebView*>(_tabs->currentWidget())->size());
|
||||
qobject_cast<QWebView*>(_tabs->currentWidget())->resize(0,0);
|
||||
qobject_cast<QWebView*>(_tabs->currentWidget())->resize(sz);
|
||||
@@ -1001,215 +1002,215 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
//@{
|
||||
|
||||
void triggeredOpenLink(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredOpenLinkInNewWindow(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredOpenFrameInNewWindow(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredDownloadLinkToDisk(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredCopyLinkToClipboard(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredOpenImageInNewWindow(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredDownloadImageToDisk(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredCopyImageToClipboard(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredBack(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredForward(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredStop(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredReload(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredCut(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredCopy(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredPaste(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredUndo(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredRedo(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToNextChar(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToPreviousChar(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToNextWord(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToPreviousWord(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToNextLine(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToPreviousLine(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToStartOfLine(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToEndOfLine(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToStartOfBlock(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToEndOfBlock(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToStartOfDocument(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredMoveToEndOfDocument(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectNextChar(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectPreviousChar(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectNextWord(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectPreviousWord(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectNextLine(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectPreviousLine(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectStartOfLine(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectEndOfLine(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectStartOfBlock(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectEndOfBlock(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectStartOfDocument(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectEndOfDocument(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredDeleteStartOfWord(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredDeleteEndOfWord(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSetTextDirectionDefault(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSetTextDirectionLeftToRight(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSetTextDirectionRightToLeft(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredToggleBold(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredToggleItalic(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredToggleUnderline(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredInspectElement(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredInsertParagraphSeparator(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredInsertLineSeparator(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
void triggeredSelectAll(bool) {
|
||||
LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
TRC; LOG<<qobject_cast<QAction*>(sender())->data().toString();
|
||||
}
|
||||
|
||||
//@}
|
||||
@@ -1218,97 +1219,97 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
//@{
|
||||
|
||||
void contentsChanged() {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void databaseQuotaExceeded(QWebFrame* frame, QString databaseName) {
|
||||
LOG<<databaseName;
|
||||
TRC; LOG<<databaseName;
|
||||
}
|
||||
|
||||
void downloadRequested(const QNetworkRequest& request) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void frameCreated(QWebFrame* frame) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void geometryChangeRequested(const QRect& geom) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
// void linkClicked(const QUrl& url) {
|
||||
// LOG<<url.toString();
|
||||
// TRC; LOG<<url.toString();
|
||||
// }
|
||||
|
||||
void linkHovered(const QString& link, const QString& title,
|
||||
const QString& textContent) {
|
||||
LOG<<link<<title<<textContent;
|
||||
TRC; LOG<<link<<title<<textContent;
|
||||
statusBar()->showMessage(tr("%1", "statusbar for hovered link %1=url")
|
||||
.arg(link));
|
||||
}
|
||||
|
||||
// void loadFinished(bool ok) {
|
||||
// LOG<<(ok?"succeess":"error");
|
||||
// TRC; LOG<<(ok?"succeess":"error");
|
||||
// }
|
||||
|
||||
// void loadProgress(int progress) {
|
||||
// LOG<<progress;
|
||||
// TRC; LOG<<progress;
|
||||
// }
|
||||
|
||||
// void loadStarted() {
|
||||
// LOG;
|
||||
// TRC;
|
||||
// }
|
||||
|
||||
void menuBarVisibilityChangeRequested(bool visible) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void microFocusChanged() {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void printRequested(QWebFrame* frame) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void repaintRequested(const QRect& dirtyRect) {
|
||||
//LOG;
|
||||
//TRC;
|
||||
}
|
||||
|
||||
void restoreFrameStateRequested(QWebFrame* frame) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void scrollRequested(int dx, int dy, const QRect& rectToScroll) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void selectionChanged() {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
// void statusBarMessage(const QString& text) {
|
||||
// LOG;
|
||||
// TRC;
|
||||
// }
|
||||
|
||||
void statusBarVisibilityChangeRequested(bool visible) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void toolBarVisibilityChangeRequested(bool visible) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
//@name handle downloads
|
||||
//@{
|
||||
|
||||
void unsupportedContent(QNetworkReply* reply) {
|
||||
LOG<<reply->header(QNetworkRequest::ContentTypeHeader).toString();
|
||||
TRC; LOG<<reply->header(QNetworkRequest::ContentTypeHeader).toString();
|
||||
LOG<<"Status:"<<_downloadManager->networkError(reply->error());
|
||||
QList<QNetworkReply::RawHeaderPair> rh(reply->rawHeaderPairs());
|
||||
for(QList<QNetworkReply::RawHeaderPair>::iterator it(rh.begin());
|
||||
@@ -1320,6 +1321,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
|
||||
//! check and handle content that is defined in settings
|
||||
void metaDataChanged(QNetworkReply* reply) {
|
||||
TRC;
|
||||
QString filename
|
||||
(QString::fromUtf8(reply->rawHeader("Content-Disposition")));
|
||||
if (filename.contains
|
||||
@@ -1343,7 +1345,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void handleContent(QNetworkReply* reply) {
|
||||
LOG<<"Location:"<<reply->header(QNetworkRequest::LocationHeader)
|
||||
TRC; LOG<<"Location:"<<reply->header(QNetworkRequest::LocationHeader)
|
||||
.toString();
|
||||
LOG<<"Content-Type:"<<reply->header(QNetworkRequest::ContentTypeHeader)
|
||||
.toString();
|
||||
@@ -1368,7 +1370,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
//@}
|
||||
|
||||
void windowCloseRequested() {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
//@}
|
||||
@@ -1392,7 +1394,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void finished() {
|
||||
LOG;
|
||||
TRC;
|
||||
QApplication::restoreOverrideCursor();
|
||||
actionStop->setVisible(false);
|
||||
actionReload->setVisible(true);
|
||||
@@ -1402,7 +1404,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void finished(QNetworkReply *r) {
|
||||
LOG;
|
||||
TRC;
|
||||
if (r->error()!=QNetworkReply::NoError &&
|
||||
r->error()!=QNetworkReply::OperationCanceledError) {
|
||||
statusBar()->showMessage(DownloadManager::networkError(r->error()));
|
||||
@@ -1419,7 +1421,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
|
||||
void errorReset() {
|
||||
LOG;
|
||||
TRC;
|
||||
_showErrorLog->hide();
|
||||
}
|
||||
|
||||
@@ -1454,7 +1456,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
|
||||
void authenticationRequired(QNetworkReply* reply,
|
||||
QAuthenticator* authenticator) {
|
||||
LOG<<reply->url().toString()<<authenticator->realm();
|
||||
TRC; LOG<<reply->url().toString()<<authenticator->realm();
|
||||
statusBar()->showMessage(tr("authentication required"));
|
||||
Authentication auth(authenticator, this);
|
||||
if (auth.exec()==QDialog::Rejected) reply->abort();
|
||||
@@ -1462,11 +1464,11 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
|
||||
void proxyAuthenticationRequired(const QNetworkProxy& proxy,
|
||||
QAuthenticator* authenticator) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void sslErrors(QNetworkReply* reply, const QList<QSslError>& errors) {
|
||||
LOG;
|
||||
TRC;
|
||||
statusBar()->showMessage(tr("ssl error"));
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -70,7 +70,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1009</width>
|
||||
<height>23</height>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuDatei">
|
||||
@@ -115,6 +115,7 @@
|
||||
<addaction name="actionLoginCertificate"/>
|
||||
<addaction name="actionErrorLog"/>
|
||||
<addaction name="actionAbout"/>
|
||||
<addaction name="actionDebugLog"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="_bookmarks">
|
||||
<property name="title">
|
||||
@@ -479,6 +480,11 @@
|
||||
<string>Clear Search</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDebugLog">
|
||||
<property name="text">
|
||||
<string>Debug Log</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="resources.qrc"/>
|
||||
|
||||
@@ -8,13 +8,10 @@
|
||||
#ifndef __BUTTONLINEEDITWIDGETIFC_HXX
|
||||
#define __BUTTONLINEEDITWIDGETIFC_HXX
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <qbrowserlib/buttonlineedit.hxx>
|
||||
#include <QtDesigner>
|
||||
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
//! @defgroup designer
|
||||
//! @{
|
||||
|
||||
@@ -25,15 +22,15 @@ class ButtonLineEditWidgetIfc: public QObject,
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface);
|
||||
public:
|
||||
bool isContainer() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return false;
|
||||
}
|
||||
QIcon icon() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return QIcon(":/icons/buttonlineedit.png");
|
||||
}
|
||||
QString domXml() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return
|
||||
QString
|
||||
("<ui language=\"c++\" displayname=\"%1\">"
|
||||
@@ -48,27 +45,27 @@ class ButtonLineEditWidgetIfc: public QObject,
|
||||
.arg(name().toLower());
|
||||
}
|
||||
QString group() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return "Input Widgets";
|
||||
}
|
||||
QString includeFile() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return "qbrowserlib/buttonlineedit.hxx";
|
||||
}
|
||||
QString name() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return "ButtonLineEdit";
|
||||
}
|
||||
QString toolTip() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return "";
|
||||
}
|
||||
QString whatsThis() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return "";
|
||||
}
|
||||
QWidget *createWidget(QWidget *parent) {
|
||||
LOG;
|
||||
TRC;
|
||||
return new ButtonLineEdit(parent);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,13 +8,10 @@
|
||||
#ifndef __WEBVIEWWIDGETIFC_HXX
|
||||
#define __WEBVIEWWIDGETIFC_HXX
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <qbrowserlib/swisswebview.hxx>
|
||||
#include <QtDesigner>
|
||||
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
//! @defgroup designer
|
||||
//! @{
|
||||
|
||||
@@ -26,15 +23,15 @@ class SwissWebViewWidgetIfc: public QObject,
|
||||
public:
|
||||
SwissWebViewWidgetIfc(): _initialized(false) {}
|
||||
bool isContainer() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return true;
|
||||
}
|
||||
QIcon icon() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return QIcon(":/icons/swisswebview.png");
|
||||
}
|
||||
QString domXml() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return
|
||||
QString
|
||||
("<ui language=\"c++\" displayname=\"%1\">"
|
||||
@@ -49,35 +46,35 @@ class SwissWebViewWidgetIfc: public QObject,
|
||||
.arg(name().toLower());
|
||||
}
|
||||
QString group() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return "Display Widgets [Examples]";
|
||||
}
|
||||
QString includeFile() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return "qbrowserlib/swisswebview.hxx";
|
||||
}
|
||||
QString name() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return "SwissWebView";
|
||||
}
|
||||
QString toolTip() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return "";
|
||||
}
|
||||
QString whatsThis() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return "";
|
||||
}
|
||||
QWidget *createWidget(QWidget *parent) {
|
||||
LOG;
|
||||
TRC;
|
||||
return new qbrowserlib::SwissWebView(&_net, &_executor, parent);
|
||||
}
|
||||
bool isInitialized() {
|
||||
LOG;
|
||||
TRC;
|
||||
return _initialized;
|
||||
}
|
||||
void initialized() {
|
||||
LOG;
|
||||
TRC;
|
||||
_initialized = true;
|
||||
}
|
||||
private:
|
||||
|
||||
+12
-15
@@ -8,28 +8,25 @@
|
||||
#ifndef __DOWNLOAD_MANAGER_HXX
|
||||
#define __DOWNLOAD_MANAGER_HXX
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
#include <QtNetwork/QSslError>
|
||||
#include <map>
|
||||
|
||||
#include <cassert>
|
||||
#include <QtCore/QDebug>
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
class DownloadManager: public QObject {
|
||||
Q_OBJECT;
|
||||
public:
|
||||
|
||||
DownloadManager& operator+=(QNetworkReply* reply) {
|
||||
LOG;
|
||||
TRC;
|
||||
add(reply);
|
||||
return *this;
|
||||
}
|
||||
|
||||
static QString networkError(QNetworkReply::NetworkError err) {
|
||||
LOG<<err;
|
||||
TRC_FN; LOG<<err;
|
||||
switch (err) {
|
||||
case QNetworkReply::NoError:
|
||||
return tr("Network connection successful, remote host can be"
|
||||
@@ -111,7 +108,7 @@ class DownloadManager: public QObject {
|
||||
public Q_SLOTS:
|
||||
|
||||
void add(QNetworkReply* reply) {
|
||||
LOG<<_downloads.size()<<reply->url().toString();
|
||||
TRC; LOG<<_downloads.size()<<reply->url().toString();
|
||||
LOG<<reply;
|
||||
_downloads[reply].progress = Progress(0, 0);
|
||||
assert(connect(reply, SIGNAL(downloadProgress(qint64, qint64)),
|
||||
@@ -138,7 +135,7 @@ class DownloadManager: public QObject {
|
||||
private:
|
||||
|
||||
void calcProgress() {
|
||||
//LOG;
|
||||
//TRC;
|
||||
qint64 done(0);
|
||||
qint64 total(0);
|
||||
for (Downloads::iterator it(_downloads.begin());
|
||||
@@ -152,7 +149,7 @@ class DownloadManager: public QObject {
|
||||
private Q_SLOTS:
|
||||
|
||||
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) {
|
||||
//LOG<<bytesReceived<<bytesTotal;
|
||||
//TRC; LOG<<bytesReceived<<bytesTotal;
|
||||
_downloads[qobject_cast<QNetworkReply*>(sender())].progress.first
|
||||
= bytesReceived;
|
||||
_downloads[qobject_cast<QNetworkReply*>(sender())].progress.second
|
||||
@@ -160,7 +157,7 @@ class DownloadManager: public QObject {
|
||||
calcProgress();
|
||||
}
|
||||
void error(QNetworkReply::NetworkError code) {
|
||||
LOG<<"Status:"<<networkError(code);
|
||||
TRC; LOG<<"Status:"<<networkError(code);
|
||||
QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender()));
|
||||
_downloads[reply].error +=
|
||||
tr("<h1>Network Error</h1>"
|
||||
@@ -172,11 +169,11 @@ class DownloadManager: public QObject {
|
||||
.arg(code);
|
||||
}
|
||||
void slotDestroyed(QObject* obj) {
|
||||
LOG<<_downloads.size();
|
||||
TRC; LOG<<_downloads.size();
|
||||
_downloads.erase((QNetworkReply*)obj);
|
||||
}
|
||||
void slotFinished() {
|
||||
LOG<<_downloads.size();
|
||||
TRC; LOG<<_downloads.size();
|
||||
QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender()));
|
||||
if (_downloads[reply].error.size())
|
||||
error(_downloads[reply].error);
|
||||
@@ -184,7 +181,7 @@ class DownloadManager: public QObject {
|
||||
if (_downloads.size()==0) finished();
|
||||
}
|
||||
void slotMetaDataChanged() {
|
||||
LOG;
|
||||
TRC;
|
||||
QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender()));
|
||||
if (!reply) return;
|
||||
LOG<<"Location:"<<reply->header(QNetworkRequest::LocationHeader)
|
||||
@@ -199,7 +196,7 @@ class DownloadManager: public QObject {
|
||||
metaDataChanged(reply);
|
||||
}
|
||||
void sslErrors(const QList<QSslError> & errors) {
|
||||
LOG;
|
||||
TRC;
|
||||
QNetworkReply* reply(qobject_cast<QNetworkReply*>(sender()));
|
||||
for (QList<QSslError>::const_iterator err(errors.begin());
|
||||
err!=errors.end(); ++err) {
|
||||
@@ -261,7 +258,7 @@ class DownloadManager: public QObject {
|
||||
}
|
||||
|
||||
void uploadProgress(qint64 bytesSent, qint64 bytesTotal) {
|
||||
//LOG<<bytesSent<<bytesTotal;
|
||||
//TRC; LOG<<bytesSent<<bytesTotal;
|
||||
_downloads[qobject_cast<QNetworkReply*>(sender())].progress.first
|
||||
= bytesSent;
|
||||
_downloads[qobject_cast<QNetworkReply*>(sender())].progress.second
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#ifndef ERRORLOG_HXX
|
||||
#define ERRORLOG_HXX
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <ui_errorlog.h>
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
@@ -18,13 +19,16 @@ class ErrorLog: public QDialog, protected Ui::ErrorLog {
|
||||
void reset();
|
||||
public:
|
||||
ErrorLog(QWidget* p): QDialog(p) {
|
||||
TRC;
|
||||
setupUi(this);
|
||||
}
|
||||
void append(QString text) {
|
||||
TRC; LOG<<text;
|
||||
_errors->append(text);
|
||||
}
|
||||
protected Q_SLOTS:
|
||||
void on__buttons_clicked(QAbstractButton* button) {
|
||||
TRC;
|
||||
switch (_buttons->buttonRole(button)) {
|
||||
case QDialogButtonBox::ResetRole: {
|
||||
_errors->clear();
|
||||
|
||||
@@ -8,15 +8,18 @@
|
||||
#ifndef LOGINCERTIFICATE_HXX
|
||||
#define LOGINCERTIFICATE_HXX
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <ui_logincertificate.h>
|
||||
|
||||
class LoginCertificate: public QDialog, protected Ui::LoginCertificate {
|
||||
public:
|
||||
LoginCertificate(QWidget* p): QDialog(p) {
|
||||
TRC;
|
||||
setupUi(this);
|
||||
setup();
|
||||
}
|
||||
LoginCertificate& setup() {
|
||||
TRC;
|
||||
QSslCertificate c(QSslConfiguration::defaultConfiguration()
|
||||
.localCertificate());
|
||||
_cert->certificate(c);
|
||||
@@ -24,6 +27,7 @@ class LoginCertificate: public QDialog, protected Ui::LoginCertificate {
|
||||
}
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent *event) {
|
||||
TRC;
|
||||
setup();
|
||||
QDialog::showEvent(event);
|
||||
}
|
||||
|
||||
+45
-242
@@ -8,6 +8,9 @@
|
||||
// 1 2 3 4 5 6 7 8
|
||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <browser.hxx>
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtCore/QTranslator>
|
||||
#include <QtCore/QTextCodec>
|
||||
@@ -20,7 +23,6 @@
|
||||
#include <QtNetwork/QSslKey>
|
||||
#include <QtWebKit/QWebSettings>
|
||||
|
||||
#include <browser.hxx>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
@@ -46,197 +48,6 @@
|
||||
|
||||
QString TMP;
|
||||
|
||||
const QByteArray SWISSSIGN_EV_GOLD_CA_2009_G2
|
||||
("-----BEGIN CERTIFICATE-----\n"
|
||||
"MIIGvzCCBaegAwIBAgIQAPI39KUS4aGJo+mkR4+YuTANBgkqhkiG9w0BAQUFADBN\n"
|
||||
"MQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMScwJQYDVQQDEx5T\n"
|
||||
"d2lzc1NpZ24gRVYgR29sZCBDQSAyMDA5IC0gRzIw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
|
||||
"TTVbW2Kh8xul9jLole+hWXtx8Ln4E8oW+bV25HGUjt8QrC1wXGABRCijgIjQ8PtR\n"
|
||||
"CQrcwJCmC9ShcckP7KXiaETaT67TUB8qIQ/pf3akNeWKcdFGcD6CDYM7umuu1Q1X\n"
|
||||
"326mufNviiqlU0uoK1LJQHhme3HMHarYdzkuIeShvIYHUYP3JnorXaizcCqjBhdF\n"
|
||||
"rj4QcCZx8hKE6gmNL+dJkBM/5CSqByy15tMs2qa0iMdwkPUiNxlL0VuZkwzooVQx\n"
|
||||
"1eKQwsSx3807MkQMKs+4v1LexkY+5/xU9dvtyRysjuSEWS8yCx3+E3fOOVAIX5jD\n"
|
||||
"0uSX\n"
|
||||
"-----END CERTIFICATE-----");
|
||||
const QByteArray SWISSSIGN_SERVER_GOLD_CA_2008_G2
|
||||
("-----BEGIN CERTIFICATE-----\n"
|
||||
"MIIGXjCCBEagAwIBAgIIXsz6acAzJ+8wDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UE\n"
|
||||
"BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEfMB0GA1UEAxMWU3dpc3NTaWdu\n"
|
||||
"IEdvbGQgQ0EgLSBHMjAeFw0wODA3MDcxNzA2MDNaFw0yMzA3MDcxNzA2MDNaMFEx\n"
|
||||
"CzAJBgNVBAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxKzApBgNVBAMTIlN3\n"
|
||||
"aXNzU2lnbiBTZXJ2ZXIgR29sZCBDQSAyMDA4IC0gRzIwggEiMA0GCSqGSIb3DQEB\n"
|
||||
"AQUAA4IBDwAwggEKAoIBAQDNMradteMVxVvR6t+pOooZejP8r1lY85el0PB7C118\n"
|
||||
"iKYv1Apfq3mZ0wt7ZdpCyd2DzKE338Ki04Qn9IidLCkKDLOSNtlQlw4Yvg12W2bU\n"
|
||||
"/WVaVAeUN0Tn3VeCkdWbSRIbvTGU63X9dp5lbgEm8XyjpLAK3SKABn7dWivfWuBo\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jviOvrv1vA+ACOzB2+htt\n"
|
||||
"Qc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ\n"
|
||||
"-----END CERTIFICATE-----\n");
|
||||
const QByteArray SWISSSIGN_PLATINUM_CA_G2
|
||||
("-----BEGIN CERTIFICATE-----\n"
|
||||
"MIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkG\n"
|
||||
"A1UEBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dp\n"
|
||||
"c3NTaWduIFBsYXRpbnVtIENBIC0gRzIwHhcNMDYxMDI1MDgzNjAwWhcNMzYx\n"
|
||||
"MDI1MDgzNjAwWjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWdu\n"
|
||||
"IEFHMSMwIQYDVQQDExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIw\n"
|
||||
"DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZc\n"
|
||||
"ZB/HL37PZ/pEQtZ2Y5Wu669yIIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeT\n"
|
||||
"IsBQnIJ71NUERFzLtMKfkr4k2HtnIuJpX+UFeNSH2XFwMyVTtIc7KZAoNppV\n"
|
||||
"RDBopIOXfw0enHb/FZ1glwCNioUD7IC+6ixuEFGSzH7VozPY1kneWCqv9hbr\n"
|
||||
"S3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5objM89o03Oy3z2u5yg+gnOI2Ky\n"
|
||||
"6Q0f4nIoj5+saCB9bzuohTEJfwvH6GXp43gOCWcwizSC+13gzJ2BbWLuCB4E\n"
|
||||
"LE6b7P6pT1/9aXjvCR+htL/68++QHkwFix7qepF6w9fl+zC8bBsQWJj3Gl/Q\n"
|
||||
"KTIDE0ZNYWqFTFJ0LwYfexHihJfGmfNtf9dng34TaNhxKFrYzt3o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15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpH\n"
|
||||
"kXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE\n"
|
||||
"790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8aRl5xB9+lwW/xekkUV7U\n"
|
||||
"1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqPe97Dh4kQ\n"
|
||||
"mUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNV\n"
|
||||
"V4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29\n"
|
||||
"MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm\n"
|
||||
"0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy\n"
|
||||
"tGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u\n"
|
||||
"-----END CERTIFICATE-----\n");
|
||||
|
||||
void notrace(QtMsgType, const char*) {
|
||||
return;
|
||||
}
|
||||
|
||||
extern QWEBKIT_EXPORT void qt_drt_overwritePluginDirectories();
|
||||
|
||||
QMap<QString, QString>& env() {
|
||||
@@ -286,7 +97,7 @@ QString helptext() {
|
||||
" PROXY_HOST proxy host name (actual: %4)\n"
|
||||
" SWISS_USERAGENT fake user agent (actual: %6)\n"
|
||||
" QT_PLUGIN_PATH path to plugins dir (actual: %7)\n"
|
||||
" QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)\n")
|
||||
" QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)")
|
||||
.arg(QFileInfo(QCoreApplication::arguments().at(0)).fileName())
|
||||
.arg(env()["PROXY_TYPE"]).arg(env()["PROXY_PORT"]).arg(env()["PROXY_HOST"])
|
||||
.arg(env()["LANGUAGE"]).arg(env()["SWISS_USERAGENT"])
|
||||
@@ -294,29 +105,10 @@ QString helptext() {
|
||||
}
|
||||
|
||||
int main(int argv, char** argc) try {
|
||||
// qInstallMsgHandler(notrace);
|
||||
// std::cout.rdbuf((new std::stringstream)->rdbuf());
|
||||
// std::cerr.rdbuf((new std::stringstream)->rdbuf());
|
||||
// std::clog.rdbuf((new std::stringstream)->rdbuf());
|
||||
//............................................................................
|
||||
QSslConfiguration sslConfig(QSslConfiguration::defaultConfiguration());
|
||||
sslConfig.setProtocol(QSsl::AnyProtocol);
|
||||
sslConfig.setPeerVerifyMode(QSslSocket::AutoVerifyPeer);
|
||||
QList<QSslCertificate> certs(sslConfig.caCertificates());
|
||||
for (QList<QSslCertificate>::iterator cert(certs.begin());
|
||||
cert!=certs.end(); ++cert) {
|
||||
qDebug()<<"CERTIFICATE: "
|
||||
<<cert->issuerInfo(QSslCertificate::Organization)
|
||||
<<cert->issuerInfo(QSslCertificate::CommonName)
|
||||
<<cert->subjectInfo(QSslCertificate::Organization)
|
||||
<<cert->subjectInfo(QSslCertificate::CommonName);
|
||||
}
|
||||
// certs.push_back(QSslCertificate(SWISSSIGN_EV_GOLD_CA_2009_G2));
|
||||
// certs.push_back(QSslCertificate(SWISSSIGN_GOLD_CA_G2));
|
||||
// //certs.push_back(QSslCertificate(SWISSSIGN_SERVER_GOLD_CA_2008_G2));
|
||||
// certs.push_back(QSslCertificate(SWISSSIGN_SILVER_CA_G2));
|
||||
// certs.push_back(QSslCertificate(SWISSSIGN_PLATINUM_CA_G2));
|
||||
// sslConfig.setCaCertificates(certs);
|
||||
//............................................................................
|
||||
QTextCodec* utf8(QTextCodec::codecForName("UTF-8"));
|
||||
QTextCodec::setCodecForCStrings(utf8);
|
||||
@@ -333,28 +125,6 @@ int main(int argv, char** argc) try {
|
||||
QTranslator appTranslator;
|
||||
appTranslator.load(":/language/swissbrowser_"+ QLocale().name());
|
||||
app.installTranslator(&appTranslator);
|
||||
//............................................................................
|
||||
if (env()["PROXY_TYPE"]=="http")
|
||||
QNetworkProxy::setApplicationProxy
|
||||
(QNetworkProxy
|
||||
(QNetworkProxy::HttpProxy,
|
||||
env()["PROXY_HOST"], env()["PROXY_PORT"].toInt()));
|
||||
if (env()["PROXY_TYPE"]=="socks")
|
||||
QNetworkProxy::setApplicationProxy
|
||||
(QNetworkProxy
|
||||
(QNetworkProxy::Socks5Proxy,
|
||||
env()["PROXY_HOST"], env()["PROXY_PORT"].toInt()));
|
||||
else
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
qDebug()<<"***************************************************************";
|
||||
qDebug()<<"Start - Proxy:"
|
||||
<<(QNetworkProxy::applicationProxy().type()==QNetworkProxy::NoProxy
|
||||
? "No Proxy"
|
||||
: (QNetworkProxy::applicationProxy().type()
|
||||
==QNetworkProxy::Socks5Proxy ? "socks" : "http"))
|
||||
<<"Hostname"<<QNetworkProxy::applicationProxy().hostName()
|
||||
<<"Port"<<QNetworkProxy::applicationProxy().port();
|
||||
qDebug()<<"***************************************************************";
|
||||
//----------------------------------------------------------------------------
|
||||
TMP=QDir::toNativeSeparators(QDir::tempPath());
|
||||
QStringList urls;
|
||||
@@ -386,6 +156,8 @@ int main(int argv, char** argc) try {
|
||||
if (*it=="-h" || *it=="--help" || *it=="-help" || *it=="/?") {
|
||||
std::cout<<helptext().toStdString()<<std::endl;
|
||||
return 0;
|
||||
} else if (*it=="-d" || *it=="--debug") {
|
||||
qbrowserlib::Log::DEBUG = true;
|
||||
} else if ((*it=="-t" || *it=="--tmp") && ++it!=args.end()) {
|
||||
TMP=*it;
|
||||
} else if ((*it=="-k" || *it=="--kiosk")) {
|
||||
@@ -440,22 +212,50 @@ int main(int argv, char** argc) try {
|
||||
} else if (it!=args.end()) {
|
||||
urls<<*it;
|
||||
} else {
|
||||
std::cout<<QObject::trUtf8("Too few arguments.\nTry: %1 --help")
|
||||
std::cerr<<QObject::trUtf8("Too few arguments.\nTry: %1 --help")
|
||||
.arg(QFileInfo(argc[0]).fileName()).toStdString()<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
TRC_FN;
|
||||
QList<QSslCertificate> certs(sslConfig.caCertificates());
|
||||
for (QList<QSslCertificate>::iterator cert(certs.begin());
|
||||
cert!=certs.end(); ++cert) {
|
||||
LOG<<"CERTIFICATE: "
|
||||
<<cert->issuerInfo(QSslCertificate::Organization)
|
||||
<<cert->issuerInfo(QSslCertificate::CommonName)
|
||||
<<cert->subjectInfo(QSslCertificate::Organization)
|
||||
<<cert->subjectInfo(QSslCertificate::CommonName);
|
||||
}
|
||||
QSslConfiguration::setDefaultConfiguration(sslConfig);
|
||||
//............................................................................
|
||||
std::cerr<<"LIBRARY PATHES:\n"<<app.libraryPaths().join("\n").toStdString()
|
||||
<<std::endl;
|
||||
if (env()["PROXY_TYPE"]=="http")
|
||||
QNetworkProxy::setApplicationProxy
|
||||
(QNetworkProxy
|
||||
(QNetworkProxy::HttpProxy,
|
||||
env()["PROXY_HOST"], env()["PROXY_PORT"].toInt()));
|
||||
if (env()["PROXY_TYPE"]=="socks")
|
||||
QNetworkProxy::setApplicationProxy
|
||||
(QNetworkProxy
|
||||
(QNetworkProxy::Socks5Proxy,
|
||||
env()["PROXY_HOST"], env()["PROXY_PORT"].toInt()));
|
||||
else
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
LOG<<"Start - Proxy:"
|
||||
<<(QNetworkProxy::applicationProxy().type()==QNetworkProxy::NoProxy
|
||||
? "No Proxy"
|
||||
: (QNetworkProxy::applicationProxy().type()
|
||||
==QNetworkProxy::Socks5Proxy ? "socks" : "http"))
|
||||
<<"Hostname"<<QNetworkProxy::applicationProxy().hostName()
|
||||
<<"Port"<<QNetworkProxy::applicationProxy().port();
|
||||
//............................................................................
|
||||
LOG<<"LIBRARY PATHES:\n"<<app.libraryPaths().join("\n").toStdString();
|
||||
if (env().contains("QT_PLUGIN_PATH")) {
|
||||
foreach (QString path, env()["QT_PLUGIN_PATH"].split(":")) {
|
||||
std::cerr<<"**** Setting: PLUGIN-PATH to "<<path.toStdString()<<std::endl;
|
||||
LOG<<"**** Setting: PLUGIN-PATH to "<<path.toStdString();
|
||||
app.addLibraryPath(path);
|
||||
}
|
||||
} else {
|
||||
std::cerr<<"**** Error: PLUGIN-PATH is not defined"<<std::endl;
|
||||
abort();
|
||||
LOG<<"**** PLUGIN-PATH is not defined";
|
||||
}
|
||||
if (env().contains("QTWEBKIT_PLUGIN_PATH"))
|
||||
qt_drt_overwritePluginDirectories();
|
||||
@@ -464,11 +264,14 @@ int main(int argv, char** argc) try {
|
||||
if (editbookmarks) browser.on_actionEditBookmarks_triggered();
|
||||
return app.exec();
|
||||
} catch (std::exception& x) {
|
||||
std::cerr<<"**** Error: "<<x.what()<<std::endl;
|
||||
TRC_FN; LOG<<"Terminated with Exception"<<x.what();
|
||||
std::cerr<<"**** Terminated with Error:"
|
||||
<<std::endl<<x.what()<<std::endl;
|
||||
return 1;
|
||||
} catch (...) {
|
||||
// unexpected exception - just terminate
|
||||
std::cerr<<"**** Error"<<std::endl;
|
||||
TRC_FN; LOG<<"Terminated with unknown Exception";
|
||||
std::cerr<<"**** Terminated with unknown Error"<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+5
-8
@@ -8,16 +8,13 @@
|
||||
#ifndef __PINDIALOG_HXX__
|
||||
#define __PINDIALOG_HXX__
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <ui_pinentry.h>
|
||||
#include <QtGui/QDialog>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtNetwork/QSslCertificate>
|
||||
|
||||
#include <cassert>
|
||||
#include <QtCore/QDebug>
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
class PinEntry: public QDialog, public Ui::PinEntry {
|
||||
Q_OBJECT;
|
||||
@@ -49,7 +46,7 @@ class PinEntry: public QDialog, public Ui::PinEntry {
|
||||
return _pin->text();
|
||||
}
|
||||
int myexec() {
|
||||
LOG;
|
||||
TRC;
|
||||
_pin->clear();
|
||||
show();
|
||||
LOG<<"SSSSSSSSSTTTTTTTAAAAAAAAAAAAARRRRRRRRRRTTTTTTTTTT";
|
||||
@@ -60,18 +57,18 @@ class PinEntry: public QDialog, public Ui::PinEntry {
|
||||
}
|
||||
public Q_SLOTS:
|
||||
virtual void accept() {
|
||||
LOG;
|
||||
TRC;
|
||||
QDialog::accept();
|
||||
}
|
||||
virtual void done(int r) {
|
||||
LOG<<r;
|
||||
TRC; LOG<<r;
|
||||
_run.exit(r);
|
||||
assert(!_run.isRunning());
|
||||
LOG<<"DDDDDDDDOOOOOOOOOOOONNNNNNNNNNNEEEEEEE";
|
||||
QDialog::done(r);
|
||||
}
|
||||
virtual void reject() {
|
||||
LOG;
|
||||
TRC;
|
||||
QDialog::reject();
|
||||
}
|
||||
protected Q_SLOTS:
|
||||
|
||||
@@ -8,16 +8,13 @@
|
||||
#ifndef __BUTTONLINEEDIT_HXX__
|
||||
#define __BUTTONLINEEDIT_HXX__
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QStyle>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
//! @addtogroup qbrowserlib
|
||||
//! @{
|
||||
|
||||
@@ -26,17 +23,17 @@ class ButtonLineEdit: public QLineEdit {
|
||||
Q_OBJECT;
|
||||
public:
|
||||
ButtonLineEdit(QWidget* p=0): QLineEdit(p) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
QToolButton* add(QAction* a) {
|
||||
LOG;
|
||||
TRC;
|
||||
QToolButton* b(new QToolButton(this));
|
||||
b->setDefaultAction(a);
|
||||
add(b);
|
||||
return b;
|
||||
}
|
||||
ButtonLineEdit& add(QToolButton* b) {
|
||||
LOG;
|
||||
TRC;
|
||||
b->setParent(this);
|
||||
b->setStyleSheet("QToolButton { border: none; padding: 0; }");
|
||||
b->setCursor(Qt::ArrowCursor);
|
||||
@@ -45,7 +42,7 @@ class ButtonLineEdit: public QLineEdit {
|
||||
return *this;
|
||||
}
|
||||
ButtonLineEdit& changeStyleSheet(QString s) {
|
||||
LOG;
|
||||
TRC;
|
||||
_style = s;
|
||||
resizeEvent(0);
|
||||
return *this;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#ifndef QBROWSERLIB_EXECUTOR_HXX
|
||||
#define QBROWSERLIB_EXECUTOR_HXX
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <qbrowserlib/settings.hxx>
|
||||
#include <qbrowserlib/temporaryfile.hxx>
|
||||
|
||||
@@ -31,6 +32,7 @@ namespace qbrowserlib {
|
||||
Executor(Settings* settings=0): _settings(settings) {}
|
||||
|
||||
~Executor() {
|
||||
TRC;
|
||||
for (DownloadProcesses::iterator it(_downloadProcesses.begin());
|
||||
it!=_downloadProcesses.end(); ++it) {
|
||||
LOG<<"cleanup:"<<it->second->fileName();
|
||||
@@ -52,7 +54,7 @@ namespace qbrowserlib {
|
||||
public Q_SLOTS:
|
||||
|
||||
void run(QNetworkReply* reply, QString filename, QString command) {
|
||||
LOG<<filename<<command;
|
||||
TRC; LOG<<filename<<command;
|
||||
_reply = reply;
|
||||
_filename = filename;
|
||||
_command = command;
|
||||
@@ -68,6 +70,7 @@ namespace qbrowserlib {
|
||||
private Q_SLOTS:
|
||||
|
||||
void downloadFinished() {
|
||||
TRC;
|
||||
TemporaryFile *file(new TemporaryFile
|
||||
(QDir::tempPath()+QDir::separator()
|
||||
+QFileInfo(_filename).fileName()));
|
||||
@@ -89,7 +92,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
void processFinished() {
|
||||
LOG;
|
||||
TRC;
|
||||
if (_downloadProcesses.find(qobject_cast<QProcess*>(sender()))
|
||||
== _downloadProcesses.end()) return;
|
||||
if (_downloadProcesses[qobject_cast<QProcess*>(sender())])
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/*! @file
|
||||
|
||||
@id $Id$
|
||||
*/
|
||||
// 1 2 3 4 5 6 7 8
|
||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
|
||||
namespace qbrowserlib {
|
||||
|
||||
bool Log::DEBUG(false);
|
||||
LogDialog* Log::_dialog(0);
|
||||
unsigned int Log::_level(0);
|
||||
|
||||
Log::Log(const void* addr, const std::string& name,
|
||||
const std::string& file, unsigned long line):
|
||||
_debug(DEBUG), _addr(addr), _name(name), _file(file), _line(line) {
|
||||
if (!_debug) return;
|
||||
++_level;
|
||||
std::stringstream ss;
|
||||
init(ss);
|
||||
indent(ss)<<"\\ "<<_name;
|
||||
std::clog<<close(ss).str()<<std::endl;
|
||||
}
|
||||
|
||||
Log::~Log() throw() {
|
||||
if (!_debug) return;
|
||||
std::stringstream ss;
|
||||
init(ss);
|
||||
indent(ss)<<"/ "<<_name;
|
||||
std::clog<<close(ss).str()<<std::endl;
|
||||
--_level;
|
||||
}
|
||||
|
||||
void Log::show(QWidget* p) {
|
||||
if (!_dialog)
|
||||
_dialog = new LogDialog(p);
|
||||
_dialog->_logs->resizeColumnsToContents();
|
||||
_dialog->_logs->resizeRowsToContents();
|
||||
_dialog->show();
|
||||
}
|
||||
|
||||
std::stringstream& Log::init(std::stringstream& ss) {
|
||||
if (_addr)
|
||||
ss<<std::hex<<std::setw(15)<<_addr<<": "<<std::dec;
|
||||
else
|
||||
ss<<std::setw(17)<<' ';
|
||||
return ss;
|
||||
}
|
||||
|
||||
std::stringstream& Log::indent(std::stringstream& ss) {
|
||||
ss<<std::setw(2+_level)<<std::setfill(' ');
|
||||
return ss;
|
||||
}
|
||||
|
||||
std::stringstream& Log::close(std::stringstream& ss) {
|
||||
ss<<" ("<<_file<<':'<<_line<<')';
|
||||
return ss;
|
||||
}
|
||||
|
||||
template<> LogDialog& LogDialog::append
|
||||
(const Log& log, std::string arg) {
|
||||
return append(log, QString::fromStdString(arg));
|
||||
}
|
||||
template<> LogDialog& LogDialog::append
|
||||
(const Log& log, const char* arg) {
|
||||
return append(log, QString(arg));
|
||||
}
|
||||
template<> LogDialog& LogDialog::append
|
||||
(const Log& log, unsigned long arg) {
|
||||
return append(log, (qulonglong)arg);
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& ss, QString arg) {
|
||||
ss<<'"'<<arg.toStdString()<<'"';
|
||||
return ss;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& ss, QStringList arg) {
|
||||
ss<<"{ ";
|
||||
for (QStringList::iterator item(arg.begin()); item!=arg.end();) {
|
||||
ss<<*item;
|
||||
if (++item!=arg.end()) ss<<", ";
|
||||
}
|
||||
ss<<" }";
|
||||
return ss;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& ss, QUrl arg) {
|
||||
ss<<arg.toString();
|
||||
return ss;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& ss, QByteArray arg) {
|
||||
ss<<QString::fromUtf8(arg);
|
||||
return ss;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
/*! @file
|
||||
|
||||
@id $Id$
|
||||
*/
|
||||
// 1 2 3 4 5 6 7 8
|
||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
#ifndef QBROWSERLIB_LOG
|
||||
#define QBROWSERLIB_LOG
|
||||
|
||||
#include <qbrowserlib/ui_log.h>
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <typeinfo>
|
||||
|
||||
// supported Qt logging types
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QByteArray>
|
||||
|
||||
namespace qbrowserlib {
|
||||
|
||||
#ifndef LOG
|
||||
#define LOG \
|
||||
QBROWSERLIB_LOCAL_TRACER
|
||||
#endif
|
||||
|
||||
#ifndef TRC
|
||||
#define TRC \
|
||||
qbrowserlib::Log QBROWSERLIB_LOCAL_TRACER \
|
||||
(this, __PRETTY_FUNCTION__, __FILE__, __LINE__)
|
||||
#endif
|
||||
|
||||
#ifndef TRC_FN
|
||||
#define TRC_FN \
|
||||
qbrowserlib::Log QBROWSERLIB_LOCAL_TRACER \
|
||||
(0, __PRETTY_FUNCTION__, __FILE__, __LINE__)
|
||||
#endif
|
||||
|
||||
class LogDialog;
|
||||
|
||||
class Log {
|
||||
|
||||
public:
|
||||
|
||||
static bool DEBUG;
|
||||
|
||||
public:
|
||||
|
||||
Log(const void* addr, const std::string& name,
|
||||
const std::string& file, unsigned long line);
|
||||
|
||||
template<typename TYPE> Log& operator<<(TYPE arg);
|
||||
|
||||
~Log() throw();
|
||||
|
||||
static void show(QWidget* p);
|
||||
|
||||
private:
|
||||
|
||||
std::stringstream& init(std::stringstream& ss);
|
||||
|
||||
std::stringstream& indent(std::stringstream& ss);
|
||||
|
||||
std::stringstream& close(std::stringstream& ss);
|
||||
|
||||
private:
|
||||
|
||||
friend class LogDialog;
|
||||
|
||||
static LogDialog* _dialog;
|
||||
static unsigned int _level;
|
||||
bool _debug;
|
||||
const void* _addr;
|
||||
const std::string _name;
|
||||
const std::string _file;
|
||||
unsigned long _line;
|
||||
};
|
||||
|
||||
class LogDialog: public QDialog, public Ui::LogDialog {
|
||||
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
|
||||
LogDialog(QWidget* p): QDialog(p) {
|
||||
setupUi(this);
|
||||
}
|
||||
|
||||
template<typename TYPE> LogDialog& append(const Log& log, TYPE* arg) {
|
||||
std::ostringstream ss;
|
||||
ss<<"("<<typeid(TYPE*).name()<<")"<<arg;
|
||||
return append(log, ss.str());
|
||||
}
|
||||
|
||||
template<typename TYPE> LogDialog& append(const Log& log, TYPE arg) {
|
||||
int pos(_logs->rowCount());
|
||||
_logs->insertRow(pos);
|
||||
_logs->setItem
|
||||
(pos, FILE,
|
||||
new QTableWidgetItem(QString::fromStdString(log._file)));
|
||||
_logs->setItem
|
||||
(pos, LINE, new QTableWidgetItem(QString::number(log._line)));
|
||||
if (log._addr) _logs->setItem
|
||||
(pos, INSTANCE,
|
||||
new QTableWidgetItem
|
||||
(QString::number((qulonglong)log._addr)));
|
||||
_logs->setItem
|
||||
(pos, FUNCTION,
|
||||
new QTableWidgetItem(QString::fromStdString(log._name)));
|
||||
_logs->setItem
|
||||
(pos, MESSAGE,
|
||||
new QTableWidgetItem(QVariant(arg).toString()));
|
||||
return *this;
|
||||
}
|
||||
|
||||
protected Q_SLOTS:
|
||||
|
||||
void on__fileLine_toggled(bool checked) {
|
||||
if (checked) {
|
||||
_logs->showColumn(FILE);
|
||||
_logs->showColumn(LINE);
|
||||
} else {
|
||||
_logs->hideColumn(FILE);
|
||||
_logs->hideColumn(LINE);
|
||||
}
|
||||
}
|
||||
|
||||
void on__instance_toggled(bool checked) {
|
||||
if (checked) {
|
||||
_logs->showColumn(INSTANCE);
|
||||
} else {
|
||||
_logs->hideColumn(INSTANCE);
|
||||
}
|
||||
}
|
||||
|
||||
void on__function_toggled(bool checked) {
|
||||
if (checked) {
|
||||
_logs->showColumn(FUNCTION);
|
||||
} else {
|
||||
_logs->hideColumn(FUNCTION);
|
||||
}
|
||||
}
|
||||
|
||||
void on__buttons_clicked(QAbstractButton* button) {
|
||||
if (_buttons->buttonRole(button)==QDialogButtonBox::ResetRole)
|
||||
for (int i(_logs->rowCount()); i>1; --i)
|
||||
_logs->removeRow(i-1);
|
||||
}
|
||||
|
||||
void on__find_clicked(bool) {
|
||||
setCursor(QCursor(Qt::BusyCursor));
|
||||
QList<QTableWidgetItem*> items
|
||||
(_logs->findItems(_search->text(),
|
||||
Qt::MatchWrap|Qt::MatchContains
|
||||
|Qt::MatchFixedString));
|
||||
_logs->clearSelection();
|
||||
foreach (QTableWidgetItem* item, items) {
|
||||
item->setSelected(true);
|
||||
}
|
||||
if (!items.isEmpty()) _logs->scrollToItem(items[0]);
|
||||
unsetCursor();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
friend class Log;
|
||||
enum {FILE, LINE, INSTANCE, FUNCTION, MESSAGE} Columns;
|
||||
|
||||
};
|
||||
|
||||
// note: template class method must be defined in the header
|
||||
template<typename TYPE> Log& Log::operator<<(TYPE arg) {
|
||||
if (!_debug) return *this;
|
||||
std::stringstream ss;
|
||||
init(ss);
|
||||
indent(ss)<<" → "<<arg;
|
||||
std::clog<<close(ss).str()<<std::endl;
|
||||
if (!_dialog) _dialog = new LogDialog(0);
|
||||
_dialog->append(*this, arg);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<> LogDialog& LogDialog::append
|
||||
(const Log& log, const char* arg);
|
||||
template<> LogDialog& LogDialog::append
|
||||
(const Log& log, std::string arg);
|
||||
template<> LogDialog& LogDialog::append
|
||||
(const Log& log, unsigned long arg);
|
||||
|
||||
std::ostream& operator<<(std::ostream& ss, QString arg);
|
||||
std::ostream& operator<<(std::ostream& ss, QStringList arg);
|
||||
std::ostream& operator<<(std::ostream& ss, QUrl arg);
|
||||
std::ostream& operator<<(std::ostream& ss, QByteArray arg);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,203 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>LogDialog</class>
|
||||
<widget class="QDialog" name="LogDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>957</width>
|
||||
<height>736</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Debug Log</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Show Columns</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_fileLine">
|
||||
<property name="text">
|
||||
<string>File/Line</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_instance">
|
||||
<property name="text">
|
||||
<string>Instance</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="_function">
|
||||
<property name="text">
|
||||
<string>Function</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Find Text</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="_search"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="_find">
|
||||
<property name="text">
|
||||
<string>Find</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableWidget" name="_logs">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="showDropIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropOverwriteMode">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderCascadingSectionResizes">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderCascadingSectionResizes">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>File</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignLeft|AlignTop</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Line</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignLeft|AlignTop</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Instance</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignLeft|AlignTop</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Function</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignLeft|AlignTop</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Message</string>
|
||||
</property>
|
||||
<property name="textAlignment">
|
||||
<set>AlignJustify|AlignTop</set>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="_buttons">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close|QDialogButtonBox::Reset</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>_buttons</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>LogDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>227</x>
|
||||
<y>640</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>_buttons</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>LogDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>295</x>
|
||||
<y>646</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -8,14 +8,10 @@
|
||||
#ifndef __PLUGINFACTORY_HXX__
|
||||
#define __PLUGINFACTORY_HXX__
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <QtWebKit/QWebPluginFactory>
|
||||
#include <qbrowserlib/saveorrun.hxx>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
//! @addtogroup qbrowserlib
|
||||
//! @{
|
||||
|
||||
@@ -31,7 +27,7 @@ namespace qbrowserlib {
|
||||
PluginFactory(QNetworkAccessManager* net, Executor* executor,
|
||||
QObject* p=0): QWebPluginFactory(p),
|
||||
_net(net), _executor(executor) {
|
||||
LOG;
|
||||
TRC;
|
||||
// Plugin plugin;
|
||||
// plugin.name = "Show PDF-Document";
|
||||
// plugin.description = "Plugin for PDF documents";
|
||||
@@ -45,7 +41,7 @@ namespace qbrowserlib {
|
||||
virtual QObject* create(const QString& mimeType, const QUrl& url,
|
||||
const QStringList& argumentNames,
|
||||
const QStringList& argumentValues ) const {
|
||||
LOG<<"mimeType:"<<mimeType
|
||||
TRC; LOG<<"mimeType:"<<mimeType
|
||||
<<"url:"<<url
|
||||
<<"argumentNames:"<<argumentNames.join(", ")
|
||||
<<"argumentValues:"<<argumentValues.join(", ");
|
||||
@@ -64,11 +60,11 @@ namespace qbrowserlib {
|
||||
return 0;
|
||||
}
|
||||
virtual QList<Plugin> plugins() const {
|
||||
LOG;
|
||||
TRC;
|
||||
return _plugins;
|
||||
}
|
||||
virtual void refreshPlugins() {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
private:
|
||||
QList<Plugin> _plugins;
|
||||
|
||||
@@ -2,6 +2,61 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.0" language="de_DE">
|
||||
<defaultcodec>UTF-8</defaultcodec>
|
||||
<context>
|
||||
<name>LogDialog</name>
|
||||
<message>
|
||||
<location filename="log.ui" line="14"/>
|
||||
<source>Debug Log</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="22"/>
|
||||
<source>Show Columns</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="28"/>
|
||||
<source>File/Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="38"/>
|
||||
<location filename="log.ui" line="129"/>
|
||||
<source>Instance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="48"/>
|
||||
<location filename="log.ui" line="137"/>
|
||||
<source>Function</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="61"/>
|
||||
<source>Find Text</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="70"/>
|
||||
<source>Find</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="113"/>
|
||||
<source>File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="121"/>
|
||||
<source>Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="145"/>
|
||||
<source>Message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SaveOrRun</name>
|
||||
<message>
|
||||
@@ -523,12 +578,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRun</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<location filename="saveorrun.hxx" line="131"/>
|
||||
<source>File Exists</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="133"/>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<source>File already exists:
|
||||
|
||||
%1
|
||||
@@ -537,12 +592,12 @@ Overwrite?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<location filename="saveorrun.hxx" line="144"/>
|
||||
<source>No Program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="146"/>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<source>Not an executable Program:
|
||||
|
||||
%1
|
||||
@@ -551,23 +606,23 @@ Specify full path to executable program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="158"/>
|
||||
<location filename="saveorrun.hxx" line="157"/>
|
||||
<source>Save File As ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="171"/>
|
||||
<location filename="saveorrun.hxx" line="170"/>
|
||||
<source>Open File With ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<location filename="saveorrun.hxx" line="182"/>
|
||||
<source>Dokumente</source>
|
||||
<comment>Documents folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="185"/>
|
||||
<location filename="saveorrun.hxx" line="184"/>
|
||||
<source>Arbeitsfläche</source>
|
||||
<comment>Desktop folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -576,7 +631,7 @@ Specify full path to executable program</source>
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRunDialog</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="237"/>
|
||||
<location filename="saveorrun.hxx" line="236"/>
|
||||
<source>Unknown File Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
||||
@@ -2,6 +2,61 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.0" language="en_US">
|
||||
<defaultcodec>UTF-8</defaultcodec>
|
||||
<context>
|
||||
<name>LogDialog</name>
|
||||
<message>
|
||||
<location filename="log.ui" line="14"/>
|
||||
<source>Debug Log</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="22"/>
|
||||
<source>Show Columns</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="28"/>
|
||||
<source>File/Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="38"/>
|
||||
<location filename="log.ui" line="129"/>
|
||||
<source>Instance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="48"/>
|
||||
<location filename="log.ui" line="137"/>
|
||||
<source>Function</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="61"/>
|
||||
<source>Find Text</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="70"/>
|
||||
<source>Find</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="113"/>
|
||||
<source>File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="121"/>
|
||||
<source>Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="145"/>
|
||||
<source>Message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SaveOrRun</name>
|
||||
<message>
|
||||
@@ -523,12 +578,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRun</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<location filename="saveorrun.hxx" line="131"/>
|
||||
<source>File Exists</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="133"/>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<source>File already exists:
|
||||
|
||||
%1
|
||||
@@ -537,12 +592,12 @@ Overwrite?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<location filename="saveorrun.hxx" line="144"/>
|
||||
<source>No Program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="146"/>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<source>Not an executable Program:
|
||||
|
||||
%1
|
||||
@@ -551,23 +606,23 @@ Specify full path to executable program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="158"/>
|
||||
<location filename="saveorrun.hxx" line="157"/>
|
||||
<source>Save File As ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="171"/>
|
||||
<location filename="saveorrun.hxx" line="170"/>
|
||||
<source>Open File With ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<location filename="saveorrun.hxx" line="182"/>
|
||||
<source>Dokumente</source>
|
||||
<comment>Documents folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="185"/>
|
||||
<location filename="saveorrun.hxx" line="184"/>
|
||||
<source>Arbeitsfläche</source>
|
||||
<comment>Desktop folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -576,7 +631,7 @@ Specify full path to executable program</source>
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRunDialog</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="237"/>
|
||||
<location filename="saveorrun.hxx" line="236"/>
|
||||
<source>Unknown File Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
||||
@@ -2,6 +2,61 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.0" language="fr_FR">
|
||||
<defaultcodec>UTF-8</defaultcodec>
|
||||
<context>
|
||||
<name>LogDialog</name>
|
||||
<message>
|
||||
<location filename="log.ui" line="14"/>
|
||||
<source>Debug Log</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="22"/>
|
||||
<source>Show Columns</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="28"/>
|
||||
<source>File/Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="38"/>
|
||||
<location filename="log.ui" line="129"/>
|
||||
<source>Instance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="48"/>
|
||||
<location filename="log.ui" line="137"/>
|
||||
<source>Function</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="61"/>
|
||||
<source>Find Text</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="70"/>
|
||||
<source>Find</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="113"/>
|
||||
<source>File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="121"/>
|
||||
<source>Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="145"/>
|
||||
<source>Message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SaveOrRun</name>
|
||||
<message>
|
||||
@@ -523,12 +578,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRun</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<location filename="saveorrun.hxx" line="131"/>
|
||||
<source>File Exists</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="133"/>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<source>File already exists:
|
||||
|
||||
%1
|
||||
@@ -537,12 +592,12 @@ Overwrite?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<location filename="saveorrun.hxx" line="144"/>
|
||||
<source>No Program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="146"/>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<source>Not an executable Program:
|
||||
|
||||
%1
|
||||
@@ -551,23 +606,23 @@ Specify full path to executable program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="158"/>
|
||||
<location filename="saveorrun.hxx" line="157"/>
|
||||
<source>Save File As ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="171"/>
|
||||
<location filename="saveorrun.hxx" line="170"/>
|
||||
<source>Open File With ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<location filename="saveorrun.hxx" line="182"/>
|
||||
<source>Dokumente</source>
|
||||
<comment>Documents folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="185"/>
|
||||
<location filename="saveorrun.hxx" line="184"/>
|
||||
<source>Arbeitsfläche</source>
|
||||
<comment>Desktop folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -576,7 +631,7 @@ Specify full path to executable program</source>
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRunDialog</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="237"/>
|
||||
<location filename="saveorrun.hxx" line="236"/>
|
||||
<source>Unknown File Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
||||
@@ -2,6 +2,61 @@
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.0" language="it_IT">
|
||||
<defaultcodec>UTF-8</defaultcodec>
|
||||
<context>
|
||||
<name>LogDialog</name>
|
||||
<message>
|
||||
<location filename="log.ui" line="14"/>
|
||||
<source>Debug Log</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="22"/>
|
||||
<source>Show Columns</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="28"/>
|
||||
<source>File/Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="38"/>
|
||||
<location filename="log.ui" line="129"/>
|
||||
<source>Instance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="48"/>
|
||||
<location filename="log.ui" line="137"/>
|
||||
<source>Function</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="61"/>
|
||||
<source>Find Text</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="70"/>
|
||||
<source>Find</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="113"/>
|
||||
<source>File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="121"/>
|
||||
<source>Line</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="log.ui" line="145"/>
|
||||
<source>Message</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SaveOrRun</name>
|
||||
<message>
|
||||
@@ -523,12 +578,12 @@ p, li { white-space: pre-wrap; }
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRun</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<location filename="saveorrun.hxx" line="131"/>
|
||||
<source>File Exists</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="133"/>
|
||||
<location filename="saveorrun.hxx" line="132"/>
|
||||
<source>File already exists:
|
||||
|
||||
%1
|
||||
@@ -537,12 +592,12 @@ Overwrite?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<location filename="saveorrun.hxx" line="144"/>
|
||||
<source>No Program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="146"/>
|
||||
<location filename="saveorrun.hxx" line="145"/>
|
||||
<source>Not an executable Program:
|
||||
|
||||
%1
|
||||
@@ -551,23 +606,23 @@ Specify full path to executable program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="158"/>
|
||||
<location filename="saveorrun.hxx" line="157"/>
|
||||
<source>Save File As ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="171"/>
|
||||
<location filename="saveorrun.hxx" line="170"/>
|
||||
<source>Open File With ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="183"/>
|
||||
<location filename="saveorrun.hxx" line="182"/>
|
||||
<source>Dokumente</source>
|
||||
<comment>Documents folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="185"/>
|
||||
<location filename="saveorrun.hxx" line="184"/>
|
||||
<source>Arbeitsfläche</source>
|
||||
<comment>Desktop folder in local language</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -576,7 +631,7 @@ Specify full path to executable program</source>
|
||||
<context>
|
||||
<name>qbrowserlib::SaveOrRunDialog</name>
|
||||
<message>
|
||||
<location filename="saveorrun.hxx" line="237"/>
|
||||
<location filename="saveorrun.hxx" line="236"/>
|
||||
<source>Unknown File Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
||||
@@ -32,9 +32,10 @@ TRANSLATIONS = @srcdir@/qbrowserlib_en.ts \
|
||||
@srcdir@/qbrowserlib_fr.ts \
|
||||
@srcdir@/qbrowserlib_it.ts
|
||||
|
||||
SOURCES = @srcdir@/certs.cxx
|
||||
SOURCES = @srcdir@/log.cxx @srcdir@/certs.cxx
|
||||
|
||||
HEADERS = @srcdir@/swisswebview.hxx @srcdir@/swisswebpage.hxx \
|
||||
HEADERS = @srcdir@/log.hxx \
|
||||
@srcdir@/swisswebview.hxx @srcdir@/swisswebpage.hxx \
|
||||
@srcdir@/pluginfactory.hxx @srcdir@/saveorrun.hxx \
|
||||
@srcdir@/settings.hxx \
|
||||
@srcdir@/buttonlineedit.hxx \
|
||||
@@ -42,7 +43,7 @@ HEADERS = @srcdir@/swisswebview.hxx @srcdir@/swisswebpage.hxx \
|
||||
@srcdir@/executor.hxx \
|
||||
@srcdir@/temporaryfile.hxx
|
||||
|
||||
FORMS = @srcdir@/saveorrun.ui @srcdir@/settings.ui
|
||||
FORMS = @srcdir@/saveorrun.ui @srcdir@/settings.ui @srcdir@/log.ui
|
||||
|
||||
RESOURCES = languages.qrc
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#ifndef __SAVEORRUN_HXX__
|
||||
#define __SAVEORRUN_HXX__
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <qbrowserlib/ui_saveorrun.h>
|
||||
#include <qbrowserlib/executor.hxx>
|
||||
|
||||
@@ -21,10 +22,6 @@
|
||||
#include <memory>
|
||||
|
||||
#include <cassert>
|
||||
#include <QtCore/QDebug>
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
//! @addtogroup qbrowserlib
|
||||
//! @{
|
||||
@@ -44,7 +41,7 @@ namespace qbrowserlib {
|
||||
SaveOrRun(QNetworkReply* reply, Executor* executor,
|
||||
QString type, QString src,
|
||||
QWidget* p=0): QWidget(p), _reply(reply), _executor(executor) {
|
||||
LOG;
|
||||
TRC;
|
||||
setupUi(this);
|
||||
QString obj(remoteFilename());
|
||||
_rememberPath->setVisible(false);
|
||||
@@ -59,6 +56,7 @@ namespace qbrowserlib {
|
||||
|
||||
//! Run configured application if mime type is preconfigured.
|
||||
bool handlePreconfigured() {
|
||||
TRC;
|
||||
QString filename(remoteFilename());
|
||||
QStringList type
|
||||
(_executor->settings()->mimetype
|
||||
@@ -78,6 +76,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
QString remoteFilename() {
|
||||
TRC;
|
||||
QString filename
|
||||
(QString::fromUtf8(_reply->rawHeader("Content-Disposition")));
|
||||
if (filename.contains
|
||||
@@ -98,19 +97,19 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
QString filename() {
|
||||
LOG;
|
||||
TRC;
|
||||
return _filename->text();
|
||||
}
|
||||
|
||||
QString program() {
|
||||
LOG;
|
||||
TRC;
|
||||
return _program->text();
|
||||
}
|
||||
|
||||
public Q_SLOTS:
|
||||
|
||||
void save() {
|
||||
LOG;
|
||||
TRC;
|
||||
QFile file(filename());
|
||||
file.open(QIODevice::WriteOnly);
|
||||
file.write(_reply->readAll());
|
||||
@@ -119,7 +118,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
void run() {
|
||||
LOG<<program()<<filename();
|
||||
TRC; LOG<<program()<<filename();
|
||||
_executor->run(_reply, filename(), program()+" %1");
|
||||
accept();
|
||||
}
|
||||
@@ -127,7 +126,7 @@ namespace qbrowserlib {
|
||||
protected Q_SLOTS:
|
||||
|
||||
void on__saveFileAs_clicked(bool=true) {
|
||||
LOG;
|
||||
TRC;
|
||||
if (QFileInfo(filename()).exists()
|
||||
&& QMessageBox::question(this, tr("File Exists"),
|
||||
tr("File already exists:\n\n"
|
||||
@@ -139,7 +138,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
void on__openFileIn_clicked(bool=true) {
|
||||
LOG;
|
||||
TRC;
|
||||
if (!QFile::exists(program())
|
||||
|| !QFileInfo(program()).isExecutable()) {
|
||||
QMessageBox::warning(this, tr("No Program"),
|
||||
@@ -153,7 +152,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
void on__browseSaveAs_clicked(bool) {
|
||||
LOG;
|
||||
TRC;
|
||||
QString saveFile
|
||||
(QFileDialog::getSaveFileName(this, tr("Save File As ..."),
|
||||
_filename->text(), QString(), 0,
|
||||
@@ -166,7 +165,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
void on__browseOpenWith_clicked(bool) {
|
||||
LOG;
|
||||
TRC;
|
||||
QString openFile
|
||||
(QFileDialog::getOpenFileName(this, tr("Open File With ..."),
|
||||
_program->text()));
|
||||
@@ -176,7 +175,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
QString savePath() {
|
||||
LOG;
|
||||
TRC;
|
||||
QString path(QDir::homePath());
|
||||
QStringList defpaths;
|
||||
defpaths<<"downloads"<<"Downloads"<<"Documents"
|
||||
@@ -209,7 +208,7 @@ namespace qbrowserlib {
|
||||
bool kiosk=false, QWidget* p=0):
|
||||
SaveOrRun(reply, executor,
|
||||
mime, url.toString(), p) {
|
||||
LOG;
|
||||
TRC;
|
||||
setAutoFillBackground(true);
|
||||
_type->setText(mime);
|
||||
_source->setText(url.host());
|
||||
@@ -233,7 +232,7 @@ namespace qbrowserlib {
|
||||
QString type, QString src,
|
||||
bool kiosk=false, QWidget* p=0):
|
||||
QDialog(p), _sor(new SaveOrRun(reply, executor, type, src)) {
|
||||
LOG;
|
||||
TRC;
|
||||
setWindowTitle(tr("Unknown File Type"));
|
||||
QVBoxLayout* l(new QVBoxLayout(this));
|
||||
l->addWidget(_sor);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#ifndef QBROWSERLIB_SETTINGS_HXX
|
||||
#define QBROWSERLIB_SETTINGS_HXX
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <qbrowserlib/ui_settings.h>
|
||||
|
||||
#include <QtWebKit/QWebSettings>
|
||||
@@ -17,10 +18,6 @@
|
||||
#include <QtGui/QLineEdit>
|
||||
|
||||
#include <cassert>
|
||||
#include <QtCore/QDebug>
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
namespace qbrowserlib {
|
||||
|
||||
@@ -117,7 +114,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
void setAttribute(QWebSettings::WebAttribute attr, bool state) {
|
||||
//LOG;
|
||||
//TRC;
|
||||
QWebSettings::globalSettings()->setAttribute(attr, state);
|
||||
_attributes[attr]->setChecked(state);
|
||||
}
|
||||
@@ -147,7 +144,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
QString& replaceSearchEngine(QString& url) {
|
||||
LOG;
|
||||
TRC;
|
||||
int len(url.indexOf(QRegExp("[ :]")));
|
||||
if (len<=0) return url;
|
||||
QString scheme(url.left(len));
|
||||
@@ -165,7 +162,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
bool save() {
|
||||
LOG;
|
||||
TRC;
|
||||
if (!_settings || !_settings->isWritable()) return false;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
@@ -191,7 +188,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
bool load(bool overwriteMimeTypes=true) {
|
||||
LOG;
|
||||
TRC;
|
||||
if (!_settings) return false;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
@@ -242,7 +239,7 @@ namespace qbrowserlib {
|
||||
private Q_SLOTS:
|
||||
|
||||
void on__buttons_accepted() {
|
||||
LOG;
|
||||
TRC;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
it!=_attributes.end(); ++it)
|
||||
@@ -274,7 +271,7 @@ namespace qbrowserlib {
|
||||
}
|
||||
|
||||
void on__buttons_rejected() {
|
||||
LOG;
|
||||
TRC;
|
||||
// Attributes
|
||||
for (Attributes::iterator it(_attributes.begin());
|
||||
it!=_attributes.end(); ++it)
|
||||
|
||||
@@ -8,17 +8,13 @@
|
||||
#ifndef __SWISSWEBPAGE_HXX__
|
||||
#define __SWISSWEBPAGE_HXX__
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <qbrowserlib/pluginfactory.hxx>
|
||||
|
||||
#include <QtWebKit/QWebPage>
|
||||
#include <QtWebKit/QWebHistory>
|
||||
#include <QtCore/QProcessEnvironment>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
//! @addtogroup qbrowserlib
|
||||
//! @{
|
||||
|
||||
@@ -72,7 +68,7 @@ namespace qbrowserlib {
|
||||
QObject* createPlugin(const QString& classid, const QUrl& url,
|
||||
const QStringList& paramNames,
|
||||
const QStringList& paramValues) {
|
||||
LOG<<"classid:"<<classid
|
||||
TRC; LOG<<"classid:"<<classid
|
||||
<<"url:"<<url
|
||||
<<"paramNames:"<<paramNames.join(", ")
|
||||
<<"paramValues:"<<paramValues.join(", ");
|
||||
|
||||
+45
-45
@@ -1,6 +1,7 @@
|
||||
#ifndef SMARTCARDAUTH_H
|
||||
#define SMARTCARDAUTH_H
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtCore/QWaitCondition>
|
||||
#include <QtNetwork/QSslSocket>
|
||||
@@ -18,10 +19,6 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
class CryptokiEngine: public QObject, public openssl::Engine {
|
||||
|
||||
Q_OBJECT;
|
||||
@@ -34,11 +31,11 @@ class CryptokiEngine: public QObject, public openssl::Engine {
|
||||
|
||||
CryptokiEngine(std::string lib):
|
||||
_cryptoki(lib) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
operator bool() {
|
||||
LOG<<"Status of CryptokiEngine: "
|
||||
TRC; LOG<<"Status of CryptokiEngine: "
|
||||
<<(_privateKey.get()
|
||||
?"privateKey defined, ":"privateKey undefined");
|
||||
return _privateKey.get();
|
||||
@@ -49,7 +46,7 @@ class CryptokiEngine: public QObject, public openssl::Engine {
|
||||
}
|
||||
|
||||
void cert(cryptoki::Object& privateKey, const std::string& certVal) {
|
||||
LOG;
|
||||
TRC;
|
||||
_privateKey = std::auto_ptr<cryptoki::Object>
|
||||
(new cryptoki::Object(privateKey));
|
||||
try { // new
|
||||
@@ -101,6 +98,7 @@ class CryptokiEngine: public QObject, public openssl::Engine {
|
||||
protected:
|
||||
|
||||
void set(BIGNUM*& num, cryptoki::Object& key, int type, std::string name) {
|
||||
TRC;
|
||||
try {
|
||||
std::string value(key.attribute(type).value);
|
||||
num = BN_bin2bn((const unsigned char*)value.data(),
|
||||
@@ -111,17 +109,17 @@ class CryptokiEngine: public QObject, public openssl::Engine {
|
||||
}
|
||||
|
||||
virtual const char* id() {
|
||||
LOG;
|
||||
TRC;
|
||||
return "CryptokiEngine_ID";
|
||||
}
|
||||
|
||||
virtual const char* name() {
|
||||
LOG;
|
||||
TRC;
|
||||
return "CryptokiEngine_NAME";
|
||||
}
|
||||
|
||||
virtual std::string rsaSign(const std::string& in, unsigned int type) {
|
||||
LOG<<"log; type="<<type<<"; size="<<in.size();
|
||||
TRC; LOG<<"log; type="<<type<<"; size="<<in.size();
|
||||
LOG<<crypto::readable(in).c_str();
|
||||
if (type != NID_md5_sha1) throw std::runtime_error("wrong sign type");
|
||||
if (in.size() != 36) throw std::runtime_error("wrong msg size to sign");
|
||||
@@ -148,7 +146,7 @@ class SmartCardAuth: public QObject {
|
||||
|
||||
SmartCardAuth(const QString& lib, QWidget* p=0, bool loginAtStart=true):
|
||||
_parent(p), _e(new CryptokiEngine(lib.toStdString())), _reg(_e) {
|
||||
LOG;
|
||||
TRC;
|
||||
if (loginAtStart) login();
|
||||
assert(connect(_e, SIGNAL(certRequired()), SLOT(login())));
|
||||
}
|
||||
@@ -156,8 +154,8 @@ class SmartCardAuth: public QObject {
|
||||
public Q_SLOTS:
|
||||
|
||||
void login(bool force=true) {
|
||||
TRC;
|
||||
try {
|
||||
LOG;
|
||||
Lock lock;
|
||||
LOG<<"got lock";
|
||||
if (!_e || (!force && *_e)) return; // no smartcard or already logged in
|
||||
@@ -252,42 +250,44 @@ class SmartCardAuth: public QObject {
|
||||
|
||||
private:
|
||||
|
||||
int retries(const std::string& name) try {
|
||||
LOG<<name.c_str();
|
||||
pcsc::Connection pcsc;
|
||||
pcsc::Connection::Reader& reader(pcsc.reader(name));
|
||||
int retries(const std::string& name) {
|
||||
TRC; LOG<<name.c_str();
|
||||
try {
|
||||
pcsc::Connection pcsc;
|
||||
pcsc::Connection::Reader& reader(pcsc.reader(name));
|
||||
#ifndef Q_OS_MAC
|
||||
pcsc::Connection::Reader::Transaction lock(reader);
|
||||
pcsc::Connection::Reader::Transaction lock(reader);
|
||||
#endif
|
||||
// first try to read version info
|
||||
if (reader.transmit(0x00, 0xA4, 0x08, 0x0C, "\x3f\x00\x56\x49", 4)
|
||||
!= std::string("\x90\x00", 2) || !reader) {
|
||||
LOG<<"Select File failed";
|
||||
// first try to read version info
|
||||
if (reader.transmit(0x00, 0xA4, 0x08, 0x0C, "\x3f\x00\x56\x49", 4)
|
||||
!= std::string("\x90\x00", 2) || !reader) {
|
||||
LOG<<"Select File failed";
|
||||
return -2;
|
||||
}
|
||||
std::string res(reader.transmit(0x00, 0xB0, 0x00, 0x00));
|
||||
if (res.substr(res.size()-2)!=std::string("\x90\x00", 2)) {
|
||||
LOG<<"read error";
|
||||
return -2;
|
||||
}
|
||||
LOG<<"version text is: "<<res.substr(4, res[3]).c_str();
|
||||
// if (res.substr(4, res[3]) != "RAPost 2009" &&
|
||||
// res.substr(4, res[3]) != "RAPost 2010") {
|
||||
// LOG<<"unsupported card";
|
||||
// return -2;
|
||||
// }
|
||||
if (retCode(reader.transmit(0x00, 0xA4, 0x00, 0x0C)) == 0x9000) {
|
||||
int value(retCode(reader.transmit(0x00, 0x20, 0x00, 0x81)));
|
||||
if ((value&0x63C0)==0x63C0) return value&0x0F;
|
||||
} else {
|
||||
LOG<<"**** ERROR in select MF while reading pin status";
|
||||
}
|
||||
return -1; // locked
|
||||
} catch (const std::exception& x) {
|
||||
LOG<<"**** ERROR while reading pin status: "<<x.what();
|
||||
return -2;
|
||||
}
|
||||
std::string res(reader.transmit(0x00, 0xB0, 0x00, 0x00));
|
||||
if (res.substr(res.size()-2)!=std::string("\x90\x00", 2)) {
|
||||
LOG<<"read error";
|
||||
return -2;
|
||||
}
|
||||
LOG<<"version text is: "<<res.substr(4, res[3]).c_str();
|
||||
// if (res.substr(4, res[3]) != "RAPost 2009" &&
|
||||
// res.substr(4, res[3]) != "RAPost 2010") {
|
||||
// LOG<<"unsupported card";
|
||||
// return -2;
|
||||
// }
|
||||
if (retCode(reader.transmit(0x00, 0xA4, 0x00, 0x0C)) == 0x9000) {
|
||||
int value(retCode(reader.transmit(0x00, 0x20, 0x00, 0x81)));
|
||||
if ((value&0x63C0)==0x63C0) return value&0x0F;
|
||||
} else {
|
||||
LOG<<"**** ERROR in select MF while reading pin status";
|
||||
}
|
||||
return -1; // locked
|
||||
} catch (const std::exception& x) {
|
||||
LOG<<"**** ERROR while reading pin status: "<<x.what();
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
||||
int retCode(const std::string& res) {
|
||||
if (res.size()>=2)
|
||||
return ((((unsigned int)(unsigned char)res[res.size()-2])*256)
|
||||
@@ -311,12 +311,12 @@ class SmartCardAuth: public QObject {
|
||||
class Lock {
|
||||
public:
|
||||
Lock() {
|
||||
LOG<<loops().size();
|
||||
TRC; LOG<<loops().size();
|
||||
loops().append(new QEventLoop); // add to queue
|
||||
if (loops().size()>1) loops().back()->exec(); // wait
|
||||
}
|
||||
~Lock() {
|
||||
LOG<<loops().size();
|
||||
TRC; LOG<<loops().size();
|
||||
delete loops().front(); // mine is the first;
|
||||
loops().erase(loops().begin()); // mine is the first;
|
||||
if (loops().begin()!=loops().end())
|
||||
|
||||
@@ -7,15 +7,11 @@
|
||||
#ifndef SSLCLIENTNETWORKMANAGER_HXX
|
||||
#define SSLCLIENTNETWORKMANAGER_HXX
|
||||
|
||||
#include <qbrowserlib/log.hxx>
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
#include <QtNetwork/QNetworkAccessManager>
|
||||
#include <smartcardauth.hxx>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
//! @addtogroup pkcs11
|
||||
//! @{
|
||||
class SslClientAuthNetworkAccessManager: public QNetworkAccessManager {
|
||||
@@ -24,11 +20,11 @@ class SslClientAuthNetworkAccessManager: public QNetworkAccessManager {
|
||||
|
||||
SslClientAuthNetworkAccessManager(QObject* parent = 0):
|
||||
QNetworkAccessManager(parent) {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
virtual ~SslClientAuthNetworkAccessManager() {
|
||||
LOG;
|
||||
TRC;
|
||||
}
|
||||
|
||||
void scAuth(SmartCardAuth* auth) {
|
||||
@@ -44,7 +40,7 @@ class SslClientAuthNetworkAccessManager: public QNetworkAccessManager {
|
||||
virtual QNetworkReply* createRequest(Operation op,
|
||||
const QNetworkRequest& req,
|
||||
QIODevice* outgoingData = 0 ) {
|
||||
LOG<<req.url();
|
||||
TRC; LOG<<req.url();
|
||||
if (req.url().scheme()=="https") {
|
||||
LOG<<"Need to login";
|
||||
if (_scAuth.get()) _scAuth->login(false);
|
||||
|
||||
@@ -399,6 +399,10 @@ openssl-%7</source>
|
||||
<source>handling content ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Debug Log</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Certificate</name>
|
||||
@@ -743,8 +747,7 @@ Environment:
|
||||
PROXY_HOST proxy host name (actual: %4)
|
||||
SWISS_USERAGENT fake user agent (actual: %6)
|
||||
QT_PLUGIN_PATH path to plugins dir (actual: %7)
|
||||
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)
|
||||
</source>
|
||||
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
||||
@@ -399,6 +399,10 @@ openssl-%7</source>
|
||||
<source>handling content ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Debug Log</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Certificate</name>
|
||||
@@ -743,8 +747,7 @@ Environment:
|
||||
PROXY_HOST proxy host name (actual: %4)
|
||||
SWISS_USERAGENT fake user agent (actual: %6)
|
||||
QT_PLUGIN_PATH path to plugins dir (actual: %7)
|
||||
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)
|
||||
</source>
|
||||
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
||||
@@ -399,6 +399,10 @@ openssl-%7</source>
|
||||
<source>handling content ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Debug Log</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Certificate</name>
|
||||
@@ -743,8 +747,7 @@ Environment:
|
||||
PROXY_HOST proxy host name (actual: %4)
|
||||
SWISS_USERAGENT fake user agent (actual: %6)
|
||||
QT_PLUGIN_PATH path to plugins dir (actual: %7)
|
||||
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)
|
||||
</source>
|
||||
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
||||
@@ -399,6 +399,10 @@ openssl-%7</source>
|
||||
<source>handling content ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Debug Log</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Certificate</name>
|
||||
@@ -743,8 +747,7 @@ Environment:
|
||||
PROXY_HOST proxy host name (actual: %4)
|
||||
SWISS_USERAGENT fake user agent (actual: %6)
|
||||
QT_PLUGIN_PATH path to plugins dir (actual: %7)
|
||||
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)
|
||||
</source>
|
||||
QTWEBKIT_PLUGIN_PATH path to netscape plugins (actual: %8)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
||||
Reference in New Issue
Block a user