+38
-80
@@ -13,7 +13,6 @@
|
||||
#include <errorlog.hxx>
|
||||
#include <downloadmanager.hxx>
|
||||
#include <authentication.hxx>
|
||||
#include <qbrowserlib/swisswebview.hxx>
|
||||
#include <settings.hxx>
|
||||
#include <editbookmarks.hxx>
|
||||
#include <temporaryfile.hxx>
|
||||
@@ -22,11 +21,12 @@
|
||||
|
||||
#include <ui_browser.h>
|
||||
|
||||
#include <qbrowserlib/buttonlineedit.hxx>
|
||||
#include <qbrowserlib/swisswebview.hxx>
|
||||
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QProgressBar>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QSlider>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QPrinter>
|
||||
@@ -41,6 +41,8 @@
|
||||
#include <QtCore/QDir>
|
||||
#include <QtGui/QFileDialog>
|
||||
|
||||
#include <QtGui/QDesktopServices>
|
||||
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
#include <memory>
|
||||
@@ -50,6 +52,8 @@
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
extern QString TMP;
|
||||
|
||||
//! @addtogroup browser
|
||||
//! @{
|
||||
|
||||
@@ -104,18 +108,25 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
_zoom->setPageStep(10);
|
||||
_zoom->setTickPosition(QSlider::TicksAbove);
|
||||
assert(connect(_zoom, SIGNAL(valueChanged(int)), SLOT(zoom(int))));
|
||||
if (!_quirks) {
|
||||
if (_kiosk||!_quirks) {
|
||||
_toolbar->addAction(actionReload);
|
||||
_toolbar->addAction(actionStop);
|
||||
}
|
||||
if (!_kiosk) {
|
||||
QComboBox* combo(new QComboBox(_toolbar));
|
||||
_url = combo;
|
||||
QFrame* urlFrame(new QFrame);
|
||||
QHBoxLayout* layout(new QHBoxLayout);
|
||||
urlFrame->setLayout(layout);
|
||||
_toolbar->addWidget(urlFrame);
|
||||
urlFrame->setSizePolicy(QSizePolicy::Preferred,
|
||||
QSizePolicy::Preferred);
|
||||
layout->addWidget(_url);
|
||||
combo->setInsertPolicy(QComboBox::NoInsert);
|
||||
combo->setLineEdit(new ButtonLineEdit(combo));
|
||||
combo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
|
||||
combo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,
|
||||
QSizePolicy::Preferred));
|
||||
combo->setSizePolicy(QSizePolicy::MinimumExpanding,
|
||||
QSizePolicy::Preferred);
|
||||
combo->setEditable(!_kiosk);
|
||||
assert(connect(combo, SIGNAL(currentIndexChanged(const QString&)),
|
||||
SLOT(load(QString))));
|
||||
@@ -141,21 +152,25 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
QLineEdit* label(new QLineEdit(_toolbar));
|
||||
_url = label;
|
||||
label->setReadOnly(true);
|
||||
_url->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,
|
||||
QSizePolicy::Minimum));
|
||||
}
|
||||
// _url->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,
|
||||
// QSizePolicy::Minimum));
|
||||
_toolbar->addWidget(_url);
|
||||
}
|
||||
if (!_kiosk) {
|
||||
QFrame* searchFrame(new QFrame);
|
||||
searchFrame->setBackgroundRole(QPalette::Base);
|
||||
searchFrame->setAutoFillBackground(true);
|
||||
QHBoxLayout* layout(new QHBoxLayout);
|
||||
layout->addWidget(_searchEngines);
|
||||
_searchEngines->setStyleSheet(tr("background-color: white",
|
||||
"search engines combobox"));
|
||||
layout->addWidget(_search);
|
||||
searchFrame->setLayout(layout);
|
||||
_toolbar->addWidget(searchFrame);
|
||||
_search->add(actionSearch);
|
||||
_searchEngines->setSizePolicy(QSizePolicy::Preferred,
|
||||
QSizePolicy::Preferred);
|
||||
_search->setSizePolicy(QSizePolicy::Preferred,
|
||||
QSizePolicy::Preferred);
|
||||
searchFrame->setSizePolicy(QSizePolicy::Preferred,
|
||||
QSizePolicy::Preferred);
|
||||
}
|
||||
if (!_quirks) _search->add(actionClearSearch);
|
||||
_search->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
|
||||
QSizePolicy::Minimum));
|
||||
@@ -203,10 +218,13 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
if (!QSslSocket::supportsSsl())
|
||||
QMessageBox::critical(this, tr("SSL Not Supported"),
|
||||
tr("SSL is not supported on your system"));
|
||||
// temporary caching of favicons
|
||||
QWebSettings::setIconDatabasePath(TMP);
|
||||
}
|
||||
|
||||
~Browser() {
|
||||
LOG;
|
||||
QWebSettings::clearIconDatabase();
|
||||
for (DownloadProcesses::iterator it(_downloadProcesses.begin());
|
||||
it!=_downloadProcesses.end(); ++it) {
|
||||
LOG<<"cleanup:"<<it->second->fileName();
|
||||
@@ -225,6 +243,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
return true;
|
||||
}
|
||||
|
||||
//! Create new empty tab.
|
||||
SwissWebView* newTab() {
|
||||
SwissWebView* browser(new SwissWebView);
|
||||
newTab(browser);
|
||||
@@ -280,10 +299,9 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
view->load(page);
|
||||
}
|
||||
|
||||
//! Slot that receives and initializes a new SwissWebView
|
||||
void newTab(SwissWebView* browser) {
|
||||
browser->page()->setNetworkAccessManager(&_networkManager);
|
||||
assert(connect(&_networkManager, SIGNAL(finished(QNetworkReply*)),
|
||||
SLOT(finished(QNetworkReply*))));
|
||||
_url->setFocus();
|
||||
// SwissWebView
|
||||
assert(connect(browser, SIGNAL(newView(SwissWebView*)),
|
||||
@@ -557,6 +575,7 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
if (_searchEngines->count()==0)
|
||||
_searchEngines->addItem(QIcon(":/icons/gg"), tr("gg"),
|
||||
tr("http://www.google.com/search?hl=%2&q=%1"));
|
||||
_searchEngines->setVisible(_searchEngines->count()>1);
|
||||
}
|
||||
|
||||
void on_actionAddBookmark_triggered() {
|
||||
@@ -880,15 +899,12 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
QWebView* view(qobject_cast<QWebView*>(sender()));
|
||||
int index = _tabs->indexOf(view);
|
||||
if (index<0) return;
|
||||
LOG<<"get icon for "<<view->url();
|
||||
QIcon icon(QWebSettings::iconForUrl(view->url()));
|
||||
if (icon.isNull()) {
|
||||
LOG<<"Icon for URL is Null"<<view->url();
|
||||
QPixmap pixmap(QWebSettings::webGraphic
|
||||
if (!icon.isNull()) return _tabs->setTabIcon(index, icon);
|
||||
LOG<<"icon for url is null"<<view->url();
|
||||
_tabs->setTabIcon(index, QWebSettings::webGraphic
|
||||
(QWebSettings::DefaultFrameIconGraphic));
|
||||
if (!pixmap.isNull()) icon = pixmap;
|
||||
} else icon = icon.pixmap(16, 16);
|
||||
if (icon.isNull()) LOG<<"Icon is still null";
|
||||
_tabs->setTabIcon(index, icon);
|
||||
}
|
||||
|
||||
void titleChanged(const QString& text) {
|
||||
@@ -1388,12 +1404,8 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
|
||||
void started() {
|
||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
if (_quirks) {
|
||||
actionStop->setEnabled(true);
|
||||
} else {
|
||||
actionStop->setVisible(true);
|
||||
actionReload->setVisible(false);
|
||||
}
|
||||
_progress->setRange(0, 0);
|
||||
_progress->setValue(0);
|
||||
_progress->setEnabled(true);
|
||||
@@ -1403,12 +1415,8 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
void finished() {
|
||||
LOG;
|
||||
QApplication::restoreOverrideCursor();
|
||||
if (_quirks) {
|
||||
actionStop->setEnabled(false);
|
||||
} else {
|
||||
actionStop->setVisible(false);
|
||||
actionReload->setVisible(true);
|
||||
}
|
||||
_progress->setRange(0, 1);
|
||||
_progress->setValue(1);
|
||||
_progress->setEnabled(false);
|
||||
@@ -1502,56 +1510,6 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
class ButtonLineEdit: public QLineEdit {
|
||||
public:
|
||||
ButtonLineEdit(QWidget* p=0): QLineEdit(p) {
|
||||
LOG;
|
||||
}
|
||||
QToolButton* add(QAction* a) {
|
||||
LOG;
|
||||
QToolButton* b(new QToolButton(this));
|
||||
b->setDefaultAction(a);
|
||||
add(b);
|
||||
return b;
|
||||
}
|
||||
ButtonLineEdit& add(QToolButton* b) {
|
||||
LOG;
|
||||
b->setParent(this);
|
||||
b->setStyleSheet("QToolButton { border: none; padding: 0; }");
|
||||
b->setCursor(Qt::ArrowCursor);
|
||||
_buttons.push_back(b);
|
||||
resizeEvent(0);
|
||||
return *this;
|
||||
}
|
||||
ButtonLineEdit& changeStyleSheet(QString s) {
|
||||
LOG;
|
||||
_style = s;
|
||||
resizeEvent(0);
|
||||
return *this;
|
||||
}
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent*) {
|
||||
QSize sz;
|
||||
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
|
||||
for (Buttons::iterator it(_buttons.begin());
|
||||
it!=_buttons.end(); ++it) {
|
||||
if (sz.isEmpty()) sz = (*it)->sizeHint();
|
||||
else sz.setWidth(sz.width()+(*it)->sizeHint().width());
|
||||
(*it)->move(rect().right() - frameWidth - sz.width(),
|
||||
(rect().bottom() + 1 - (*it)->sizeHint().height())/2);
|
||||
}
|
||||
setStyleSheet(QString("QLineEdit { padding-right: %1px; %2 }")
|
||||
.arg(sz.width() + frameWidth + 1)
|
||||
.arg(_style));
|
||||
}
|
||||
private:
|
||||
typedef QList<QToolButton*> Buttons;
|
||||
Buttons _buttons;
|
||||
QString _style;
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
QWidget* _url;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,15 @@
|
||||
/*! @file
|
||||
|
||||
@id $Id$
|
||||
*/
|
||||
// 1 2 3 4 5 6 7 8
|
||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
#include <buttonlineeditwidgetifc.hxx>
|
||||
|
||||
//! @defgroup designer
|
||||
//! @{
|
||||
|
||||
Q_EXPORT_PLUGIN2(buttonlineedit, ButtonLineEditWidgetIfc);
|
||||
|
||||
//! @}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*! @file
|
||||
|
||||
@id $Id$
|
||||
*/
|
||||
// 1 2 3 4 5 6 7 8
|
||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
#ifndef __BUTTONLINEEDITWIDGETIFC_HXX
|
||||
#define __BUTTONLINEEDITWIDGETIFC_HXX
|
||||
|
||||
#include <qbrowserlib/buttonlineedit.hxx>
|
||||
#include <QtDesigner>
|
||||
|
||||
#ifndef LOG
|
||||
#define LOG qDebug()<<__PRETTY_FUNCTION__
|
||||
#endif
|
||||
|
||||
//! @defgroup designer
|
||||
//! @{
|
||||
|
||||
//! Buttonlineedit widget for Qt Designer
|
||||
class ButtonLineEditWidgetIfc: public QObject,
|
||||
public QDesignerCustomWidgetInterface {
|
||||
Q_OBJECT;
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface);
|
||||
public:
|
||||
bool isContainer() const {
|
||||
LOG;
|
||||
return false;
|
||||
}
|
||||
QIcon icon() const {
|
||||
LOG;
|
||||
return QIcon(":/icons/buttonlineedit.png");
|
||||
}
|
||||
QString domXml() const {
|
||||
LOG;
|
||||
return
|
||||
QString
|
||||
("<ui language=\"c++\" displayname=\"%1\">"
|
||||
" <widget class=\"%1\" name=\"%2\"/>"
|
||||
" <customwidgets>"
|
||||
" <customwidget>"
|
||||
" <class>%1</class>"
|
||||
" </customwidget>"
|
||||
" </customwidgets>"
|
||||
"</ui>")
|
||||
.arg(name())
|
||||
.arg(name().toLower());
|
||||
}
|
||||
QString group() const {
|
||||
LOG;
|
||||
return "Input Widgets";
|
||||
}
|
||||
QString includeFile() const {
|
||||
LOG;
|
||||
return "qbrowserlib/buttonlineedit.hxx";
|
||||
}
|
||||
QString name() const {
|
||||
LOG;
|
||||
return "ButtonLineEdit";
|
||||
}
|
||||
QString toolTip() const {
|
||||
LOG;
|
||||
return "";
|
||||
}
|
||||
QString whatsThis() const {
|
||||
LOG;
|
||||
return "";
|
||||
}
|
||||
QWidget *createWidget(QWidget *parent) {
|
||||
LOG;
|
||||
return new ButtonLineEdit(parent);
|
||||
}
|
||||
};
|
||||
|
||||
//! @}
|
||||
#endif
|
||||
@@ -27,10 +27,10 @@ ALL_SRC = @srcdir@/*.[ch]xx \
|
||||
# @srcdir@/*.ui
|
||||
|
||||
QMAKE_PROJECT = qmake.pro
|
||||
QMAKE_MAKEFILE = makefile.qmake
|
||||
|
||||
QMAKE_TARGET = libqbrowserlib-plugin.so
|
||||
QMAKE_TARGET = qbrowserlib-swisswebview qbrowserlib-buttonlineedit
|
||||
TARGETS = ${QMAKE_TARGET}
|
||||
QMAKE_MAKEFILE = ${QMAKE_TARGET:%=makefile.qmake.%}
|
||||
|
||||
all: ${TARGETS} $
|
||||
#$(LANGS:%=@PACKAGENAME@_%.ts)
|
||||
@@ -71,24 +71,24 @@ print:
|
||||
# ${LUPDATE} @LUPDATE_ARGS@ ${QMAKE_PROJECT}
|
||||
|
||||
${QMAKE_MAKEFILE}: ${QMAKE_PROJECT} ${ALL_SRC}
|
||||
${QMAKE} -o $@ $<
|
||||
${QMAKE} -o $@ $< CONFIG+=${@:makefile.qmake.%=%}
|
||||
|
||||
# $(LANGS:%=@PACKAGENAME@_%.qm)
|
||||
${QMAKE_TARGET}: ${QMAKE_MAKEFILE} ${ALL_SRC}
|
||||
make -f ${QMAKE_MAKEFILE}
|
||||
make -f makefile.qmake.$@
|
||||
|
||||
install-data-local: ${QMAKE_MAKEFILE}
|
||||
${mkinstalldirs} ${DESTDIR}${QT_INSTALL_PLUGINS}
|
||||
${INSTALL} ${QMAKE_TARGET}* ${DESTDIR}${QT_INSTALL_PLUGINS}
|
||||
${INSTALL} ${QMAKE_TARGET:%=lib%*} ${DESTDIR}${QT_INSTALL_PLUGINS}
|
||||
|
||||
uninstall-local:
|
||||
rm -r ${DESTDIR}${QT_INSTALL_PLUGINS}/${QMAKE_TARGET}*
|
||||
-rm -r ${QMAKE_TARGET:%=${DESTDIR}${QT_INSTALL_PLUGINS}/lib%*}
|
||||
|
||||
clean-local:
|
||||
-rm -r ${QMAKE_TARGET}*
|
||||
-rm -r ${QMAKE_TARGET:%=lib%*}
|
||||
|
||||
# $(LANGS:%=@PACKAGENAME@_%.qm)
|
||||
CLEANFILES = ${TARGETS} ${TARGETS:%=%.exe} \
|
||||
*.o *.obj qrc_*.cpp ui_*.h moc_*.cpp \
|
||||
${QMAKE_TARGET}
|
||||
${QMAKE_TARGET:%=lib%*}
|
||||
MAINTAINERCLEANFILES = makefile.in ${QMAKE_MAKEFILE}
|
||||
|
||||
@@ -29,15 +29,22 @@ win32 {
|
||||
CONFIG += release
|
||||
}
|
||||
|
||||
SOURCES = webviewwidgetifc.cxx
|
||||
HEADERS = webviewwidgetifc.hxx
|
||||
|
||||
FORMS =
|
||||
|
||||
RESOURCES = resources.qrc
|
||||
|
||||
TEMPLATE = lib
|
||||
TARGET = qbrowserlib-plugin
|
||||
|
||||
qbrowserlib-swisswebview {
|
||||
SOURCES = webviewwidgetifc.cxx
|
||||
HEADERS = webviewwidgetifc.hxx
|
||||
TARGET = qbrowserlib-swisswebview
|
||||
}
|
||||
qbrowserlib-buttonlineedit {
|
||||
SOURCES = buttonlineeditwidgetifc.cxx
|
||||
HEADERS = buttonlineeditwidgetifc.hxx
|
||||
TARGET = qbrowserlib-buttonlineedit
|
||||
}
|
||||
|
||||
CODECFORSRC = UTF-8
|
||||
CODECFORTR = UTF-8
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/icons">
|
||||
<file>webview.png</file>
|
||||
<file>swisswebview.png</file>
|
||||
<file>buttonlineedit.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
|
Before Width: | Height: | Size: 397 B After Width: | Height: | Size: 397 B |
@@ -24,13 +24,14 @@ class SwissWebViewWidgetIfc: public QObject,
|
||||
Q_OBJECT;
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface);
|
||||
public:
|
||||
SwissWebViewWidgetIfc(): _initialized(false) {}
|
||||
bool isContainer() const {
|
||||
LOG;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
QIcon icon() const {
|
||||
LOG;
|
||||
return QIcon(":/icons/webview.png");
|
||||
return QIcon(":/icons/swisswebview.png");
|
||||
}
|
||||
QString domXml() const {
|
||||
LOG;
|
||||
@@ -53,7 +54,7 @@ class SwissWebViewWidgetIfc: public QObject,
|
||||
}
|
||||
QString includeFile() const {
|
||||
LOG;
|
||||
return "qbrowserlib/webview.hxx";
|
||||
return "qbrowserlib/swisswebview.hxx";
|
||||
}
|
||||
QString name() const {
|
||||
LOG;
|
||||
@@ -71,6 +72,16 @@ class SwissWebViewWidgetIfc: public QObject,
|
||||
LOG;
|
||||
return new SwissWebView(parent);
|
||||
}
|
||||
bool isInitialized() {
|
||||
LOG;
|
||||
return _initialized;
|
||||
}
|
||||
void initialized() {
|
||||
LOG;
|
||||
_initialized = true;
|
||||
}
|
||||
private:
|
||||
bool _initialized;
|
||||
};
|
||||
|
||||
//! @}
|
||||
|
||||
+17
-10
@@ -26,23 +26,26 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
/*! @mainpage The Secure Swiss PKCS#11 WebBrowser
|
||||
|
||||
The browser is divided into a library, qbrowserlib that implements
|
||||
generic browsing utilities, the main browser page that collects
|
||||
those features into a main window, a PKCS#11 Post-SuisseID
|
||||
hardware token client authentication and a designer plugin for
|
||||
flexible GUI creation.
|
||||
*/
|
||||
|
||||
//! @defgroup browser The SwissBrowser Executable and Main Window
|
||||
//! @defgroup pkcs11 The PKCS#11 Client Authentication
|
||||
//! @defgroup qbrowserlib The Swiss Browser Library
|
||||
//! @defgroup designer Qt Designer Plugin for Browser Related Widgets
|
||||
|
||||
/*! @mainpage The Secure Swiss PKCS#11 WebBrowser
|
||||
|
||||
The browser is divided into a library, @ref qbrowserlib that implements
|
||||
generic browsing utilities, the main @ref browser page that collects
|
||||
those features into a main window, a @ref pkcs11 Post-SuisseID
|
||||
hardware token client authentication and a @ref designer plugin for
|
||||
flexible GUI creation.
|
||||
*/
|
||||
|
||||
//! @addtogroup browser
|
||||
//! @{
|
||||
|
||||
QString TMP;
|
||||
|
||||
const QByteArray SWISSSIGN_EV_GOLD_CA_2009_G2
|
||||
("-----BEGIN CERTIFICATE-----\n"
|
||||
"MIIGvzCCBaegAwIBAgIQAPI39KUS4aGJo+mkR4+YuTANBgkqhkiG9w0BAQUFADBN\n"
|
||||
@@ -309,6 +312,7 @@ int main(int argv, char** argc) try {
|
||||
<<"Port"<<QNetworkProxy::applicationProxy().port();
|
||||
qDebug()<<"***************************************************************";
|
||||
//----------------------------------------------------------------------------
|
||||
TMP=QDir::toNativeSeparators(QDir::tempPath());
|
||||
QStringList urls;
|
||||
QString actlib
|
||||
#ifdef Q_OS_LINUX
|
||||
@@ -338,6 +342,7 @@ int main(int argv, char** argc) try {
|
||||
("Usage: %1 [OPTIONS...] [<url> ...]\n"
|
||||
"Options:\n"
|
||||
" -h, --help show this help text\n"
|
||||
" -t --tmp path temporary folder for data caching\n"
|
||||
" -k, --kiosk no url bar\n"
|
||||
" if you sepcify -k and -s, -k must be first\n"
|
||||
" -q, --quirks alternate user interface\n"
|
||||
@@ -357,13 +362,15 @@ int main(int argv, char** argc) try {
|
||||
" PROXY_TYPE \"http\" or \"socks\" or \"\" (actual: %2)\n"
|
||||
" PROXY_PORT proxy port number (actual: %3)\n"
|
||||
" PROXY_HOST proxy host name (actual: %4)\n"
|
||||
" SWISSSURFER_USERAGENT fake user agent (actual: %6)\n")
|
||||
" SWISS_USERAGENT fake user agent (actual: %6)\n")
|
||||
.arg(QFileInfo(argc[0]).fileName())
|
||||
.arg(env["PROXY_TYPE"]).arg(env["PROXY_PORT"]).arg(env["PROXY_HOST"])
|
||||
.arg(env["LANGUAGE"]).arg(env["SWISSSURFER_USERAGENT"])
|
||||
.arg(env["LANGUAGE"]).arg(env["SWISS_USERAGENT"])
|
||||
.toStdString()
|
||||
<<std::endl;
|
||||
return 0;
|
||||
} else if ((*it=="-t" || *it=="--tmp") && ++it!=args.end()) {
|
||||
TMP=*it;
|
||||
} else if ((*it=="-k" || *it=="--kiosk")) {
|
||||
silent=true;
|
||||
settings.reset();
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/*! @file
|
||||
|
||||
@id $Id$
|
||||
*/
|
||||
// 1 2 3 4 5 6 7 8
|
||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
#ifndef __BUTTONLINEEDIT_HXX__
|
||||
#define __BUTTONLINEEDIT_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
|
||||
//! @{
|
||||
|
||||
//! A QLineEdit that may have buttons to the right within the lineedit.
|
||||
class ButtonLineEdit: public QLineEdit {
|
||||
Q_OBJECT;
|
||||
public:
|
||||
ButtonLineEdit(QWidget* p=0): QLineEdit(p) {
|
||||
LOG;
|
||||
}
|
||||
QToolButton* add(QAction* a) {
|
||||
LOG;
|
||||
QToolButton* b(new QToolButton(this));
|
||||
b->setDefaultAction(a);
|
||||
add(b);
|
||||
return b;
|
||||
}
|
||||
ButtonLineEdit& add(QToolButton* b) {
|
||||
LOG;
|
||||
b->setParent(this);
|
||||
b->setStyleSheet("QToolButton { border: none; padding: 0; }");
|
||||
b->setCursor(Qt::ArrowCursor);
|
||||
_buttons.push_back(b);
|
||||
resizeEvent(0);
|
||||
return *this;
|
||||
}
|
||||
ButtonLineEdit& changeStyleSheet(QString s) {
|
||||
LOG;
|
||||
_style = s;
|
||||
resizeEvent(0);
|
||||
return *this;
|
||||
}
|
||||
static void foreachActionWidget(QAction& a, void(QWidget::*f)()) {
|
||||
QList<QWidget*> widgets(a.associatedWidgets());
|
||||
for (QList<QWidget*>::iterator w(widgets.begin()); w!=widgets.end(); ++w)
|
||||
((*w)->*f)();
|
||||
}
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent*) {
|
||||
QSize sz;
|
||||
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
|
||||
for (Buttons::iterator it(_buttons.begin());
|
||||
it!=_buttons.end(); ++it) {
|
||||
if (sz.isEmpty()) sz = (*it)->sizeHint();
|
||||
else sz.setWidth(sz.width()+(*it)->sizeHint().width());
|
||||
(*it)->move(rect().right() - frameWidth - sz.width(),
|
||||
(rect().bottom() + 1 - (*it)->sizeHint().height())/2);
|
||||
}
|
||||
setStyleSheet(QString("QLineEdit { padding-right: %1px; %2 }")
|
||||
.arg(sz.width() + frameWidth + 1)
|
||||
.arg(_style));
|
||||
}
|
||||
private:
|
||||
typedef QList<QToolButton*> Buttons;
|
||||
Buttons _buttons;
|
||||
QString _style;
|
||||
};
|
||||
|
||||
//! @}
|
||||
#endif
|
||||
@@ -80,7 +80,7 @@ install-data-local:
|
||||
${INSTALL} ${QMAKE_TARGET}* ${DESTDIR}${libdir}
|
||||
|
||||
uninstall-local:
|
||||
rm -r ${DESTDIR}${libdir}/${QMAKE_TARGET}*
|
||||
-rm -r ${DESTDIR}${libdir}/${QMAKE_TARGET}*
|
||||
|
||||
clean-local:
|
||||
-rm -r ${QMAKE_TARGET}*
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
//! @addtogroup qbrowserlib
|
||||
//! @{
|
||||
|
||||
//! Handle PDF Documents
|
||||
/*! */
|
||||
class PluginFactory: public QWebPluginFactory {
|
||||
public:
|
||||
PluginFactory(QObject* p=0): QWebPluginFactory(p) {
|
||||
|
||||
@@ -37,7 +37,8 @@ TRANSLATIONS = @srcdir@/qbrowserlib_en.ts \
|
||||
SOURCES =
|
||||
|
||||
HEADERS = @srcdir@/swisswebview.hxx @srcdir@/swisswebpage.hxx \
|
||||
@srcdir@/pluginfactory.hxx @srcdir@/saveorrun.hxx
|
||||
@srcdir@/pluginfactory.hxx @srcdir@/saveorrun.hxx \
|
||||
@srcdir@/buttonlineedit.hxx
|
||||
|
||||
FORMS = @srcdir@/saveorrun.ui
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
//! @addtogroup qbrowserlib
|
||||
//! @{
|
||||
|
||||
//! Ask User for Saving or Opening a Download
|
||||
class SaveOrRun: public QWidget, public Ui::SaveOrRun {
|
||||
Q_OBJECT;
|
||||
|
||||
|
||||
+23
-27
@@ -263,11 +263,6 @@
|
||||
<source>Clear Search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>background-color: white</source>
|
||||
<comment>search engines combobox</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SSL Not Supported</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -696,10 +691,32 @@ openssl-%7</source>
|
||||
<comment>application name</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Usage: %1 [OPTIONS...] [<url> ...]
|
||||
Options:
|
||||
-h, --help show this help text
|
||||
-t --tmp path temporary folder for data caching
|
||||
-k, --kiosk no url bar
|
||||
if you sepcify -k and -s, -k must be first
|
||||
-q, --quirks alternate user interface
|
||||
@@ -719,31 +736,10 @@ Environment:
|
||||
PROXY_TYPE "http" or "socks" or "" (actual: %2)
|
||||
PROXY_PORT proxy port number (actual: %3)
|
||||
PROXY_HOST proxy host name (actual: %4)
|
||||
SWISSSURFER_USERAGENT fake user agent (actual: %6)
|
||||
SWISS_USERAGENT fake user agent (actual: %6)
|
||||
</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Settings</name>
|
||||
|
||||
+23
-27
@@ -263,11 +263,6 @@
|
||||
<source>Clear Search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>background-color: white</source>
|
||||
<comment>search engines combobox</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SSL Not Supported</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -696,10 +691,32 @@ openssl-%7</source>
|
||||
<comment>application name</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Usage: %1 [OPTIONS...] [<url> ...]
|
||||
Options:
|
||||
-h, --help show this help text
|
||||
-t --tmp path temporary folder for data caching
|
||||
-k, --kiosk no url bar
|
||||
if you sepcify -k and -s, -k must be first
|
||||
-q, --quirks alternate user interface
|
||||
@@ -719,31 +736,10 @@ Environment:
|
||||
PROXY_TYPE "http" or "socks" or "" (actual: %2)
|
||||
PROXY_PORT proxy port number (actual: %3)
|
||||
PROXY_HOST proxy host name (actual: %4)
|
||||
SWISSSURFER_USERAGENT fake user agent (actual: %6)
|
||||
SWISS_USERAGENT fake user agent (actual: %6)
|
||||
</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Settings</name>
|
||||
|
||||
+23
-27
@@ -263,11 +263,6 @@
|
||||
<source>Clear Search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>background-color: white</source>
|
||||
<comment>search engines combobox</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SSL Not Supported</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -696,10 +691,32 @@ openssl-%7</source>
|
||||
<comment>application name</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Usage: %1 [OPTIONS...] [<url> ...]
|
||||
Options:
|
||||
-h, --help show this help text
|
||||
-t --tmp path temporary folder for data caching
|
||||
-k, --kiosk no url bar
|
||||
if you sepcify -k and -s, -k must be first
|
||||
-q, --quirks alternate user interface
|
||||
@@ -719,31 +736,10 @@ Environment:
|
||||
PROXY_TYPE "http" or "socks" or "" (actual: %2)
|
||||
PROXY_PORT proxy port number (actual: %3)
|
||||
PROXY_HOST proxy host name (actual: %4)
|
||||
SWISSSURFER_USERAGENT fake user agent (actual: %6)
|
||||
SWISS_USERAGENT fake user agent (actual: %6)
|
||||
</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Settings</name>
|
||||
|
||||
+23
-27
@@ -263,11 +263,6 @@
|
||||
<source>Clear Search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>background-color: white</source>
|
||||
<comment>search engines combobox</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SSL Not Supported</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -696,10 +691,32 @@ openssl-%7</source>
|
||||
<comment>application name</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Usage: %1 [OPTIONS...] [<url> ...]
|
||||
Options:
|
||||
-h, --help show this help text
|
||||
-t --tmp path temporary folder for data caching
|
||||
-k, --kiosk no url bar
|
||||
if you sepcify -k and -s, -k must be first
|
||||
-q, --quirks alternate user interface
|
||||
@@ -719,31 +736,10 @@ Environment:
|
||||
PROXY_TYPE "http" or "socks" or "" (actual: %2)
|
||||
PROXY_PORT proxy port number (actual: %3)
|
||||
PROXY_HOST proxy host name (actual: %4)
|
||||
SWISSSURFER_USERAGENT fake user agent (actual: %6)
|
||||
SWISS_USERAGENT fake user agent (actual: %6)
|
||||
</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM certificate from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read PEM certificates from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot read PEM RSA key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Read private key from file: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Too few arguments.
|
||||
Try: %1 --help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Settings</name>
|
||||
|
||||
Reference in New Issue
Block a user